⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hd64f38024f_chw.h

📁 ADE7758三相电能芯片读写源程序
💻 H
📖 第 1 页 / 共 2 页
字号:



#define	uchar 	unsigned char
#define	uint	       unsigned int
#define   ulong     unsigned long

/*The following defination is about flash memory application */
/********************************************************/

/*define the abbreviation of the byte and bits in FLMCR1*/
#define	HB_FLMCR1				P_ROM.FLMCR1.BYTE
#define 	HF_FLMCR1_SWE			P_ROM.FLMCR1.BIT.SWE	
#define 	HF_FLMCR1_ESU			P_ROM.FLMCR1.BIT.ESU
#define 	HF_FLMCR1_PSU			P_ROM.FLMCR1.BIT.EV
#define 	HF_FLMCR1_EV			P_ROM.FLMCR1.BIT.EV
#define 	HF_FLMCR1_PV			P_ROM.FLMCR1.BIT.PV
#define 	HF_FLMCR1_E			P_ROM.FLMCR1.BIT.E
#define 	HF_FLMCR1_P			P_ROM.FLMCR1.BIT.P

/*define the abbreviation of the byte and bits in FLMCR2*/
#define 	HB_FLMCR2				P_ROM.FLMCR2.BYTE
#define	HF_FLMCR2_FLER          	P_ROM.FLMCR2.BIT.FLER

/*define the abbreviation of the byte and bits in FLPWCR*/
#define	HB_FLPWCR				P_ROM.FLPWCR.BYTE
#define 	HF_FLPWCR_PDWND		P_ROM.FLPWCR.BIT.PDWND	

/*define the abbreviation of the byte and bits in EBR*/
#define 	HB_EBR					P_ROM.EBR.BYTE
#define 	HF_EBR_EB4				P_ROM.EBR.BIT.EB4
#define 	HF_EBR_EB3				P_ROM.EBR.BIT.EB3
#define 	HF_EBR_EB2				P_ROM.EBR.BIT.EB2
#define 	HF_EBR_EB1				P_ROM.EBR.BIT.EB1
#define 	HF_EBR_EB0				P_ROM.EBR.BIT.EB0

/*define the abbreviation of the byte and bits in FENR*/
#define 	HB_FENR				P_ROM.FENR.BYTE	
#define 	HF_FENR_FLSHE			P_ROM.FENR.BIT.FLSHE	

/*The following defination is about Atacama Asychronous event counter */
/********************************************************/

#define	HB_ECPWCRH				P_AEC.ECPWCRH
#define	HB_ECPWCRL				P_AEC.ECPWCRL
#define	HB_ECPWDRH				P_AEC.ECPWDRH
#define	HB_ECPWCRL				P_AEC.ECPWCRL

/*define the abbreviation of the byte and bits in AEGSR*/
#define 	HB_AEGSR					P_AEC.AEGSR.BYTE
#define 	HB2_AEGSR_AHEGS			P_AEC.AEGSR.BIT.AHEGS
#define 	HB2_AEGSR_ALEGS			P_AEC.AEGSR.BIT.ALEGS
#define 	HB2_AEGSR_AIEGS			P_AEC.AEGSR.BIT.AIEGS
#define 	HF_AEGSR_ECPWME			P_AEC.AEGSR.BIT.ECPWME

/*define the abbreviation of the byte and bits in ECCR*/
#define 	HB_ECCR					P_AEC.ECCR.BYTE
#define 	HB2_ECCR_ACKH				P_AEC.ECCR.BIT.ACKH
#define 	HB2_ECCR_ACKL				P_AEC.ECCR.BIT.ACKL
#define 	HB3_ECCR_PWCK				P_AEC.ECCR.BIT.PWCK

/*define the abbreviation of the byte and bits in ECCSR*/
#define 	HB_ECCSR					P_AEC.ECCSR.BYTE
#define 	HF_ECCSR_OVH				P_AEC.ECCSR.BIT.OVH
#define 	HF_ECCSR_OVL				P_AEC.ECCSR.BIT.OVL
#define 	HF_ECCSR_CH2				P_AEC.ECCSR.BIT.CH2
#define 	HF_ECCSR_CUEH				P_AEC.ECCSR.BIT.CUEH
#define 	HF_ECCSR_CUEL				P_AEC.ECCSR.BIT.CUEL
#define 	HF_ECCSR_CRCH				P_AEC.ECCSR.BIT.CRCH
#define 	HF_ECCSR_CRCL				P_AEC.ECCSR.BIT.CRCL

#define 	HB_ECH						P_AEC.ECH
#define 	HB_ECH						P_AEC.ECH

/*The following defination is about system contral*/
/********************************************************/
/*define the abbreviation of the byte and bits in WEGR*/
#define 	HB_WEGR					P_SYSCR.WEGR.BYTE
#define 	HF_WEGR_WKEGS7			P_SYSCR.WEGR.BIT.WKEGS7
#define 	HF_WEGR_WKEGS6			P_SYSCR.WEGR.BIT.WKEGS6
#define 	HF_WEGR_WKEGS5			P_SYSCR.WEGR.BIT.WKEGS5
#define 	HF_WEGR_WKEGS4			P_SYSCR.WEGR.BIT.WKEGS4
#define 	HF_WEGR_WKEGS3			P_SYSCR.WEGR.BIT.WKEGS3
#define 	HF_WEGR_WKEGS2			P_SYSCR.WEGR.BIT.WKEGS2
#define 	HF_WEGR_WKEGS1			P_SYSCR.WEGR.BIT.WKEGS1
#define 	HF_WEGR_WKEGS0			P_SYSCR.WEGR.BIT.WKEGS0


/*define the abbreviation of the byte and bits in SYSCR1*/
#define 	HB_SYSCR1					P_SYSCR.SYSCR1.BYTE
#define 	HF_SYSCR1_SSBY			P_SYSCR.SYSCR1.BIT.SSBY
#define 	HB3_SYSCR1_STS			P_SYSCR.SYSCR1.BIT.STS
#define 	HF_SYSCR1_LSON			P_SYSCR.SYSCR1.BIT.LSON
#define 	HB2_SYSCR1_MA				P_SYSCR.SYSCR1.BIT.MA

/*define the abbreviation of the byte and bits in SYSCR2*/
#define 	HB_SYSCR2					P_SYSCR.SYSCR2.BYTE
#define 	HF_SYSCR2_NESEL			P_SYSCR.SYSCR2.BIT.NESEL
#define 	HF_SYSCR2_DTON			P_SYSCR.SYSCR2.BIT.DTON
#define 	HF_SYSCR2_MSON			P_SYSCR.SYSCR2.BIT.MSON
#define 	HB2_SYSCR2_SA				P_SYSCR.SYSCR2.BIT.SA

/*define the abbreviation of the byte and bits in IEGR*/
#define 	HB_IEGR					P_SYSCR.IEGR.BYTE
#define 	HF_IEGR_IEG4				P_SYSCR.IEGR.BIT.IEG4
#define 	HF_IEGR_IEG3				P_SYSCR.IEGR.BIT.IEG3
#define 	HF_IEGR_IEG1				P_SYSCR.IEGR.BIT.IEG1
#define 	HF_IEGR_IEG0				P_SYSCR.IEGR.BIT.IEG0

/*define the abbreviation of the byte and bits in IENR1*/
#define 	HB_IENR1					P_SYSCR.IENR1.BYTE
#define 	HF_IENR1_IENTA			P_SYSCR.IENR1.BIT.IENTA
#define 	HF_IENR1_IENWP			P_SYSCR.IENR1.BIT.IENWP
#define 	HF_IENR1_IEN4				P_SYSCR.IENR1.BIT.IEN4
#define 	HF_IENR1_IEN3				P_SYSCR.IENR1.BIT.IEN3
#define 	HF_IENR1_IENEC2			P_SYSCR.IENR1.BIT.IENEC2
#define 	HF_IENR1_IEN1				P_SYSCR.IENR1.BIT.IEN1
#define 	HF_IENR1_IEN0				P_SYSCR.IENR1.BIT.IEN0

/*define the abbreviation of the byte and bits in IENR2*/
#define 	HB_IENR2					P_SYSCR.IENR2.BYTE
#define 	HF_IENR2_IENDT			P_SYSCR.IENR2.BIT.IENDT
#define 	HF_IENR2_IENAD			P_SYSCR.IENR2.BIT.IENAD
#define 	HF_IENR2_IENTG			P_SYSCR.IENR2.BIT.IENTG
#define 	HF_IENR2_IENTFH			P_SYSCR.IENR2.BIT.IENTFH
#define 	HF_IENR2_IENTFL			P_SYSCR.IENR2.BIT.IENTFL
#define 	HF_IENR2_IENTC				P_SYSCR.IENR2.BIT.IENTC
#define 	HF_IENR2_IENEC				P_SYSCR.IENR2.BIT.IENEC

/*define the abbreviation of the byte and bits in IRR1*/
#define 	HB_IRR1					P_SYSCR.IRR1.BYTE
#define 	HF_IRR1_IRRTA			P_SYSCR.IRR1.BIT.IRRTA
#define 	HF_IRR1_IRRI4			P_SYSCR.IRR1.BIT.IRRI4
#define 	HF_IRR1_IRRI3			P_SYSCR.IRR1.BIT.IRRI3
#define 	HF_IRR1_IRREC2			P_SYSCR.IRR1.BIT.IRREC2
#define 	HF_IRR1_IRRI1			P_SYSCR.IRR1.BIT.IRRI1
#define 	HF_IRR1_IRRI0			P_SYSCR.IRR1.BIT.IRRI0

/*define the abbreviation of the byte and bits in IRR2*/
#define 	HB_IRR2					P_SYSCR.IRR2.BYTE
#define 	HF_IRR2_IRRDT			P_SYSCR.IRR2.BIT.IRRDT
#define 	HF_IRR2_IRRAD			P_SYSCR.IRR2.BIT.IRRAD
#define 	HF_IRR2_IRRTG			P_SYSCR.IRR2.BIT.IRRTG
#define 	HF_IRR2_IRRTFH			P_SYSCR.IRR2.BIT.IRRTFH
#define 	HF_IRR2_IRRTFL			P_SYSCR.IRR2.BIT.IRRTFL
#define 	HF_IRR2_IRRTC			P_SYSCR.IRR2.BIT.IRRTC
#define 	HF_IRR2_IRREC			P_SYSCR.IRR2.BIT.IRREC

/*define the abbreviation of the byte and bits in IWPR*/
#define 	HB_IWPR					P_SYSCR.IWPR.BYTE
#define 	HF_IWPR_IWPF7 			P_SYSCR.IWPR.BIT.IWPF7
#define 	HF_IWPR_IWPF6 			P_SYSCR.IWPR.BIT.IWPF6
#define 	HF_IWPR_IWPF5				P_SYSCR.IWPR.BIT.IWPF5
#define 	HF_IWPR_IWPF4				P_SYSCR.IWPR.BIT.IWPF4
#define 	HF_IWPR_IWPF3				P_SYSCR.IWPR.BIT.IWPF3
#define 	HF_IWPR_IWPF2				P_SYSCR.IWPR.BIT.IWPF2
#define 	HF_IWPR_IWPF1				P_SYSCR.IWPR.BIT.IWPF1
#define 	HF_IWPR_IWPF0				P_SYSCR.IWPR.BIT.IWPF0

/*define the abbreviation of the byte and bits in CKSTPR1*/
#define 	HB_CKSTPR1					P_SYSCR.CKSTPR1.BYTE
#define 	HF_CKSTPR1_S32CKSTP		P_SYSCR.CKSTPR1.BIT.S32CKSTP
#define 	HF_CKSTPR1_ADCKSTP 		P_SYSCR.CKSTPR1.BIT.ADCKSTP
#define 	HF_CKSTPR1_TGCKSTP		P_SYSCR.CKSTPR1.BIT.TGCKSTP
#define 	HF_CKSTPR1_TFCKSTP		P_SYSCR.CKSTPR1.BIT.TFCKSTP
#define 	HF_CKSTPR1_TCCKSTP 		P_SYSCR.CKSTPR1.BIT.TCCKSTP
#define 	HF_CKSTPR1_TACKSTP 		P_SYSCR.CKSTPR1.BIT.TACKSTP

/*define the abbreviation of the byte and bits in CKSTPR2*/
#define 	HB_CKSTPR2					P_SYSCR.CKSTPR2.BYTE
#define 	HF_CKSTPR2_PW2CKSTP		P_SYSCR.CKSTPR2.BIT.PW2CKSTP
#define 	HF_CKSTPR2_AECKSTP		P_SYSCR.CKSTPR2.BIT.AECKSTP
#define 	HF_CKSTPR2_WDCKSTP		P_SYSCR.CKSTPR2.BIT.WDCKSTP
#define 	HF_CKSTPR2_PW1CKSTP		P_SYSCR.CKSTPR2.BIT.PW1CKSTP
#define 	HF_CKSTPR2_LDCKSTP		P_SYSCR.CKSTPR2.BIT.LDCKSTP

/*The following defination is about SIC3*/
/********************************************************/
/*define the abbreviation of the byte and bits in SPCR*/
#define 	HB_SPCR					P_SCI3.SPCR.BYTE
#define 	HF_SPCR_SPC32				P_SCI3.SPCR.BIT.SPC32
#define 	HF_SPCR_SCINV3			P_SCI3.SPCR.BIT.SCINV3
#define 	HF_SPCR_SCINV2			P_SCI3.SPCR.BIT.SCINV2

 /*define the abbreviation of the byte and bits in SMR*/
#define   HB_SMR					P_SCI3.SMR.BYTE
#define	HF_SMR_COM			P_SCI3.SMR.BIT.COM
#define	HF_SMR_CHR2			P_SCI3.SMR.BIT.CHR
#define	HF_SMR_PE				P_SCI3.SMR.BIT.PE
#define	HF_SMR_PM				P_SCI3.SMR.BIT.PM
#define	HF_SMR_STOP			P_SCI3.SMR.BIT.STOP
#define	HF_SMR_MP				P_SCI3.SMR.BIT.MP
#define   HB2_SMR_CKS			P_SCI3.SMR.BIT.CKS
/*end of SMR def*/

/*define the abbreviation of the byte and bits in BRR*/
#define	HB_BRR			P_SCI3.BRR

/*define the abbreviation of the byte and bits in SCR*/
#define 	HB_SCR3				P_SCI3.SCR3.BYTE
#define	HF_SCR3_TIE			P_SCI3.SCR3.BIT.TIE
#define	HF_SCR3_RIE			P_SCI3.SCR3.BIT.RIE
#define	HF_SCR3_TE				P_SCI3.SCR3.BIT.TE
#define	HF_SCR3_RE				P_SCI3.SCR3.BIT.RE
#define	HF_SCR3_MPIE			P_SCI3.SCR3.BIT.MPIE
#define	HF_SCR3_TEIE			P_SCI3.SCR3.BIT.TEIE
#define	HB2_SCR3_CKE			P_SCI3.SCR3.BIT.CKE
/*end of SCR def*/

/*define the abbreviation of the byte and bits in TDR*/
#define 	HB_TDR				P_SCI3.TDR
/*end of TDR def*/

/*define the abbreviation of the byte and bits in SSR*/
#define 	HB_SSR				P_SCI3.SSR.BYTE
#define	HF_SSR_TDRE		P_SCI3.SSR.BIT.TDRE
#define	HF_SSR_RDRF		P_SCI3.SSR.BIT.RDRF
#define	HF_SSR_OER			P_SCI3.SSR.BIT.OER
#define	HF_SSR_FER			P_SCI3.SSR.BIT.FER
#define	HF_SSR_PER			P_SCI3.SSR.BIT.PER
#define	HF_SSR_TEND		P_SCI3.SSR.BIT.TEND
#define	HF_SSR_MPBR		P_SCI3.SSR.BIT.MPBR
#define	HF_SSR_MPBT		P_SCI3.SSR.BIT.MPBT
/*end of SSR def*/

/*define the abbreviation of the byte and bits in RDR*/
#define	HB_RDR			P_SCI3.RDR	
/*end of RDR def*/

/*The following defination is about timer A*/
/********************************************************/
/*define the abbreviation of the byte and bits in TMA*/
#define 	HB_TMA				P_TMRA.TMA.BYTE
#define	HB4_TMA_TMA		P_TMRA.TMA.BIT.TMA

#define	HB_TCA				P_TMRA.TCA

/*The following defination is about watchdog timer*/
/********************************************************/
/*define the abbreviation of the byte and bits in TCSRW*/
#define 	HB_TCSRW				P_WDT.TCSRW.BYTE
#define	HF_TCSRW_B6WI			P_WDT.TCSRW.BIT.B6WI
#define	HF_TCSRW_TCWE		P_WDT.TCSRW.BIT.TCWE
#define	HF_TCSRW_B4WI			P_WDT.TCSRW.BIT.B4WI
#define	HF_TCSRW_TCSRWE		P_WDT.TCSRW.BIT.TCSRWE
#define	HF_TCSRW_B2WI			P_WDT.TCSRW.BIT.B2WI
#define	HF_TCSRW_WDON		P_WDT.TCSRW.BIT.WDON
#define	HF_TCSRW_BOWI		P_WDT.TCSRW.BIT.BOWI
#define	HF_TCSRW_WRST		P_WDT.TCSRW.BIT.WRST

#define	HB_TCW					P_WDT.TCW

/*The following defination is about  timer C*/
/********************************************************/
/*define the abbreviation of the byte and bits in TCSRW*/
#define 	HB_TMC				P_TMRC.TMC.BYTE
#define	HF_TMC_TMC7		P_TMRC.TMC.BIT.TMC7
#define	HB2_TMC_TMC65		P_TMRC.TMC.BIT.TMC65
#define	HB3_TMC_TMC		P_TMRC.TMC.BIT.TMC

#define	HB_TCCTLC			P_TMRC.TCCTLC

/*The following defination is about  timer F*/
/********************************************************/
/*define the abbreviation of the byte and bits in TCRF*/
#define 	HB_TCRF				P_TMRF.TCRF.BYTE
#define	HF_TCRF_TOLH			P_TMRF.TCRF.BIT.TOLH
#define	HB3_TCRF_CKSH			P_TMRF.TCRF.BIT.CKSH
#define	HF_TCRF_TOLL			P_TMRF.TCRF.BIT.TOLL
#define	HB3_TCRF_CKSL			P_TMRF.TCRF.BIT.CKSL
                                 
/*define the abbreviation of the byte and bits in TCSRF*/
#define 	HB_TCSRF				P_TMRF.TCSRF.BYTE
#define	HF_TCSRF_OVFH			P_TMRF.TCSRF.BIT.OVFH
#define	HF_TCSRF_CMFH			P_TMRF.TCSRF.BIT.CMFH
#define	HF_TCSRF_OVIEH		P_TMRF.TCSRF.BIT.OVIEH
#define	HF_TCSRF_CCLRH		P_TMRF.TCSRF.BIT.CCLRH
#define	HF_TCSRF_OVFL			P_TMRF.TCSRF.BIT.OVFL
#define	HF_TCSRF_CMFL			P_TMRF.TCSRF.BIT.CMFL
#define	HF_TCSRF_OVIEL			P_TMRF.TCSRF.BIT.OVIEL
#define	HF_TCSRF_CCLRL			P_TMRF.TCSRF.BIT.CCLRL

/*define the abbreviation of the byte and bits in TCF*/
#define 	HW_TCF				P_TMRF.TCF.WORD
#define	HF_TCF_H			P_TMRF.TCF.BYTE.H
#define	HF_TCF_L			P_TMRF.TCF.BYTE.L     

/*define the abbreviation of the byte and bits in OCRF*/
#define 	HW_OCRF			P_TMRF.OCRF.WORD
#define	HF_OCRF_H			P_TMRF.OCRF.BYTE.H
#define	HF_OCRF_L			P_TMRF.OCRF.BYTE.L     

/*The following defination is about  timer G*/
/********************************************************/
/*define the abbreviation of the byte and bits in TMG*/
#define 	HB_TMG				P_TMRG.TMG.BYTE
#define	HF_TMG_OVFH		P_TMRG.TMG.BIT.OVFH
#define	HF_TMG_OVFL		P_TMRG.TMG.BIT.OVFL
#define	HF_TMG_OVIE		P_TMRG.TMG.BIT.OVIE
#define	HF_TMG_IIEGS		P_TMRG.TMG.BIT.IIEGS
#define	HB2_TMG_CCLR		P_TMRG.TMG.BIT.CCLR
#define	HB2_TMG_CKS		P_TMRG.TMG.BIT.CKS

#define   HB_ICRGF			P_TMRG.ICRGF
#define   HB_ICRGR			P_TMRG.ICRGR

/*The following defination is about  LCD*/
/********************************************************/
/*define the abbreviation of the byte and bits in LPCR*/
#define 	HB_LPCR				P_LCD.LPCR.BYTE
#define	HB2_LPCR_DTS			P_LCD.LPCR.BIT.DTS
#define	HF_LPCR_CMX			P_LCD.LPCR.BIT.CMX
#define	HB4_LPCR_SGS			P_LCD.LPCR.BIT.SGS

/*define the abbreviation of the byte and bits in LCR*/
#define 	HB_LCR					P_LCD.LCR.BYTE
#define	HF_LCR_PSW			P_LCD.LCR.BIT.PSW
#define	HF_LCR_ACT				P_LCD.LCR.BIT.ACT
#define	HF_LCR_DISP			P_LCD.LCR.BIT.DISP
#define	HB4_LCR_CKS			P_LCD.LCR.BIT.CKS

/*define the abbreviation of the byte and bits in LCR2*/
#define 	HB_LCR2					P_LCD.LCR2.BYTE
#define	HF_LCR2_LCDAB				P_LCD.LCR2.BIT.LCDAB


#define 	HW_ADRR					P_AD.ADRR
/*define the abbreviation of the byte and bits in ADRR*/
#define 	HB_AMR					P_AD.AMR.BYTE
#define	HF_AMR_CKS			P_AD.AMR.BIT.CKS
#define	HF_AMR_TRGE			P_AD.AMR.BIT.TRGE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -