📄 mmi.h
字号:
#define INT32U unsigned long
#define INT32S long
#define INT16U unsigned int
#define INT16S int
#define INT8U char
#define LCD_NORMAL 0
#define LCD_REVERSE 1
#define LCD_UNDERLINE 2
INT16U LCD_rd(INT16U left_right,INT16U data_cmd);
void LCD_wt(INT16U data_cmd,INT16U left_right,INT16U c);
void LCD_on();
void LCD_off();
void LCD_wt_byte(INT16U x,INT16U y,INT16U c);
void LCD_clear();
void LCD_black();
void Lprint_asc(INT16U x,INT16U y,char c);
void Lprint_hz(INT16U x,INT16U y,INT16U c);
void Lprint(INT16U x,INT16U y,char const *str,INT16U md);
INT16U hz_seek(INT16U s);
void LCD_cvt(INT16U x,INT16U y,INT16U n);
const char DaysInMonth[4][12]=
{31,29,31,30,31,30,31,31,30,31,30,31,
31,28,31,30,31,30,31,31,30,31,30,31,
31,28,31,30,31,30,31,31,30,31,30,31,
31,28,31,30,31,30,31,31,30,31,30,31};
const INT16U bit1_tab[16]={0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,
0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000};
const INT16U bit0_tab[16]={0xfffe,0xfffd,0xfffb,0xfff7,0xffef,0xffdf,0xffbf,0xff7f,
0xfeff,0xfdff,0xfbff,0xf7ff,0xefff,0xdfff,0xbfff,0x7fff};
struct TIME_STRUCT
{INT8U year;
INT8U month;
INT8U day;
INT8U hour;
INT8U minute;
INT8U second;
INT16U msecond;
};
struct TIME_STRUCT mytime ;
INT16U ms_timer;
INT16U ms_timer_bak;
INT16U msec;
INT16U run_time;
INT8U sys_lock;
INT16U main_version;
INT8U run_status;
#define SET_ERRO 0
#define ADC_ERRO 1
#define ZXQ_ERRO 2
#define KCH_ERRO 3
#define EEP_ERRO 4
#define GRP_NUM 5
#define CRP_FLAG 6
#define SYS_ERRO 7
INT8U oct_status;
INT8U erro_point;
INT8U ad_erro_flag;
INT8U kch_erro_flag;
INT8U set_erro_flag;
INT8U com_erro_flag;
INT8U zxq_erro_flag;
INT8U frq_erro_flag;
INT8U asp_erro_flag;
INT8U key_now ;
INT8U key_now_bak ;
INT16U key_count ;
INT16U key_code;
INT16U key_hnd_delay;
INT8U no_key_time;
INT8U lcd_off_flag;
INT8U clear_flag;
#define NO_KEY 0
#define KEY_UP 0x01
#define KEY_DOWN 0x02
#define KEY_LEFT 0x20
#define KEY_RIGHT 0x10
#define KEY_ENTER 0x08
#define KEY_ESC 0x04
#define KEY_CLOSE 0x2f
#define KEY_TRIP 0x8f
#define KEY_YK_ENABLE 0x4f
#define COM_LEN 128
INT8U com_rx_buf[COM_LEN];
INT8U com_tx_buf[COM_LEN];
INT8U com_tx_buf_bak[COM_LEN];
INT16U com_tx_count;
INT16U com_tx_count_bak;
INT16U com_rx_count;
INT16U com_rx_point;
INT16U com_tx_point;
INT16U com_rx_time;
INT16U com_rx_flag;
INT16U com_tx_time;
INT16U com_no_rx_time;
INT8U rd_buf[128];
INT8U wt_buf[32];
#define MMI_DRF 0x00 //全数据
#define MMI_PQT 0x02 //电度量
#define MMI_ASP 0x06 //系统故障报告
#define MMI_COE 0x08 //遥控执行
#define MMI_RDS 0x0a //读取定值
#define MMI_LDS 0x0c //下载定值
#define MMI_WRS 0x0e //写入定值
#define MMI_RTS 0x12 //信号复归
#define MMI_AJT 0x14 //对时
#define MMI_RDK 0x16 //读系数
#define MMI_WRK 0x18 //写系数
#define MMI_RDR 0x1a //读内存
#define MMI_WRR 0x1c //写内存
#define MMI_RDT 0x1e //读操作回路动作次数
#define MMI_DEV 0x20 //装置配置信息
#define MMI_SET_KCH 0x22 //下发定值和系数
INT8U read_flag;
INT8U yk_enable_count;
INT8U yk_enable_time;
INT8U yk_enable_flag;
INT8U drf_flag;
INT8U pqt_flag;
INT8U asp_flag;
INT8U coe_flag;
INT8U rds_flag;
INT8U lds_flag;
INT8U wrs_flag;
INT8U rts_flag;
INT8U ajt_flag;
INT8U rdk_flag;
INT8U wrk_flag;
INT8U rdr_flag;
INT8U wrr_flag;
INT8U rdt_flag;
INT8U dev_flag;
INT8U set_kch_flag; //361装置主动下发系数和定值
INT8U coe_data;
INT8U coe_data_bak;
INT8U ask_dev_time;
INT16U rdr_addr;
INT16U rdr_addr_bak;
INT16U rdr_enable;
INT16U rdr_data[3];
INT8U coe_return_data;
INT8U current_page;
INT8U page_point;
INT8U arrow_state;
INT8U arrow_point;
INT8U cursor_state;
INT8U cursor_point;
INT8U cursor_line;
INT8U asp_line_point;
INT8U main_type;
INT8U write_eep_ok;
INT8U set_bit[2][4];
INT16U pass_word;
INT8U pass_flag;
#define MAIN_PAGE_NUM 2
#define ASP_PAGE_NUM 8
#define MAIN_PAGE 0
#define YC_PAGE 1
#define YX_PAGE 2
#define PW_PAGE 3
#define YK_PAGE 4
#define MODIFY_PAGE 5
#define TIME_PAGE 6
#define KCH_PAGE 7
#define SET_PAGE 8
#define COM_PAGE 9
#define ASP_PAGE 10
#define MODIFY_RETUREN_PAGE 11
#define READ_WAIT_PAGE 12
#define COE_WAIT_PAGE 13
#define COE_RETURN_PAGE 14
#define ERRO_PAGE 15
#define HELP_PAGE 16
#define RDR_PAGE 17
#define LOCK_PAGE 18
#define YK_CONFIG_PAGE 19
#define YK_ENABLE_PAGE 20
INT16U set_data[64];
INT16S yc_data[24];
INT16U pt_val;
INT16U ct_val;
INT8U yx_data[6];
INT8U hlq_status;
#define REC_HJS 6
#define SHH_HJS 7
#define FLG_HWK 0 //合闸位置
#define FLG_KDX 1 //控回断线
#define FLG_YK 2 //YK投入
#define SET_LEN 31
#define KCH_LEN 15
INT16U kch_data[KCH_LEN];
#define my_set struct SET_STRUCT;
#define PTCT_ADDR 00
#define ASP_ADDR 0x80
struct ASP_STRUCT
{
INT8U year;
INT8U month;
INT8U day;
INT8U hour;
INT8U minute;
INT8U second;
INT8U type;
INT8U phase;
INT16U data;
} ;
struct ASP_STRUCT asp_data[ASP_PAGE_NUM];
#define KCH_ADDR 00
#define SET_ADDR 0x10
INT8U asp_wtp;
const char main_str[MAIN_PAGE_NUM*2][16]={ {" 测量 状态 "},
{" 传动 修改 "},
{" 查询 通信 "},
{" 调试 帮助 "},};
const char arrow_str[]="->";
const char pw_str[16]="请输入密码\0";
const char modify_str[2][16]={{" 时间 定值 "},
{" 系数 表底 "},};
const char time_str[2][16]= {{"年 月 日\0"},
{"时 分 秒\0"},};
const char com_str[2][16]={ {" 速率 2400 \0"},
{" 方式 N,8,1\0"},
};
const char asp_str[4][16]={ {"报告 \0"},
{"动作值 \0"},
{" 年 月 日\0"},
{" 时 分 秒\0"},};
const char asp_type_str[48][10]={ {"无 \0"}, //0
{"速断 \0"}, //1
{"过流 \0"}, //2
{"差速断 \0"}, //3
{"差动 \0"}, //4
{"充电保护\0"}, //5
{"联切1段 \0"}, //6
{"联切2段 \0"}, //7
{"过负荷 \0"}, //8
{"差流过大\0"}, //9
{"零序电流\0"}, //10
{"选线 \0"}, //11
{"零序电压\0"}, //12
{"过压 \0"}, //13
{"欠压 \0"}, //14
{"后加速 \0"}, //15
{"负序电流\0"}, //16
{"自投1段 \0"}, //17
{"自投2段 \0"}, //18
{"一次重合\0"}, //19
{"二次重合\0"}, //20
{"三次重合\0"}, //21
{"低频减载\0"}, //22
{"本体重瓦\0"}, //23
{"有载重瓦\0"}, //24
{"本体轻瓦\0"}, //25
{"有载轻瓦\0"}, //26
{"油温过高\0"}, //27
{"不平衡 \0"}, //28
{"PT断线 \0"}, //29
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -