#ifndef MC30P6201_H
#define MC30P6201_H

#include <mc32-common.h>

//
// Register addresses.
//
#define INDF_ADDR       	0x0060
#define T0CNT_ADDR      	0x0061
#define PCL_ADDR        	0x0062
#define STATUS_ADDR     	0x0063
#define FSR_ADDR        	0x0064
#define P0_ADDR         	0x0065
#define P1_ADDR         	0x0066
#define P2_ADDR         	0x0067
#define MCR_ADDR        	0x0068
#define T0CR_ADDR       	0x0069
#define TMRCR_ADDR      	0x006A
#define PCLATH_ADDR     	0x006B
#define INTE1_ADDR      	0x006C
#define INTF1_ADDR      	0x006D
#define INTE0_ADDR      	0x006E
#define INTF0_ADDR      	0x006F
#define CMPCR0_ADDR     	0x0070
#define CMPCR1_ADDR     	0x0071
#define PUCON1_ADDR     	0x0072
#define PDCONL_ADDR     	0x0073
#define ODCON_ADDR      	0x0074
#define DDR0_ADDR       	0x0075
#define DDR1_ADDR       	0x0076
#define DDR2_ADDR       	0x0077
#define PUCON0_ADDR     	0x0070
#define PDCONH_ADDR     	0x0071
#define PMOD_ADDR       	0x0073
#define P0ADCR_ADDR     	0x0074
#define T1DATA_ADDR     	0x0078
#define T1DATB_ADDR     	0x0079
#define T1DATC_ADDR     	0x007A
#define PWM1CR_ADDR     	0x007B
#define T2DATAH_ADDR    	0x007C
#define T2DATAL_ADDR    	0x007D
#define T2DATBH_ADDR    	0x007E
#define T2DATBL_ADDR    	0x007F
#define T1CR_ADDR       	0x0078
#define T1CNT_ADDR      	0x0079
#define T1LOAD_ADDR     	0x007A
#define T2CR_ADDR       	0x007B
#define T2LOADH_ADDR    	0x007C
#define T2LOADL_ADDR    	0x007D
#define P0KBCR_ADDR     	0x007E
#define P1KBCR_ADDR     	0x007F

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

extern __sfr __at (INDF_ADDR)     	INDF;
extern __sfr __at (T0CNT_ADDR)    	T0CNT;
extern __sfr __at (PCL_ADDR)      	PCL;
extern __sfr __at (STATUS_ADDR)   	STATUS;
extern __sfr __at (FSR_ADDR)      	FSR;
extern __sfr __at (P0_ADDR)       	P0;
extern __sfr __at (P1_ADDR)       	P1;
extern __sfr __at (P2_ADDR)       	P2;
extern __sfr __at (MCR_ADDR)      	MCR;
extern __sfr __at (T0CR_ADDR)     	T0CR;
extern __sfr __at (TMRCR_ADDR)    	TMRCR;
extern __sfr __at (PCLATH_ADDR)   	PCLATH;
extern __sfr __at (INTE1_ADDR)    	INTE1;
extern __sfr __at (INTF1_ADDR)    	INTF1;
extern __sfr __at (INTE0_ADDR)    	INTE0;
extern __sfr __at (INTF0_ADDR)    	INTF0;
extern __sfr __at (CMPCR0_ADDR)   	CMPCR0;
extern __sfr __at (CMPCR1_ADDR)   	CMPCR1;
extern __sfr __at (PUCON1_ADDR)   	PUCON1;
extern __sfr __at (PDCONL_ADDR)   	PDCONL;
extern __sfr __at (ODCON_ADDR)    	ODCON;
extern __sfr __at (DDR0_ADDR)     	DDR0;
extern __sfr __at (DDR1_ADDR)     	DDR1;
extern __sfr __at (DDR2_ADDR)     	DDR2;
extern __sfr __at (PUCON0_ADDR)   	PUCON0;
extern __sfr __at (PDCONH_ADDR)   	PDCONH;
extern __sfr __at (PMOD_ADDR)     	PMOD;
extern __sfr __at (P0ADCR_ADDR)   	P0ADCR;
extern __sfr __at (T1DATA_ADDR)   	T1DATA;
extern __sfr __at (T1DATB_ADDR)   	T1DATB;
extern __sfr __at (T1DATC_ADDR)   	T1DATC;
extern __sfr __at (PWM1CR_ADDR)   	PWM1CR;
extern __sfr __at (T2DATAH_ADDR)  	T2DATAH;
extern __sfr __at (T2DATAL_ADDR)  	T2DATAL;
extern __sfr __at (T2DATBH_ADDR)  	T2DATBH;
extern __sfr __at (T2DATBL_ADDR)  	T2DATBL;
extern __sfr __at (T1CR_ADDR)     	T1CR;
extern __sfr __at (T1CNT_ADDR)    	T1CNT;
extern __sfr __at (T1LOAD_ADDR)   	T1LOAD;
extern __sfr __at (T2CR_ADDR)     	T2CR;
extern __sfr __at (T2LOADH_ADDR)  	T2LOADH;
extern __sfr __at (T2LOADL_ADDR)  	T2LOADL;
extern __sfr __at (P0KBCR_ADDR)   	P0KBCR;
extern __sfr __at (P1KBCR_ADDR)   	P1KBCR;

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

//OPBIT1

//OPBIT0

// ----- 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 */

// ----- 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 */

// ----- 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 */

// ----- STATUS Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char C:1;
		unsigned char DC:1;
		unsigned char Z:1;
		unsigned char PD:1;
		unsigned char TO:1;
		unsigned char RBS:1;
		unsigned char :1;
		unsigned char WKUP:1;
	};
} __STATUSbits_t;
extern volatile __STATUSbits_t __at(STATUS_ADDR) STATUSbits;

#define C         	STATUSbits.C        	/* bit 0 */
#define DC        	STATUSbits.DC       	/* bit 1 */
#define Z         	STATUSbits.Z        	/* bit 2 */
#define PD        	STATUSbits.PD       	/* bit 3 */
#define TO        	STATUSbits.TO       	/* bit 4 */
#define RBS       	STATUSbits.RBS      	/* bit 5 */
#define WKUP      	STATUSbits.WKUP     	/* bit 7 */

// ----- FSR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char FSR0:1;
		unsigned char FSR1:1;
		unsigned char FSR2:1;
		unsigned char FSR3:1;
		unsigned char FSR4:1;
		unsigned char FSR5:1;
		unsigned char FSR6:1;
		unsigned char :1;
	};
} __FSRbits_t;
extern volatile __FSRbits_t __at(FSR_ADDR) FSRbits;

#define FSR0      	FSRbits.FSR0        	/* bit 0 */
#define FSR1      	FSRbits.FSR1        	/* bit 1 */
#define FSR2      	FSRbits.FSR2        	/* bit 2 */
#define FSR3      	FSRbits.FSR3        	/* bit 3 */
#define FSR4      	FSRbits.FSR4        	/* bit 4 */
#define FSR5      	FSRbits.FSR5        	/* bit 5 */
#define FSR6      	FSRbits.FSR6        	/* bit 6 */

// ----- P0 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 P05D:1;
		unsigned char P06D:1;
		unsigned char P07D:1;
	};
} __P0bits_t;
extern volatile __P0bits_t __at(P0_ADDR) P0bits;

#define P00D      	P0bits.P00D         	/* bit 0 */
#define P01D      	P0bits.P01D         	/* bit 1 */
#define P02D      	P0bits.P02D         	/* bit 2 */
#define P03D      	P0bits.P03D         	/* bit 3 */
#define P04D      	P0bits.P04D         	/* bit 4 */
#define P05D      	P0bits.P05D         	/* bit 5 */
#define P06D      	P0bits.P06D         	/* bit 6 */
#define P07D      	P0bits.P07D         	/* bit 7 */

// ----- P1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P10D:1;
		unsigned char P11D:1;
		unsigned char P12D:1;
		unsigned char P13D:1;
		unsigned char P14D:1;
		unsigned char P15D:1;
		unsigned char P16D:1;
		unsigned char P17D:1;
	};
} __P1bits_t;
extern volatile __P1bits_t __at(P1_ADDR) P1bits;

#define P10D      	P1bits.P10D         	/* bit 0 */
#define P11D      	P1bits.P11D         	/* bit 1 */
#define P12D      	P1bits.P12D         	/* bit 2 */
#define P13D      	P1bits.P13D         	/* bit 3 */
#define P14D      	P1bits.P14D         	/* bit 4 */
#define P15D      	P1bits.P15D         	/* bit 5 */
#define P16D      	P1bits.P16D         	/* bit 6 */
#define P17D      	P1bits.P17D         	/* bit 7 */

// ----- P2 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P20D:1;
		unsigned char P21D:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __P2bits_t;
extern volatile __P2bits_t __at(P2_ADDR) P2bits;

#define P20D      	P2bits.P20D         	/* bit 0 */
#define P21D      	P2bits.P21D         	/* bit 1 */

// ----- MCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char EIS:1;
		unsigned char WDTEN:1;
	};
} __MCRbits_t;
extern volatile __MCRbits_t __at(MCR_ADDR) MCRbits;

#define EIS       	MCRbits.EIS         	/* bit 6 */
#define WDTEN     	MCRbits.WDTEN       	/* bit 7 */

// ----- T0CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T0PRS0:1;
		unsigned char T0PRS1:1;
		unsigned char T0PRS2:1;
		unsigned char T0PTA:1;
		unsigned char T0CSE:1;
		unsigned char T0PTS:1;
		unsigned char T0TBS:1;
		unsigned char :1;
	};
} __T0CRbits_t;
extern volatile __T0CRbits_t __at(T0CR_ADDR) T0CRbits;

#define T0PRS0    	T0CRbits.T0PRS0     	/* bit 0 */
#define T0PRS1    	T0CRbits.T0PRS1     	/* bit 1 */
#define T0PRS2    	T0CRbits.T0PRS2     	/* bit 2 */
#define T0PTA     	T0CRbits.T0PTA      	/* bit 3 */
#define T0CSE     	T0CRbits.T0CSE      	/* bit 4 */
#define T0PTS     	T0CRbits.T0PTS      	/* bit 5 */
#define T0TBS     	T0CRbits.T0TBS      	/* bit 6 */

// ----- TMRCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PWM1COE:1;
		unsigned char PWM1CEN:1;
		unsigned char PWM1BEC:1;
		unsigned char PWM1AEC:1;
		unsigned char T1EN:1;
		unsigned char PWM2BEC:1;
		unsigned char PWM2AEC:1;
		unsigned char T2EN:1;
	};
} __TMRCRbits_t;
extern volatile __TMRCRbits_t __at(TMRCR_ADDR) TMRCRbits;

#define PWM1COE   	TMRCRbits.PWM1COE   	/* bit 0 */
#define PWM1CEN   	TMRCRbits.PWM1CEN   	/* bit 1 */
#define PWM1BEC   	TMRCRbits.PWM1BEC   	/* bit 2 */
#define PWM1AEC   	TMRCRbits.PWM1AEC   	/* bit 3 */
#define T1EN      	TMRCRbits.T1EN      	/* bit 4 */
#define PWM2BEC   	TMRCRbits.PWM2BEC   	/* bit 5 */
#define PWM2AEC   	TMRCRbits.PWM2AEC   	/* bit 6 */
#define T2EN      	TMRCRbits.T2EN      	/* bit 7 */

// ----- PCLATH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char PCH0:1;
		unsigned char PCH1:1;
		unsigned char PCH2:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __PCLATHbits_t;
extern volatile __PCLATHbits_t __at(PCLATH_ADDR) PCLATHbits;

#define PCH0      	PCLATHbits.PCH0     	/* bit 0 */
#define PCH1      	PCLATHbits.PCH1     	/* bit 1 */
#define PCH2      	PCLATHbits.PCH2     	/* bit 2 */

// ----- INTE1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char INT1IE:1;
		unsigned char T1IE:1;
		unsigned char T2IE:1;
		unsigned char CMPIE:1;
		unsigned char :1;
		unsigned char INT0M:1;
		unsigned char INT1M:1;
		unsigned char GIE:1;
	};
} __INTE1bits_t;
extern volatile __INTE1bits_t __at(INTE1_ADDR) INTE1bits;

#define INT1IE    	INTE1bits.INT1IE    	/* bit 0 */
#define T1IE      	INTE1bits.T1IE      	/* bit 1 */
#define T2IE      	INTE1bits.T2IE      	/* bit 2 */
#define CMPIE     	INTE1bits.CMPIE     	/* bit 3 */
#define INT0M     	INTE1bits.INT0M     	/* bit 5 */
#define INT1M     	INTE1bits.INT1M     	/* bit 6 */
#define GIE       	INTE1bits.GIE       	/* bit 7 */

// ----- INTF1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char INT1IF:1;
		unsigned char T1IF:1;
		unsigned char T2IF:1;
		unsigned char CMPIF:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __INTF1bits_t;
extern volatile __INTF1bits_t __at(INTF1_ADDR) INTF1bits;

#define INT1IF    	INTF1bits.INT1IF    	/* bit 0 */
#define T1IF      	INTF1bits.T1IF      	/* bit 1 */
#define T2IF      	INTF1bits.T2IF      	/* bit 2 */
#define CMPIF     	INTF1bits.CMPIF     	/* bit 3 */

// ----- INTE0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T0IE:1;
		unsigned char KBIE:1;
		unsigned char INT0IE:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __INTE0bits_t;
extern volatile __INTE0bits_t __at(INTE0_ADDR) INTE0bits;

#define T0IE      	INTE0bits.T0IE      	/* bit 0 */
#define KBIE      	INTE0bits.KBIE      	/* bit 1 */
#define INT0IE    	INTE0bits.INT0IE    	/* bit 2 */

// ----- INTF0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T0IF:1;
		unsigned char KBIF:1;
		unsigned char INT0IF:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __INTF0bits_t;
extern volatile __INTF0bits_t __at(INTF0_ADDR) INTF0bits;

#define T0IF      	INTF0bits.T0IF      	/* bit 0 */
#define KBIF      	INTF0bits.KBIF      	/* bit 1 */
#define INT0IF    	INTF0bits.INT0IF    	/* bit 2 */

// ----- CMPCR0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char CMPOF:1;
		unsigned char CMPIM:1;
		unsigned char CMPOE:1;
		unsigned char CMPNV:1;
		unsigned char CMPNS:1;
		unsigned char CMPPS:1;
		unsigned char CMPHY:1;
		unsigned char CMPEN:1;
	};
} __CMPCR0bits_t;
extern volatile __CMPCR0bits_t __at(CMPCR0_ADDR) CMPCR0bits;

#define CMPOF     	CMPCR0bits.CMPOF    	/* bit 0 */
#define CMPIM     	CMPCR0bits.CMPIM    	/* bit 1 */
#define CMPOE     	CMPCR0bits.CMPOE    	/* bit 2 */
#define CMPNV     	CMPCR0bits.CMPNV    	/* bit 3 */
#define CMPNS     	CMPCR0bits.CMPNS    	/* bit 4 */
#define CMPPS     	CMPCR0bits.CMPPS    	/* bit 5 */
#define CMPHY     	CMPCR0bits.CMPHY    	/* bit 6 */
#define CMPEN     	CMPCR0bits.CMPEN    	/* bit 7 */

// ----- CMPCR1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char EVDVS0:1;
		unsigned char EVDVS1:1;
		unsigned char EVDVS2:1;
		unsigned char EVDVS3:1;
		unsigned char EVDVS4:1;
		unsigned char EVDVS5:1;
		unsigned char EVDIS0:1;
		unsigned char EVDIS1:1;
	};
} __CMPCR1bits_t;
extern volatile __CMPCR1bits_t __at(CMPCR1_ADDR) CMPCR1bits;

#define EVDVS0    	CMPCR1bits.EVDVS0   	/* bit 0 */
#define EVDVS1    	CMPCR1bits.EVDVS1   	/* bit 1 */
#define EVDVS2    	CMPCR1bits.EVDVS2   	/* bit 2 */
#define EVDVS3    	CMPCR1bits.EVDVS3   	/* bit 3 */
#define EVDVS4    	CMPCR1bits.EVDVS4   	/* bit 4 */
#define EVDVS5    	CMPCR1bits.EVDVS5   	/* bit 5 */
#define EVDIS0    	CMPCR1bits.EVDIS0   	/* bit 6 */
#define EVDIS1    	CMPCR1bits.EVDIS1   	/* bit 7 */

// ----- PUCON1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P10PU:1;
		unsigned char P11PU:1;
		unsigned char P12PU:1;
		unsigned char P13PU:1;
		unsigned char P14PU:1;
		unsigned char P15PU:1;
		unsigned char P16PU:1;
		unsigned char P17PU:1;
	};
} __PUCON1bits_t;
extern volatile __PUCON1bits_t __at(PUCON1_ADDR) PUCON1bits;

#define P10PU     	PUCON1bits.P10PU    	/* bit 0 */
#define P11PU     	PUCON1bits.P11PU    	/* bit 1 */
#define P12PU     	PUCON1bits.P12PU    	/* bit 2 */
#define P13PU     	PUCON1bits.P13PU    	/* bit 3 */
#define P14PU     	PUCON1bits.P14PU    	/* bit 4 */
#define P15PU     	PUCON1bits.P15PU    	/* bit 5 */
#define P16PU     	PUCON1bits.P16PU    	/* bit 6 */
#define P17PU     	PUCON1bits.P17PU    	/* bit 7 */

// ----- PDCONL Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P00PD:1;
		unsigned char P01PD:1;
		unsigned char P02PD:1;
		unsigned char P03PD:1;
		unsigned char P10PD:1;
		unsigned char P11PD:1;
		unsigned char P12PD:1;
		unsigned char P13PD:1;
	};
} __PDCONLbits_t;
extern volatile __PDCONLbits_t __at(PDCONL_ADDR) PDCONLbits;

#define P00PD     	PDCONLbits.P00PD    	/* bit 0 */
#define P01PD     	PDCONLbits.P01PD    	/* bit 1 */
#define P02PD     	PDCONLbits.P02PD    	/* bit 2 */
#define P03PD     	PDCONLbits.P03PD    	/* bit 3 */
#define P10PD     	PDCONLbits.P10PD    	/* bit 4 */
#define P11PD     	PDCONLbits.P11PD    	/* bit 5 */
#define P12PD     	PDCONLbits.P12PD    	/* bit 6 */
#define P13PD     	PDCONLbits.P13PD    	/* bit 7 */

// ----- ODCON Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P10OD:1;
		unsigned char P11OD:1;
		unsigned char P12OD:1;
		unsigned char P13OD:1;
		unsigned char P14OD:1;
		unsigned char P15OD:1;
		unsigned char P16OD:1;
		unsigned char P17OD:1;
	};
} __ODCONbits_t;
extern volatile __ODCONbits_t __at(ODCON_ADDR) ODCONbits;

#define P10OD     	ODCONbits.P10OD     	/* bit 0 */
#define P11OD     	ODCONbits.P11OD     	/* bit 1 */
#define P12OD     	ODCONbits.P12OD     	/* bit 2 */
#define P13OD     	ODCONbits.P13OD     	/* bit 3 */
#define P14OD     	ODCONbits.P14OD     	/* bit 4 */
#define P15OD     	ODCONbits.P15OD     	/* bit 5 */
#define P16OD     	ODCONbits.P16OD     	/* bit 6 */
#define P17OD     	ODCONbits.P17OD     	/* bit 7 */

// ----- DDR0 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char DDR00:1;
		unsigned char DDR01:1;
		unsigned char DDR02:1;
		unsigned char DDR03:1;
		unsigned char DDR04:1;
		unsigned char DDR05:1;
		unsigned char DDR06:1;
		unsigned char DDR07:1;
	};
} __DDR0bits_t;
extern volatile __DDR0bits_t __at(DDR0_ADDR) DDR0bits;

#define DDR00     	DDR0bits.DDR00      	/* bit 0 */
#define DDR01     	DDR0bits.DDR01      	/* bit 1 */
#define DDR02     	DDR0bits.DDR02      	/* bit 2 */
#define DDR03     	DDR0bits.DDR03      	/* bit 3 */
#define DDR04     	DDR0bits.DDR04      	/* bit 4 */
#define DDR05     	DDR0bits.DDR05      	/* bit 5 */
#define DDR06     	DDR0bits.DDR06      	/* bit 6 */
#define DDR07     	DDR0bits.DDR07      	/* bit 7 */

// ----- DDR1 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char DDR10:1;
		unsigned char DDR11:1;
		unsigned char DDR12:1;
		unsigned char DDR13:1;
		unsigned char DDR14:1;
		unsigned char DDR15:1;
		unsigned char DDR16:1;
		unsigned char DDR17:1;
	};
} __DDR1bits_t;
extern volatile __DDR1bits_t __at(DDR1_ADDR) DDR1bits;

#define DDR10     	DDR1bits.DDR10      	/* bit 0 */
#define DDR11     	DDR1bits.DDR11      	/* bit 1 */
#define DDR12     	DDR1bits.DDR12      	/* bit 2 */
#define DDR13     	DDR1bits.DDR13      	/* bit 3 */
#define DDR14     	DDR1bits.DDR14      	/* bit 4 */
#define DDR15     	DDR1bits.DDR15      	/* bit 5 */
#define DDR16     	DDR1bits.DDR16      	/* bit 6 */
#define DDR17     	DDR1bits.DDR17      	/* bit 7 */

// ----- DDR2 Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char DDR20:1;
		unsigned char DDR21:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __DDR2bits_t;
extern volatile __DDR2bits_t __at(DDR2_ADDR) DDR2bits;

#define DDR20     	DDR2bits.DDR20      	/* bit 0 */
#define DDR21     	DDR2bits.DDR21      	/* bit 1 */

// ----- PUCON0 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 P05PU:1;
		unsigned char P06PU:1;
		unsigned char P07PU:1;
	};
} __PUCON0bits_t;
extern volatile __PUCON0bits_t __at(PUCON0_ADDR) PUCON0bits;

#define P00PU     	PUCON0bits.P00PU    	/* bit 0 */
#define P01PU     	PUCON0bits.P01PU    	/* bit 1 */
#define P02PU     	PUCON0bits.P02PU    	/* bit 2 */
#define P03PU     	PUCON0bits.P03PU    	/* bit 3 */
#define P04PU     	PUCON0bits.P04PU    	/* bit 4 */
#define P05PU     	PUCON0bits.P05PU    	/* bit 5 */
#define P06PU     	PUCON0bits.P06PU    	/* bit 6 */
#define P07PU     	PUCON0bits.P07PU    	/* bit 7 */

// ----- PDCONH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P04PD:1;
		unsigned char P05PD:1;
		unsigned char P06PD:1;
		unsigned char P07PD:1;
		unsigned char P14PD:1;
		unsigned char P15PD:1;
		unsigned char P16PD:1;
		unsigned char P17PD:1;
	};
} __PDCONHbits_t;
extern volatile __PDCONHbits_t __at(PDCONH_ADDR) PDCONHbits;

#define P04PD     	PDCONHbits.P04PD    	/* bit 0 */
#define P05PD     	PDCONHbits.P05PD    	/* bit 1 */
#define P06PD     	PDCONHbits.P06PD    	/* bit 2 */
#define P07PD     	PDCONHbits.P07PD    	/* bit 3 */
#define P14PD     	PDCONHbits.P14PD    	/* bit 4 */
#define P15PD     	PDCONHbits.P15PD    	/* bit 5 */
#define P16PD     	PDCONHbits.P16PD    	/* bit 6 */
#define P17PD     	PDCONHbits.P17PD    	/* bit 7 */

// ----- PMOD Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P20PD:1;
		unsigned char P21PD:1;
		unsigned char P20PU:1;
		unsigned char P21PU:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char P2ST:1;
		unsigned char P0HST:1;
	};
} __PMODbits_t;
extern volatile __PMODbits_t __at(PMOD_ADDR) PMODbits;

#define P20PD     	PMODbits.P20PD      	/* bit 0 */
#define P21PD     	PMODbits.P21PD      	/* bit 1 */
#define P20PU     	PMODbits.P20PU      	/* bit 2 */
#define P21PU     	PMODbits.P21PU      	/* bit 3 */
#define P2ST      	PMODbits.P2ST       	/* bit 6 */
#define P0HST     	PMODbits.P0HST      	/* bit 7 */

// ----- P0ADCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char :1;
		unsigned char P02DC:1;
		unsigned char P03DC:1;
		unsigned char P04DC:1;
		unsigned char P05DC:1;
		unsigned char :1;
		unsigned char :1;
	};
} __P0ADCRbits_t;
extern volatile __P0ADCRbits_t __at(P0ADCR_ADDR) P0ADCRbits;

#define P02DC     	P0ADCRbits.P02DC    	/* bit 2 */
#define P03DC     	P0ADCRbits.P03DC    	/* bit 3 */
#define P04DC     	P0ADCRbits.P04DC    	/* bit 4 */
#define P05DC     	P0ADCRbits.P05DC    	/* bit 5 */

// ----- T1DATA Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1DATA0:1;
		unsigned char T1DATA1:1;
		unsigned char T1DATA2:1;
		unsigned char T1DATA3:1;
		unsigned char T1DATA4:1;
		unsigned char T1DATA5:1;
		unsigned char T1DATA6:1;
		unsigned char T1DATA7:1;
	};
} __T1DATAbits_t;
extern volatile __T1DATAbits_t __at(T1DATA_ADDR) T1DATAbits;

#define T1DATA0   	T1DATAbits.T1DATA0  	/* bit 0 */
#define T1DATA1   	T1DATAbits.T1DATA1  	/* bit 1 */
#define T1DATA2   	T1DATAbits.T1DATA2  	/* bit 2 */
#define T1DATA3   	T1DATAbits.T1DATA3  	/* bit 3 */
#define T1DATA4   	T1DATAbits.T1DATA4  	/* bit 4 */
#define T1DATA5   	T1DATAbits.T1DATA5  	/* bit 5 */
#define T1DATA6   	T1DATAbits.T1DATA6  	/* bit 6 */
#define T1DATA7   	T1DATAbits.T1DATA7  	/* bit 7 */

// ----- T1DATB Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1DATB0:1;
		unsigned char T1DATB1:1;
		unsigned char T1DATB2:1;
		unsigned char T1DATB3:1;
		unsigned char T1DATB4:1;
		unsigned char T1DATB5:1;
		unsigned char T1DATB6:1;
		unsigned char T1DATB7:1;
	};
} __T1DATBbits_t;
extern volatile __T1DATBbits_t __at(T1DATB_ADDR) T1DATBbits;

#define T1DATB0   	T1DATBbits.T1DATB0  	/* bit 0 */
#define T1DATB1   	T1DATBbits.T1DATB1  	/* bit 1 */
#define T1DATB2   	T1DATBbits.T1DATB2  	/* bit 2 */
#define T1DATB3   	T1DATBbits.T1DATB3  	/* bit 3 */
#define T1DATB4   	T1DATBbits.T1DATB4  	/* bit 4 */
#define T1DATB5   	T1DATBbits.T1DATB5  	/* bit 5 */
#define T1DATB6   	T1DATBbits.T1DATB6  	/* bit 6 */
#define T1DATB7   	T1DATBbits.T1DATB7  	/* bit 7 */

// ----- T1DATC Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1DATC0:1;
		unsigned char T1DATC1:1;
		unsigned char T1DATC2:1;
		unsigned char T1DATC3:1;
		unsigned char T1DATC4:1;
		unsigned char T1DATC5:1;
		unsigned char T1DATC6:1;
		unsigned char T1DATC7:1;
	};
} __T1DATCbits_t;
extern volatile __T1DATCbits_t __at(T1DATC_ADDR) T1DATCbits;

#define T1DATC0   	T1DATCbits.T1DATC0  	/* bit 0 */
#define T1DATC1   	T1DATCbits.T1DATC1  	/* bit 1 */
#define T1DATC2   	T1DATCbits.T1DATC2  	/* bit 2 */
#define T1DATC3   	T1DATCbits.T1DATC3  	/* bit 3 */
#define T1DATC4   	T1DATCbits.T1DATC4  	/* bit 4 */
#define T1DATC5   	T1DATCbits.T1DATC5  	/* bit 5 */
#define T1DATC6   	T1DATCbits.T1DATC6  	/* bit 6 */
#define T1DATC7   	T1DATCbits.T1DATC7  	/* bit 7 */

// ----- PWM1CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char :1;
		unsigned char PWM1CCE:1;
		unsigned char PWM1BCE:1;
		unsigned char PWM1ACE:1;
		unsigned char :1;
		unsigned char PWM1CMD:1;
		unsigned char PWM1BMD:1;
		unsigned char PWM1AMD:1;
	};
} __PWM1CRbits_t;
extern volatile __PWM1CRbits_t __at(PWM1CR_ADDR) PWM1CRbits;

#define PWM1CCE   	PWM1CRbits.PWM1CCE  	/* bit 1 */
#define PWM1BCE   	PWM1CRbits.PWM1BCE  	/* bit 2 */
#define PWM1ACE   	PWM1CRbits.PWM1ACE  	/* bit 3 */
#define PWM1CMD   	PWM1CRbits.PWM1CMD  	/* bit 5 */
#define PWM1BMD   	PWM1CRbits.PWM1BMD  	/* bit 6 */
#define PWM1AMD   	PWM1CRbits.PWM1AMD  	/* bit 7 */

// ----- T2DATAH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2DATA8:1;
		unsigned char T2DATA9:1;
		unsigned char T2DATA10:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __T2DATAHbits_t;
extern volatile __T2DATAHbits_t __at(T2DATAH_ADDR) T2DATAHbits;

#define T2DATA8   	T2DATAHbits.T2DATA8 	/* bit 0 */
#define T2DATA9   	T2DATAHbits.T2DATA9 	/* bit 1 */
#define T2DATA10  	T2DATAHbits.T2DATA10	/* bit 2 */

// ----- T2DATAL Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2DATA0:1;
		unsigned char T2DATA1:1;
		unsigned char T2DATA2:1;
		unsigned char T2DATA3:1;
		unsigned char T2DATA4:1;
		unsigned char T2DATA5:1;
		unsigned char T2DATA6:1;
		unsigned char T2DATA7:1;
	};
} __T2DATALbits_t;
extern volatile __T2DATALbits_t __at(T2DATAL_ADDR) T2DATALbits;

#define T2DATA0   	T2DATALbits.T2DATA0 	/* bit 0 */
#define T2DATA1   	T2DATALbits.T2DATA1 	/* bit 1 */
#define T2DATA2   	T2DATALbits.T2DATA2 	/* bit 2 */
#define T2DATA3   	T2DATALbits.T2DATA3 	/* bit 3 */
#define T2DATA4   	T2DATALbits.T2DATA4 	/* bit 4 */
#define T2DATA5   	T2DATALbits.T2DATA5 	/* bit 5 */
#define T2DATA6   	T2DATALbits.T2DATA6 	/* bit 6 */
#define T2DATA7   	T2DATALbits.T2DATA7 	/* bit 7 */

// ----- T2DATBH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2DATB8:1;
		unsigned char T2DATB9:1;
		unsigned char T2DATB10:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __T2DATBHbits_t;
extern volatile __T2DATBHbits_t __at(T2DATBH_ADDR) T2DATBHbits;

#define T2DATB8   	T2DATBHbits.T2DATB8 	/* bit 0 */
#define T2DATB9   	T2DATBHbits.T2DATB9 	/* bit 1 */
#define T2DATB10  	T2DATBHbits.T2DATB10	/* bit 2 */

// ----- T2DATBL Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2DATB0:1;
		unsigned char T2DATB1:1;
		unsigned char T2DATB2:1;
		unsigned char T2DATB3:1;
		unsigned char T2DATB4:1;
		unsigned char T2DATB5:1;
		unsigned char T2DATB6:1;
		unsigned char T2DATB7:1;
	};
} __T2DATBLbits_t;
extern volatile __T2DATBLbits_t __at(T2DATBL_ADDR) T2DATBLbits;

#define T2DATB0   	T2DATBLbits.T2DATB0 	/* bit 0 */
#define T2DATB1   	T2DATBLbits.T2DATB1 	/* bit 1 */
#define T2DATB2   	T2DATBLbits.T2DATB2 	/* bit 2 */
#define T2DATB3   	T2DATBLbits.T2DATB3 	/* bit 3 */
#define T2DATB4   	T2DATBLbits.T2DATB4 	/* bit 4 */
#define T2DATB5   	T2DATBLbits.T2DATB5 	/* bit 5 */
#define T2DATB6   	T2DATBLbits.T2DATB6 	/* bit 6 */
#define T2DATB7   	T2DATBLbits.T2DATB7 	/* bit 7 */

// ----- T1CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1PRS0:1;
		unsigned char T1PRS1:1;
		unsigned char T1PRS2:1;
		unsigned char T1CKS0:1;
		unsigned char T1CKS1:1;
		unsigned char PWM1BOS:1;
		unsigned char PWM1BNV:1;
		unsigned char PWM1ANV:1;
	};
} __T1CRbits_t;
extern volatile __T1CRbits_t __at(T1CR_ADDR) T1CRbits;

#define T1PRS0    	T1CRbits.T1PRS0     	/* bit 0 */
#define T1PRS1    	T1CRbits.T1PRS1     	/* bit 1 */
#define T1PRS2    	T1CRbits.T1PRS2     	/* bit 2 */
#define T1CKS0    	T1CRbits.T1CKS0     	/* bit 3 */
#define T1CKS1    	T1CRbits.T1CKS1     	/* bit 4 */
#define PWM1BOS   	T1CRbits.PWM1BOS    	/* bit 5 */
#define PWM1BNV   	T1CRbits.PWM1BNV    	/* bit 6 */
#define PWM1ANV   	T1CRbits.PWM1ANV    	/* 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 */

// ----- T1LOAD Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T1LOAD0:1;
		unsigned char T1LOAD1:1;
		unsigned char T1LOAD2:1;
		unsigned char T1LOAD3:1;
		unsigned char T1LOAD4:1;
		unsigned char T1LOAD5:1;
		unsigned char T1LOAD6:1;
		unsigned char T1LOAD7:1;
	};
} __T1LOADbits_t;
extern volatile __T1LOADbits_t __at(T1LOAD_ADDR) T1LOADbits;

#define T1LOAD0   	T1LOADbits.T1LOAD0  	/* bit 0 */
#define T1LOAD1   	T1LOADbits.T1LOAD1  	/* bit 1 */
#define T1LOAD2   	T1LOADbits.T1LOAD2  	/* bit 2 */
#define T1LOAD3   	T1LOADbits.T1LOAD3  	/* bit 3 */
#define T1LOAD4   	T1LOADbits.T1LOAD4  	/* bit 4 */
#define T1LOAD5   	T1LOADbits.T1LOAD5  	/* bit 5 */
#define T1LOAD6   	T1LOADbits.T1LOAD6  	/* bit 6 */
#define T1LOAD7   	T1LOADbits.T1LOAD7  	/* bit 7 */

// ----- T2CR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2PRS0:1;
		unsigned char T2PRS1:1;
		unsigned char T2PRS2:1;
		unsigned char T2CKS0:1;
		unsigned char T2CKS1:1;
		unsigned char :1;
		unsigned char PWM2BNV:1;
		unsigned char PWM2ANV:1;
	};
} __T2CRbits_t;
extern volatile __T2CRbits_t __at(T2CR_ADDR) T2CRbits;

#define T2PRS0    	T2CRbits.T2PRS0     	/* bit 0 */
#define T2PRS1    	T2CRbits.T2PRS1     	/* bit 1 */
#define T2PRS2    	T2CRbits.T2PRS2     	/* bit 2 */
#define T2CKS0    	T2CRbits.T2CKS0     	/* bit 3 */
#define T2CKS1    	T2CRbits.T2CKS1     	/* bit 4 */
#define PWM2BNV   	T2CRbits.PWM2BNV    	/* bit 6 */
#define PWM2ANV   	T2CRbits.PWM2ANV    	/* bit 7 */

// ----- T2LOADH Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2LOAD8:1;
		unsigned char T2LOAD9:1;
		unsigned char T2LOAD10:1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
		unsigned char :1;
	};
} __T2LOADHbits_t;
extern volatile __T2LOADHbits_t __at(T2LOADH_ADDR) T2LOADHbits;

#define T2LOAD8   	T2LOADHbits.T2LOAD8 	/* bit 0 */
#define T2LOAD9   	T2LOADHbits.T2LOAD9 	/* bit 1 */
#define T2LOAD10  	T2LOADHbits.T2LOAD10	/* bit 2 */

// ----- T2LOADL Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char T2LOAD0:1;
		unsigned char T2LOAD1:1;
		unsigned char T2LOAD2:1;
		unsigned char T2LOAD3:1;
		unsigned char T2LOAD4:1;
		unsigned char T2LOAD5:1;
		unsigned char T2LOAD6:1;
		unsigned char T2LOAD7:1;
	};
} __T2LOADLbits_t;
extern volatile __T2LOADLbits_t __at(T2LOADL_ADDR) T2LOADLbits;

#define T2LOAD0   	T2LOADLbits.T2LOAD0 	/* bit 0 */
#define T2LOAD1   	T2LOADLbits.T2LOAD1 	/* bit 1 */
#define T2LOAD2   	T2LOADLbits.T2LOAD2 	/* bit 2 */
#define T2LOAD3   	T2LOADLbits.T2LOAD3 	/* bit 3 */
#define T2LOAD4   	T2LOADLbits.T2LOAD4 	/* bit 4 */
#define T2LOAD5   	T2LOADLbits.T2LOAD5 	/* bit 5 */
#define T2LOAD6   	T2LOADLbits.T2LOAD6 	/* bit 6 */
#define T2LOAD7   	T2LOADLbits.T2LOAD7 	/* bit 7 */

// ----- P0KBCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P00KE:1;
		unsigned char P01KE:1;
		unsigned char P02KE:1;
		unsigned char P03KE:1;
		unsigned char P04KE:1;
		unsigned char P05KE:1;
		unsigned char P06KE:1;
		unsigned char P07KE:1;
	};
} __P0KBCRbits_t;
extern volatile __P0KBCRbits_t __at(P0KBCR_ADDR) P0KBCRbits;

#define P00KE     	P0KBCRbits.P00KE    	/* bit 0 */
#define P01KE     	P0KBCRbits.P01KE    	/* bit 1 */
#define P02KE     	P0KBCRbits.P02KE    	/* bit 2 */
#define P03KE     	P0KBCRbits.P03KE    	/* bit 3 */
#define P04KE     	P0KBCRbits.P04KE    	/* bit 4 */
#define P05KE     	P0KBCRbits.P05KE    	/* bit 5 */
#define P06KE     	P0KBCRbits.P06KE    	/* bit 6 */
#define P07KE     	P0KBCRbits.P07KE    	/* bit 7 */

// ----- P1KBCR Bits --------------------------------------------
typedef union {
	 struct {
		unsigned char P10KE:1;
		unsigned char P11KE:1;
		unsigned char P12KE:1;
		unsigned char P13KE:1;
		unsigned char P14KE:1;
		unsigned char P15KE:1;
		unsigned char P16KE:1;
		unsigned char P17KE:1;
	};
} __P1KBCRbits_t;
extern volatile __P1KBCRbits_t __at(P1KBCR_ADDR) P1KBCRbits;

#define P10KE     	P1KBCRbits.P10KE    	/* bit 0 */
#define P11KE     	P1KBCRbits.P11KE    	/* bit 1 */
#define P12KE     	P1KBCRbits.P12KE    	/* bit 2 */
#define P13KE     	P1KBCRbits.P13KE    	/* bit 3 */
#define P14KE     	P1KBCRbits.P14KE    	/* bit 4 */
#define P15KE     	P1KBCRbits.P15KE    	/* bit 5 */
#define P16KE     	P1KBCRbits.P16KE    	/* bit 6 */
#define P17KE     	P1KBCRbits.P17KE    	/* bit 7 */

#endif
