📄 extern.h
字号:
#define Stop_Disp OtherFlg_Disp.BIT.B2 //停显、轮显切换信号 1为停显
#define Open_Disp OtherFlg_Disp.BIT.B3 //开显示、关显示切换信号 1为开显示
#define Batt_Disp OtherFlg_Disp.BIT.B4 //电池电压低显示信号
#define Progrm_Disp OtherFlg_Disp.BIT.B5 //编程开关打开信号 1为开关打开
#define Revs_Disp OtherFlg_Disp.BIT.B6 //电表电压反向显示信号
#define DispTbl_Disp OtherFlg_Disp.BIT.B7 //显示表改变信号
#define AccdntRcd_Byte AccdntRcd_Comm.BYTE //事件记录字节信号
#define Prgrm_Accdnt AccdntRcd_Comm.BIT.B0 //编程事件
#define _Accdnt AccdntRcd_Comm.BIT.B1 //
#define Reset_Accdnt AccdntRcd_Comm.BIT.B2 //系统数据复位事件
//#define ClrPw_Accdnt AccdntRcd_Comm.BIT.B3 //电量总清零事件
#define HstryClr_Accdnt AccdntRcd_Comm.BIT.B4 //历史电量清零事件
#define NewComDisp_Disp AccdntRcd_Comm.BIT.B5 //新通信触发显示信号
#define SetTm_Accdnt AccdntRcd_Comm.BIT.B6 //时间设置事件
#define SetDate_Accdnt AccdntRcd_Comm.BIT.B7 //日期设置事件
#define Led_Flg Cf_Flg.BIT.B0 //脉冲指示标志
#define Revp_Flg Cf_Flg.BIT.B1 //反向脉冲指示
#define Dl_ZcFlg Cf_Flg.BIT.B2 //电量转存标志
#define PowerDown_Flg Power_Flg.BIT.B0
#define PowerUp_Flg Power_Flg.BIT.B1 //系统上电生成标志
#define Sys_Powerdn Power_Flg.BIT.B2
#define PriPwUp_Flg Sys_Reg.BIT.B0 //电表系统初次上电
#define SecPwUp_Flg Sys_Reg.BIT.B1 //电表系统重新上电(无电池状态)
#define NmlPwUp_Flg Sys_Reg.BIT.B2 //电表系统正常上电
#define Dl_VerErr Sys_Reg.BIT.B3 //电量比较出错
/*******************************************************************************************/
#define ESysData_Group 0x0000 //16bytes
//***************三个月电量数据及当前反向电量 ************************************
#define EPPwrTtl_Dtr ESysData_Group+16 //4bytes
#define ENPwrTtl_Dtr EPPwrTtl_Dtr+4 //4bytes
#define ELPPwrTtl_Dtr ENPwrTtl_Dtr+4 //4bytes
#define ELLPPwrTtl_Dtr ELPPwrTtl_Dtr+4 //4bytes
#define EM3_PPwrTtl_Dtr ELLPPwrTtl_Dtr+4 //4bytes
#define EM4_PPwrTtl_Dtr EM3_PPwrTtl_Dtr+4 //4bytes
#define EM5_PPwrTtl_Dtr EM4_PPwrTtl_Dtr+4 //4bytes
#define EM6_PPwrTtl_Dtr EM5_PPwrTtl_Dtr+4 //4bytes
#define EM7_PPwrTtl_Dtr EM6_PPwrTtl_Dtr+4 //4bytes
#define EM8_PPwrTtl_Dtr EM7_PPwrTtl_Dtr+4 //4bytes
#define EM9_PPwrTtl_Dtr EM8_PPwrTtl_Dtr+4 //4bytes
#define EM10_PPwrTtl_Dtr EM9_PPwrTtl_Dtr+4 //4bytes
#define EM11_PPwrTtl_Dtr EM10_PPwrTtl_Dtr+4 //4bytes
#define EM12_PPwrTtl_Dtr EM11_PPwrTtl_Dtr+4 //4bytes
//14 *4 +16 = 62bytes
///////////////////////////////////////////////////////////////////////////
//****************1天冻结数据***************************************
#define ELDay_PPwrTtl_Dtr EM12_PPwrTtl_Dtr+4 //4bytes,1天冻结总电量
#define ELBrock_PPwrTtl_Dtr ELDay_PPwrTtl_Dtr+4 //4bytes,广播冻结总电量
#define ELBrock_Tm ELBrock_PPwrTtl_Dtr+4 //4bytes,广播冻结时间
//12bytes //62 + 12 =74bytes
//***************三个月电量备份数据 ************************************
#define EPPwrTtl_BKUP ELBrock_Tm+5 //4ytes
#define ENPwrTtl_BKUP EPPwrTtl_BKUP+4 //4bytes //共20bytes + 376 bytes =616bytes
#define EPrgrm_Cnt_Dtr ENPwrTtl_BKUP+4
#define ELPrgrm_Tm_Dtr EPrgrm_Cnt_Dtr+2
#define EL2Prgrm_Tm_Dtr ELPrgrm_Tm_Dtr+5
#define EL3Prgrm_Tm_Dtr EL2Prgrm_Tm_Dtr+5
#define EL4Prgrm_Tm_Dtr EL3Prgrm_Tm_Dtr+5
#define ELPrgrm_MdCnt_Dtr EL4Prgrm_Tm_Dtr+5
#define EL2Prgrm_MdCnt_Dtr ELPrgrm_MdCnt_Dtr+2
#define EL3Prgrm_MdCnt_Dtr EL2Prgrm_MdCnt_Dtr+2
#define EL4Prgrm_MdCnt_Dtr EL3Prgrm_MdCnt_Dtr+2 //26 +8 = 34bytes
#define EPdCnt_Dtr EL4Prgrm_MdCnt_Dtr+4 //停电次数
#define EPDRcd1_Dtr EPdCnt_Dtr+2 //最近1次停电时间
#define EPDRcd2_Dtr EPDRcd1_Dtr+10 //最近2次停电时间
#define EPDRcd3_Dtr EPDRcd2_Dtr+10 //最近3次停电时间
#define EPDRcd4_Dtr EPDRcd3_Dtr+10 //最近4次停电时间
#define EPDRcd5_Dtr EPDRcd4_Dtr+10 //最近5次停电时间
#define EPDRcd6_Dtr EPDRcd5_Dtr+10 //最近6次停电时间
#define EPDRcd7_Dtr EPDRcd6_Dtr+10 //最近7次停电时间
#define EPDRcd8_Dtr EPDRcd7_Dtr+10 //最近8次停电时间
#define EPDRcd9_Dtr EPDRcd8_Dtr+10 //最近9次停电时间
#define EPDRcd10_Dtr EPDRcd9_Dtr+10 //最近10次停电时间
//102bytes
#define ECrntRvrs_Cnt_Dtr EPDRcd10_Dtr+10 //电流反向次数
#define ECrntRvrs_Rcd1_Dtr ECrntRvrs_Cnt_Dtr+2 //最近1次反向时间
#define ECrntRvrs_Rcd2_Dtr ECrntRvrs_Rcd1_Dtr+10 //最近2次反向时间
#define ECrntRvrs_Rcd3_Dtr ECrntRvrs_Rcd2_Dtr+10 //最近3次反向时间
#define ECrntRvrs_Rcd4_Dtr ECrntRvrs_Rcd3_Dtr+10 //最近4次反向时间
#define ECrntRvrs_Rcd5_Dtr ECrntRvrs_Rcd4_Dtr+10 //最近5次反向时间
#define ECrntRvrs_Rcd6_Dtr ECrntRvrs_Rcd5_Dtr+10 //最近6次反向时间
#define ECrntRvrs_Rcd7_Dtr ECrntRvrs_Rcd6_Dtr+10 //最近7次反向时间
#define ECrntRvrs_Rcd8_Dtr ECrntRvrs_Rcd7_Dtr+10 //最近8次反向时间
#define ECrntRvrs_Rcd9_Dtr ECrntRvrs_Rcd8_Dtr+10 //最近9次反向时间
#define ECrntRvrs_Rcd10_Dtr ECrntRvrs_Rcd9_Dtr+10 //最近10次反向时间
//102bytes
#define EClrPw_Cnt_Dtr ECrntRvrs_Rcd10_Dtr+10 //清零次数
#define ELClrPw_Tm_Dtr EClrPw_Cnt_Dtr+2 //最近1次清零时间
#define EL2ClrPw_Tm_Dtr ELClrPw_Tm_Dtr+5 //最近2次清零时间
#define EL3ClrPw_Tm_Dtr EL2ClrPw_Tm_Dtr+5 //最近3次清零时间
#define EL4ClrPw_Tm_Dtr EL3ClrPw_Tm_Dtr+5 //最近4次清零时间
#define EL5ClrPw_Tm_Dtr EL4ClrPw_Tm_Dtr+5 //最近5次清零时间
//27bytes
#define ELClrPwrTtl_Dtr EL5ClrPw_Tm_Dtr+5 //最近1次清零时电量
#define EL2ClrPwrTtl_Dtr ELClrPwrTtl_Dtr+4 //最近2次清零时电量
#define EL3ClrPwrTtl_Dtr EL2ClrPwrTtl_Dtr+4 //最近3次清零时电量
#define EL4ClrPwrTtl_Dtr EL3ClrPwrTtl_Dtr+4 //最近4次清零时电量
#define EL5ClrPwrTtl_Dtr EL4ClrPwrTtl_Dtr+4 //最近5次清零时电量
//27bytes
//164 + 18 +34 +74 =290bytes
#define EMtCt_Dtr EL5ClrPwrTtl_Dtr+4
#define EMtNo_Dtr EMtCt_Dtr+3
#define EUsrNo_Dtr EMtNo_Dtr+6
#define EDvcNo_Dtr EUsrNo_Dtr+6
#define EShftDspTm_Dtr EDvcNo_Dtr+6
#define EStpDspTm_Dtr EShftDspTm_Dtr+1
#define EAUtRdTm_Dtr EStpDspTm_Dtr+1
#define EIntPwr_Dtr EAUtRdTm_Dtr+2
#define EPassWd_Dtr EIntPwr_Dtr+4
#define ERttDspNo_Dtr EPassWd_Dtr+4
#define EKeyDspNo_Dtr ERttDspNo_Dtr+16
#define EOpnClsLcd_Dtr EKeyDspNo_Dtr+16
#define PowDwn_Reg EOpnClsLcd_Dtr+4 // = 0xe8 :掉电事件完成标志
#define PowDwn_Tm PowDwn_Reg+1 // 最近一次掉电时间
#define PowUp_Tm PowDwn_Tm+5 // 最近一次上电时间
#define HstryEngy_Pter PowUp_Tm+5 //历史电量偏移指针
#define CrntRvrs_Pter HstryEngy_Pter+1 //电流反向事件偏移量指针
#define PDRcd_Pter CrntRvrs_Pter+1 //停电事件偏移量指针
#define Prgrm_Tm_Pter PDRcd_Pter+1 //编程时间偏移量指针
#define ClrPw_Tm_Pter Prgrm_Tm_Pter+1 //电量总清零时间偏移量指针
#define Rtc_Time ClrPw_Tm_Pter+1 //7 bytes 时钟
#define E_Cf_Cnt Rtc_Time+7 //脉冲数
#define ClrPw_Cnt E_Cf_Cnt+1 ///非编程状态清零次数 //88bytes + 686 bytes = 704bytes
//***************三个月电量备份数据 ************************************
#define EPPwrTtl_BKUP1 0x0000
#define ENPwrTtl_BKUP1 EPPwrTtl_BKUP1+4 //20bytes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -