#ifndef MC35P7040_H
#define MC35P7040_H

#include <mc35-common.h>

//
// Register addresses.
//
#define HIBYTE_ADDR     	0x0082
#define FSR0_ADDR       	0x0083
#define FSR1_ADDR       	0x0084
#define PFLAG_ADDR      	0x0086
#define P4CON_ADDR      	0x00AE
#define VREFCR_ADDR     	0x00AF
#define ADM_ADDR        	0x00B1
#define ADB_ADDR        	0x00B2
#define ADR_ADDR        	0x00B3
#define ADT_ADDR        	0x00B4
#define OEP0_ADDR       	0x00B8
#define EINTCR_ADDR     	0x00BF
#define OEP4_ADDR       	0x00C4
#define OEP5_ADDR       	0x00C5
#define INTF_ADDR       	0x00C8
#define INTE_ADDR       	0x00C9
#define OSCM_ADDR       	0x00CA
#define WDTCR_ADDR      	0x00CC
#define T0LDR_ADDR      	0x00CD
#define PCL_ADDR        	0x00CE
#define PCH_ADDR        	0x00CF
#define IOP0_ADDR       	0x00D0
#define IOP4_ADDR       	0x00D4
#define IOP5_ADDR       	0x00D5
#define TMRCR_ADDR      	0x00D8
#define T0CR_ADDR       	0x00DA
#define T0CNT_ADDR      	0x00DB
#define T1CR_ADDR       	0x00DC
#define T1CNT_ADDR      	0x00DD
#define T1LDR_ADDR      	0x00DE
#define MCR_ADDR        	0x00DF
#define PUP0_ADDR       	0x00E0
#define PUP4_ADDR       	0x00E4
#define PUP5_ADDR       	0x00E5
#define INDF_ADDR       	0x00E7
#define STKR3L_ADDR     	0x00F8
#define STKR3H_ADDR     	0x00F9
#define STKR2L_ADDR     	0x00FA
#define STKR2H_ADDR     	0x00FB
#define STKR1L_ADDR     	0x00FC
#define STKR1H_ADDR     	0x00FD
#define STKR0L_ADDR     	0x00FE
#define STKR0H_ADDR     	0x00FF

//----- Register Files -----------------------------------------------------

extern __sfr __at (HIBYTE_ADDR)   	HIBYTE;
extern __sfr __at (FSR0_ADDR)     	FSR0;
extern __sfr __at (FSR1_ADDR)     	FSR1;
extern __sfr __at (PFLAG_ADDR)    	PFLAG;
extern __sfr __at (P4CON_ADDR)    	P4CON;
extern __sfr __at (VREFCR_ADDR)   	VREFCR;
extern __sfr __at (ADM_ADDR)      	ADM;
extern __sfr __at (ADB_ADDR)      	ADB;
extern __sfr __at (ADR_ADDR)      	ADR;
extern __sfr __at (ADT_ADDR)      	ADT;
extern __sfr __at (OEP0_ADDR)     	OEP0;
extern __sfr __at (EINTCR_ADDR)   	EINTCR;
extern __sfr __at (OEP4_ADDR)     	OEP4;
extern __sfr __at (OEP5_ADDR)     	OEP5;
extern __sfr __at (INTF_ADDR)     	INTF;
extern __sfr __at (INTE_ADDR)     	INTE;
extern __sfr __at (OSCM_ADDR)     	OSCM;
extern __sfr __at (WDTCR_ADDR)    	WDTCR;
extern __sfr __at (T0LDR_ADDR)    	T0LDR;
extern __sfr __at (PCL_ADDR)      	PCL;
extern __sfr __at (PCH_ADDR)      	PCH;
extern __sfr __at (IOP0_ADDR)     	IOP0;
extern __sfr __at (IOP4_ADDR)     	IOP4;
extern __sfr __at (IOP5_ADDR)     	IOP5;
extern __sfr __at (TMRCR_ADDR)    	TMRCR;
extern __sfr __at (T0CR_ADDR)     	T0CR;
extern __sfr __at (T0CNT_ADDR)    	T0CNT;
extern __sfr __at (T1CR_ADDR)     	T1CR;
extern __sfr __at (T1CNT_ADDR)    	T1CNT;
extern __sfr __at (T1LDR_ADDR)    	T1LDR;
extern __sfr __at (MCR_ADDR)      	MCR;
extern __sfr __at (PUP0_ADDR)     	PUP0;
extern __sfr __at (PUP4_ADDR)     	PUP4;
extern __sfr __at (PUP5_ADDR)     	PUP5;
extern __sfr __at (INDF_ADDR)     	INDF;
extern __sfr __at (STKR3L_ADDR)   	STKR3L;
extern __sfr __at (STKR3H_ADDR)   	STKR3H;
extern __sfr __at (STKR2L_ADDR)   	STKR2L;
extern __sfr __at (STKR2H_ADDR)   	STKR2H;
extern __sfr __at (STKR1L_ADDR)   	STKR1L;
extern __sfr __at (STKR1H_ADDR)   	STKR1H;
extern __sfr __at (STKR0L_ADDR)   	STKR0L;
extern __sfr __at (STKR0H_ADDR)   	STKR0H;

//==========================================================================
//
//	Configuration Bits
//
//==========================================================================

//OPBIT1

//OPBIT0

// ----- HIBYTE Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char HIBYTE0:1;
		unsigned char HIBYTE1:1;
		unsigned char HIBYTE2:1;
		unsigned char HIBYTE3:1;
		unsigned char HIBYTE4:1;
		unsigned char HIBYTE5:1;
		unsigned char HIBYTE6:1;
		unsigned char HIBYTE7:1;
	};
} __HIBYTEbits_t;
extern volatile __HIBYTEbits_t __at(HIBYTE_ADDR) HIBYTEbits;

#define HIBYTE0   	HIBYTEbits.HIBYTE0  	/* bit 0 */
#define HIBYTE1   	HIBYTEbits.HIBYTE1  	/* bit 1 */
#define HIBYTE2   	HIBYTEbits.HIBYTE2  	/* bit 2 */
#define HIBYTE3   	HIBYTEbits.HIBYTE3  	/* bit 3 */
#define HIBYTE4   	HIBYTEbits.HIBYTE4  	/* bit 4 */
#define HIBYTE5   	HIBYTEbits.HIBYTE5  	/* bit 5 */
#define HIBYTE6   	HIBYTEbits.HIBYTE6  	/* bit 6 */
#define HIBYTE7   	HIBYTEbits.HIBYTE7  	/* bit 7 */

// ----- FSR0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char FSR00:1;
		unsigned char FSR01:1;
		unsigned char FSR02:1;
		unsigned char FSR03:1;
		unsigned char FSR04:1;
		unsigned char FSR05:1;
		unsigned char FSR06:1;
		unsigned char FSR07:1;
	};
} __FSR0bits_t;
extern volatile __FSR0bits_t __at(FSR0_ADDR) FSR0bits;

#define FSR00     	FSR0bits.FSR00      	/* bit 0 */
#define FSR01     	FSR0bits.FSR01      	/* bit 1 */
#define FSR02     	FSR0bits.FSR02      	/* bit 2 */
#define FSR03     	FSR0bits.FSR03      	/* bit 3 */
#define FSR04     	FSR0bits.FSR04      	/* bit 4 */
#define FSR05     	FSR0bits.FSR05      	/* bit 5 */
#define FSR06     	FSR0bits.FSR06      	/* bit 6 */
#define FSR07     	FSR0bits.FSR07      	/* bit 7 */

// ----- FSR1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char FSR10:1;
		unsigned char FSR11:1;
		unsigned char FSR12:1;
		unsigned char FSR13:1;
		unsigned char FSR14:1;
		unsigned char FSR15:1;
		unsigned char FSR16:1;
		unsigned char FSR17:1;
	};
} __FSR1bits_t;
extern volatile __FSR1bits_t __at(FSR1_ADDR) FSR1bits;

#define FSR10     	FSR1bits.FSR10      	/* bit 0 */
#define FSR11     	FSR1bits.FSR11      	/* bit 1 */
#define FSR12     	FSR1bits.FSR12      	/* bit 2 */
#define FSR13     	FSR1bits.FSR13      	/* bit 3 */
#define FSR14     	FSR1bits.FSR14      	/* bit 4 */
#define FSR15     	FSR1bits.FSR15      	/* bit 5 */
#define FSR16     	FSR1bits.FSR16      	/* bit 6 */
#define FSR17     	FSR1bits.FSR17      	/* bit 7 */

// ----- PFLAG Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char Z:1;
		unsigned char DC:1;
		unsigned char C:1;
		unsigned char :1;
		unsigned char LVD24:1;
		unsigned char LVD36:1;
		unsigned char PD:1;
		unsigned char TO:1;
	};
} __PFLAGbits_t;
extern volatile __PFLAGbits_t __at(PFLAG_ADDR) PFLAGbits;

#define Z         	PFLAGbits.Z         	/* bit 0 */
#define DC        	PFLAGbits.DC        	/* bit 1 */
#define C         	PFLAGbits.C         	/* bit 2 */
#define LVD24     	PFLAGbits.LVD24     	/* bit 4 */
#define LVD36     	PFLAGbits.LVD36     	/* bit 5 */
#define PD        	PFLAGbits.PD        	/* bit 6 */
#define TO        	PFLAGbits.TO        	/* bit 7 */

// ----- P4CON Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P40CON:1;
		unsigned char P41CON:1;
		unsigned char P42CON:1;
		unsigned char P43CON:1;
		unsigned char P44CON:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __P4CONbits_t;
extern volatile __P4CONbits_t __at(P4CON_ADDR) P4CONbits;

#define P40CON    	P4CONbits.P40CON    	/* bit 0 */
#define P41CON    	P4CONbits.P41CON    	/* bit 1 */
#define P42CON    	P4CONbits.P42CON    	/* bit 2 */
#define P43CON    	P4CONbits.P43CON    	/* bit 3 */
#define P44CON    	P4CONbits.P44CON    	/* bit 4 */

// ----- VREFCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char ADVRS0:1;
		unsigned char ADVRS1:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char VEREN:1;
	};
} __VREFCRbits_t;
extern volatile __VREFCRbits_t __at(VREFCR_ADDR) VREFCRbits;

#define ADVRS0    	VREFCRbits.ADVRS0   	/* bit 0 */
#define ADVRS1    	VREFCRbits.ADVRS1   	/* bit 1 */
#define VEREN     	VREFCRbits.VEREN    	/* bit 7 */

// ----- ADM Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char ADCHS0:1;
		unsigned char ADCHS1:1;
		unsigned char ADCHS2:1;
		unsigned char :1;
		unsigned char GCHS:1;
		unsigned char ADEOC:1;
		unsigned char ADSTR:1;
		unsigned char ADEN:1;
	};
} __ADMbits_t;
extern volatile __ADMbits_t __at(ADM_ADDR) ADMbits;

#define ADCHS0    	ADMbits.ADCHS0      	/* bit 0 */
#define ADCHS1    	ADMbits.ADCHS1      	/* bit 1 */
#define ADCHS2    	ADMbits.ADCHS2      	/* bit 2 */
#define GCHS      	ADMbits.GCHS        	/* bit 4 */
#define ADEOC     	ADMbits.ADEOC       	/* bit 5 */
#define ADSTR     	ADMbits.ADSTR       	/* bit 6 */
#define ADEN      	ADMbits.ADEN        	/* bit 7 */

// ----- ADB Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char ADB4:1;
		unsigned char ADB5:1;
		unsigned char ADB6:1;
		unsigned char ADB7:1;
		unsigned char ADB8:1;
		unsigned char ADB9:1;
		unsigned char ADB10:1;
		unsigned char ADB11:1;
	};
} __ADBbits_t;
extern volatile __ADBbits_t __at(ADB_ADDR) ADBbits;

#define ADB4      	ADBbits.ADB4        	/* bit 0 */
#define ADB5      	ADBbits.ADB5        	/* bit 1 */
#define ADB6      	ADBbits.ADB6        	/* bit 2 */
#define ADB7      	ADBbits.ADB7        	/* bit 3 */
#define ADB8      	ADBbits.ADB8        	/* bit 4 */
#define ADB9      	ADBbits.ADB9        	/* bit 5 */
#define ADB10     	ADBbits.ADB10       	/* bit 6 */
#define ADB11     	ADBbits.ADB11       	/* bit 7 */

// ----- ADR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char ADB0:1;
		unsigned char ADB1:1;
		unsigned char ADB2:1;
		unsigned char ADB3:1;
		unsigned char ADCKS0:1;
		unsigned char :1;
		unsigned char ADCKS1:1;
		unsigned char :1;
	};
} __ADRbits_t;
extern volatile __ADRbits_t __at(ADR_ADDR) ADRbits;

#define ADB0      	ADRbits.ADB0        	/* bit 0 */
#define ADB1      	ADRbits.ADB1        	/* bit 1 */
#define ADB2      	ADRbits.ADB2        	/* bit 2 */
#define ADB3      	ADRbits.ADB3        	/* bit 3 */
#define ADCKS0    	ADRbits.ADCKS0      	/* bit 4 */
#define ADCKS1    	ADRbits.ADCKS1      	/* bit 6 */

// ----- ADT Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char ADTR0:1;
		unsigned char ADTR1:1;
		unsigned char ADTR2:1;
		unsigned char ADTR3:1;
		unsigned char ADTR4:1;
		unsigned char :1;
		unsigned char ADTS0:1;
		unsigned char ADTS1:1;
	};
} __ADTbits_t;
extern volatile __ADTbits_t __at(ADT_ADDR) ADTbits;

#define ADTR0     	ADTbits.ADTR0       	/* bit 0 */
#define ADTR1     	ADTbits.ADTR1       	/* bit 1 */
#define ADTR2     	ADTbits.ADTR2       	/* bit 2 */
#define ADTR3     	ADTbits.ADTR3       	/* bit 3 */
#define ADTR4     	ADTbits.ADTR4       	/* bit 4 */
#define ADTS0     	ADTbits.ADTS0       	/* bit 6 */
#define ADTS1     	ADTbits.ADTS1       	/* bit 7 */

// ----- OEP0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P00OE:1;
		unsigned char P01OE:1;
		unsigned char P02OE:1;
		unsigned char P03OE:1;
		unsigned char P04OE:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __OEP0bits_t;
extern volatile __OEP0bits_t __at(OEP0_ADDR) OEP0bits;

#define P00OE     	OEP0bits.P00OE      	/* bit 0 */
#define P01OE     	OEP0bits.P01OE      	/* bit 1 */
#define P02OE     	OEP0bits.P02OE      	/* bit 2 */
#define P03OE     	OEP0bits.P03OE      	/* bit 3 */
#define P04OE     	OEP0bits.P04OE      	/* bit 4 */

// ----- EINTCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char MINT00:1;
		unsigned char MINT01:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __EINTCRbits_t;
extern volatile __EINTCRbits_t __at(EINTCR_ADDR) EINTCRbits;

#define MINT00    	EINTCRbits.MINT00   	/* bit 3 */
#define MINT01    	EINTCRbits.MINT01   	/* bit 4 */

// ----- OEP4 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P40OE:1;
		unsigned char P41OE:1;
		unsigned char P42OE:1;
		unsigned char P43OE:1;
		unsigned char P44OE:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __OEP4bits_t;
extern volatile __OEP4bits_t __at(OEP4_ADDR) OEP4bits;

#define P40OE     	OEP4bits.P40OE      	/* bit 0 */
#define P41OE     	OEP4bits.P41OE      	/* bit 1 */
#define P42OE     	OEP4bits.P42OE      	/* bit 2 */
#define P43OE     	OEP4bits.P43OE      	/* bit 3 */
#define P44OE     	OEP4bits.P44OE      	/* bit 4 */

// ----- OEP5 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char P53OE:1;
		unsigned char P54OE:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __OEP5bits_t;
extern volatile __OEP5bits_t __at(OEP5_ADDR) OEP5bits;

#define P53OE     	OEP5bits.P53OE      	/* bit 3 */
#define P54OE     	OEP5bits.P54OE      	/* bit 4 */

// ----- INTF Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char INT0IF:1;
		unsigned char INT1IF:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char T0IF:1;
		unsigned char T1IF:1;
		unsigned char ADIF:1;
	};
} __INTFbits_t;
extern volatile __INTFbits_t __at(INTF_ADDR) INTFbits;

#define INT0IF    	INTFbits.INT0IF     	/* bit 0 */
#define INT1IF    	INTFbits.INT1IF     	/* bit 1 */
#define T0IF      	INTFbits.T0IF       	/* bit 5 */
#define T1IF      	INTFbits.T1IF       	/* bit 6 */
#define ADIF      	INTFbits.ADIF       	/* bit 7 */

// ----- INTE Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char INT0IE:1;
		unsigned char INT1IE:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char T0IE:1;
		unsigned char T1IE:1;
		unsigned char ADIE:1;
	};
} __INTEbits_t;
extern volatile __INTEbits_t __at(INTE_ADDR) INTEbits;

#define INT0IE    	INTEbits.INT0IE     	/* bit 0 */
#define INT1IE    	INTEbits.INT1IE     	/* bit 1 */
#define T0IE      	INTEbits.T0IE       	/* bit 5 */
#define T1IE      	INTEbits.T1IE       	/* bit 6 */
#define ADIE      	INTEbits.ADIE       	/* bit 7 */

// ----- OSCM Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char HFDE:1;
		unsigned char CLKS:1;
		unsigned char CPUM0:1;
		unsigned char CPUM1:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __OSCMbits_t;
extern volatile __OSCMbits_t __at(OSCM_ADDR) OSCMbits;

#define HFDE      	OSCMbits.HFDE       	/* bit 1 */
#define CLKS      	OSCMbits.CLKS       	/* bit 2 */
#define CPUM0     	OSCMbits.CPUM0      	/* bit 3 */
#define CPUM1     	OSCMbits.CPUM1      	/* bit 4 */

// ----- WDTCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char WDTCR0:1;
		unsigned char WDTCR1:1;
		unsigned char WDTCR2:1;
		unsigned char WDTCR3:1;
		unsigned char WDTCR4:1;
		unsigned char WDTCR5:1;
		unsigned char WDTCR6:1;
		unsigned char WDTCR7:1;
	};
} __WDTCRbits_t;
extern volatile __WDTCRbits_t __at(WDTCR_ADDR) WDTCRbits;

#define WDTCR0    	WDTCRbits.WDTCR0    	/* bit 0 */
#define WDTCR1    	WDTCRbits.WDTCR1    	/* bit 1 */
#define WDTCR2    	WDTCRbits.WDTCR2    	/* bit 2 */
#define WDTCR3    	WDTCRbits.WDTCR3    	/* bit 3 */
#define WDTCR4    	WDTCRbits.WDTCR4    	/* bit 4 */
#define WDTCR5    	WDTCRbits.WDTCR5    	/* bit 5 */
#define WDTCR6    	WDTCRbits.WDTCR6    	/* bit 6 */
#define WDTCR7    	WDTCRbits.WDTCR7    	/* bit 7 */

// ----- T0LDR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T0LDR0:1;
		unsigned char T0LDR1:1;
		unsigned char T0LDR2:1;
		unsigned char T0LDR3:1;
		unsigned char T0LDR4:1;
		unsigned char T0LDR5:1;
		unsigned char T0LDR6:1;
		unsigned char T0LDR7:1;
	};
} __T0LDRbits_t;
extern volatile __T0LDRbits_t __at(T0LDR_ADDR) T0LDRbits;

#define T0LDR0    	T0LDRbits.T0LDR0    	/* bit 0 */
#define T0LDR1    	T0LDRbits.T0LDR1    	/* bit 1 */
#define T0LDR2    	T0LDRbits.T0LDR2    	/* bit 2 */
#define T0LDR3    	T0LDRbits.T0LDR3    	/* bit 3 */
#define T0LDR4    	T0LDRbits.T0LDR4    	/* bit 4 */
#define T0LDR5    	T0LDRbits.T0LDR5    	/* bit 5 */
#define T0LDR6    	T0LDRbits.T0LDR6    	/* bit 6 */
#define T0LDR7    	T0LDRbits.T0LDR7    	/* bit 7 */

// ----- PCL Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PC0:1;
		unsigned char PC1:1;
		unsigned char PC2:1;
		unsigned char PC3:1;
		unsigned char PC4:1;
		unsigned char PC5:1;
		unsigned char PC6:1;
		unsigned char PC7:1;
	};
} __PCLbits_t;
extern volatile __PCLbits_t __at(PCL_ADDR) PCLbits;

#define PC0       	PCLbits.PC0         	/* bit 0 */
#define PC1       	PCLbits.PC1         	/* bit 1 */
#define PC2       	PCLbits.PC2         	/* bit 2 */
#define PC3       	PCLbits.PC3         	/* bit 3 */
#define PC4       	PCLbits.PC4         	/* bit 4 */
#define PC5       	PCLbits.PC5         	/* bit 5 */
#define PC6       	PCLbits.PC6         	/* bit 6 */
#define PC7       	PCLbits.PC7         	/* bit 7 */

// ----- PCH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PC8:1;
		unsigned char PC9:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __PCHbits_t;
extern volatile __PCHbits_t __at(PCH_ADDR) PCHbits;

#define PC8       	PCHbits.PC8         	/* bit 0 */
#define PC9       	PCHbits.PC9         	/* bit 1 */

// ----- IOP0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P00D:1;
		unsigned char P01D:1;
		unsigned char P02D:1;
		unsigned char P03D:1;
		unsigned char P04D:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __IOP0bits_t;
extern volatile __IOP0bits_t __at(IOP0_ADDR) IOP0bits;

#define P00D      	IOP0bits.P00D       	/* bit 0 */
#define P01D      	IOP0bits.P01D       	/* bit 1 */
#define P02D      	IOP0bits.P02D       	/* bit 2 */
#define P03D      	IOP0bits.P03D       	/* bit 3 */
#define P04D      	IOP0bits.P04D       	/* bit 4 */

// ----- IOP4 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P40D:1;
		unsigned char P41D:1;
		unsigned char P42D:1;
		unsigned char P43D:1;
		unsigned char P44D:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __IOP4bits_t;
extern volatile __IOP4bits_t __at(IOP4_ADDR) IOP4bits;

#define P40D      	IOP4bits.P40D       	/* bit 0 */
#define P41D      	IOP4bits.P41D       	/* bit 1 */
#define P42D      	IOP4bits.P42D       	/* bit 2 */
#define P43D      	IOP4bits.P43D       	/* bit 3 */
#define P44D      	IOP4bits.P44D       	/* bit 4 */

// ----- IOP5 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char P53D:1;
		unsigned char P54D:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __IOP5bits_t;
extern volatile __IOP5bits_t __at(IOP5_ADDR) IOP5bits;

#define P53D      	IOP5bits.P53D       	/* bit 3 */
#define P54D      	IOP5bits.P54D       	/* bit 4 */

// ----- TMRCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char T0WUEN:1;
		unsigned char T0ICKS:1;
		unsigned char T1ICKS:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __TMRCRbits_t;
extern volatile __TMRCRbits_t __at(TMRCR_ADDR) TMRCRbits;

#define T0WUEN    	TMRCRbits.T0WUEN    	/* bit 1 */
#define T0ICKS    	TMRCRbits.T0ICKS    	/* bit 2 */
#define T1ICKS    	TMRCRbits.T1ICKS    	/* bit 3 */

// ----- T0CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PWM0OE:1;
		unsigned char BUZ0OE:1;
		unsigned char T0LDEN:1;
		unsigned char T0CKS:1;
		unsigned char T0PRS0:1;
		unsigned char T0PRS1:1;
		unsigned char T0PRS2:1;
		unsigned char T0EN:1;
	};
} __T0CRbits_t;
extern volatile __T0CRbits_t __at(T0CR_ADDR) T0CRbits;

#define PWM0OE    	T0CRbits.PWM0OE     	/* bit 0 */
#define BUZ0OE    	T0CRbits.BUZ0OE     	/* bit 1 */
#define T0LDEN    	T0CRbits.T0LDEN     	/* bit 2 */
#define T0CKS     	T0CRbits.T0CKS      	/* bit 3 */
#define T0PRS0    	T0CRbits.T0PRS0     	/* bit 4 */
#define T0PRS1    	T0CRbits.T0PRS1     	/* bit 5 */
#define T0PRS2    	T0CRbits.T0PRS2     	/* bit 6 */
#define T0EN      	T0CRbits.T0EN       	/* bit 7 */

// ----- T0CNT Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T0CNT0:1;
		unsigned char T0CNT1:1;
		unsigned char T0CNT2:1;
		unsigned char T0CNT3:1;
		unsigned char T0CNT4:1;
		unsigned char T0CNT5:1;
		unsigned char T0CNT6:1;
		unsigned char T0CNT7:1;
	};
} __T0CNTbits_t;
extern volatile __T0CNTbits_t __at(T0CNT_ADDR) T0CNTbits;

#define T0CNT0    	T0CNTbits.T0CNT0    	/* bit 0 */
#define T0CNT1    	T0CNTbits.T0CNT1    	/* bit 1 */
#define T0CNT2    	T0CNTbits.T0CNT2    	/* bit 2 */
#define T0CNT3    	T0CNTbits.T0CNT3    	/* bit 3 */
#define T0CNT4    	T0CNTbits.T0CNT4    	/* bit 4 */
#define T0CNT5    	T0CNTbits.T0CNT5    	/* bit 5 */
#define T0CNT6    	T0CNTbits.T0CNT6    	/* bit 6 */
#define T0CNT7    	T0CNTbits.T0CNT7    	/* bit 7 */

// ----- T1CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PWM1OE:1;
		unsigned char BUZ1OE:1;
		unsigned char T1LDEN:1;
		unsigned char T1CKS:1;
		unsigned char T1PRS0:1;
		unsigned char T1PRS1:1;
		unsigned char T1PRS2:1;
		unsigned char T1EN:1;
	};
} __T1CRbits_t;
extern volatile __T1CRbits_t __at(T1CR_ADDR) T1CRbits;

#define PWM1OE    	T1CRbits.PWM1OE     	/* bit 0 */
#define BUZ1OE    	T1CRbits.BUZ1OE     	/* bit 1 */
#define T1LDEN    	T1CRbits.T1LDEN     	/* bit 2 */
#define T1CKS     	T1CRbits.T1CKS      	/* bit 3 */
#define T1PRS0    	T1CRbits.T1PRS0     	/* bit 4 */
#define T1PRS1    	T1CRbits.T1PRS1     	/* bit 5 */
#define T1PRS2    	T1CRbits.T1PRS2     	/* bit 6 */
#define T1EN      	T1CRbits.T1EN       	/* bit 7 */

// ----- T1CNT Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1CNT0:1;
		unsigned char T1CNT1:1;
		unsigned char T1CNT2:1;
		unsigned char T1CNT3:1;
		unsigned char T1CNT4:1;
		unsigned char T1CNT5:1;
		unsigned char T1CNT6:1;
		unsigned char T1CNT7:1;
	};
} __T1CNTbits_t;
extern volatile __T1CNTbits_t __at(T1CNT_ADDR) T1CNTbits;

#define T1CNT0    	T1CNTbits.T1CNT0    	/* bit 0 */
#define T1CNT1    	T1CNTbits.T1CNT1    	/* bit 1 */
#define T1CNT2    	T1CNTbits.T1CNT2    	/* bit 2 */
#define T1CNT3    	T1CNTbits.T1CNT3    	/* bit 3 */
#define T1CNT4    	T1CNTbits.T1CNT4    	/* bit 4 */
#define T1CNT5    	T1CNTbits.T1CNT5    	/* bit 5 */
#define T1CNT6    	T1CNTbits.T1CNT6    	/* bit 6 */
#define T1CNT7    	T1CNTbits.T1CNT7    	/* bit 7 */

// ----- T1LDR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1LDR0:1;
		unsigned char T1LDR1:1;
		unsigned char T1LDR2:1;
		unsigned char T1LDR3:1;
		unsigned char T1LDR4:1;
		unsigned char T1LDR5:1;
		unsigned char T1LDR6:1;
		unsigned char T1LDR7:1;
	};
} __T1LDRbits_t;
extern volatile __T1LDRbits_t __at(T1LDR_ADDR) T1LDRbits;

#define T1LDR0    	T1LDRbits.T1LDR0    	/* bit 0 */
#define T1LDR1    	T1LDRbits.T1LDR1    	/* bit 1 */
#define T1LDR2    	T1LDRbits.T1LDR2    	/* bit 2 */
#define T1LDR3    	T1LDRbits.T1LDR3    	/* bit 3 */
#define T1LDR4    	T1LDRbits.T1LDR4    	/* bit 4 */
#define T1LDR5    	T1LDRbits.T1LDR5    	/* bit 5 */
#define T1LDR6    	T1LDRbits.T1LDR6    	/* bit 6 */
#define T1LDR7    	T1LDRbits.T1LDR7    	/* bit 7 */

// ----- MCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKP0:1;
		unsigned char STKP1:1;
		unsigned char STKP2:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char GIE:1;
	};
} __MCRbits_t;
extern volatile __MCRbits_t __at(MCR_ADDR) MCRbits;

#define STKP0     	MCRbits.STKP0       	/* bit 0 */
#define STKP1     	MCRbits.STKP1       	/* bit 1 */
#define STKP2     	MCRbits.STKP2       	/* bit 2 */
#define GIE       	MCRbits.GIE         	/* bit 7 */

// ----- PUP0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P00PU:1;
		unsigned char P01PU:1;
		unsigned char P02PU:1;
		unsigned char P03PU:1;
		unsigned char P04PU:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __PUP0bits_t;
extern volatile __PUP0bits_t __at(PUP0_ADDR) PUP0bits;

#define P00PU     	PUP0bits.P00PU      	/* bit 0 */
#define P01PU     	PUP0bits.P01PU      	/* bit 1 */
#define P02PU     	PUP0bits.P02PU      	/* bit 2 */
#define P03PU     	PUP0bits.P03PU      	/* bit 3 */
#define P04PU     	PUP0bits.P04PU      	/* bit 4 */

// ----- PUP4 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P40PU:1;
		unsigned char P41PU:1;
		unsigned char P42PU:1;
		unsigned char P43PU:1;
		unsigned char P44PU:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __PUP4bits_t;
extern volatile __PUP4bits_t __at(PUP4_ADDR) PUP4bits;

#define P40PU     	PUP4bits.P40PU      	/* bit 0 */
#define P41PU     	PUP4bits.P41PU      	/* bit 1 */
#define P42PU     	PUP4bits.P42PU      	/* bit 2 */
#define P43PU     	PUP4bits.P43PU      	/* bit 3 */
#define P44PU     	PUP4bits.P44PU      	/* bit 4 */

// ----- PUP5 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char P53PU:1;
		unsigned char P54PU:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __PUP5bits_t;
extern volatile __PUP5bits_t __at(PUP5_ADDR) PUP5bits;

#define P53PU     	PUP5bits.P53PU      	/* bit 3 */
#define P54PU     	PUP5bits.P54PU      	/* bit 4 */

// ----- INDF Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char INDF0:1;
		unsigned char INDF1:1;
		unsigned char INDF2:1;
		unsigned char INDF3:1;
		unsigned char INDF4:1;
		unsigned char INDF5:1;
		unsigned char INDF6:1;
		unsigned char INDF7:1;
	};
} __INDFbits_t;
extern volatile __INDFbits_t __at(INDF_ADDR) INDFbits;

#define INDF0     	INDFbits.INDF0      	/* bit 0 */
#define INDF1     	INDFbits.INDF1      	/* bit 1 */
#define INDF2     	INDFbits.INDF2      	/* bit 2 */
#define INDF3     	INDFbits.INDF3      	/* bit 3 */
#define INDF4     	INDFbits.INDF4      	/* bit 4 */
#define INDF5     	INDFbits.INDF5      	/* bit 5 */
#define INDF6     	INDFbits.INDF6      	/* bit 6 */
#define INDF7     	INDFbits.INDF7      	/* bit 7 */

// ----- STKR3L Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR3B0:1;
		unsigned char STKR3B1:1;
		unsigned char STKR3B2:1;
		unsigned char STKR3B3:1;
		unsigned char STKR3B4:1;
		unsigned char STKR3B5:1;
		unsigned char STKR3B6:1;
		unsigned char STKR3B7:1;
	};
} __STKR3Lbits_t;
extern volatile __STKR3Lbits_t __at(STKR3L_ADDR) STKR3Lbits;

#define STKR3B0   	STKR3Lbits.STKR3B0  	/* bit 0 */
#define STKR3B1   	STKR3Lbits.STKR3B1  	/* bit 1 */
#define STKR3B2   	STKR3Lbits.STKR3B2  	/* bit 2 */
#define STKR3B3   	STKR3Lbits.STKR3B3  	/* bit 3 */
#define STKR3B4   	STKR3Lbits.STKR3B4  	/* bit 4 */
#define STKR3B5   	STKR3Lbits.STKR3B5  	/* bit 5 */
#define STKR3B6   	STKR3Lbits.STKR3B6  	/* bit 6 */
#define STKR3B7   	STKR3Lbits.STKR3B7  	/* bit 7 */

// ----- STKR3H Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR3B8:1;
		unsigned char STKR3B9:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __STKR3Hbits_t;
extern volatile __STKR3Hbits_t __at(STKR3H_ADDR) STKR3Hbits;

#define STKR3B8   	STKR3Hbits.STKR3B8  	/* bit 0 */
#define STKR3B9   	STKR3Hbits.STKR3B9  	/* bit 1 */

// ----- STKR2L Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR2B0:1;
		unsigned char STKR2B1:1;
		unsigned char STKR2B2:1;
		unsigned char STKR2B3:1;
		unsigned char STKR2B4:1;
		unsigned char STKR2B5:1;
		unsigned char STKR2B6:1;
		unsigned char STKR2B7:1;
	};
} __STKR2Lbits_t;
extern volatile __STKR2Lbits_t __at(STKR2L_ADDR) STKR2Lbits;

#define STKR2B0   	STKR2Lbits.STKR2B0  	/* bit 0 */
#define STKR2B1   	STKR2Lbits.STKR2B1  	/* bit 1 */
#define STKR2B2   	STKR2Lbits.STKR2B2  	/* bit 2 */
#define STKR2B3   	STKR2Lbits.STKR2B3  	/* bit 3 */
#define STKR2B4   	STKR2Lbits.STKR2B4  	/* bit 4 */
#define STKR2B5   	STKR2Lbits.STKR2B5  	/* bit 5 */
#define STKR2B6   	STKR2Lbits.STKR2B6  	/* bit 6 */
#define STKR2B7   	STKR2Lbits.STKR2B7  	/* bit 7 */

// ----- STKR2H Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR2B8:1;
		unsigned char STKR2B9:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __STKR2Hbits_t;
extern volatile __STKR2Hbits_t __at(STKR2H_ADDR) STKR2Hbits;

#define STKR2B8   	STKR2Hbits.STKR2B8  	/* bit 0 */
#define STKR2B9   	STKR2Hbits.STKR2B9  	/* bit 1 */

// ----- STKR1L Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR1B0:1;
		unsigned char STKR1B1:1;
		unsigned char STKR1B2:1;
		unsigned char STKR1B3:1;
		unsigned char STKR1B4:1;
		unsigned char STKR1B5:1;
		unsigned char STKR1B6:1;
		unsigned char STKR1B7:1;
	};
} __STKR1Lbits_t;
extern volatile __STKR1Lbits_t __at(STKR1L_ADDR) STKR1Lbits;

#define STKR1B0   	STKR1Lbits.STKR1B0  	/* bit 0 */
#define STKR1B1   	STKR1Lbits.STKR1B1  	/* bit 1 */
#define STKR1B2   	STKR1Lbits.STKR1B2  	/* bit 2 */
#define STKR1B3   	STKR1Lbits.STKR1B3  	/* bit 3 */
#define STKR1B4   	STKR1Lbits.STKR1B4  	/* bit 4 */
#define STKR1B5   	STKR1Lbits.STKR1B5  	/* bit 5 */
#define STKR1B6   	STKR1Lbits.STKR1B6  	/* bit 6 */
#define STKR1B7   	STKR1Lbits.STKR1B7  	/* bit 7 */

// ----- STKR1H Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR1B8:1;
		unsigned char STKR1B9:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __STKR1Hbits_t;
extern volatile __STKR1Hbits_t __at(STKR1H_ADDR) STKR1Hbits;

#define STKR1B8   	STKR1Hbits.STKR1B8  	/* bit 0 */
#define STKR1B9   	STKR1Hbits.STKR1B9  	/* bit 1 */

// ----- STKR0L Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR0B0:1;
		unsigned char STKR0B1:1;
		unsigned char STKR0B2:1;
		unsigned char STKR0B3:1;
		unsigned char STKR0B4:1;
		unsigned char STKR0B5:1;
		unsigned char STKR0B6:1;
		unsigned char STKR0B7:1;
	};
} __STKR0Lbits_t;
extern volatile __STKR0Lbits_t __at(STKR0L_ADDR) STKR0Lbits;

#define STKR0B0   	STKR0Lbits.STKR0B0  	/* bit 0 */
#define STKR0B1   	STKR0Lbits.STKR0B1  	/* bit 1 */
#define STKR0B2   	STKR0Lbits.STKR0B2  	/* bit 2 */
#define STKR0B3   	STKR0Lbits.STKR0B3  	/* bit 3 */
#define STKR0B4   	STKR0Lbits.STKR0B4  	/* bit 4 */
#define STKR0B5   	STKR0Lbits.STKR0B5  	/* bit 5 */
#define STKR0B6   	STKR0Lbits.STKR0B6  	/* bit 6 */
#define STKR0B7   	STKR0Lbits.STKR0B7  	/* bit 7 */

// ----- STKR0H Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char STKR0B8:1;
		unsigned char STKR0B9:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __STKR0Hbits_t;
extern volatile __STKR0Hbits_t __at(STKR0H_ADDR) STKR0Hbits;

#define STKR0B8   	STKR0Hbits.STKR0B8  	/* bit 0 */
#define STKR0B9   	STKR0Hbits.STKR0B9  	/* bit 1 */

#endif
