151 lines
5.0 KiB
C
151 lines
5.0 KiB
C
#ifndef _APPS_GATHER_H_
|
||
#define _APPS_GATHER_H_
|
||
|
||
/**********************************************Drivers**********************************************/
|
||
#include "main.h"
|
||
#include <string.h>
|
||
#include "gpio.h"
|
||
#include "usart.h"
|
||
#include "FreeRTOS.h"
|
||
#include "task.h"
|
||
#include "timer.h"
|
||
#include "stdio.h"
|
||
#include "stdlib.h"
|
||
#include "cmsis_os.h"
|
||
#include "tim.h"
|
||
|
||
#include "ip5310_i2c.h"
|
||
#include "eeprom_spi.h"
|
||
#include "tm1650.h"
|
||
#include "mux_signal.h"
|
||
#include "JLX240-00301-BN.h"
|
||
#include "ble.h"
|
||
#include "hart.h"
|
||
#include "rn7302.h"
|
||
#include "SIG24130.h"
|
||
|
||
extern osThreadId task_lcdHandle;
|
||
extern osThreadId task_menuHandle;
|
||
extern uint8_t screen_suspend_flag;
|
||
/**********************************************Drivers**********************************************/
|
||
//
|
||
//
|
||
//
|
||
/**********************************************LVGL**********************************************/
|
||
#include "lvgl.h" // 它为整个LVGL提供了更完整的头文件引用
|
||
#include "lv_port_disp.h" // LVGL的显示
|
||
#include "gui_guider.h" // Gui Guider 生成的界面和控件的声明
|
||
#include "events_init.h" // Gui Guider 生成的初始化事件、回调函数
|
||
//#include "lv_demo_benchmark.h"
|
||
|
||
//LVGL相关外部变量
|
||
extern lv_ui guider_ui;
|
||
extern const lv_img_dsc_t * screen_main_animimg_battery_imgs[6];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_0_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_1_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_2_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_3_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_4_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_5_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_6_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_0_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_1_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_2_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_3_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_4_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_5_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_6_imgs[11];
|
||
extern const lv_img_dsc_t * screen_main_ani_in_sign_imgs[3];
|
||
extern const lv_img_dsc_t * screen_main_ani_out_sign_imgs[3];
|
||
|
||
/**********************************************LVGL**********************************************/
|
||
//
|
||
//
|
||
//
|
||
/**********************************************Functions**********************************************/
|
||
#include "apps_var_def.h"
|
||
#include "app_screen_main.h"
|
||
#include "app_screen_setting.h"
|
||
#include "scr_setting_item_text.h"
|
||
#include "scr_setting_item_value.h"
|
||
#include "key_functions.h"
|
||
#include "scr_setting_text.h"
|
||
#include "app_screen_modbus.h"
|
||
#include "key_functions_main.h"
|
||
#include "key_functions_setting.h"
|
||
#include "key_functions_modbus.h"
|
||
#include "modbus_485.h"
|
||
#include "modbus_rtu.h"
|
||
#include "modbus_rtu_master.h"
|
||
#include "scr_setting_progam_out.h"
|
||
|
||
extern PHYSICAL_QUANTITY VOL[2]; //电压,VOL[0]-V, VOL[1]-mV
|
||
extern PHYSICAL_QUANTITY CUR; //电流,mA
|
||
extern PHYSICAL_QUANTITY RES; //电阻,Ω
|
||
extern PHYSICAL_QUANTITY FRE; //频率,KHz
|
||
extern PHYSICAL_QUANTITY TC[8]; //热电偶,共8种
|
||
extern PHYSICAL_QUANTITY RTD; //热电阻
|
||
extern OPERATIONS current_operation; //当前操作
|
||
extern SYSTEM_STATUS_WATCH system_sts; //系统状态监控
|
||
extern SIG_TRANSMISSION sig_trans; //通讯模式
|
||
|
||
//绝对值计算
|
||
#define MY_ABS(pa) ( ( (pa) >= 0 )?( (pa) ):( 0 - (pa) ) )
|
||
|
||
#define MUX_TASK_PERIOD 50 //多通道输入输出任务周期
|
||
#define LVGL_TASK_PERIOD 5 //LVGL任务周期
|
||
#define MENU_TASK_PERIOD 300 //显示内容设置周期
|
||
#define BLE_TASK_PERIOD 100 //蓝牙任务周期
|
||
#define HART_TASK_PERIOD 100 //HART任务周期
|
||
#define RS485_TASK_PERIOD MUX_TASK_PERIOD //485任务周期
|
||
|
||
|
||
//屏幕显示
|
||
void screen_run(void);
|
||
|
||
//计算a的b次方
|
||
float32 my_power(int a, int b);
|
||
|
||
//物理量内容初始化
|
||
void physical_quantity_init(void);
|
||
|
||
//热电偶数据初始化
|
||
void TC_init(void);
|
||
|
||
//通道选择与切换
|
||
void sig_channel_select(uint8_t io, SIG_FUNCTIONS_TYPE type);
|
||
|
||
//更新设定值(根据ON\OFF状态)
|
||
void sig_sv_update(void);
|
||
|
||
//数据转换,mux_signal.pv -> real_value
|
||
float32 mux2real(float32 mux_pv);
|
||
|
||
//数据转换,real_value -> mux_signal.sv
|
||
float32 real2mux(float32 real_value);
|
||
|
||
//数据转换,将输入热电偶电压值转换为实际温度值℃
|
||
float32 tcmv2temp(SIG_FUNCTIONS_TYPE type, float32 mv);
|
||
|
||
//数据转换,将需要模拟的温度值℃转化为热电偶对应的mv
|
||
float32 temp2tcmv(SIG_FUNCTIONS_TYPE type, float32 temp);
|
||
|
||
//数据转换,热电阻阻值 Ω 转化为温度 ℃
|
||
float32 ohm2temp(float32 ohm);
|
||
|
||
//数据转换,温度 ℃ 转化为热电阻阻值 Ω
|
||
float32 temp2ohm(float32 temp);
|
||
|
||
//初始化打包
|
||
void my_inits_gather(void);
|
||
|
||
|
||
|
||
/**********************************************Functions**********************************************/
|
||
//
|
||
//
|
||
//
|
||
#endif
|
||
|
||
|