111 lines
2.7 KiB
C
Executable File

#ifndef MAIN_H
#define MAIN_H
#include "lvgl.h"
#define DEBUG 0
enum {
TAB_SETTINGS_ID = 1,
TAB_SERVICE_ID
};
enum {
TAB_MODES = 0,
TAB_TIME,
TAB_SCREEN,
TAB_FILTERS
};
enum {
TAB_INTERVALS = 0,
TAB_POWER,
TAB_TEMPERATURE
};
#define ROLLER_ROWS_DEFAULT 5
#define PASSWORD 1234
#define MAX_NUM_ROTORS (11)
#define NUM_OF_POPUP_WINDOWS (64)
#define TMR_WAIT_COMMAND (10)
#define KPD_NONE (255)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define CLAMP(x, min, max) ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x)))
LV_FONT_DECLARE(montserrat_16_ru_en)
LV_FONT_DECLARE(montserrat_20_ru_en)
LV_FONT_DECLARE(montserrat_24_ru_en)
LV_FONT_DECLARE(montserrat_28_ru_en)
LV_FONT_DECLARE(montserrat_32_ru_en)
LV_FONT_DECLARE(montserrat_semibold_20_ru_en)
LV_FONT_DECLARE(montserrat_semibold_24_ru_en)
LV_FONT_DECLARE(montserrat_semibold_28_ru_en)
LV_FONT_DECLARE(montserrat_semibold_32_ru_en)
LV_IMG_DECLARE(sun_yellow)
LV_IMG_DECLARE(moon_purple)
LV_IMG_DECLARE(arrow)
typedef struct {
uint8_t id;
bool ignored;
lv_obj_t *window;
} PopupWindow_t;
typedef enum {
ERROR_FILT_SUP_MISSING = 1,
ERROR_FILT_EXH_MISSING = 2,
ERROR_FILT_SUP_DIRTY = 3,
ERROR_FILT_EXH_DIRTY = 4,
ERROR_ROTOR_BASE = 5,
ERROR_MODULE_BASE = 45
} ErrorBit_t;
typedef struct {
uint16_t mode;
int16_t te1;
int16_t te2;
int16_t te3;
int16_t te4;
uint16_t speedB3;
uint16_t speedB4;
uint16_t rotorSpeed[MAX_NUM_ROTORS];
uint16_t kpd;
uint16_t filterSupState;
uint16_t filterExhState;
uint16_t filterSensorsState;
uint16_t year;
uint16_t month;
uint16_t date;
uint16_t dayOfWeek;
uint16_t time;
uint16_t errorMask1;
uint16_t errorMask2;
uint16_t errorMask3;
uint16_t errorMask4;
} SysState_t;
extern const char* kbMap[];
extern const lv_btnmatrix_ctrl_t kbCtrlMap[];
extern lv_style_t text_16;
extern lv_style_t text_20;
extern lv_style_t text_24;
extern lv_style_t text_28;
extern lv_style_t text_28_semibold;
extern lv_style_t text_24_semibold;
extern lv_style_t text_20_semibold;
extern lv_style_t styleRollerMain;
extern lv_style_t styleRollerSelected;
extern lv_style_t styleBackground;
extern char *days[];
extern char rollerOptionsHour[24 * 3 + 1];
extern char rollerOptionsMinute[60 * 3 + 1];
#endif /* MAIN_H */