/***1****2****3****4****5****6****7****8****9****A****B****C****D****E****F
***************************************************************************
 * @file:		hs16p2811.h
 * @author:		HSun-LvBuWei
 * @version:	V1.1
 * @data:		20241021
 * @brief:		Special function register definitions
 *  			特殊寄存器定义
 * @copyright:	Copyright(c) 2024,SUZHOU HUAXIN MICRO-ELECTRONICS CO.,LTD.
**************************************************************************
 * @attention
 *
 * @ 修改说明
 * @ V1.0 20240828 - 初版
 * @ V1.1 20241021 - 用户手册V1.00
 */


#ifndef __HS16P2811_H
#define __HS16P2811_H

/**
 * @ 通用寄存器：80+80+16=176-ram
 * @ bank0~3:70H~7FH【16-bytes】;
 * @ bank0:20H~6FH【80-bytes】;
 * @ bank0:A0H~EFH【80-bytes】;
 */

 
/**
 * @ asm SYSTEM DEFINE
 */
#define	NOP()		asm("NOP")
#define	CLRWDT()	asm("clrwdt")
#define	SLEEP()		asm("sleep")
#define	DAA()		asm("DAA")
#define	DAS()		asm("DAS")
#define	INT()		asm("INT")
#define	CLRA()		asm("CLRA")
#define	ACC_0()		asm("MOVLW 0X00")	//ACC=0
#define	RETURN()	asm("RETURN")


/**
 * @ brief:	 BANK0 Special function register definitions
 */

// Register: INDF
volatile unsigned char		INDF		@ 0x000; 

// Register: TMR0
//volatile unsigned char		TMR0		@ 0x001;

// Register: PCL
volatile unsigned char      PCL			@ 0x002;

// Register: STATUS
volatile unsigned char		STATUS		@ 0x003;

	volatile bit C		@((unsigned)&STATUS*8)+0;
	volatile bit DC		@((unsigned)&STATUS*8)+1;
	volatile bit Z		@((unsigned)&STATUS*8)+2;
	volatile bit NPD	@((unsigned)&STATUS*8)+3;
	volatile bit NTO	@((unsigned)&STATUS*8)+4;
	volatile bit RP0	@((unsigned)&STATUS*8)+5;
	volatile bit RP1	@((unsigned)&STATUS*8)+6;
	volatile bit IRP	@((unsigned)&STATUS*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	C      : 1;
        unsigned	DC     : 1;
        unsigned	Z      : 1;
        unsigned	NPD    : 1; 
        unsigned	NTO    : 1; 
        unsigned	RP0    : 1;
        unsigned	RP1    : 1;
        unsigned	IRP    : 1;
    };
}STATUSbits @ 0x003;
#endif


// Register: FSR
volatile unsigned char		FSR			@ 0x004;
	volatile bit FSR_7	@((unsigned)&FSR*8)+7;

// Register: PORTA
volatile unsigned char		PORTA		@ 0x005;
volatile unsigned char		PA			@ 0x005;

	volatile bit FPA0	@((unsigned)&PORTA*8)+0;
	volatile bit FPA1	@((unsigned)&PORTA*8)+1;
	volatile bit FPA2	@((unsigned)&PORTA*8)+2;
	volatile bit FPA3	@((unsigned)&PORTA*8)+3;
	volatile bit FPA4	@((unsigned)&PORTA*8)+4;
	volatile bit FPA5	@((unsigned)&PORTA*8)+5;
	volatile bit FPA6	@((unsigned)&PORTA*8)+6;
	volatile bit FPA7	@((unsigned)&PORTA*8)+7;

	volatile bit PA0	@((unsigned)&PORTA*8)+0;
	volatile bit PA1	@((unsigned)&PORTA*8)+1;
	volatile bit PA2	@((unsigned)&PORTA*8)+2;
	volatile bit PA3	@((unsigned)&PORTA*8)+3;
	volatile bit PA4	@((unsigned)&PORTA*8)+4;
	volatile bit PA5	@((unsigned)&PORTA*8)+5;
	volatile bit PA6	@((unsigned)&PORTA*8)+6;
	volatile bit PA7	@((unsigned)&PORTA*8)+7;

#if 0
// Register: PORTB
volatile unsigned char		PORTB		@ 0x006; 
volatile unsigned char		PB			@ 0x006;

	volatile bit FPB0		@((unsigned)&PORTB*8)+0;
	volatile bit FPB1		@((unsigned)&PORTB*8)+1;
	volatile bit FPB2		@((unsigned)&PORTB*8)+2;
	volatile bit FPB3		@((unsigned)&PORTB*8)+3;
	volatile bit FPB4		@((unsigned)&PORTB*8)+4;
	volatile bit FPB5		@((unsigned)&PORTB*8)+5;
	volatile bit FPB6		@((unsigned)&PORTB*8)+6;
	volatile bit FPB7		@((unsigned)&PORTB*8)+7;

	volatile bit PB0		@((unsigned)&PORTB*8)+0;
	volatile bit PB1		@((unsigned)&PORTB*8)+1;
	volatile bit PB2		@((unsigned)&PORTB*8)+2;
	volatile bit PB3		@((unsigned)&PORTB*8)+3;
	volatile bit PB4		@((unsigned)&PORTB*8)+4;
	volatile bit PB5		@((unsigned)&PORTB*8)+5;
	volatile bit PB6		@((unsigned)&PORTB*8)+6;
	volatile bit PB7		@((unsigned)&PORTB*8)+7;
 
#endif

// Register: PORTC 
volatile unsigned char		PORTC		@ 0x007;
volatile unsigned char		RC			@ 0x007;

	volatile bit FPC0		@((unsigned)&PORTC*8)+0;
	volatile bit FPC1		@((unsigned)&PORTC*8)+1;
	volatile bit FPC2		@((unsigned)&PORTC*8)+2;
	volatile bit FPC3		@((unsigned)&PORTC*8)+3;
	volatile bit FPC4		@((unsigned)&PORTC*8)+4;
	volatile bit FPC5		@((unsigned)&PORTC*8)+5;
	volatile bit FPC6		@((unsigned)&PORTC*8)+6;
	volatile bit FPC7		@((unsigned)&PORTC*8)+7;

	volatile bit PC0		@((unsigned)&PORTC*8)+0;
	volatile bit PC1		@((unsigned)&PORTC*8)+1;
	volatile bit PC2		@((unsigned)&PORTC*8)+2;
	volatile bit PC3		@((unsigned)&PORTC*8)+3;
	volatile bit PC4		@((unsigned)&PORTC*8)+4;
	volatile bit PC5		@((unsigned)&PORTC*8)+5;
	volatile bit PC6		@((unsigned)&PORTC*8)+6;
	volatile bit PC7		@((unsigned)&PORTC*8)+7;


// Register: PCHBUF
volatile unsigned char		PCHBUF		@ 0x00A;
volatile unsigned char		PCLATH		@ 0x00A;

// Register: INTCON
volatile unsigned char		INTCON		@ 0x00B;

	volatile bit FPAIF		@((unsigned)&INTCON*8)+0;
	volatile bit FINTIF		@((unsigned)&INTCON*8)+1;
	//volatile bit FT0IF		@((unsigned)&INTCON*8)+2;
	volatile bit FPAIE		@((unsigned)&INTCON*8)+3;
	volatile bit FINTIE		@((unsigned)&INTCON*8)+4;
	//volatile bit FT0IE		@((unsigned)&INTCON*8)+5;
	volatile bit FPEIE		@((unsigned)&INTCON*8)+6;
	volatile bit FGIE		@((unsigned)&INTCON*8)+7;

	volatile bit PAIF		@((unsigned)&INTCON*8)+0;
	volatile bit INTIF		@((unsigned)&INTCON*8)+1;
	//volatile bit T0IF		@((unsigned)&INTCON*8)+2;
	volatile bit PAIE		@((unsigned)&INTCON*8)+3;
	volatile bit INTIE		@((unsigned)&INTCON*8)+4;
	//volatile bit T0IE		@((unsigned)&INTCON*8)+5;
	volatile bit PEIE		@((unsigned)&INTCON*8)+6;
	volatile bit GIE		@((unsigned)&INTCON*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	PAIF    : 1;
        unsigned	INTIF   : 1;
        unsigned	T0IF    : 1;
        unsigned	PAIE    : 1; 
        unsigned	INTIE   : 1; 
        unsigned	T0IE    : 1;
        unsigned	PEIE    : 1;
        unsigned	GIE     : 1;
    };
}INTCONbits @ 0x00B;
#endif

// Register: PIR1
volatile unsigned char		PIR1		@ 0x00C;

	volatile bit FT1IF		@((unsigned)&PIR1*8)+0;
	//volatile bit FT2IF	@((unsigned)&PIR1*8)+1;
	//volatile bit FCCP1IF	@((unsigned)&PIR1*8)+2;
	volatile bit FADCIF		@((unsigned)&PIR1*8)+6;

	volatile bit T1IF		@((unsigned)&PIR1*8)+0;
	//volatile bit T2IF		@((unsigned)&PIR1*8)+1;
	//volatile bit CCP1IF	@((unsigned)&PIR1*8)+2;
	volatile bit ADCIF		@((unsigned)&PIR1*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T1IF    : 1;
        unsigned	T2IF    : 1;
        unsigned	CCP1IF  : 1;
        unsigned	        : 1;
        unsigned	        : 1;
        unsigned	        : 1;
        unsigned	ADCIF   : 1;
        unsigned	        : 1;
    };
}PIR1bits @ 0x00C;
#endif

// Register: PIR2
volatile unsigned char		PIR2		@ 0x0D; 

	volatile bit T3IF		@((unsigned)&PIR2*8)+1;
	volatile bit T4IF		@((unsigned)&PIR2*8)+2;
	//volatile bit T5IF		@((unsigned)&PIR2*8)+3;
	volatile bit C1IF		@((unsigned)&PIR2*8)+5;
	//volatile bit C2IF		@((unsigned)&PIR2*8)+6;

	volatile bit FT3IF		@((unsigned)&PIR2*8)+1;
	volatile bit FT4IF		@((unsigned)&PIR2*8)+2;
	//volatile bit FT5IF		@((unsigned)&PIR2*8)+3;
	volatile bit FC1IF		@((unsigned)&PIR2*8)+5;
	//volatile bit FC2IF		@((unsigned)&PIR2*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	          : 1;
        unsigned	T3IF      : 1;
        unsigned	T4IF      : 1;
        unsigned	T5IF      : 1;
        unsigned	          : 1;
        unsigned	C1IF      : 1;
        unsigned	C2IF      : 1;
        unsigned	          : 1;
    };
}PIR2bits @ 0x00D;
#endif

//**************************************************************

// Register: PCHCON
volatile unsigned char		PCHCON		@ 0x012;
	volatile bit PHC0		@((unsigned)&PCHCON*8)+0;
	volatile bit PHC1		@((unsigned)&PCHCON*8)+1;
	volatile bit PHC2		@((unsigned)&PCHCON*8)+2;
	volatile bit PHC3		@((unsigned)&PCHCON*8)+3;
	volatile bit PHC4		@((unsigned)&PCHCON*8)+4;
	volatile bit PHC5		@((unsigned)&PCHCON*8)+5;
	//volatile bit PHC6		@((unsigned)&PCHCON*8)+6;
	//volatile bit PHC7		@((unsigned)&PCHCON*8)+7;

	volatile bit FPHC0		@((unsigned)&PCHCON*8)+0;
	volatile bit FPHC1		@((unsigned)&PCHCON*8)+1;
	volatile bit FPHC2		@((unsigned)&PCHCON*8)+2;
	volatile bit FPHC3		@((unsigned)&PCHCON*8)+3;
	volatile bit FPHC4		@((unsigned)&PCHCON*8)+4;
	volatile bit FPHC5		@((unsigned)&PCHCON*8)+5;
	//volatile bit FPHC6		@((unsigned)&PCHCON*8)+6;
	//volatile bit FPHC7		@((unsigned)&PCHCON*8)+7;

// Register: PCDCON
volatile unsigned char		PCDCON		@ 0x013;

	volatile bit PDC0		@((unsigned)&PCDCON*8)+0;
	volatile bit PDC1		@((unsigned)&PCDCON*8)+1;
	volatile bit PDC2		@((unsigned)&PCDCON*8)+2;
	volatile bit PDC3		@((unsigned)&PCDCON*8)+3;
	volatile bit PDC4		@((unsigned)&PCDCON*8)+4;
	volatile bit PDC5		@((unsigned)&PCDCON*8)+5;
	//volatile bit PDC6		@((unsigned)&PCDCON*8)+6;
	//volatile bit PDC7		@((unsigned)&PCDCON*8)+7;

	volatile bit FPDC0		@((unsigned)&PCDCON*8)+0;
	volatile bit FPDC1		@((unsigned)&PCDCON*8)+1;
	volatile bit FPDC2		@((unsigned)&PCDCON*8)+2;
	volatile bit FPDC3		@((unsigned)&PCDCON*8)+3;
	volatile bit FPDC4		@((unsigned)&PCDCON*8)+4;
	volatile bit FPDC5		@((unsigned)&PCDCON*8)+5;
	//volatile bit FPDC6		@((unsigned)&PCDCON*8)+6;
	//volatile bit FPDC7		@((unsigned)&PCDCON*8)+7;


//ADB1
volatile unsigned char		ADB1		@ 0x016;

//ADF1
//volatile unsigned char		ADF1		@ 0x017;		
//ADF0		
//volatile unsigned char		ADF0		@ 0x018;
		
volatile unsigned char		ADPCON1		@ 0x019;

volatile unsigned char		ADPC		@ 0x01A;
volatile unsigned char		ADPCON		@ 0x01A;
		
//ADM 		
volatile unsigned char		ADM			@ 0x01B;

	volatile bit FCHS0		@((unsigned)&ADM*8)+0;
	volatile bit FCHS1		@((unsigned)&ADM*8)+1;
	volatile bit FCHS2		@((unsigned)&ADM*8)+2;
	volatile bit FCHS3		@((unsigned)&ADM*8)+3;
	volatile bit FGCHS		@((unsigned)&ADM*8)+4;
	volatile bit FEOC		@((unsigned)&ADM*8)+5;
	volatile bit FADS		@((unsigned)&ADM*8)+6;
	volatile bit FADENB		@((unsigned)&ADM*8)+7;

	volatile bit CHS0		@((unsigned)&ADM*8)+0;
	volatile bit CHS1		@((unsigned)&ADM*8)+1;
	volatile bit CHS2		@((unsigned)&ADM*8)+2;
	volatile bit CHS3		@((unsigned)&ADM*8)+3;
	volatile bit GCHS		@((unsigned)&ADM*8)+4;
	volatile bit EOC		@((unsigned)&ADM*8)+5;
	volatile bit ADS		@((unsigned)&ADM*8)+6;
	volatile bit ADENB		@((unsigned)&ADM*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	CHS0      : 1;	//0
        unsigned	CHS1      : 1;	//1
        unsigned	CHS2      : 1;	//2
        unsigned	CHS3      : 1;	//3
        unsigned	GCHS      : 1;	//4
        unsigned	EOC       : 1;	//5
        unsigned	ADS       : 1;	//6
        unsigned	ADENB     : 1;	//7
    };
}ADMbits @ 0x01B;
#endif

volatile unsigned char		ADB			@ 0x01C;

volatile unsigned char		ADR			@ 0x01D;

volatile unsigned char		ADT			@ 0x01E;

volatile unsigned char		VREFH		@ 0x01F;
volatile unsigned char		VREF		@ 0x01F;

	volatile bit FVHS0		@((unsigned)&VREFH*8)+0;
	volatile bit FVHS1		@((unsigned)&VREFH*8)+1;
	volatile bit FEVHENB	@((unsigned)&VREFH*8)+7;

	volatile bit VHS0		@((unsigned)&VREFH*8)+0;
	volatile bit VHS1		@((unsigned)&VREFH*8)+1;
	volatile bit EVHENB		@((unsigned)&VREFH*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	VHS0      : 1;	//0
        unsigned	VHS1      : 1;	//1
        unsigned	          : 1;	//2
        unsigned	          : 1;	//3
        unsigned	          : 1;	//4
        unsigned	          : 1;	//5
        unsigned	          : 1;	//6
        unsigned	EVHEFB    : 1;	//7
    };
}VREFHbits @ 0x01F;
#endif

//General USER RAM 
//20H~6FH

//General USER RAM 
//70H~7FH

/**
 * @ brief:	 BANK1 Special function register definitions
 */
 
//OPTION_REG
volatile unsigned char		OPTION		@ 0x081; 
volatile unsigned char		OPTIONR		@ 0x081; //1021-2811
volatile unsigned char		OPTION_REG	@ 0x081; 

	//volatile bit FPS0		@((unsigned)&OPTION_REG*8)+0;
	//volatile bit FPS1		@((unsigned)&OPTION_REG*8)+1;
	//volatile bit FPS2		@((unsigned)&OPTION_REG*8)+2;
	//volatile bit FPSA		@((unsigned)&OPTION_REG*8)+3;
	//volatile bit FT0SE	@((unsigned)&OPTION_REG*8)+4;
	//volatile bit FT0CS	@((unsigned)&OPTION_REG*8)+5;
	volatile bit FINTEDG	@((unsigned)&OPTION_REG*8)+6; 

	//volatile bit PS0		@((unsigned)&OPTION_REG*8)+0;
	//volatile bit PS1		@((unsigned)&OPTION_REG*8)+1;
	//volatile bit PS2		@((unsigned)&OPTION_REG*8)+2;
	//volatile bit PSA		@((unsigned)&OPTION_REG*8)+3;
	//volatile bit T0SE		@((unsigned)&OPTION_REG*8)+4;
	//volatile bit T0CS		@((unsigned)&OPTION_REG*8)+5;
	volatile bit INTEDG		@((unsigned)&OPTION_REG*8)+6; 

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	PS0      : 1;	//0
        unsigned	PS1      : 1;	//1
        unsigned	PS2      : 1;	//2
        unsigned	PSA      : 1;	//3
        unsigned	T0SE     : 1;	//4
        unsigned	T0CS     : 1;	//5
        unsigned	INTEDGE  : 1;	//6
        unsigned	         : 1;	//7
    };
}OPTIONbits @ 0x081;
#endif

//TRISA 85H
volatile unsigned char		TRISA		@ 0x085; 

//TRISB	87H
volatile unsigned char		TRISC		@ 0x087; 

//PIE1 8CH
volatile unsigned char		PIE1		@ 0x08C; 
	volatile bit T1IE		@((unsigned)&PIE1*8)+0;
	//volatile bit T2IE		@((unsigned)&PIE1*8)+1;
	//volatile bit CCP1IE	@((unsigned)&PIE1*8)+2;
	volatile bit ADCIE		@((unsigned)&PIE1*8)+6;

	volatile bit FT1IE		@((unsigned)&PIE1*8)+0;
	//volatile bit FT2IE	@((unsigned)&PIE1*8)+1;
	//volatile bit FCCP1IE	@((unsigned)&PIE1*8)+2;
	volatile bit FADCIE		@((unsigned)&PIE1*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T1IE      : 1;	//0
        unsigned	T2IE      : 1;	//1
        unsigned	CCP1IE    : 1;	//2
        unsigned	          : 1;	//3
        unsigned	          : 1;	//4
        unsigned	          : 1;	//5
        unsigned	ADCIE     : 1;	//6
        unsigned	          : 1;	//7
    };
}PIE1bits @ 0x08C;
#endif

//PIE2 8DH
volatile unsigned char		PIE2		@ 0x08D; 

	volatile bit FT3IE		@((unsigned)&PIE2*8)+1;
	volatile bit FT4IE		@((unsigned)&PIE2*8)+2;
	//volatile bit FT5IE	@((unsigned)&PIE2*8)+3;
	volatile bit FC1IE		@((unsigned)&PIE2*8)+5;
	//volatile bit FC2IE	@((unsigned)&PIE2*8)+6;

	volatile bit T3IE		@((unsigned)&PIE2*8)+1;
	volatile bit T4IE		@((unsigned)&PIE2*8)+2;
	//volatile bit T5IE		@((unsigned)&PIE2*8)+3;
	volatile bit C1IE		@((unsigned)&PIE2*8)+5;
	//volatile bit C2IE		@((unsigned)&PIE2*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned		      : 1;	//0
        unsigned	T3IE      : 1;	//1
        unsigned	T4IE      : 1;	//2
        unsigned	T5IE      : 1;	//3
        unsigned	          : 1;	//4
        unsigned	C1IE      : 1;	//5
        unsigned	C2IE      : 1;	//6
        unsigned	          : 1;	//7
    };
}PIE2bits @ 0x08D;
#endif

//PCON 8EH
volatile unsigned char		CHIPCON		@ 0x08E;
volatile unsigned char		PCON		@ 0x08E;
 
	volatile bit FLVREN		@((unsigned)&PCON*8)+5; //1021
	volatile bit FLVDTE		@((unsigned)&PCON*8)+5; 
	volatile bit FWDTE		@((unsigned)&PCON*8)+7;
	 
	volatile bit LVREN		@((unsigned)&PCON*8)+5; //1021-2811
	volatile bit LVDTE		@((unsigned)&PCON*8)+5; 
	volatile bit WDTE		@((unsigned)&PCON*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned		      : 1;	//0
        unsigned		      : 1;	//1
        unsigned		      : 1;	//2
        unsigned		      : 1;	//3
        unsigned	          : 1;	//4
        unsigned	LVREN     : 1;	//5
        unsigned		      : 1;	//6
        unsigned	WDTE      : 1;	//7
    };
}PCONbits @ 0x08E;
#endif

//WUCON 8FH
volatile unsigned char		WUACON		@ 0x08F;

	volatile bit WUA0		@((unsigned)&WUACON*8)+0;
	volatile bit WUA1		@((unsigned)&WUACON*8)+1;
	volatile bit WUA2		@((unsigned)&WUACON*8)+2;
	volatile bit WUA3		@((unsigned)&WUACON*8)+3;
	volatile bit WUA4		@((unsigned)&WUACON*8)+4;
	volatile bit WUA5		@((unsigned)&WUACON*8)+5;
	volatile bit WUA6		@((unsigned)&WUACON*8)+6;
	volatile bit WUA7		@((unsigned)&WUACON*8)+7;

	volatile bit FWUA0		@((unsigned)&WUACON*8)+0;
	volatile bit FWUA1		@((unsigned)&WUACON*8)+1;
	volatile bit FWUA2		@((unsigned)&WUACON*8)+2;
	volatile bit FWUA3		@((unsigned)&WUACON*8)+3;
	volatile bit FWUA4		@((unsigned)&WUACON*8)+4;
	volatile bit FWUA5		@((unsigned)&WUACON*8)+5;
	volatile bit FWUA6		@((unsigned)&WUACON*8)+6;
	volatile bit FWUA7		@((unsigned)&WUACON*8)+7;

//**************************************************************
#if 0
//PAIC0 90H
volatile unsigned char		PAIC0		@ 0x090;

	volatile bit PAIC0_0		@((unsigned)&PAIC0*8)+0;
	volatile bit PAIC0_1		@((unsigned)&PAIC0*8)+1;
	volatile bit PAIC0_2		@((unsigned)&PAIC0*8)+2;
	volatile bit PAIC0_3		@((unsigned)&PAIC0*8)+3;
	volatile bit PAIC0_4		@((unsigned)&PAIC0*8)+4;
	volatile bit PAIC0_5		@((unsigned)&PAIC0*8)+5;
	volatile bit PAIC0_6		@((unsigned)&PAIC0*8)+6;
	volatile bit PAIC0_7		@((unsigned)&PAIC0*8)+7;

	volatile bit FPAIC0_0		@((unsigned)&PAIC0*8)+0;
	volatile bit FPAIC0_1		@((unsigned)&PAIC0*8)+1;
	volatile bit FPAIC0_2		@((unsigned)&PAIC0*8)+2;
	volatile bit FPAIC0_3		@((unsigned)&PAIC0*8)+3;
	volatile bit FPAIC0_4		@((unsigned)&PAIC0*8)+4;
	volatile bit FPAIC0_5		@((unsigned)&PAIC0*8)+5;
	volatile bit FPAIC0_6		@((unsigned)&PAIC0*8)+6;
	volatile bit FPAIC0_7		@((unsigned)&PAIC0*8)+7;

//PBIC0 91H
volatile unsigned char		PCIC0		@ 0x091;

	volatile bit PCIC0_0		@((unsigned)&PCIC0*8)+0;
	volatile bit PCIC0_1		@((unsigned)&PCIC0*8)+1;
	volatile bit PCIC0_2		@((unsigned)&PCIC0*8)+2;
	volatile bit PCIC0_3		@((unsigned)&PCIC0*8)+3;
	volatile bit PCIC0_4		@((unsigned)&PCIC0*8)+4;
	volatile bit PCIC0_5		@((unsigned)&PCIC0*8)+5;
	volatile bit PCIC0_6		@((unsigned)&PCIC0*8)+6;
	volatile bit PCIC0_7		@((unsigned)&PCIC0*8)+7;

	volatile bit FPCIC0_0		@((unsigned)&PCIC0*8)+0;
	volatile bit FPCIC0_1		@((unsigned)&PCIC0*8)+1;
	volatile bit FPCIC0_2		@((unsigned)&PCIC0*8)+2;
	volatile bit FPCIC0_3		@((unsigned)&PCIC0*8)+3;
	volatile bit FPCIC0_4		@((unsigned)&PCIC0*8)+4;
	volatile bit FPCIC0_5		@((unsigned)&PCIC0*8)+5;
	volatile bit FPCIC0_6		@((unsigned)&PCIC0*8)+6;
	volatile bit FPCIC0_7		@((unsigned)&PCIC0*8)+7;
#endif

//PAHCON 92H
volatile unsigned char		PAHCON		@ 0x092;

	volatile bit PAH0		@((unsigned)&PAHCON*8)+0;
	volatile bit PAH1		@((unsigned)&PAHCON*8)+1;
	volatile bit PAH2		@((unsigned)&PAHCON*8)+2;
	volatile bit PAH3		@((unsigned)&PAHCON*8)+3;
	volatile bit PAH4		@((unsigned)&PAHCON*8)+4;
	volatile bit PAH5		@((unsigned)&PAHCON*8)+5;
	volatile bit PAH6		@((unsigned)&PAHCON*8)+6;
	volatile bit PAH7		@((unsigned)&PAHCON*8)+7;

	volatile bit FPAH0		@((unsigned)&PAHCON*8)+0;
	volatile bit FPAH1		@((unsigned)&PAHCON*8)+1;
	volatile bit FPAH2		@((unsigned)&PAHCON*8)+2;
	volatile bit FPAH3		@((unsigned)&PAHCON*8)+3;
	volatile bit FPAH4		@((unsigned)&PAHCON*8)+4;
	volatile bit FPAH5		@((unsigned)&PAHCON*8)+5;
	volatile bit FPAH6		@((unsigned)&PAHCON*8)+6;
	volatile bit FPAH7		@((unsigned)&PAHCON*8)+7;


//PADCON 93H
volatile unsigned char		PADCON		@ 0x093;

	volatile bit PAD0		@((unsigned)&PADCON*8)+0;
	volatile bit PAD1		@((unsigned)&PADCON*8)+1;
	volatile bit PAD2		@((unsigned)&PADCON*8)+2;
	volatile bit PAD3		@((unsigned)&PADCON*8)+3;
	volatile bit PAD4		@((unsigned)&PADCON*8)+4;
	volatile bit PAD5		@((unsigned)&PADCON*8)+5;
	volatile bit PAD6		@((unsigned)&PADCON*8)+6;
	volatile bit PAD7		@((unsigned)&PADCON*8)+7;

	volatile bit FPAD0		@((unsigned)&PADCON*8)+0;
	volatile bit FPAD1		@((unsigned)&PADCON*8)+1;
	volatile bit FPAD2		@((unsigned)&PADCON*8)+2;
	volatile bit FPAD3		@((unsigned)&PADCON*8)+3;
	volatile bit FPAD4		@((unsigned)&PADCON*8)+4;
	volatile bit FPAD5		@((unsigned)&PADCON*8)+5;
	volatile bit FPAD6		@((unsigned)&PADCON*8)+6;
	volatile bit FPAD7		@((unsigned)&PADCON*8)+7;

//OSCM 94H
volatile unsigned char		OSCM		@ 0x094;

	volatile bit FCLKMD		@((unsigned)&OSCM*8)+0;
	volatile bit FSTPHX		@((unsigned)&OSCM*8)+1;
	//volatile bit FXTSEL	@((unsigned)&OSCM*8)+2;
	volatile bit FSLCON		@((unsigned)&OSCM*8)+3;
	//volatile bit FRTCEN	@((unsigned)&OSCM*8)+4;
	volatile bit FGREEN		@((unsigned)&OSCM*8)+5;
	volatile bit FWAKEMODE	@((unsigned)&OSCM*8)+6;

	volatile bit CLKMD		@((unsigned)&OSCM*8)+0;
	volatile bit STPHX		@((unsigned)&OSCM*8)+1;
	//volatile bit XTSEL	@((unsigned)&OSCM*8)+2;
	volatile bit SLCON		@((unsigned)&OSCM*8)+3;
	//volatile bit RTCEN	@((unsigned)&OSCM*8)+4;
	volatile bit GREEN		@((unsigned)&OSCM*8)+5;
	volatile bit WAKEMODE	@((unsigned)&OSCM*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	CLKMD     : 1;	//0
        unsigned	STPHX     : 1;	//1
        unsigned	XTSEL     : 1;	//2
        unsigned	SLCON     : 1;	//3
        unsigned	RTCEN     : 1;	//4
        unsigned	GREEN     : 1;	//5
        unsigned	WAKEMODE  : 1;	//6
        unsigned	          : 1;	//7
    };
}OSCMbits @ 0x094;
#endif

volatile unsigned char		PAODCON		@ 0x095;

	volatile bit FODA0		@((unsigned)&PAODCON*8)+0;
	volatile bit FODA1		@((unsigned)&PAODCON*8)+1;
	volatile bit FODA2		@((unsigned)&PAODCON*8)+2;
	volatile bit FODA3		@((unsigned)&PAODCON*8)+3;
	volatile bit FODA4		@((unsigned)&PAODCON*8)+4;
	volatile bit FODA5		@((unsigned)&PAODCON*8)+5;
	volatile bit FODA6		@((unsigned)&PAODCON*8)+6;
	volatile bit FODA7		@((unsigned)&PAODCON*8)+7;

	volatile bit ODA0		@((unsigned)&PAODCON*8)+0;
	volatile bit ODA1		@((unsigned)&PAODCON*8)+1;
	volatile bit ODA2		@((unsigned)&PAODCON*8)+2;
	volatile bit ODA3		@((unsigned)&PAODCON*8)+3;
	volatile bit ODA4		@((unsigned)&PAODCON*8)+4;
	volatile bit ODA5		@((unsigned)&PAODCON*8)+5;
	volatile bit ODA6		@((unsigned)&PAODCON*8)+6;
	volatile bit ODA7		@((unsigned)&PAODCON*8)+7;

#if 0
volatile unsigned char		PWMP1CON	@ 0x096;

volatile unsigned char		ECCPAS		@ 0x097;

volatile unsigned char		CCPCON		@ 0x098;

	volatile bit CCP1M0		@((unsigned)&CCPCON*8)+0;
	volatile bit CCP1M1		@((unsigned)&CCPCON*8)+1;
	volatile bit CCP1M2		@((unsigned)&CCPCON*8)+2;
	volatile bit CCP1M3		@((unsigned)&CCPCON*8)+3;
	volatile bit P1M0		@((unsigned)&CCPCON*8)+6;
	volatile bit P1M1		@((unsigned)&CCPCON*8)+7;

	volatile bit FCCP1M0	@((unsigned)&CCPCON*8)+0;
	volatile bit FCCP1M1	@((unsigned)&CCPCON*8)+1;
	volatile bit FCCP1M2	@((unsigned)&CCPCON*8)+2;
	volatile bit FCCP1M3	@((unsigned)&CCPCON*8)+3;
	volatile bit FP1M0		@((unsigned)&CCPCON*8)+6;
	volatile bit FP1M1		@((unsigned)&CCPCON*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	CCP1M0     : 1;	//0
        unsigned	CCP1M1     : 1;	//1
        unsigned	CCP1M2     : 1;	//2
        unsigned	CCP1M3     : 1;	//3
        unsigned	           : 1;	//4
        unsigned	           : 1;	//5
        unsigned	P1M0       : 1;	//6
        unsigned	P1M1       : 1;	//7
    };
}CCPCONbits @ 0x098;
#endif

volatile unsigned char		CCPRH		@ 0x099;
volatile unsigned char		CCPRL		@ 0x09A;
#endif 
//T1CON
volatile unsigned char		T1CON		@ 0x09B;

	volatile bit T1REN		@((unsigned)&T1CON*8)+0;
	volatile bit T1CKS0		@((unsigned)&T1CON*8)+1;
	volatile bit T1SYNC		@((unsigned)&T1CON*8)+2;
	volatile bit T1CKS1		@((unsigned)&T1CON*8)+3;
	volatile bit T1CK0		@((unsigned)&T1CON*8)+4;
	volatile bit T1CK1		@((unsigned)&T1CON*8)+5;
	//volatile bit T1GE		@((unsigned)&T1CON*8)+6;
	//volatile bit T1GINV		@((unsigned)&T1CON*8)+7;

	volatile bit FT1REN		@((unsigned)&T1CON*8)+0;
	volatile bit FT1CKS0	@((unsigned)&T1CON*8)+1;
	volatile bit FT1SYNC	@((unsigned)&T1CON*8)+2;
	volatile bit FT1CKS1	@((unsigned)&T1CON*8)+3;
	volatile bit FT1CK0		@((unsigned)&T1CON*8)+4;
	volatile bit FT1CK1		@((unsigned)&T1CON*8)+5;
	//volatile bit FT1GE		@((unsigned)&T1CON*8)+6;
	//volatile bit FT1GINV	@((unsigned)&T1CON*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T1REN      : 1;	//0
        unsigned	T1CKS0     : 1;	//1
        unsigned	T1SYNC     : 1;	//2
        unsigned	T1CKS1     : 1;	//3
        unsigned	T1CK0      : 1;	//4
        unsigned	T1CK1      : 1;	//5
        unsigned	T1GE       : 1;	//6
        unsigned	T1GINV     : 1;	//7
    };
}T1CONbits @ 0x09B;
#endif

volatile unsigned char		T1TH		@ 0x09C;

volatile unsigned char		T1TL		@ 0x09D;

volatile unsigned char		T3D4L		@ 0x09E;

volatile unsigned char		T3D4H		@ 0x09F;

//General USER RAM 
//A0H~EFH

/**
 * @ brief:	 BANK2 Special function register definitions
 */
#if 0
//LVDCON 10CH
volatile unsigned char		LVDCON		@ 0x10C;

	volatile bit FLVDS0		@((unsigned)&LVDCON*8)+0;
	volatile bit FLVDS1		@((unsigned)&LVDCON*8)+1;
	volatile bit FLVDS2		@((unsigned)&LVDCON*8)+2;
	volatile bit FLVDS3		@((unsigned)&LVDCON*8)+3;
	volatile bit FLVDEN		@((unsigned)&LVDCON*8)+4;
	volatile bit FLVDIF		@((unsigned)&LVDCON*8)+5;

	volatile bit LVDS0		@((unsigned)&LVDCON*8)+0;
	volatile bit LVDS1		@((unsigned)&LVDCON*8)+1;
	volatile bit LVDS2		@((unsigned)&LVDCON*8)+2;
	volatile bit LVDS3		@((unsigned)&LVDCON*8)+3;
	volatile bit LVDEN		@((unsigned)&LVDCON*8)+4;
	volatile bit LVDIF		@((unsigned)&LVDCON*8)+5;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	LVDS0      : 1;	//0
        unsigned	LVDS1      : 1;	//1
        unsigned	LVDS2      : 1;	//2
        unsigned	LVDS3      : 1;	//3
        unsigned	LVDEN      : 1;	//4
        unsigned	LVDIF      : 1;	//5
        unsigned			   : 1;	//6
        unsigned	           : 1;	//7
    };
}LVDCONbits @ 0x10C;
#endif

//EEADR 10DH
volatile unsigned char		EEADR		@ 0x10D;
		
//EEDATL 10EH		
volatile unsigned char		EEDATL		@ 0x10E;
		
//EECON 110H EECON		
volatile unsigned char		EECON		@ 0x10F;

	volatile bit FREADEE	@ ((unsigned)&EECON*8)+0;
	volatile bit FPROGEE	@ ((unsigned)&EECON*8)+1;
	volatile bit FERASEEE	@ ((unsigned)&EECON*8)+2;
	volatile bit FERSALLEE	@ ((unsigned)&EECON*8)+3;
	volatile bit FERS16		@ ((unsigned)&EECON*8)+4;
	volatile bit FTIMEE0	@ ((unsigned)&EECON*8)+5;
	volatile bit FTIMEE1	@ ((unsigned)&EECON*8)+6;

	volatile bit READEE		@ ((unsigned)&EECON*8)+0;
	volatile bit PROGEE		@ ((unsigned)&EECON*8)+1;
	volatile bit ERASEEE	@ ((unsigned)&EECON*8)+2;
	volatile bit ERSALLEE	@ ((unsigned)&EECON*8)+3;
	volatile bit ERS16		@ ((unsigned)&EECON*8)+4;
	volatile bit TIMEE0		@ ((unsigned)&EECON*8)+5;
	volatile bit TIMEE1		@ ((unsigned)&EECON*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	READEE     : 1;	//0
        unsigned	PROGEE     : 1;	//1
        unsigned	ERASEEE    : 1;	//2
        unsigned	ERSALLEE   : 1;	//3
        unsigned	ERS16      : 1;	//4
        unsigned	TIMEE0     : 1;	//5
        unsigned	TIMEE1     : 1;	//6
        unsigned	           : 1;	//7
    };
}EECONbits @ 0x10F;
#endif
#endif  
//T3C0 110H 
volatile unsigned char		T3C0		@ 0x110; 

	volatile bit FT3PWM0EN	@((unsigned)&T3C0*8)+1;//1021
	volatile bit FT3PWM1EN	@((unsigned)&T3C0*8)+2;//1021
	volatile bit FT3PWM0INV	@((unsigned)&T3C0*8)+4;//1021
	volatile bit FT3PWM1INV	@((unsigned)&T3C0*8)+5;//1021
	volatile bit FT3REN		@((unsigned)&T3C0*8)+7;

	volatile bit T3PWM0EN	@((unsigned)&T3C0*8)+1;//1021
	volatile bit T3PWM1EN	@((unsigned)&T3C0*8)+2;//1021
	volatile bit T3PWM0INV	@((unsigned)&T3C0*8)+4;//1021
	volatile bit T3PWM1INV	@((unsigned)&T3C0*8)+5;//1021
	volatile bit T3REN		@((unsigned)&T3C0*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	 		    : 1;	//0
        unsigned	T3PWM0E     : 1;	//1
        unsigned	            : 1;	//2
        unsigned			    : 1;	//3
        unsigned	T3PWM0INV   : 1;	//4
        unsigned	T3PWM1INV   : 1;	//5
        unsigned	            : 1;	//6
        unsigned	T3REN       : 1;	//7
    };
}T3C0bits @ 0x110;
#endif

volatile unsigned char		T3C1		@ 0x111; 

	volatile bit FT3CK0 	@((unsigned)&T3C1*8)+0;
	volatile bit FT3CK1 	@((unsigned)&T3C1*8)+1;
	volatile bit FT3CK2 	@((unsigned)&T3C1*8)+2;
	volatile bit FT3CKS0	@((unsigned)&T3C1*8)+4;
	//volatile bit FT3CKS1	@((unsigned)&T3C1*8)+5;
	volatile bit FT3OUT0	@((unsigned)&T3C1*8)+6;

	volatile bit T3CK0		@((unsigned)&T3C1*8)+0;
	volatile bit T3CK1		@((unsigned)&T3C1*8)+1;
	volatile bit T3CK2		@((unsigned)&T3C1*8)+2;
	volatile bit T3CKS0		@((unsigned)&T3C1*8)+4;
	//volatile bit T3CKS1	@((unsigned)&T3C1*8)+5;
	volatile bit T3OUT0		@((unsigned)&T3C1*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T3CK0	    : 1;	//0
        unsigned	T3CK1       : 1;	//1
        unsigned	T3CK2       : 1;	//2
        unsigned	          : 1;	//3
        unsigned	T3CKS0      : 1;	//4
        unsigned	T3CKS1      : 1;	//5
        unsigned	T3OUT0      : 1;	//6
        unsigned	          : 1;	//7
    };
}T3C1bits @ 0x111;
#endif

volatile unsigned char		T3TL		@ 0x112; 
				
volatile unsigned char		T3TH		@ 0x113; 
				
				
volatile unsigned char		T3PL		@ 0x114; 
				
volatile unsigned char		T3PH		@ 0x115; 

volatile unsigned char		T3D0L		@ 0x116;

volatile unsigned char		T3D0H		@ 0x117; 

#if 0
//T2C0 110H 
volatile unsigned char		T2C0		@ 0x118;

	volatile bit FT2PWMEN	@((unsigned)&T2C0*8)+1;
	volatile bit FT2REN		@((unsigned)&T2C0*8)+7;

	volatile bit T2PWMEN	@((unsigned)&T2C0*8)+1;
	volatile bit T2REN		@((unsigned)&T2C0*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	          : 1;	//0
        unsigned	T2PWMEN   : 1;	//1
        unsigned	          : 1;	//2
        unsigned	          : 1;	//3
        unsigned	          : 1;	//4
        unsigned	          : 1;	//5
        unsigned	          : 1;	//6
        unsigned	T2REN     : 1;	//7
    };
}T2C0bits @ 0x118;
#endif
#endif

volatile unsigned char		T3C2		@ 0x119;

	volatile bit FT3PWM2EN		@((unsigned)&T3C2*8)+0;
	volatile bit FT3PWM3EN		@((unsigned)&T3C2*8)+1;
	volatile bit FT3PWM4EN		@((unsigned)&T3C2*8)+2;
	volatile bit FT3PWM2INV		@((unsigned)&T3C2*8)+3;
	volatile bit FT3PWM3INV		@((unsigned)&T3C2*8)+4;
	volatile bit FT3PWM4INV		@((unsigned)&T3C2*8)+5;
	volatile bit FPDTM0			@((unsigned)&T3C2*8)+6;
	volatile bit FPDTM2			@((unsigned)&T3C2*8)+7;
	
	volatile bit T3PWM2EN		@((unsigned)&T3C2*8)+0;
	volatile bit T3PWM3EN		@((unsigned)&T3C2*8)+1;
	volatile bit T3PWM4EN		@((unsigned)&T3C2*8)+2;
	volatile bit T3PWM2INV		@((unsigned)&T3C2*8)+3;
	volatile bit T3PWM3INV		@((unsigned)&T3C2*8)+4;
	volatile bit T3PWM4INV		@((unsigned)&T3C2*8)+5;
	volatile bit PDTM0			@((unsigned)&T3C2*8)+6;
	volatile bit PDTM2			@((unsigned)&T3C2*8)+7;

volatile unsigned char		T3D1L		@ 0x11A; 
				
volatile unsigned char		T3D1H		@ 0x11B; 
				
				
volatile unsigned char		T3D2L		@ 0x11C; 
				
volatile unsigned char		T3D2H		@ 0x11D; 
				
volatile unsigned char		T3D3L		@ 0x11E; 
				
volatile unsigned char		T3D3H		@ 0x11F; 

/**
 * @ brief:	 BANK3 Special function register definitions
 */
 
//volatile unsigned char		RCREG		@ 0x188; 

volatile unsigned char		PWMSEL1		@ 0x189;
//-----------------
volatile unsigned char		PWMSEL		@ 0x18C;

volatile unsigned char		T4C0		@ 0x18D; 

	volatile bit FT4PWMEN	@((unsigned)&T4C0*8)+1;
	volatile bit FT4BUZEN	@((unsigned)&T4C0*8)+3;
	volatile bit FT4PWMINV	@((unsigned)&T4C0*8)+4;
	volatile bit FT4REN		@((unsigned)&T4C0*8)+7;

	volatile bit T4PWMEN	@((unsigned)&T4C0*8)+1;
	volatile bit T4BUZEN	@((unsigned)&T4C0*8)+3;
	volatile bit T4PWMINV	@((unsigned)&T4C0*8)+4;
	volatile bit T4REN		@((unsigned)&T4C0*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	 		    : 1;	//0
        unsigned	T4PWMEN     : 1;	//1
        unsigned	            : 1;	//2
        unsigned	T4BUZEN     : 1;	//3
        unsigned	T4PWMINV    : 1;	//4
        unsigned	            : 1;	//5
        unsigned	            : 1;	//6
        unsigned	T4REN       : 1;	//7
    };
}T4C0bits @ 0x18D;
#endif

volatile unsigned char		T4C1		@ 0x18E; 

	volatile bit FT4CK0		@((unsigned)&T4C1*8)+0;
	volatile bit FT4CK1		@((unsigned)&T4C1*8)+1;
	volatile bit FT4CK2		@((unsigned)&T4C1*8)+2;
	volatile bit FT4CKS0	@((unsigned)&T4C1*8)+4;
	//volatile bit FT4CKS1	@((unsigned)&T4C1*8)+5;
	volatile bit FT4OUT0	@((unsigned)&T4C1*8)+6;

	volatile bit T4CK0		@ ((unsigned)&T4C1*8)+0;
	volatile bit T4CK1		@ ((unsigned)&T4C1*8)+1;
	volatile bit T4CK2		@ ((unsigned)&T4C1*8)+2;
	volatile bit T4CKS0		@ ((unsigned)&T4C1*8)+4;
	//volatile bit T4CKS1		@ ((unsigned)&T4C1*8)+5;
	volatile bit T4OUT0		@ ((unsigned)&T4C1*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T4CK0	   : 1;	//0
        unsigned	T4CK1      : 1;	//1
        unsigned	T4CK2      : 1;	//2
        unsigned	          : 1;	//3
        unsigned	T4CKS0     : 1;	//4
        unsigned	T4CKS1     : 1;	//5
        unsigned	T4OUT0     : 1;	//6
        unsigned	          : 1;	//7
    };
}T4C1bits @ 0x18E;
#endif

volatile unsigned char		T4TL		@ 0x18F; 
				
//-----------------				
volatile unsigned char		T4TH		@ 0x190;
				
volatile unsigned char		T4PL		@ 0x191; 
				
volatile unsigned char		T4PH		@ 0x192;
				
volatile unsigned char		T4DL		@ 0x193;
				
//-----------------				
volatile unsigned char		T4DH		@ 0x194;

#if 0
volatile unsigned char		T5C0		@ 0x195;

	volatile bit FT5PWMEN	@((unsigned)&T5C0*8)+1;
	volatile bit FT5BUZEN	@((unsigned)&T5C0*8)+3;
	volatile bit FT5PWMINV	@((unsigned)&T5C0*8)+4;
	volatile bit FT5REN		@((unsigned)&T5C0*8)+7;

	volatile bit T5PWMEN	@((unsigned)&T5C0*8)+1;
	volatile bit T5BUZEN	@((unsigned)&T5C0*8)+3;
	volatile bit T5PWMINV	@((unsigned)&T5C0*8)+4;
	volatile bit T5REN		@((unsigned)&T5C0*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	 		    : 1;	//0
        unsigned	T4PWMEN     : 1;	//1
        unsigned	            : 1;	//2
        unsigned	T4BUZEN     : 1;	//3
        unsigned	T4PWMINV    : 1;	//4
        unsigned	            : 1;	//5
        unsigned	            : 1;	//6
        unsigned	T4REN       : 1;	//7
    };
}T5C0bits @ 0x195;
#endif

volatile unsigned char		T5C1		@ 0x196;

	volatile bit FT5CK0		@((unsigned)&T5C1*8)+0;
	volatile bit FT5CK1		@((unsigned)&T5C1*8)+1;
	volatile bit FT5CK2		@((unsigned)&T5C1*8)+2;
	volatile bit FT5CKS0	@((unsigned)&T5C1*8)+4;
	volatile bit FT5CKS1	@((unsigned)&T5C1*8)+5;
	volatile bit FT5OUT0	@((unsigned)&T5C1*8)+6;

	volatile bit T5CK0		@((unsigned)&T5C1*8)+0;
	volatile bit T5CK1		@((unsigned)&T5C1*8)+1;
	volatile bit T5CK2		@((unsigned)&T5C1*8)+2;
	volatile bit T5CKS0		@((unsigned)&T5C1*8)+4;
	volatile bit T5CKS1		@((unsigned)&T5C1*8)+5;
	volatile bit T5OUT0		@((unsigned)&T5C1*8)+6;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	T5CK0	    : 1;	//0
        unsigned	T5CK1       : 1;	//1
        unsigned	T5CK2       : 1;	//2
        unsigned	          : 1;	//3
        unsigned	T5CKS0      : 1;	//4
        unsigned	T5CKS1      : 1;	//5
        unsigned	T5OUT0      : 1;	//6
        unsigned	          : 1;	//7
    };
}T5C1bits @ 0x196;
#endif

volatile unsigned char		T5TL		@ 0x197;
				
//-----------------				
volatile unsigned char		T5TH		@ 0x198;
				
volatile unsigned char		T5PL		@ 0x199;
				
volatile unsigned char		T5PH		@ 0x19A;
				
volatile unsigned char		T5DL		@ 0x19B;
				
//-----------------				
volatile unsigned char		T5DH		@ 0x19C;
#endif 
volatile unsigned char		CMCON0		@ 0x19D;

	volatile bit FCMCH0		@((unsigned)&CMCON0*8)+0;
	volatile bit FCMCH1		@((unsigned)&CMCON0*8)+1;
	volatile bit FCMCH2		@((unsigned)&CMCON0*8)+2;
	volatile bit FCIS		@((unsigned)&CMCON0*8)+3;
	volatile bit FC1INV		@((unsigned)&CMCON0*8)+4;
	//volatile bit FC2INV		@((unsigned)&CMCON0*8)+5;
	volatile bit FC1OUT		@((unsigned)&CMCON0*8)+6;
	//volatile bit FC2OUT		@((unsigned)&CMCON0*8)+7;

	volatile bit CMCH0		@((unsigned)&CMCON0*8)+0;
	volatile bit CMCH1		@((unsigned)&CMCON0*8)+1;
	volatile bit CMCH2		@((unsigned)&CMCON0*8)+2;
	volatile bit CIS		@((unsigned)&CMCON0*8)+3;
	volatile bit C1INV		@((unsigned)&CMCON0*8)+4;
	//volatile bit C2INV		@((unsigned)&CMCON0*8)+5;
	volatile bit C1OUT		@((unsigned)&CMCON0*8)+6;
	//volatile bit C2OUT		@((unsigned)&CMCON0*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	CMCH0	 : 1;	//0
        unsigned	CMCH1    : 1;	//1
        unsigned	CMCH2    : 1;	//2
        unsigned	CIS      : 1;	//3
        unsigned	C1INV   : 1;	//4
        unsigned	C2INV   : 1;	//5
        unsigned	C1OUT   : 1;	//6
        unsigned	C2OUT   : 1;	//7
    };
}CMCON0bits @ 0x19D;
#endif

#if 0
volatile unsigned char		CMCON1		@ 0x19E;

volatile bit FC2SYNC	@((unsigned)&CMCON1*8)+0;
volatile bit FT1GSS		@((unsigned)&CMCON1*8)+1;
volatile bit FC1FIEN	@((unsigned)&CMCON1*8)+2;
volatile bit FC2FIEN	@((unsigned)&CMCON1*8)+3;

volatile bit C2SYNC		@((unsigned)&CMCON1*8)+0;
volatile bit T1GSS		@((unsigned)&CMCON1*8)+1;
volatile bit C1FIEN		@((unsigned)&CMCON1*8)+2;
volatile bit C2FIEN		@((unsigned)&CMCON1*8)+3;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	C2SYNC	: 1;	//0
        unsigned	T1GSS	: 1;	//1
        unsigned	C1FIEN	: 1;	//2
        unsigned	C2FIEN	: 1;	//3
        unsigned	       : 1;	//4
        unsigned	       : 1;	//5
        unsigned	       : 1;	//6
        unsigned	       : 1;	//7
    };
}CMCON1bits @ 0x19E;
#endif
#endif 

volatile unsigned char		VRCON		@ 0x19F;

	volatile bit FVR0		@((unsigned)&VRCON*8)+0;
	volatile bit FVR1		@((unsigned)&VRCON*8)+1;
	volatile bit FVR2		@((unsigned)&VRCON*8)+2;
	volatile bit FVR3		@((unsigned)&VRCON*8)+3; 
	volatile bit FVRS		@((unsigned)&VRCON*8)+4; 
	volatile bit FVRR0		@((unsigned)&VRCON*8)+5; 
	volatile bit FVRR1		@((unsigned)&VRCON*8)+6; 
	volatile bit FVREN		@((unsigned)&VRCON*8)+7;

	volatile bit VR0		@((unsigned)&VRCON*8)+0;
	volatile bit VR1		@((unsigned)&VRCON*8)+1;
	volatile bit VR2		@((unsigned)&VRCON*8)+2;
	volatile bit VR3		@((unsigned)&VRCON*8)+3;
	volatile bit VRS		@((unsigned)&VRCON*8)+4; 
	volatile bit VRR0		@((unsigned)&VRCON*8)+5; 
	volatile bit VRR1		@((unsigned)&VRCON*8)+6;
	volatile bit VREN		@((unsigned)&VRCON*8)+7;

#ifndef _LIB_BUILD
volatile union 
{
    struct 
	{
        unsigned	VR0       : 1;	//0
        unsigned	VR1       : 1;	//1
        unsigned	VR2       : 1;	//2
        unsigned	VR3       : 1;	//3
        unsigned	         : 1;	//4
        unsigned	VRR       : 1;	//5
        unsigned	         : 1;	//6
        unsigned	VREN      : 1;	//7
    };
}VRCONbits @ 0x19F;
#endif

/**
 * @ brief:	 BANK0 Special function register definitions end
 */#endif

/*
// Register: PBIC1
volatile unsigned char           PBIC1               @ 0x06C;
// bit and bitfield definitions

// Register: PAIC1
volatile unsigned char           PAIC1               @ 0x06F;
// bit and bitfield definitions

// Register: EECON
volatile unsigned char           EECON1               @ 0x07A;
// bit and bitfield definitions

// Register: OPAM
volatile unsigned char           OPAM               @ 0x0DB; //0X5B
// bit and bitfield definitions
volatile bit MULTS0                @ ((unsigned)&OPAM*8)+0;
volatile bit MULTS1                @ ((unsigned)&OPAM*8)+1;
volatile bit OPAMEN                @ ((unsigned)&OPAM*8)+2;
volatile bit COMMS                 @ ((unsigned)&OPAM*8)+3;

#ifndef _LIB_BUILD
volatile union {
    struct {
        unsigned	MULTS0              : 1;
        unsigned	MULTS1              : 1;
        unsigned	OPAMEN              : 1;
        unsigned	COMMS               : 1; 
        unsigned	                    : 4;
    };
} OPAMbits @ 0x0DB;
#endif
*/
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

/**
 @ 
 @ 变量定义 ：
 @ bit				1	==布尔型位变量，0或1两种取值
 @ char				8	==有符号或无符号字符变量，
 @ unsigned char	8	==无符号字符变量
 @ short			16	==有符号整型数
 @ unsigned short	16	==无符号整型数
 @ int				16	==有符号整型数
 @ unsigned int		16	==无符号整型数
 @ long				32	==有符号长整型
 @ unsigned long	32	==无符号长整型
 @ float			24	==浮点数
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
BANK数据寄存器定义的管理
如果没有特别说明，所定义的变量降被定义在Bank0;除了Bank0内的变量声明不需要特殊处理外，
定义在其它Bank内的变量前面必须加上相应的bank序号，例如
	bank1 unsigned char buffer[2]	;变量定位在bank0
	bank2 bit flag1,flag2	;变量定位在bank2(如果硬件有bank2)
	bank3 int U16_tmp0,U16_tmp1	;变量定位在bank3(如果硬件有bank3)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
其它变量修饰关键词:
extern - 外部变量声明；如果在一个C程序文件中要使用一些变量但其原型定义写在另外的文件中，
	那么在本文件中必须将这些变量声明成“extern ”外部类型。

volatile —易变型变量声明。
const  —  常数型变量声明。
persistent —  非初始化变量声明。
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

*/


