
;**************************************************************
;V1.2：按照《HSmcu_HeadFile_定义参考说明-V1.00-20241119》编辑
;Special function register definitions
;IC Type Support:
;	HS16P2811,
;Updata:20241119
;Designer:LBW
;**************************************************************

;**************************************************************
;V1.1：
;Special function register definitions
;IC Type Support:
;	HS16P2811,
;Updata:20241030
;Designer:LBW
;**************************************************************

;----------------------------------------------------

A			EQU     0
R			EQU     1

W			EQU     0
F			EQU     1


;----------------------------------------------------
;system public Special function register definitions
;----------------------------------------------------


INDF 		EQU 	000H


PCL 		EQU 	002H


STATUS 		EQU 	003H
	IRP			EQU		STATUS,7
	RP1			EQU		STATUS,6
	RP0			EQU		STATUS,5
	TO			EQU		STATUS,4
	PD			EQU		STATUS,3
	Z			EQU		STATUS,2
	DC			EQU		STATUS,1
	C			EQU		STATUS,0
	
	FIRP		EQU		STATUS,7
	FRP1		EQU		STATUS,6
	FRP0		EQU		STATUS,5
	FTO			EQU		STATUS,4
	FPD			EQU		STATUS,3
	FZ			EQU		STATUS,2
	FDC			EQU		STATUS,1
	FC			EQU		STATUS,0
	
	
FSR 		EQU 	004H
	FSR7 		EQU		FSR,7
	
	FFSR7 		EQU		FSR,7
	
	
PCLATH 		EQU 	00AH
#define 	PCHBUF	PCLATH
	PCH2		EQU		PCLATH,2
	PCH1		EQU		PCLATH,1
	PCH0		EQU		PCLATH,0
	
	FPCH2		EQU		PCLATH,2
	FPCH1		EQU		PCLATH,1
	FPCH0		EQU		PCLATH,0


INTCON	 	EQU 	00BH
	GIE			EQU		INTCON,7
	PEIE		EQU		INTCON,6
	INTIE		EQU		INTCON,4
	PAIE		EQU		INTCON,3
	INTIF		EQU		INTCON,1
	PAIF		EQU		INTCON,0

	FGIE		EQU		INTCON,7
	FPEIE		EQU		INTCON,6
	FINTIE		EQU		INTCON,4
	FPAIE		EQU		INTCON,3
	FINTIF		EQU		INTCON,1
	FPAIF		EQU		INTCON,0
	
	
;----------------------------------------------------
;BANK0 Special function register definitions
;----------------------------------------------------


PORTA 		EQU 	005H
	PA7			EQU		PORTA,7
	PA6			EQU		PORTA,6
	PA5			EQU		PORTA,5
	PA4			EQU		PORTA,4
	PA3			EQU		PORTA,3
	PA2			EQU		PORTA,2
	PA1			EQU		PORTA,1
	PA0			EQU		PORTA,0
	
	FPA7		EQU		PORTA,7
	FPA6		EQU		PORTA,6
	FPA5		EQU		PORTA,5
	FPA4		EQU		PORTA,4
	FPA3		EQU		PORTA,3
	FPA2		EQU		PORTA,2
	FPA1		EQU		PORTA,1
	FPA0		EQU		PORTA,0
	
	
PORTC 		EQU 	007H
	PC5			EQU		PORTC,5
	PC4			EQU		PORTC,4
	PC3			EQU		PORTC,3
	PC2			EQU		PORTC,2
	PC1			EQU		PORTC,1
	PC0			EQU		PORTC,0
	
	FPC5		EQU		PORTC,5
	FPC4		EQU		PORTC,4
	FPC3		EQU		PORTC,3
	FPC2		EQU		PORTC,2
	FPC1		EQU		PORTC,1
	FPC0		EQU		PORTC,0
	
	
PIR1 		EQU 	00CH
	ADCIF		EQU		PIR1,6
	T1IF		EQU		PIR1,0
	
	FADCIF		EQU		PIR1,6
	FT1IF		EQU		PIR1,0
	

PIR2 		EQU 	00DH
	C1IF		EQU		PIR2,5
	T4IF		EQU		PIR2,2
	T3IF		EQU		PIR2,1

	FC1IF		EQU		PIR2,5
	FT4IF		EQU		PIR2,2
	FT3IF		EQU		PIR2,1
	

PCHCON		EQU 	012H
	PHC5		EQU		PCHCON,5
	PHC4		EQU		PCHCON,4
	PHC3		EQU		PCHCON,3
	PHC2		EQU		PCHCON,2
	PHC1		EQU		PCHCON,1
	PHC0		EQU		PCHCON,0
	
	FPHC5		EQU		PCHCON,5
	FPHC4		EQU		PCHCON,4
	FPHC3		EQU		PCHCON,3
	FPHC2		EQU		PCHCON,2
	FPHC1		EQU		PCHCON,1
	FPHC0		EQU		PCHCON,0


PCDCON		EQU 	013H
	PDC5		EQU		PCDCON,5
	PDC4		EQU		PCDCON,4
	PDC3		EQU		PCDCON,3
	PDC2		EQU		PCDCON,2
	PDC1		EQU		PCDCON,1
	PDC0		EQU		PCDCON,0

	FPDC5		EQU		PCDCON,5
	FPDC4		EQU		PCDCON,4
	FPDC3		EQU		PCDCON,3
	FPDC2		EQU		PCDCON,2
	FPDC1		EQU		PCDCON,1
	FPDC0		EQU		PCDCON,0
	

ADBBUF	 	EQU 	016H


ADPCON1 	EQU 	019H


ADPCON		EQU 	01AH


ADM 		EQU 	01BH
	ADENB		EQU		ADM,7
	ADS			EQU		ADM,6	
	EOC			EQU		ADM,5
	GCHS		EQU		ADM,4
	CHS3		EQU		ADM,3
	CHS2		EQU		ADM,2
	CHS1		EQU		ADM,1
	CHS0		EQU		ADM,0
	
	FADENB		EQU		ADM,7
	FADS		EQU		ADM,6	
	FEOC		EQU		ADM,5
	FGCHS		EQU		ADM,4
	FCHS3		EQU		ADM,3
	FCHS2		EQU		ADM,2
	FCHS1		EQU		ADM,1
	FCHS0		EQU		ADM,0
	

ADB 		EQU 	01CH


ADR 		EQU 	01DH
	ADCKS1		EQU		ADR,6
	ADCKS0		EQU		ADR,4

	FADCKS1		EQU		ADR,6
	FADCKS0		EQU		ADR,4
	

ADT 		EQU 	01EH


VREFH		EQU 	01FH
	EVHENB		EQU		VREFH,7
	VHS1		EQU		VREFH,1
	VHS0		EQU		VREFH,0

	FEVHENB		EQU		VREFH,7
	FVHS1		EQU		VREFH,1
	FVHS0		EQU		VREFH,0


;----------------------------------------------------
;BANK1 Special function register definitions
;----------------------------------------------------

;OPTION	 	EQU 	001H
OPTIONR 	EQU 	001H
	INTEDGE		EQU		OPTIONR,6

	FINTEDGE	EQU		OPTIONR,6
	

TRISA 		EQU 	005H
	TRISA7		EQU		TRISA,7
	TRISA6		EQU		TRISA,6
	TRISA5		EQU		TRISA,5
	TRISA4		EQU		TRISA,4
	TRISA3		EQU		TRISA,3
	TRISA2		EQU		TRISA,2
	TRISA1		EQU		TRISA,1
	TRISA0		EQU		TRISA,0
	
	FTRISA7		EQU		TRISA,7
	FTRISA6		EQU		TRISA,6
	FTRISA5		EQU		TRISA,5
	FTRISA4		EQU		TRISA,4
	FTRISA3		EQU		TRISA,3
	FTRISA2		EQU		TRISA,2
	FTRISA1		EQU		TRISA,1
	FTRISA0		EQU		TRISA,0


TRISC	 	EQU 	007H
	TRISC5		EQU		TRISC,5
	TRISC4		EQU		TRISC,4
	TRISC3		EQU		TRISC,3
	TRISC2		EQU		TRISC,2
	TRISC1		EQU		TRISC,1
	TRISC0		EQU		TRISC,0

	FTRISC5		EQU		TRISC,5
	FTRISC4		EQU		TRISC,4
	FTRISC3		EQU		TRISC,3
	FTRISC2		EQU		TRISC,2
	FTRISC1		EQU		TRISC,1
	FTRISC0		EQU		TRISC,0


PIE1		EQU 	00CH
	ADCIE		EQU		PIE1,6
	T1IE		EQU		PIE1,0

	FADCIE		EQU		PIE1,6
	FT1IE		EQU		PIE1,0
	

PIE2		EQU 	00DH
	C1IE		EQU		PIE2,5
	T4IE		EQU		PIE2,2
	T3IE		EQU		PIE2,1
	
	FC1IE		EQU		PIE2,5
	FT4IE		EQU		PIE2,2
	FT3IE		EQU		PIE2,1
	

PCON 		EQU 	00EH
	WDTE		EQU		PCON,7
	LVDTE		EQU		PCON,5

	FWDTE		EQU		PCON,7
	FLVDTE		EQU		PCON,5
	

WUACON		EQU 	00FH
	WUA7		EQU		WUACON,7
	WUA6		EQU		WUACON,6
	WUA5		EQU		WUACON,5
	WUA4		EQU		WUACON,4
	WUA3		EQU		WUACON,3
	WUA2		EQU		WUACON,2
	WUA1		EQU		WUACON,1
	WUA0		EQU		WUACON,0

	FWUA7		EQU		WUACON,7
	FWUA6		EQU		WUACON,6
	FWUA5		EQU		WUACON,5
	FWUA4		EQU		WUACON,4
	FWUA3		EQU		WUACON,3
	FWUA2		EQU		WUACON,2
	FWUA1		EQU		WUACON,1
	FWUA0		EQU		WUACON,0


PAHCON 		EQU 	012H
	PHA7		EQU		PAHCON,7
	PHA6		EQU		PAHCON,6
	PHA5		EQU		PAHCON,5
	PHA4		EQU		PAHCON,4
	PHA3		EQU		PAHCON,3
	PHA2		EQU		PAHCON,2
	PHA1		EQU		PAHCON,1
	PHA0		EQU		PAHCON,0
	
	FPHA7		EQU		PAHCON,7
	FPHA6		EQU		PAHCON,6
	FPHA5		EQU		PAHCON,5
	FPHA4		EQU		PAHCON,4
	FPHA3		EQU		PAHCON,3
	FPHA2		EQU		PAHCON,2
	FPHA1		EQU		PAHCON,1
	FPHA0		EQU		PAHCON,0


PADCON		EQU 	013H
	PDA7		EQU		PADCON,7
	PDA6		EQU		PADCON,6
	PDA5		EQU		PADCON,5
	PDA4		EQU		PADCON,4
	PDA3		EQU		PADCON,3
	PDA2		EQU		PADCON,2
	PDA1		EQU		PADCON,1
	PDA0		EQU		PADCON,0
	
	FPDA7		EQU		PADCON,7
	FPDA6		EQU		PADCON,6
	FPDA5		EQU		PADCON,5
	FPDA4		EQU		PADCON,4
	FPDA3		EQU		PADCON,3
	FPDA2		EQU		PADCON,2
	FPDA1		EQU		PADCON,1
	FPDA0		EQU		PADCON,0
	

OSCM 		EQU 	014H
	WAKEMODE	EQU		OSCM,6
	GREENEN		EQU		OSCM,5
	SLCON		EQU		OSCM,3
	STPHX		EQU		OSCM,1
	CLKMD		EQU		OSCM,0

	FWAKEMODE	EQU		OSCM,6
	FGREENEN	EQU		OSCM,5
	FSLCON		EQU		OSCM,3
	FSTPHX		EQU		OSCM,1
	FCLKMD		EQU		OSCM,0
	

PAODCON 	EQU 	015H
	ODA7		EQU		PAODCON,7
	ODA6		EQU		PAODCON,6
	ODA5		EQU		PAODCON,5
	ODA4		EQU		PAODCON,4
	ODA3		EQU		PAODCON,3
	ODA2		EQU		PAODCON,2
	ODA1		EQU		PAODCON,1
	ODA0		EQU		PAODCON,0
	
	FODA7		EQU		PAODCON,7
	FODA6		EQU		PAODCON,6
	FODA5		EQU		PAODCON,5
	FODA4		EQU		PAODCON,4
	FODA3		EQU		PAODCON,3
	FODA2		EQU		PAODCON,2
	FODA1		EQU		PAODCON,1
	FODA0		EQU		PAODCON,0


T1CON		EQU 	01BH
	T1CK1		EQU		T1CON,5
	T1CK0		EQU		T1CON,4
	T1CKS1		EQU		T1CON,3
	T1SYNC		EQU		T1CON,2
	T1CKS0		EQU		T1CON,1
	T1REN		EQU		T1CON,0

	FT1CK1		EQU		T1CON,5
	FT1CK0		EQU		T1CON,4
	FT1CKS1		EQU		T1CON,3
	FT1SYNC		EQU		T1CON,2
	FT1CKS0		EQU		T1CON,1
	FT1REN		EQU		T1CON,0
	

T1TH		EQU 	01CH


T1TL		EQU 	01DH


T3D4L		EQU 	01EH


T3D4H		EQU 	01FH



;----------------------------------------------------
;BANK2 Special function register definitions
;----------------------------------------------------

T3C0		EQU 	010H
	T3REN		EQU		T3C0,7
	T3PWM1INV	EQU		T3C0,5
	T3PWM0INV	EQU		T3C0,4
	T3PWM1EN	EQU		T3C0,2
	T3PWM0EN	EQU		T3C0,1
	
	FT3REN		EQU		T3C0,7
	FT3PWM1INV	EQU		T3C0,5
	FT3PWM0INV	EQU		T3C0,4
	FT3PWM1EN	EQU		T3C0,2
	FT3PWM0EN	EQU		T3C0,1


T3C1		EQU 	011H
	T3OUT0		EQU		T3C1,6
	T3CKS0		EQU		T3C1,4
	T3CK2		EQU		T3C1,2
	T3CK1		EQU		T3C1,1
	T3CK0		EQU		T3C1,0
	
	FT3OUT0		EQU		T3C1,6
	FT3CKS0		EQU		T3C1,4
	FT3CK2		EQU		T3C1,2
	FT3CK1		EQU		T3C1,1
	FT3CK0		EQU		T3C1,0


T3TL		EQU 	012H


T3TH		EQU 	013H


T3PL		EQU 	014H


T3PH		EQU 	015H


T3D0L		EQU 	016H


T3D0H		EQU 	017H


T3C2		EQU 	019H
	PDTM2		EQU		T3C2,7
	PDTM0		EQU		T3C2,6
	T3PWM4INV	EQU		T3C2,5
	T3PWM3INV	EQU		T3C2,4
	T3PWM2INV	EQU		T3C2,3
	T3PWM4EN	EQU		T3C2,2
	T3PWM3EN	EQU		T3C2,1
	T3PWM2EN	EQU		T3C2,0
	
	FPDTM2		EQU		T3C2,7
	FPDTM0		EQU		T3C2,6
	FT3PWM4INV	EQU		T3C2,5
	FT3PWM3INV	EQU		T3C2,4
	FT3PWM2INV	EQU		T3C2,3
	FT3PWM4EN	EQU		T3C2,2
	FT3PWM3EN	EQU		T3C2,1
	FT3PWM2EN	EQU		T3C2,0
	

T3D1L		EQU 	01AH


T3D1H		EQU 	01BH


T3D2L		EQU 	01CH


T3D2H		EQU 	01DH


T3D3L		EQU 	01EH


T3D3H		EQU 	01FH



;----------------------------------------------------
;BANK3 Special function register definitions
;----------------------------------------------------


PWMSEL1		EQU 	009H
	T4PWMS1		EQU		PWMSEL1,3
	T4PWMS0		EQU		PWMSEL1,2
	T3PWM4S1	EQU		PWMSEL1,1
	T3PWM4S0	EQU		PWMSEL1,0

	FT4PWMS1	EQU		PWMSEL1,3
	FT4PWMS0	EQU		PWMSEL1,2
	FT3PWM4S1	EQU		PWMSEL1,1
	FT3PWM4S0	EQU		PWMSEL1,0
	

PWMSEL		EQU 	00CH
	T3PWM3S1	EQU		PWMSEL,7
	T3PWM3S0	EQU		PWMSEL,6
	T3PWM2S1	EQU		PWMSEL,5
	T3PWM2S0	EQU		PWMSEL,4
	T3PWM1S1	EQU		PWMSEL,3
	T3PWM1S0	EQU		PWMSEL,2
	T3PWM0S1	EQU		PWMSEL,1
	T3PWM0S0	EQU		PWMSEL,0

	FT3PWM3S1	EQU		PWMSEL,7
	FT3PWM3S0	EQU		PWMSEL,6
	FT3PWM2S1	EQU		PWMSEL,5
	FT3PWM2S0	EQU		PWMSEL,4
	FT3PWM1S1	EQU		PWMSEL,3
	FT3PWM1S0	EQU		PWMSEL,2
	FT3PWM0S1	EQU		PWMSEL,1
	FT3PWM0S0	EQU		PWMSEL,0
	

T4C0		EQU 	00DH
	T4REN		EQU		T4C0,7
	T4PWMINV	EQU		T4C0,4
	T4BUZEN		EQU		T4C0,3
	T4PWMEN		EQU		T4C0,1
	
	FT4REN		EQU		T4C0,7
	FT4PWMINV	EQU		T4C0,4
	FT4BUZEN	EQU		T4C0,3
	FT4PWMEN	EQU		T4C0,1


T4C1		EQU 	00EH
	T4OUT0		EQU		T4C1,6
	T4CKS0		EQU		T4C1,4
	T4CK2		EQU		T4C1,2
	T4CK1		EQU		T4C1,1
	T4CK0		EQU		T4C1,0

	FT4OUT0		EQU		T4C1,6
	FT4CKS0		EQU		T4C1,4
	FT4CK2		EQU		T4C1,2
	FT4CK1		EQU		T4C1,1
	FT4CK0		EQU		T4C1,0


T4TL		EQU 	00FH


T4TH		EQU 	010H


T4PL		EQU 	011H


T4PH		EQU 	012H


T4DL		EQU 	013H


T4DH		EQU 	014H


CMCON0		EQU 	01DH
;	C2OUT		EQU		CMCON0,7
	C1OUT		EQU		CMCON0,6
;	C2INV		EQU		CMCON0,5
	C1INV		EQU		CMCON0,4
	CIS			EQU		CMCON0,3
	CMCH2		EQU		CMCON0,2
	CMCH1		EQU		CMCON0,1
	CMCH0		EQU		CMCON0,0	

;	FC2OUT		EQU		CMCON0,7
	FC1OUT		EQU		CMCON0,6
;	FC2INV		EQU		CMCON0,5
	FC1INV		EQU		CMCON0,4
	FCIS		EQU		CMCON0,3
	FCMCH2		EQU		CMCON0,2
	FCMCH1		EQU		CMCON0,1
	FCMCH0		EQU		CMCON0,0	


VRCON		EQU 	01FH
	VREN		EQU		VRCON,7
	VRR1		EQU		VRCON,6
	VRR0		EQU		VRCON,5
	VRS			EQU		VRCON,4
	VR3			EQU		VRCON,3
	VR2			EQU		VRCON,2
	VR1			EQU		VRCON,1
	VR0			EQU		VRCON,0

	FVREN		EQU		VRCON,7
	FVRR1		EQU		VRCON,6
	FVRR0		EQU		VRCON,5
	FVRS		EQU		VRCON,4
	FVR3		EQU		VRCON,3
	FVR2		EQU		VRCON,2
	FVR1		EQU		VRCON,1
	FVR0		EQU		VRCON,0


;end-define
