MXC-A36_2024.04.17/MXC-A36/xrz/lv_user_code/include/mxc_meter.h

125 lines
2.9 KiB
C

#ifndef __MXC_METER_H__
#define __MXC_METER_H__
typedef enum _ENUM_CONTROL_WIN_ID
{
IDLE_CONTROL_WIN_ID, // 0,
PAGE_MAINMENU_WIN_ID, //
SUBMENU_SET_THEME,
SUBMENU_SET_LIGHT, //
SUBMENU_SET_BLUETOOTH, // 4
SUBMENU_SET_OTHER,
SUBMENU_SET_INFORMATION,
SUBMENU_SET_PRESSURE, //
SUBMENU_SET_FAULT_CODE, //8
SUBMENU_THEME_SELECT,
SUBMENU_THEME_BG,
SUBMENU_OTHER_TIME,
SUBMENU_OTHER_LANGUAGE,
SUBMENU_OTHER_UINT, // 13
MOTO_WIN_ID_MAX,
} ENUM_CONTROL_WIN_ID;
typedef struct{
uint8_t engine; //发动机故障
uint8_t machine_oil; //机油报警
uint8_t abs; //abs防抱死
uint8_t tcs; //tcs牵引力系统
uint8_t fan; //风扇
uint8_t null; //空挡
}warning_t;
typedef struct
{
uint16_t ucYear;
uint8_t ucMonth;
uint8_t ucDate;
uint8_t ucHour;
uint8_t ucMinute;
uint8_t ucSecond;
}stTime_type;
typedef struct
{
uint8_t factory_reset; //出厂设置
uint8_t language; //语言
uint8_t display_uint; //单位
uint8_t theme; //当前主题
uint8_t theme_state; //主题状态
uint8_t light_value; //亮度
uint8_t bt_on_off; //蓝牙
uint8_t bt_state; //状态
}save_info_t;
typedef struct
{
uint8_t softwar_host; //主版本号
uint8_t softwar_order; //次版本号
uint8_t ui_page_id;
//time
stTime_type time;
save_info_t save_info;
uint8_t veer; //转向
uint8_t veer_hint; //转向提示
uint8_t lamplight; //灯光
uint8_t power_on_self_test; //开机自检
uint8_t light_perception_value; //光感亮度
uint8_t light; //具体的light_value值
uint8_t return_demo;
uint16_t velocity; //速度
uint16_t veer_velocity; //转速
uint8_t grade; //档位
uint8_t oil; //油量
uint8_t temp; //温度
double trip_mileage; //小计里程数
uint32_t total_mileage; //总计里程数
double voltage; //电池电压
warning_t warning; //警告图标
uint16_t max_velocity; //最高时速
uint16_t verage_velocity; //平均时速
char uuid[32];
char bt_name[32];
uint32_t now_defect_code; //当前故障码
uint32_t his_defect_code; //历史故障码
uint8_t ttrb; //开机检测是否获取到时间的标志
uint8_t ttrb_time; //设施时间后检测是否正常设置时间的标志
uint8_t odo_reset; //小计里程清零后检测是否正常设置时间的标志
uint8_t demo_position; //是否在demo展示界面的标志
uint16_t plan; //升级总进度标志
uint16_t pace; //升级分进度标志
uint8_t upgrade; //升级内存拷贝标志
}daily_data_t;
extern daily_data_t custom_data;
daily_data_t *daily_get_UiData(void);
ENUM_CONTROL_WIN_ID get_top_history_win(void);
void Set_UI_page_id(ENUM_CONTROL_WIN_ID id);
void system_date_init(void);
void updateCurTime();
stTime_type * getCurrentTime();
daily_data_t* GetDailyData(void);
char * GetCurTimeString();
#endif