;****************************************************   
;Copyright (asm) 2019   苏州华芯微电子股份有限公司  *   
;					            *   
;文件名称:                                          *   
;文件标识:					    *   
;摘    要:					    *   
;SYS_INIT			                    *   
;当前版本:					    *   
;作    者:			                    *   
;完成日期:			                    *   
;****************************************************   
;ROM:		2K-ROM
;EEPROM:	128*BYTE-EEPROM
;RAM:		128*BYTE-RAM
;TOUCH:		7*TouchKey
;
;*****************************************************   
;BANK0-定义   
;*****************************************************   
INDF	EQU		00H   
TMR0	EQU		01H   
PCL	EQU		02H   
STATUS	EQU		03H   
FSR	EQU		04H   
PORTA	EQU		05H   
PA	EQU		05H   
IOSTA	EQU		05H   
PORTB	EQU		06H   
PB	EQU		06H   
IOSTB	EQU		06H   
SRAM	EQU		07H   
   
PCON	EQU		08H   
WUCON	EQU		09H   
PCHBUF	EQU		0AH   
PDCON	EQU		0BH   
ODCON	EQU		0CH   
PHCON	EQU		0DH   
INTEN	EQU		0EH   
INTFLAG	EQU		0FH      
;*****************************************************   
PWM0EN		EQU		050H   
PWM0C		EQU		051H   
PWM0TL		EQU		052H   
PWM0TH		EQU		053H   
PWM0PL		EQU		054H   
PWM0PH		EQU		055H   
PWM0DL		EQU		056H   
PWM0DH		EQU		057H   
   
PWM0DTL		EQU		058H   
PWM0DTH		EQU		059H   
PWMPSCON	EQU		05BH   
   
PWM1DL		EQU		060H   
PWM1DH		EQU		061H   
   
PBIC1		EQU		06CH   
PBIC0		EQU		06DH   
PAHCON		EQU		06EH   
PAIC1		EQU		06FH   
PAIC0		EQU		070H   
   
TC0L		EQU		071H   
TC0M		EQU		072H   
TC0R		EQU		073H   
TC0H		EQU		074H   
TC0D1		EQU		075H   
TC0D2		EQU		076H   
PWMCON		EQU		077H   
   
PADCON		EQU		078H   
OSCM		EQU		079H   
EECON1		EQU		07AH   
EEADRH		EQU		07BH   
EEADRL		EQU		07CH   
EEDATL		EQU		07EH   
      
;*****************************************************   
;BANK1-定义   
;*****************************************************   
TKC0		EQU		050H   
TK16DH		EQU		051H   
TK16DL		EQU		052H   
TKC1		EQU		053H   
TKC2		EQU		054H   
TKC3		EQU		055H   
TKSTA		EQU		056H   
TKPDH		EQU		057H   
   
TKPDL		EQU		058H   
CMPCON		EQU		059H   
CMPM		EQU		05AH   
OPAM		EQU		05BH   
   
INTEN1		EQU		05EH   
INTFLAG1	EQU		05FH   
   
FLCON1		EQU		079H   
FLCON2		EQU		07AH   
FLADRH		EQU		07BH   
FLADRL		EQU		07CH   
FLDATH		EQU		07DH   
FLDATL		EQU		07EH   
FLerrf		EQU		07FH   
   
;*****************************************************   
;BANK0-BIT-定义   
;*****************************************************   
;INDF	EQU		00H   
;TMR0	EQU		01H   
;PCL	EQU		02H   
;STATUS	EQU		03H   
	#define		FC	STATUS,0   
	#define		FDC	STATUS,1   
	#define		FZ	STATUS,2   
	#define		FNPD	STATUS,3   
	   
	#define		FNTO	STATUS,4   
	#define		FRP0	STATUS,5   
	#define		FRP1	STATUS,6   
	#define		FRST	STATUS,7   
	   
;FSR	EQU		04H   
;PORTA	EQU		05H   
;PA	EQU		05H   
;IOSTA	EQU		05H   
;PORTB	EQU		06H   
;PB	EQU		06H   
;IOSTB	EQU		06H   
;SRAM	EQU		07H   
   
;PCON	EQU		08H   
	#define		FLVDTE	PCON,5   
	#define		FEIS	PCON,6   
	#define		FWDTE	PCON,7   
	   
;WUCON	EQU		09H   
;PCHBUF	EQU		0AH   
;PDCON	EQU		0BH   
;ODCON	EQU		0CH   
;PHCON	EQU		0DH   
;INTEN	EQU		0EH   
	#define		FT0IE		INTEN,0   
	#define		FPBIE		INTEN,1   
	#define		FINTIE		INTEN,2   
	#define		FTC0IE		INTEN,3   
	   
	#define		FTP0IE		INTEN,4   
	#define		FINT1IE		INTEN,5     
	#define		FGIE		INTEN,7   
	   
;INTFLAG	EQU		0FH   
	#define		FT0IF		INTFLAG,0   
	#define		FPBIF		INTFLAG,1   
	#define		FINTIF		INTFLAG,2   
	#define		FTC0IF		INTFLAG,3   
	   
	#define		FTP0IF		INTFLAG,4   
	#define		FINT1IF		INTFLAG,5   
   
;*****************************************************   
;PWM0EN		EQU		050H   
	#define		FPWM0EN		PWM0EN,0   
	#define		FPWM0OEN	PWM0EN,1   
	#define		FPWM01OEN	PWM0EN,2   
	#define		FPWM0M		PWM0EN,3   
	   
	#define		FPWM1OEN	PWM0EN,4   
	#define		FTPSEL8		PWM0EN,5   	   
	#define		FTPEN		PWM0EN,7   
	   
;PWM0C		EQU		051H   
;PWM0TL		EQU		052H   
;PWM0TH		EQU		053H   
;PWM0PL		EQU		054H   
;PWM0PH		EQU		055H   
;PWM0DL		EQU		056H   
;PWM0DH		EQU		057H   
   
;PWM0DTL	EQU		058H   
;PWM0DTH	EQU		059H   
;PWMPSCON	EQU		05BH   
   
;PWM1DL		EQU		060H   
;PWM1DH		EQU		061H   
   
;PBIC1		EQU		06CH   
;PBIC0		EQU		06DH   
;PAHCON		EQU		06EH   
;PAIC1		EQU		06FH   
;PAIC0		EQU		070H   
   
;TC0L		EQU		071H   
;TC0M		EQU		072H 
	#define		FPWM0		TC0M,0   
	#define		FBUZ		TC0M,1   
	#define		FT16SEL		TC0M,2   
	#define		FTCCKS		TC0M,3  

	#define		FTC0S0		TC0M,4   
	#define		FTC0S1		TC0M,5   
	#define		FTC0S2		TC0M,6   
	#define		FTC0TR		TC0M,7 
	
;TC0R		EQU		073H   
;TC0H		EQU		074H   
;TC0D1		EQU		075H   
;TC0D2		EQU		076H   
;PWMCON		EQU		077H   
   
;PADCON		EQU		078H   
;OSCM		EQU		079H   
	#define		FCLKMD		OSCM,0   
	#define		FSTPHX		OSCM,1   
	#define		FXTSEL		OSCM,2   
	#define		FSLCON		OSCM,3   
	   
	#define		FSLT0CON	OSCM,4   
	#define		FGREENEN	OSCM,5   
	#define		FWAKEMODE	OSCM,6   
  
;EECON1		EQU		07AH   
;EEADRH		EQU		07BH   
;EEADRL		EQU		07CH   
;EEDATL		EQU		07EH      
   
;*****************************************************   
;BANK1-BIT-定义   
;*****************************************************   
;TKC0		EQU		050H   
	#define		FTKPS0		TKC0,0   
	#define		FTKPS1		TKC0,1   
	#define		FTKPS2		TKC0,2   
	#define		FTKPS3		TKC0,3   
	   
	#define		FCVS		TKC0,4   
	;#define	FTKPS1		TKC0,5   
	#define		FTKST		TKC0,6	   
	#define		FTKEN		TKC0,7   
;TK16DH		EQU		051H   
;TK16DL		EQU		052H   
;TKC1		EQU		053H   
;TKC2		EQU		054H   
;TKC3		EQU		055H   
;TKSTA		EQU		056H   
	#define		FSACMPO		TKSTA,1   
	#define		FACMPO		TKSTA,2   
	#define		FDCMPO		TKSTA,3   
  
	#define		FTMOUT		TKSTA,7   
;TKPDH		EQU		057H      
;TKPDL		EQU		058H   
     
;*****************************************************   
;PIN-DEFINE   
;****************************************************   
;	    PA0	-1	14- PA1	                    *   
;	    PB7	-2	13- PA2	                    *   
;	    PB6	-3	12- PA3	                    *   
;	    VDD -4	11- VSS	                    *   
;	    PB5	-5	10- PB0	                    *   
;	    PB4	-6	9 - PB1	                    *   
;	    PB3	-7	8 - PB2	                    *   
;****************************************************      

	
