//
// Register Declarations for Microchip 12F1822 Processor
//
//
// This header file was automatically generated by:
//
//	inc2h.pl V4850
//
//	Copyright (c) 2002, Kevin L. Pauba, All Rights Reserved
//
//	SDCC is licensed under the GNU Public license (GPL) v2.  Note that
//	this license covers the code to the compiler and other executables,
//	but explicitly does not cover any code or objects generated by sdcc.
//	We have not yet decided on a license for the run time libraries, but
//	it will not put any requirements on code linked against it. See:
// 
//	http://www.gnu.org/copyleft/gpl/html
//
//	See http://sdcc.sourceforge.net/ for the latest information on sdcc.
//
// 
#ifndef P12F1822_H
#define P12F1822_H

//
// Register addresses.
//
#define INDF0_ADDR	0x0000
#define INDF1_ADDR	0x0001
#define PCL_ADDR	0x0002
#define STATUS_ADDR	0x0003
#define FSR0_ADDR	0x0004
#define FSR0L_ADDR	0x0004
#define FSR0H_ADDR	0x0005
#define FSR1_ADDR	0x0006
#define FSR1L_ADDR	0x0006
#define FSR1H_ADDR	0x0007
#define BSR_ADDR	0x0008
#define WREG_ADDR	0x0009
#define PCLATH_ADDR	0x000A
#define INTCON_ADDR	0x000B
#define PORTA_ADDR	0x000C
#define PIR1_ADDR	0x0011
#define PIR2_ADDR	0x0012
#define TMR0_ADDR	0x0015
#define TMR1_ADDR	0x0016
#define TMR1L_ADDR	0x0016
#define TMR1H_ADDR	0x0017
#define T1CON_ADDR	0x0018
#define T1GCON_ADDR	0x0019
#define TMR2_ADDR	0x001A
#define PR2_ADDR	0x001B
#define T2CON_ADDR	0x001C
#define CPSCON0_ADDR	0x001E
#define CPSCON1_ADDR	0x001F
#define TRISA_ADDR	0x008C
#define PIE1_ADDR	0x0091
#define PIE2_ADDR	0x0092
#define OPTION_REG_ADDR	0x0095
#define PCON_ADDR	0x0096
#define WDTCON_ADDR	0x0097
#define OSCTUNE_ADDR	0x0098
#define OSCCON_ADDR	0x0099
#define OSCSTAT_ADDR	0x009A
#define ADRES_ADDR	0x009B
#define ADRESL_ADDR	0x009B
#define ADRESH_ADDR	0x009C
#define ADCON0_ADDR	0x009D
#define ADCON1_ADDR	0x009E
#define LATA_ADDR	0x010C
#define CM1CON0_ADDR	0x0111
#define CM1CON1_ADDR	0x0112
#define CMOUT_ADDR	0x0115
#define BORCON_ADDR	0x0116
#define FVRCON_ADDR	0x0117
#define DACCON0_ADDR	0x0118
#define DACCON1_ADDR	0x0119
#define SRCON0_ADDR	0x011A
#define SRCON1_ADDR	0x011B
#define APFCON_ADDR	0x011D
#define APFCON0_ADDR	0x011D
#define ANSELA_ADDR	0x018C
#define EEADR_ADDR	0x0191
#define EEADRL_ADDR	0x0191
#define EEADRH_ADDR	0x0192
#define EEDAT_ADDR	0x0193
#define EEDATL_ADDR	0x0193
#define EEDATH_ADDR	0x0194
#define EECON1_ADDR	0x0195
#define EECON2_ADDR	0x0196
#define RCREG_ADDR	0x0199
#define TXREG_ADDR	0x019A
#define SPBRG_ADDR	0x019B
#define SPBRGL_ADDR	0x019B
#define SPBRGH_ADDR	0x019C
#define RCSTA_ADDR	0x019D
#define TXSTA_ADDR	0x019E
#define BAUDCON_ADDR	0x019F
#define WPUA_ADDR	0x020C
#define SSP1BUF_ADDR	0x0211
#define SSPBUF_ADDR	0x0211
#define SSP1ADD_ADDR	0x0212
#define SSPADD_ADDR	0x0212
#define SSP1MSK_ADDR	0x0213
#define SSPMSK_ADDR	0x0213
#define SSP1STAT_ADDR	0x0214
#define SSPSTAT_ADDR	0x0214
#define SSP1CON1_ADDR	0x0215
#define SSPCON_ADDR	0x0215
#define SSPCON1_ADDR	0x0215
#define SSP1CON2_ADDR	0x0216
#define SSPCON2_ADDR	0x0216
#define SSP1CON3_ADDR	0x0217
#define SSPCON3_ADDR	0x0217
#define CCPR1L_ADDR	0x0291
#define CCPR1H_ADDR	0x0292
#define CCP1CON_ADDR	0x0293
#define PWM1CON_ADDR	0x0294
#define CCP1AS_ADDR	0x0295
#define ECCP1AS_ADDR	0x0295
#define PSTR1CON_ADDR	0x0296
#define IOCAP_ADDR	0x0391
#define IOCAN_ADDR	0x0392
#define IOCAF_ADDR	0x0393
#define CLKRCON_ADDR	0x039A
#define MDCON_ADDR	0x039C
#define MDSRC_ADDR	0x039D
#define MDCARL_ADDR	0x039E
#define MDCARH_ADDR	0x039F
#define STATUS_SHAD_ADDR	0x0FE4
#define WREG_SHAD_ADDR	0x0FE5
#define BSR_SHAD_ADDR	0x0FE6
#define PCLATH_SHAD_ADDR	0x0FE7
#define FSR0L_SHAD_ADDR	0x0FE8
#define FSR0H_SHAD_ADDR	0x0FE9
#define FSR1L_SHAD_ADDR	0x0FEA
#define FSR1H_SHAD_ADDR	0x0FEB
#define STKPTR_ADDR	0x0FED
#define TOSL_ADDR	0x0FEE
#define TOSH_ADDR	0x0FEF

//
// Memory organization.
//



//         LIST

//==========================================================================
//  MPASM PIC12F1822 processor include
// 
//  (c) Copyright 1999-2011 Microchip Technology, All rights reserved
//==========================================================================

//         NOLIST

//==========================================================================
//  This header file defines configurations, registers, and other useful
//  bits of information for the PIC12F1822 microcontroller.  These names
//  are taken to match the data sheets as closely as possible.
//
//  Note that the processor must be selected before this file is included.
//  The processor may be selected the following ways:
//
//       1. Command line switch:
//               C:\MPASM MYFILE.ASM /PIC12F1822
//       2. LIST directive in the source file
//               LIST   P=PIC12F1822
//       3. Processor Type entry in the MPASM full-screen interface
//       4. Setting the processor in the MPLAB Project Dialog
//==========================================================================

//==========================================================================
//
//       Verify Processor
//
//==========================================================================
//        IFNDEF __12F1822
//            MESSG "Processor-header file mismatch.  Verify selected processor."
//         ENDIF



//==========================================================================
//
//       Register Definitions
//
//==========================================================================

#define W                    0x0000
#define F                    0x0001

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

//-----Bank0------------------
extern __sfr  __at (INDF0_ADDR)                   INDF0;
extern __sfr  __at (INDF1_ADDR)                   INDF1;
extern __sfr  __at (PCL_ADDR)                     PCL;
extern __sfr  __at (STATUS_ADDR)                  STATUS;
extern __sfr  __at (FSR0_ADDR)                    FSR0;
extern __sfr  __at (FSR0L_ADDR)                   FSR0L;
extern __sfr  __at (FSR0H_ADDR)                   FSR0H;
extern __sfr  __at (FSR1_ADDR)                    FSR1;
extern __sfr  __at (FSR1L_ADDR)                   FSR1L;
extern __sfr  __at (FSR1H_ADDR)                   FSR1H;
extern __sfr  __at (BSR_ADDR)                     BSR;
extern __sfr  __at (WREG_ADDR)                    WREG;
extern __sfr  __at (PCLATH_ADDR)                  PCLATH;
extern __sfr  __at (INTCON_ADDR)                  INTCON;
extern __sfr  __at (PORTA_ADDR)                   PORTA;
extern __sfr  __at (PIR1_ADDR)                    PIR1;
extern __sfr  __at (PIR2_ADDR)                    PIR2;
extern __sfr  __at (TMR0_ADDR)                    TMR0;
extern __sfr  __at (TMR1_ADDR)                    TMR1;
extern __sfr  __at (TMR1L_ADDR)                   TMR1L;
extern __sfr  __at (TMR1H_ADDR)                   TMR1H;
extern __sfr  __at (T1CON_ADDR)                   T1CON;
extern __sfr  __at (T1GCON_ADDR)                  T1GCON;
extern __sfr  __at (TMR2_ADDR)                    TMR2;
extern __sfr  __at (PR2_ADDR)                     PR2;
extern __sfr  __at (T2CON_ADDR)                   T2CON;
extern __sfr  __at (CPSCON0_ADDR)                 CPSCON0;
extern __sfr  __at (CPSCON1_ADDR)                 CPSCON1;

//-----Bank1------------------
extern __sfr  __at (TRISA_ADDR)                   TRISA;
extern __sfr  __at (PIE1_ADDR)                    PIE1;
extern __sfr  __at (PIE2_ADDR)                    PIE2;
extern __sfr  __at (OPTION_REG_ADDR)              OPTION_REG;
extern __sfr  __at (PCON_ADDR)                    PCON;
extern __sfr  __at (WDTCON_ADDR)                  WDTCON;
extern __sfr  __at (OSCTUNE_ADDR)                 OSCTUNE;
extern __sfr  __at (OSCCON_ADDR)                  OSCCON;
extern __sfr  __at (OSCSTAT_ADDR)                 OSCSTAT;
extern __sfr  __at (ADRES_ADDR)                   ADRES;
extern __sfr  __at (ADRESL_ADDR)                  ADRESL;
extern __sfr  __at (ADRESH_ADDR)                  ADRESH;
extern __sfr  __at (ADCON0_ADDR)                  ADCON0;
extern __sfr  __at (ADCON1_ADDR)                  ADCON1;

//-----Bank2------------------
extern __sfr  __at (LATA_ADDR)                    LATA;
extern __sfr  __at (CM1CON0_ADDR)                 CM1CON0;
extern __sfr  __at (CM1CON1_ADDR)                 CM1CON1;
extern __sfr  __at (CMOUT_ADDR)                   CMOUT;
extern __sfr  __at (BORCON_ADDR)                  BORCON;
extern __sfr  __at (FVRCON_ADDR)                  FVRCON;
extern __sfr  __at (DACCON0_ADDR)                 DACCON0;
extern __sfr  __at (DACCON1_ADDR)                 DACCON1;
extern __sfr  __at (SRCON0_ADDR)                  SRCON0;
extern __sfr  __at (SRCON1_ADDR)                  SRCON1;
extern __sfr  __at (APFCON_ADDR)                  APFCON;
extern __sfr  __at (APFCON0_ADDR)                 APFCON0;

//-----Bank3------------------
extern __sfr  __at (ANSELA_ADDR)                  ANSELA;
extern __sfr  __at (EEADR_ADDR)                   EEADR;
extern __sfr  __at (EEADRL_ADDR)                  EEADRL;
extern __sfr  __at (EEADRH_ADDR)                  EEADRH;
extern __sfr  __at (EEDAT_ADDR)                   EEDAT;
extern __sfr  __at (EEDATL_ADDR)                  EEDATL;
extern __sfr  __at (EEDATH_ADDR)                  EEDATH;
extern __sfr  __at (EECON1_ADDR)                  EECON1;
extern __sfr  __at (EECON2_ADDR)                  EECON2;
extern __sfr  __at (RCREG_ADDR)                   RCREG;
extern __sfr  __at (TXREG_ADDR)                   TXREG;
extern __sfr  __at (SPBRG_ADDR)                   SPBRG;
extern __sfr  __at (SPBRGL_ADDR)                  SPBRGL;
extern __sfr  __at (SPBRGH_ADDR)                  SPBRGH;
extern __sfr  __at (RCSTA_ADDR)                   RCSTA;
extern __sfr  __at (TXSTA_ADDR)                   TXSTA;
extern __sfr  __at (BAUDCON_ADDR)                 BAUDCON;

//-----Bank4------------------
extern __sfr  __at (WPUA_ADDR)                    WPUA;
extern __sfr  __at (SSP1BUF_ADDR)                 SSP1BUF;
extern __sfr  __at (SSPBUF_ADDR)                  SSPBUF;
extern __sfr  __at (SSP1ADD_ADDR)                 SSP1ADD;
extern __sfr  __at (SSPADD_ADDR)                  SSPADD;
extern __sfr  __at (SSP1MSK_ADDR)                 SSP1MSK;
extern __sfr  __at (SSPMSK_ADDR)                  SSPMSK;
extern __sfr  __at (SSP1STAT_ADDR)                SSP1STAT;
extern __sfr  __at (SSPSTAT_ADDR)                 SSPSTAT;
extern __sfr  __at (SSP1CON1_ADDR)                SSP1CON1;
extern __sfr  __at (SSPCON_ADDR)                  SSPCON;
extern __sfr  __at (SSPCON1_ADDR)                 SSPCON1;
extern __sfr  __at (SSP1CON2_ADDR)                SSP1CON2;
extern __sfr  __at (SSPCON2_ADDR)                 SSPCON2;
extern __sfr  __at (SSP1CON3_ADDR)                SSP1CON3;
extern __sfr  __at (SSPCON3_ADDR)                 SSPCON3;

//-----Bank5------------------
extern __sfr  __at (CCPR1L_ADDR)                  CCPR1L;
extern __sfr  __at (CCPR1H_ADDR)                  CCPR1H;
extern __sfr  __at (CCP1CON_ADDR)                 CCP1CON;
extern __sfr  __at (PWM1CON_ADDR)                 PWM1CON;
extern __sfr  __at (CCP1AS_ADDR)                  CCP1AS;
extern __sfr  __at (ECCP1AS_ADDR)                 ECCP1AS;
extern __sfr  __at (PSTR1CON_ADDR)                PSTR1CON;

//-----Bank7------------------
extern __sfr  __at (IOCAP_ADDR)                   IOCAP;
extern __sfr  __at (IOCAN_ADDR)                   IOCAN;
extern __sfr  __at (IOCAF_ADDR)                   IOCAF;
extern __sfr  __at (CLKRCON_ADDR)                 CLKRCON;
extern __sfr  __at (MDCON_ADDR)                   MDCON;
extern __sfr  __at (MDSRC_ADDR)                   MDSRC;
extern __sfr  __at (MDCARL_ADDR)                  MDCARL;
extern __sfr  __at (MDCARH_ADDR)                  MDCARH;

//-----Bank31------------------
extern __sfr  __at (STATUS_SHAD_ADDR)             STATUS_SHAD;
extern __sfr  __at (WREG_SHAD_ADDR)               WREG_SHAD;
extern __sfr  __at (BSR_SHAD_ADDR)                BSR_SHAD;
extern __sfr  __at (PCLATH_SHAD_ADDR)             PCLATH_SHAD;
extern __sfr  __at (FSR0L_SHAD_ADDR)              FSR0L_SHAD;
extern __sfr  __at (FSR0H_SHAD_ADDR)              FSR0H_SHAD;
extern __sfr  __at (FSR1L_SHAD_ADDR)              FSR1L_SHAD;
extern __sfr  __at (FSR1H_SHAD_ADDR)              FSR1H_SHAD;
extern __sfr  __at (STKPTR_ADDR)                  STKPTR;
extern __sfr  __at (TOSL_ADDR)                    TOSL;
extern __sfr  __at (TOSH_ADDR)                    TOSH;

//----- STATUS Bits -----------------------------------------------------


//----- BSR Bits -----------------------------------------------------



//----- INTCON Bits -----------------------------------------------------



//----- PORTA Bits -----------------------------------------------------











//----- PIR1 Bits -----------------------------------------------------


//----- PIR2 Bits -----------------------------------------------------


//----- T1CON Bits -----------------------------------------------------



//----- T1GCON Bits -----------------------------------------------------



//----- T2CON Bits -----------------------------------------------------



//----- CPSCON0 Bits -----------------------------------------------------



//----- CPSCON1 Bits -----------------------------------------------------



//----- TRISA Bits -----------------------------------------------------


//----- PIE1 Bits -----------------------------------------------------


//----- PIE2 Bits -----------------------------------------------------


//----- OPTION_REG Bits -----------------------------------------------------



//----- PCON Bits -----------------------------------------------------


//----- WDTCON Bits -----------------------------------------------------



//----- OSCTUNE Bits -----------------------------------------------------



//----- OSCCON Bits -----------------------------------------------------



//----- OSCSTAT Bits -----------------------------------------------------


//----- ADCON0 Bits -----------------------------------------------------





//----- ADCON1 Bits -----------------------------------------------------



//----- LATA Bits -----------------------------------------------------


//----- CM1CON0 Bits -----------------------------------------------------


//----- CM1CON1 Bits -----------------------------------------------------



//----- CMOUT Bits -----------------------------------------------------


//----- BORCON Bits -----------------------------------------------------


//----- FVRCON Bits -----------------------------------------------------



//----- DACCON0 Bits -----------------------------------------------------



//----- DACCON1 Bits -----------------------------------------------------



//----- SRCON0 Bits -----------------------------------------------------



//----- SRCON1 Bits -----------------------------------------------------


//----- APFCON Bits -----------------------------------------------------



//----- APFCON0 Bits -----------------------------------------------------



//----- ANSELA Bits -----------------------------------------------------



//----- EECON1 Bits -----------------------------------------------------


//----- RCSTA Bits -----------------------------------------------------


//----- TXSTA Bits -----------------------------------------------------


//----- BAUDCON Bits -----------------------------------------------------


//----- WPUA Bits -----------------------------------------------------



//----- SSP1STAT Bits -----------------------------------------------------


//----- SSPSTAT Bits -----------------------------------------------------


//----- SSP1CON1 Bits -----------------------------------------------------



//----- SSPCON Bits -----------------------------------------------------



//----- SSPCON1 Bits -----------------------------------------------------



//----- SSP1CON2 Bits -----------------------------------------------------


//----- SSPCON2 Bits -----------------------------------------------------


//----- SSP1CON3 Bits -----------------------------------------------------


//----- SSPCON3 Bits -----------------------------------------------------


//----- CCP1CON Bits -----------------------------------------------------



//----- PWM1CON Bits -----------------------------------------------------



//----- CCP1AS Bits -----------------------------------------------------



//----- ECCP1AS Bits -----------------------------------------------------



//----- PSTR1CON Bits -----------------------------------------------------


//----- IOCAP Bits -----------------------------------------------------



//----- IOCAN Bits -----------------------------------------------------



//----- IOCAF Bits -----------------------------------------------------



//----- CLKRCON Bits -----------------------------------------------------



//----- MDCON Bits -----------------------------------------------------


//----- MDSRC Bits -----------------------------------------------------



//----- MDCARL Bits -----------------------------------------------------



//----- MDCARH Bits -----------------------------------------------------



//----- STATUS_SHAD Bits -----------------------------------------------------



//==========================================================================
//
//       RAM Definitions
//
//==========================================================================
//        __MAXRAM  H'0FFF'
//        __BADRAM  H'000D'-H'0010'
//        __BADRAM  H'0013'-H'0014'
//        __BADRAM  H'001D'
//        __BADRAM  H'008D'-H'0090'
//        __BADRAM  H'0093'-H'0094'
//        __BADRAM  H'009F'
//        __BADRAM  H'00C0'-H'00EF'
//        __BADRAM  H'010D'-H'0110'
//        __BADRAM  H'0113'-H'0114'
//        __BADRAM  H'011C'
//        __BADRAM  H'011E'-H'011F'
//        __BADRAM  H'0120'-H'016F'
//        __BADRAM  H'018D'-H'0190'
//        __BADRAM  H'0197'-H'0198'
//        __BADRAM  H'01A0'-H'01EF'
//        __BADRAM  H'020D'-H'0210'
//        __BADRAM  H'0218'-H'021F'
//        __BADRAM  H'0220'-H'026F'
//        __BADRAM  H'028C'-H'0290'
//        __BADRAM  H'0297'-H'029F'
//        __BADRAM  H'02A0'-H'02EF'
//        __BADRAM  H'030C'-H'031F'
//        __BADRAM  H'0320'-H'036F'
//        __BADRAM  H'038C'-H'0390'
//        __BADRAM  H'0394'-H'0399'
//        __BADRAM  H'039B'
//        __BADRAM  H'03A0'-H'03EF'
//        __BADRAM  H'040C'-H'041F'
//        __BADRAM  H'0420'-H'046F'
//        __BADRAM  H'048C'-H'049F'
//        __BADRAM  H'04A0'-H'04EF'
//        __BADRAM  H'050C'-H'051F'
//        __BADRAM  H'0520'-H'056F'
//        __BADRAM  H'058C'-H'059F'
//        __BADRAM  H'05A0'-H'05EF'
//        __BADRAM  H'060C'-H'061F'
//        __BADRAM  H'0620'-H'066F'
//        __BADRAM  H'068C'-H'069F'
//        __BADRAM  H'06A0'-H'06EF'
//        __BADRAM  H'070C'-H'071F'
//        __BADRAM  H'0720'-H'076F'
//        __BADRAM  H'078C'-H'079F'
//        __BADRAM  H'07A0'-H'07EF'
//        __BADRAM  H'080C'-H'081F'
//        __BADRAM  H'0820'-H'086F'
//        __BADRAM  H'088C'-H'089F'
//        __BADRAM  H'08A0'-H'08EF'
//        __BADRAM  H'090C'-H'091F'
//        __BADRAM  H'0920'-H'096F'
//        __BADRAM  H'098C'-H'099F'
//        __BADRAM  H'09A0'-H'09EF'
//        __BADRAM  H'0A0C'-H'0A1F'
//        __BADRAM  H'0A20'-H'0A6F'
//        __BADRAM  H'0A8C'-H'0A9F'
//        __BADRAM  H'0AA0'-H'0AEF'
//        __BADRAM  H'0B0C'-H'0B1F'
//        __BADRAM  H'0B20'-H'0B6F'
//        __BADRAM  H'0B8C'-H'0B9F'
//        __BADRAM  H'0BA0'-H'0BEF'
//        __BADRAM  H'0C0C'-H'0C1F'
//        __BADRAM  H'0C20'-H'0C6F'
//        __BADRAM  H'0C8C'-H'0C9F'
//        __BADRAM  H'0CA0'-H'0CEF'
//        __BADRAM  H'0D0C'-H'0D1F'
//        __BADRAM  H'0D20'-H'0D6F'
//        __BADRAM  H'0D8C'-H'0D9F'
//        __BADRAM  H'0DA0'-H'0DEF'
//        __BADRAM  H'0E0C'-H'0E1F'
//        __BADRAM  H'0E20'-H'0E6F'
//        __BADRAM  H'0E8C'-H'0E9F'
//        __BADRAM  H'0EA0'-H'0EEF'
//        __BADRAM  H'0F0C'-H'0F1F'
//        __BADRAM  H'0F20'-H'0F6F'
//        __BADRAM  H'0F8C'-H'0FE3'
//        __BADRAM  H'0FEC'

//==========================================================================
//
//       Configuration Bits
//
//   NAME            Address
//   CONFIG1           8007h
//   CONFIG2           8008h
//
//==========================================================================

// The following is an assignment of address values for all of the
// configuration registers for the purpose of table reads
#define _CONFIG1             0x8007
#define _CONFIG2             0x8008

//----- CONFIG1 Options --------------------------------------------------
#define _FOSC_LP             0xFFF8    // LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins
#define _FOSC_XT             0xFFF9    // XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins
#define _FOSC_HS             0xFFFA    // HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins
#define _FOSC_EXTRC          0xFFFB    // EXTRC oscillator: External RC circuit connected to CLKIN pin
#define _FOSC_INTOSC         0xFFFC    // INTOSC oscillator: I/O function on CLKIN pin
#define _FOSC_ECL            0xFFFD    // ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin
#define _FOSC_ECM            0xFFFE    // ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin
#define _FOSC_ECH            0xFFFF    // ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin

#define _WDTE_OFF            0xFFE7    // WDT disabled
#define _WDTE_SWDTEN         0xFFEF    // WDT controlled by the SWDTEN bit in the WDTCON register
#define _WDTE_NSLEEP         0xFFF7    // WDT enabled while running and disabled in Sleep
#define _WDTE_ON             0xFFFF    // WDT enabled

#define _PWRTE_ON            0xFFDF    // PWRT enabled
#define _PWRTE_OFF           0xFFFF    // PWRT disabled

#define _MCLRE_OFF           0xFFBF    // MCLR/VPP pin function is digital input
#define _MCLRE_ON            0xFFFF    // MCLR/VPP pin function is MCLR

#define _CP_ON               0xFF7F    // Program memory code protection is enabled
#define _CP_OFF              0xFFFF    // Program memory code protection is disabled

#define _CPD_ON              0xFEFF    // Data memory code protection is enabled
#define _CPD_OFF             0xFFFF    // Data memory code protection is disabled

#define _BOREN_OFF           0xF9FF    // Brown-out Reset disabled
#define _BOREN_SBODEN        0xFBFF    // Brown-out Reset controlled by the SBOREN bit in the BORCON register
#define _BOREN_NSLEEP        0xFDFF    // Brown-out Reset enabled while running and disabled in Sleep
#define _BOREN_ON            0xFFFF    // Brown-out Reset enabled

#define _CLKOUTEN_ON         0xF7FF    // CLKOUT function is enabled on the CLKOUT pin
#define _CLKOUTEN_OFF        0xFFFF    // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin

#define _IESO_OFF            0xEFFF    // Internal/External Switchover mode is disabled
#define _IESO_ON             0xFFFF    // Internal/External Switchover mode is enabled

#define _FCMEN_OFF           0xDFFF    // Fail-Safe Clock Monitor is disabled
#define _FCMEN_ON            0xFFFF    // Fail-Safe Clock Monitor is enabled

//----- CONFIG2 Options --------------------------------------------------
#define _WRT_ALL             0xFFFC    // 000h to 7FFh write protected, no addresses may be modified by EECON control
#define _WRT_HALF            0xFFFD    // 000h to 3FFh write protected, 400h to 7FFh may be modified by EECON control
#define _WRT_BOOT            0xFFFE    // 000h to 1FFh write protected, 200h to 7FFh may be modified by EECON control
#define _WRT_OFF             0xFFFF    // Write protection off

#define _PLLEN_OFF           0xFEFF    // 4x PLL disabled
#define _PLLEN_ON            0xFFFF    // 4x PLL enabled

#define _STVREN_OFF          0xFDFF    // Stack Overflow or Underflow will not cause a Reset
#define _STVREN_ON           0xFFFF    // Stack Overflow or Underflow will cause a Reset

#define _BORV_HI             0xFBFF    // Brown-out Reset Voltage (VBOR) set to 2.7V
#define _BORV_LO             0xFFFF    // Brown-out Reset Voltage (VBOR) set to 1.9V
#define _BORV_19             0xFFFF    // Brown-out Reset Voltage (VBOR) set to 1.9V

#define _LVP_OFF             0xDFFF    // High-voltage on MCLR/VPP must be used for programming
#define _LVP_ON              0xFFFF    // Low-voltage programming enabled

//----- DEVID Equates --------------------------------------------------
#define _DEVID1              0x8006

//----- IDLOC Equates --------------------------------------------------
#define _IDLOC0              0x8000
#define _IDLOC1              0x8001
#define _IDLOC2              0x8002
#define _IDLOC3              0x8003

//         LIST

// ----- ADCON0 bits --------------------
typedef union {
  struct {
    unsigned char ADON:1;
    unsigned char GO_NOT_DONE:1;
    unsigned char CHS0:1;
    unsigned char CHS1:1;
    unsigned char CHS2:1;
    unsigned char CHS3:1;
    unsigned char CHS4:1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char ADGO:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char GO:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char NOT_DONE:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __ADCON0bits_t;
extern volatile __ADCON0bits_t __at(ADCON0_ADDR) ADCON0bits;

// ----- ADCON1 bits --------------------
typedef union {
  struct {
    unsigned char ADPREF0:1;
    unsigned char ADPREF1:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char ADCS0:1;
    unsigned char ADCS1:1;
    unsigned char ADCS2:1;
    unsigned char ADFM:1;
  };
} __ADCON1bits_t;
extern volatile __ADCON1bits_t __at(ADCON1_ADDR) ADCON1bits;

// ----- ANSELA bits --------------------
typedef union {
  struct {
    unsigned char ANSA0:1;
    unsigned char ANSA1:1;
    unsigned char ANSA2:1;
    unsigned char :1;
    unsigned char ANSA4:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __ANSELAbits_t;
extern volatile __ANSELAbits_t __at(ANSELA_ADDR) ANSELAbits;

// ----- APFCON bits --------------------
typedef union {
  struct {
    unsigned char CCP1SEL:1;
    unsigned char P1BSEL:1;
    unsigned char TXCKSEL:1;
    unsigned char T1GSEL:1;
    unsigned char :1;
    unsigned char SSSEL:1;
    unsigned char SDOSEL:1;
    unsigned char RXDTSEL:1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char SS1SEL:1;
    unsigned char SDO1SEL:1;
    unsigned char :1;
  };
} __APFCONbits_t;
extern volatile __APFCONbits_t __at(APFCON_ADDR) APFCONbits;

// ----- APFCON0 bits --------------------
typedef union {
  struct {
    unsigned char CCP1SEL:1;
    unsigned char P1BSEL:1;
    unsigned char TXCKSEL:1;
    unsigned char T1GSEL:1;
    unsigned char :1;
    unsigned char SSSEL:1;
    unsigned char SDOSEL:1;
    unsigned char RXDTSEL:1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char SS1SEL:1;
    unsigned char SDO1SEL:1;
    unsigned char :1;
  };
} __APFCON0bits_t;
extern volatile __APFCON0bits_t __at(APFCON0_ADDR) APFCON0bits;

// ----- BAUDCON bits --------------------
typedef union {
  struct {
    unsigned char ABDEN:1;
    unsigned char WUE:1;
    unsigned char :1;
    unsigned char BRG16:1;
    unsigned char SCKP:1;
    unsigned char :1;
    unsigned char RCIDL:1;
    unsigned char ABDOVF:1;
  };
} __BAUDCONbits_t;
extern volatile __BAUDCONbits_t __at(BAUDCON_ADDR) BAUDCONbits;

// ----- BORCON bits --------------------
typedef union {
  struct {
    unsigned char BORRDY:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char SBOREN:1;
  };
} __BORCONbits_t;
extern volatile __BORCONbits_t __at(BORCON_ADDR) BORCONbits;

// ----- BSR bits --------------------
typedef union {
  struct {
    unsigned char BSR0:1;
    unsigned char BSR1:1;
    unsigned char BSR2:1;
    unsigned char BSR3:1;
    unsigned char BSR4:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __BSRbits_t;
extern volatile __BSRbits_t __at(BSR_ADDR) BSRbits;

// ----- CCP1AS bits --------------------
typedef union {
  struct {
    unsigned char PSS1BD0:1;
    unsigned char PSS1BD1:1;
    unsigned char PSS1AC0:1;
    unsigned char PSS1AC1:1;
    unsigned char CCP1AS0:1;
    unsigned char CCP1AS1:1;
    unsigned char CCP1AS2:1;
    unsigned char CCP1ASE:1;
  };
} __CCP1ASbits_t;
extern volatile __CCP1ASbits_t __at(CCP1AS_ADDR) CCP1ASbits;

// ----- CCP1CON bits --------------------
typedef union {
  struct {
    unsigned char CCP1M0:1;
    unsigned char CCP1M1:1;
    unsigned char CCP1M2:1;
    unsigned char CCP1M3:1;
    unsigned char DC1B0:1;
    unsigned char DC1B1:1;
    unsigned char P1M0:1;
    unsigned char P1M1:1;
  };
} __CCP1CONbits_t;
extern volatile __CCP1CONbits_t __at(CCP1CON_ADDR) CCP1CONbits;

// ----- CLKRCON bits --------------------
typedef union {
  struct {
    unsigned char CLKRDIV0:1;
    unsigned char CLKRDIV1:1;
    unsigned char CLKRDIV2:1;
    unsigned char CLKRDC0:1;
    unsigned char CLKRDC1:1;
    unsigned char CLKRSLR:1;
    unsigned char CLKROE:1;
    unsigned char CLKREN:1;
  };
} __CLKRCONbits_t;
extern volatile __CLKRCONbits_t __at(CLKRCON_ADDR) CLKRCONbits;

// ----- CM1CON0 bits --------------------
typedef union {
  struct {
    unsigned char C1SYNC:1;
    unsigned char C1HYS:1;
    unsigned char C1SP:1;
    unsigned char :1;
    unsigned char C1POL:1;
    unsigned char C1OE:1;
    unsigned char C1OUT_CM1CON0:1;
    unsigned char C1ON:1;
  };
} __CM1CON0bits_t;
extern volatile __CM1CON0bits_t __at(CM1CON0_ADDR) CM1CON0bits;

// ----- CM1CON1 bits --------------------
typedef union {
  struct {
    unsigned char C1NCH0:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char C1PCH0:1;
    unsigned char C1PCH1:1;
    unsigned char C1INTN:1;
    unsigned char C1INTP:1;
  };
} __CM1CON1bits_t;
extern volatile __CM1CON1bits_t __at(CM1CON1_ADDR) CM1CON1bits;

// ----- CMOUT bits --------------------
typedef union {
  struct {
    unsigned char MC1OUT:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __CMOUTbits_t;
extern volatile __CMOUTbits_t __at(CMOUT_ADDR) CMOUTbits;

// ----- CPSCON0 bits --------------------
typedef union {
  struct {
    unsigned char T0XCS:1;
    unsigned char CPSOUT:1;
    unsigned char CPSRNG0:1;
    unsigned char CPSRNG1:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char CPSRM:1;
    unsigned char CPSON:1;
  };
} __CPSCON0bits_t;
extern volatile __CPSCON0bits_t __at(CPSCON0_ADDR) CPSCON0bits;

// ----- CPSCON1 bits --------------------
typedef union {
  struct {
    unsigned char CPSCH0:1;
    unsigned char CPSCH1:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __CPSCON1bits_t;
extern volatile __CPSCON1bits_t __at(CPSCON1_ADDR) CPSCON1bits;

// ----- DACCON0 bits --------------------
typedef union {
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char DACPSS0:1;
    unsigned char DACPSS1:1;
    unsigned char :1;
    unsigned char DACOE:1;
    unsigned char DACLPS:1;
    unsigned char DACEN:1;
  };
} __DACCON0bits_t;
extern volatile __DACCON0bits_t __at(DACCON0_ADDR) DACCON0bits;

// ----- DACCON1 bits --------------------
typedef union {
  struct {
    unsigned char DACR0:1;
    unsigned char DACR1:1;
    unsigned char DACR2:1;
    unsigned char DACR3:1;
    unsigned char DACR4:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __DACCON1bits_t;
extern volatile __DACCON1bits_t __at(DACCON1_ADDR) DACCON1bits;

// ----- ECCP1AS bits --------------------
typedef union {
  struct {
    unsigned char PSS1BD0:1;
    unsigned char PSS1BD1:1;
    unsigned char PSS1AC0:1;
    unsigned char PSS1AC1:1;
    unsigned char CCP1AS0:1;
    unsigned char CCP1AS1:1;
    unsigned char CCP1AS2:1;
    unsigned char CCP1ASE:1;
  };
} __ECCP1ASbits_t;
extern volatile __ECCP1ASbits_t __at(ECCP1AS_ADDR) ECCP1ASbits;

// ----- EECON1 bits --------------------
typedef union {
  struct {
    unsigned char RD:1;
    unsigned char WR:1;
    unsigned char WREN:1;
    unsigned char WRERR:1;
    unsigned char FREE:1;
    unsigned char LWLO:1;
    unsigned char CFGS:1;
    unsigned char EEPGD:1;
  };
} __EECON1bits_t;
extern volatile __EECON1bits_t __at(EECON1_ADDR) EECON1bits;

// ----- FVRCON bits --------------------
typedef union {
  struct {
    unsigned char ADFVR0:1;
    unsigned char ADFVR1:1;
    unsigned char CDAFVR0:1;
    unsigned char CDAFVR1:1;
    unsigned char TSRNG:1;
    unsigned char TSEN:1;
    unsigned char FVRRDY:1;
    unsigned char FVREN:1;
  };
} __FVRCONbits_t;
extern volatile __FVRCONbits_t __at(FVRCON_ADDR) FVRCONbits;

// ----- INTCON bits --------------------
typedef union {
  struct {
    unsigned char IOCIF:1;
    unsigned char INTF:1;
    unsigned char TMR0IF:1;
    unsigned char IOCIE:1;
    unsigned char INTE:1;
    unsigned char TMR0IE:1;
    unsigned char PEIE:1;
    unsigned char GIE:1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char T0IF:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char T0IE:1;
    unsigned char :1;
    unsigned char :1;
  };
} __INTCONbits_t;
extern volatile __INTCONbits_t __at(INTCON_ADDR) INTCONbits;

// ----- IOCAF bits --------------------
typedef union {
  struct {
    unsigned char IOCAF0:1;
    unsigned char IOCAF1:1;
    unsigned char IOCAF2:1;
    unsigned char IOCAF3:1;
    unsigned char IOCAF4:1;
    unsigned char IOCAF5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __IOCAFbits_t;
extern volatile __IOCAFbits_t __at(IOCAF_ADDR) IOCAFbits;

// ----- IOCAN bits --------------------
typedef union {
  struct {
    unsigned char IOCAN0:1;
    unsigned char IOCAN1:1;
    unsigned char IOCAN2:1;
    unsigned char IOCAN3:1;
    unsigned char IOCAN4:1;
    unsigned char IOCAN5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __IOCANbits_t;
extern volatile __IOCANbits_t __at(IOCAN_ADDR) IOCANbits;

// ----- IOCAP bits --------------------
typedef union {
  struct {
    unsigned char IOCAP0:1;
    unsigned char IOCAP1:1;
    unsigned char IOCAP2:1;
    unsigned char IOCAP3:1;
    unsigned char IOCAP4:1;
    unsigned char IOCAP5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __IOCAPbits_t;
extern volatile __IOCAPbits_t __at(IOCAP_ADDR) IOCAPbits;

// ----- LATA bits --------------------
typedef union {
  struct {
    unsigned char LATA0:1;
    unsigned char LATA1:1;
    unsigned char LATA2:1;
    unsigned char :1;
    unsigned char LATA4:1;
    unsigned char LATA5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __LATAbits_t;
extern volatile __LATAbits_t __at(LATA_ADDR) LATAbits;

// ----- MDCARH bits --------------------
typedef union {
  struct {
    unsigned char MDCH0:1;
    unsigned char MDCH1:1;
    unsigned char MDCH2:1;
    unsigned char MDCH3:1;
    unsigned char :1;
    unsigned char MDCHSYNC:1;
    unsigned char MDCHPOL:1;
    unsigned char MDCHODIS:1;
  };
} __MDCARHbits_t;
extern volatile __MDCARHbits_t __at(MDCARH_ADDR) MDCARHbits;

// ----- MDCARL bits --------------------
typedef union {
  struct {
    unsigned char MDCL0:1;
    unsigned char MDCL1:1;
    unsigned char MDCL2:1;
    unsigned char MDCL3:1;
    unsigned char :1;
    unsigned char MDCLSYNC:1;
    unsigned char MDCLPOL:1;
    unsigned char MDCLODIS:1;
  };
} __MDCARLbits_t;
extern volatile __MDCARLbits_t __at(MDCARL_ADDR) MDCARLbits;

// ----- MDCON bits --------------------
typedef union {
  struct {
    unsigned char MDBIT:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char MDOUT_MDCON:1;
    unsigned char MDOPOL:1;
    unsigned char MDSLR:1;
    unsigned char MDOE:1;
    unsigned char MDEN:1;
  };
} __MDCONbits_t;
extern volatile __MDCONbits_t __at(MDCON_ADDR) MDCONbits;

// ----- MDSRC bits --------------------
typedef union {
  struct {
    unsigned char MDMS0:1;
    unsigned char MDMS1:1;
    unsigned char MDMS2:1;
    unsigned char MDMS3:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char MDMSODIS:1;
  };
} __MDSRCbits_t;
extern volatile __MDSRCbits_t __at(MDSRC_ADDR) MDSRCbits;

// ----- OPTION_REG bits --------------------
typedef union {
  struct {
    unsigned char PS0:1;
    unsigned char PS1:1;
    unsigned char PS2:1;
    unsigned char PSA:1;
    unsigned char TMR0SE:1;
    unsigned char TMR0CS:1;
    unsigned char INTEDG:1;
    unsigned char NOT_WPUEN:1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char T0SE:1;
    unsigned char T0CS:1;
    unsigned char :1;
    unsigned char :1;
  };
} __OPTION_REGbits_t;
extern volatile __OPTION_REGbits_t __at(OPTION_REG_ADDR) OPTION_REGbits;

// ----- OSCCON bits --------------------
typedef union {
  struct {
    unsigned char SCS0:1;
    unsigned char SCS1:1;
    unsigned char :1;
    unsigned char IRCF0:1;
    unsigned char IRCF1:1;
    unsigned char IRCF2:1;
    unsigned char IRCF3:1;
    unsigned char SPLLEN:1;
  };
} __OSCCONbits_t;
extern volatile __OSCCONbits_t __at(OSCCON_ADDR) OSCCONbits;

// ----- OSCSTAT bits --------------------
typedef union {
  struct {
    unsigned char HFIOFS:1;
    unsigned char LFIOFR:1;
    unsigned char MFIOFR:1;
    unsigned char HFIOFL:1;
    unsigned char HFIOFR:1;
    unsigned char OSTS:1;
    unsigned char PLLR:1;
    unsigned char T1OSCR:1;
  };
} __OSCSTATbits_t;
extern volatile __OSCSTATbits_t __at(OSCSTAT_ADDR) OSCSTATbits;

// ----- OSCTUNE bits --------------------
typedef union {
  struct {
    unsigned char TUN0:1;
    unsigned char TUN1:1;
    unsigned char TUN2:1;
    unsigned char TUN3:1;
    unsigned char TUN4:1;
    unsigned char TUN5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __OSCTUNEbits_t;
extern volatile __OSCTUNEbits_t __at(OSCTUNE_ADDR) OSCTUNEbits;

// ----- PCON bits --------------------
typedef union {
  struct {
    unsigned char NOT_BOR:1;
    unsigned char NOT_POR:1;
    unsigned char NOT_RI:1;
    unsigned char NOT_RMCLR:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char STKUNF:1;
    unsigned char STKOVF:1;
  };
} __PCONbits_t;
extern volatile __PCONbits_t __at(PCON_ADDR) PCONbits;

// ----- PIE1 bits --------------------
typedef union {
  struct {
    unsigned char TMR1IE:1;
    unsigned char TMR2IE:1;
    unsigned char CCP1IE:1;
    unsigned char SSP1IE:1;
    unsigned char TXIE:1;
    unsigned char RCIE:1;
    unsigned char ADIE:1;
    unsigned char TMR1GIE:1;
  };
} __PIE1bits_t;
extern volatile __PIE1bits_t __at(PIE1_ADDR) PIE1bits;

// ----- PIE2 bits --------------------
typedef union {
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char BCL1IE:1;
    unsigned char EEIE:1;
    unsigned char C1IE:1;
    unsigned char :1;
    unsigned char OSFIE:1;
  };
} __PIE2bits_t;
extern volatile __PIE2bits_t __at(PIE2_ADDR) PIE2bits;

// ----- PIR1 bits --------------------
typedef union {
  struct {
    unsigned char TMR1IF:1;
    unsigned char TMR2IF:1;
    unsigned char CCP1IF:1;
    unsigned char SSP1IF:1;
    unsigned char TXIF:1;
    unsigned char RCIF:1;
    unsigned char ADIF:1;
    unsigned char TMR1GIF:1;
  };
} __PIR1bits_t;
extern volatile __PIR1bits_t __at(PIR1_ADDR) PIR1bits;

// ----- PIR2 bits --------------------
typedef union {
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char BCL1IF:1;
    unsigned char EEIF:1;
    unsigned char C1IF:1;
    unsigned char :1;
    unsigned char OSFIF:1;
  };
} __PIR2bits_t;
extern volatile __PIR2bits_t __at(PIR2_ADDR) PIR2bits;

// ----- PORTA bits --------------------
typedef union {
  struct {
    unsigned char RA0:1;
    unsigned char RA1:1;
    unsigned char RA2:1;
    unsigned char RA3:1;
    unsigned char RA4:1;
    unsigned char RA5:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char AN0:1;
    unsigned char AN1:1;
    unsigned char AN2:1;
    unsigned char NOT_MCLR:1;
    unsigned char AN3:1;
    unsigned char SRNQ:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char CPS0:1;
    unsigned char CPS1:1;
    unsigned char CPS2:1;
    unsigned char :1;
    unsigned char CPS3:1;
    unsigned char T1CKI:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char C1INP:1;
    unsigned char C1IN0N:1;
    unsigned char C1OUT_PORTA:1;
    unsigned char :1;
    unsigned char C1IN1N:1;
    unsigned char T1OSI:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char DACOUT:1;
    unsigned char SRI:1;
    unsigned char SRQ:1;
    unsigned char :1;
    unsigned char T1OSO:1;
    unsigned char OSC1:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char MDOUT_PORTA:1;
    unsigned char SCK:1;
    unsigned char T0CKI:1;
    unsigned char :1;
    unsigned char CLKR:1;
    unsigned char CLKIN:1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char SCL:1;
    unsigned char SDA:1;
    unsigned char :1;
    unsigned char MDCIN2:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char MDMIN:1;
    unsigned char MDCIN1:1;
    unsigned char :1;
    unsigned char OSC2:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char SDI:1;
    unsigned char :1;
    unsigned char CLKOUT:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char FLT0:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __PORTAbits_t;
extern volatile __PORTAbits_t __at(PORTA_ADDR) PORTAbits;

// ----- PSTR1CON bits --------------------
typedef union {
  struct {
    unsigned char STR1A:1;
    unsigned char STR1B:1;
    unsigned char STR1C:1;
    unsigned char STR1D:1;
    unsigned char STR1SYNC:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __PSTR1CONbits_t;
extern volatile __PSTR1CONbits_t __at(PSTR1CON_ADDR) PSTR1CONbits;

// ----- PWM1CON bits --------------------
typedef union {
  struct {
    unsigned char P1DC0:1;
    unsigned char P1DC1:1;
    unsigned char P1DC2:1;
    unsigned char P1DC3:1;
    unsigned char P1DC4:1;
    unsigned char P1DC5:1;
    unsigned char P1DC6:1;
    unsigned char P1RSEN:1;
  };
} __PWM1CONbits_t;
extern volatile __PWM1CONbits_t __at(PWM1CON_ADDR) PWM1CONbits;

// ----- RCSTA bits --------------------
typedef union {
  struct {
    unsigned char RX9D:1;
    unsigned char OERR:1;
    unsigned char FERR:1;
    unsigned char ADDEN:1;
    unsigned char CREN:1;
    unsigned char SREN:1;
    unsigned char RX9:1;
    unsigned char SPEN:1;
  };
} __RCSTAbits_t;
extern volatile __RCSTAbits_t __at(RCSTA_ADDR) RCSTAbits;

// ----- SRCON0 bits --------------------
typedef union {
  struct {
    unsigned char SRPR:1;
    unsigned char SRPS:1;
    unsigned char SRNQEN:1;
    unsigned char SRQEN:1;
    unsigned char SRCLK0:1;
    unsigned char SRCLK1:1;
    unsigned char SRCLK2:1;
    unsigned char SRLEN:1;
  };
} __SRCON0bits_t;
extern volatile __SRCON0bits_t __at(SRCON0_ADDR) SRCON0bits;

// ----- SRCON1 bits --------------------
typedef union {
  struct {
    unsigned char SRRC1E:1;
    unsigned char :1;
    unsigned char SRRCKE:1;
    unsigned char SRRPE:1;
    unsigned char SRSC1E:1;
    unsigned char :1;
    unsigned char SRSCKE:1;
    unsigned char SRSPE:1;
  };
} __SRCON1bits_t;
extern volatile __SRCON1bits_t __at(SRCON1_ADDR) SRCON1bits;

// ----- SSP1CON1 bits --------------------
typedef union {
  struct {
    unsigned char SSPM0:1;
    unsigned char SSPM1:1;
    unsigned char SSPM2:1;
    unsigned char SSPM3:1;
    unsigned char CKP:1;
    unsigned char SSPEN:1;
    unsigned char SSPOV:1;
    unsigned char WCOL:1;
  };
} __SSP1CON1bits_t;
extern volatile __SSP1CON1bits_t __at(SSP1CON1_ADDR) SSP1CON1bits;

// ----- SSP1CON2 bits --------------------
typedef union {
  struct {
    unsigned char SEN:1;
    unsigned char RSEN:1;
    unsigned char PEN:1;
    unsigned char RCEN:1;
    unsigned char ACKEN:1;
    unsigned char ACKDT:1;
    unsigned char ACKSTAT:1;
    unsigned char GCEN:1;
  };
} __SSP1CON2bits_t;
extern volatile __SSP1CON2bits_t __at(SSP1CON2_ADDR) SSP1CON2bits;

// ----- SSP1CON3 bits --------------------
typedef union {
  struct {
    unsigned char DHEN:1;
    unsigned char AHEN:1;
    unsigned char SBCDE:1;
    unsigned char SDAHT:1;
    unsigned char BOEN:1;
    unsigned char SCIE:1;
    unsigned char PCIE:1;
    unsigned char ACKTIM:1;
  };
} __SSP1CON3bits_t;
extern volatile __SSP1CON3bits_t __at(SSP1CON3_ADDR) SSP1CON3bits;

// ----- SSP1STAT bits --------------------
typedef union {
  struct {
    unsigned char BF:1;
    unsigned char UA:1;
    unsigned char R_NOT_W:1;
    unsigned char S:1;
    unsigned char P:1;
    unsigned char D_NOT_A:1;
    unsigned char CKE:1;
    unsigned char SMP:1;
  };
} __SSP1STATbits_t;
extern volatile __SSP1STATbits_t __at(SSP1STAT_ADDR) SSP1STATbits;

// ----- SSPCON bits --------------------
typedef union {
  struct {
    unsigned char SSPM0:1;
    unsigned char SSPM1:1;
    unsigned char SSPM2:1;
    unsigned char SSPM3:1;
    unsigned char CKP:1;
    unsigned char SSPEN:1;
    unsigned char SSPOV:1;
    unsigned char WCOL:1;
  };
} __SSPCONbits_t;
extern volatile __SSPCONbits_t __at(SSPCON_ADDR) SSPCONbits;

// ----- SSPCON1 bits --------------------
typedef union {
  struct {
    unsigned char SSPM0:1;
    unsigned char SSPM1:1;
    unsigned char SSPM2:1;
    unsigned char SSPM3:1;
    unsigned char CKP:1;
    unsigned char SSPEN:1;
    unsigned char SSPOV:1;
    unsigned char WCOL:1;
  };
} __SSPCON1bits_t;
extern volatile __SSPCON1bits_t __at(SSPCON1_ADDR) SSPCON1bits;

// ----- SSPCON2 bits --------------------
typedef union {
  struct {
    unsigned char SEN:1;
    unsigned char RSEN:1;
    unsigned char PEN:1;
    unsigned char RCEN:1;
    unsigned char ACKEN:1;
    unsigned char ACKDT:1;
    unsigned char ACKSTAT:1;
    unsigned char GCEN:1;
  };
} __SSPCON2bits_t;
extern volatile __SSPCON2bits_t __at(SSPCON2_ADDR) SSPCON2bits;

// ----- SSPCON3 bits --------------------
typedef union {
  struct {
    unsigned char DHEN:1;
    unsigned char AHEN:1;
    unsigned char SBCDE:1;
    unsigned char SDAHT:1;
    unsigned char BOEN:1;
    unsigned char SCIE:1;
    unsigned char PCIE:1;
    unsigned char ACKTIM:1;
  };
} __SSPCON3bits_t;
extern volatile __SSPCON3bits_t __at(SSPCON3_ADDR) SSPCON3bits;

// ----- SSPSTAT bits --------------------
typedef union {
  struct {
    unsigned char BF:1;
    unsigned char UA:1;
    unsigned char R_NOT_W:1;
    unsigned char S:1;
    unsigned char P:1;
    unsigned char D_NOT_A:1;
    unsigned char CKE:1;
    unsigned char SMP:1;
  };
} __SSPSTATbits_t;
extern volatile __SSPSTATbits_t __at(SSPSTAT_ADDR) SSPSTATbits;

// ----- STATUS bits --------------------
typedef union {
  struct {
    unsigned char C:1;
    unsigned char DC:1;
    unsigned char Z:1;
    unsigned char NOT_PD:1;
    unsigned char NOT_TO:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __STATUSbits_t;
extern volatile __STATUSbits_t __at(STATUS_ADDR) STATUSbits;

// ----- STATUS_SHAD bits --------------------
typedef union {
  struct {
    unsigned char C_SHAD:1;
    unsigned char DC_SHAD:1;
    unsigned char Z_SHAD:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __STATUS_SHADbits_t;
extern volatile __STATUS_SHADbits_t __at(STATUS_SHAD_ADDR) STATUS_SHADbits;

// ----- T1CON bits --------------------
typedef union {
  struct {
    unsigned char TMR1ON:1;
    unsigned char :1;
    unsigned char NOT_T1SYNC:1;
    unsigned char T1OSCEN:1;
    unsigned char T1CKPS0:1;
    unsigned char T1CKPS1:1;
    unsigned char TMR1CS0:1;
    unsigned char TMR1CS1:1;
  };
} __T1CONbits_t;
extern volatile __T1CONbits_t __at(T1CON_ADDR) T1CONbits;

// ----- T1GCON bits --------------------
typedef union {
  struct {
    unsigned char T1GSS0:1;
    unsigned char T1GSS1:1;
    unsigned char T1GVAL:1;
    unsigned char T1GGO_NOT_DONE:1;
    unsigned char T1GSPM:1;
    unsigned char T1GTM:1;
    unsigned char T1GPOL:1;
    unsigned char TMR1GE:1;
  };
  struct {
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char T1GGO:1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
    unsigned char :1;
  };
} __T1GCONbits_t;
extern volatile __T1GCONbits_t __at(T1GCON_ADDR) T1GCONbits;

// ----- T2CON bits --------------------
typedef union {
  struct {
    unsigned char T2CKPS0:1;
    unsigned char T2CKPS1:1;
    unsigned char TMR2ON:1;
    unsigned char T2OUTPS0:1;
    unsigned char T2OUTPS1:1;
    unsigned char T2OUTPS2:1;
    unsigned char T2OUTPS3:1;
    unsigned char :1;
  };
} __T2CONbits_t;
extern volatile __T2CONbits_t __at(T2CON_ADDR) T2CONbits;

// ----- TRISA bits --------------------
typedef union {
  struct {
    unsigned char TRISA0:1;
    unsigned char TRISA1:1;
    unsigned char TRISA2:1;
    unsigned char TRISA3:1;
    unsigned char TRISA4:1;
    unsigned char TRISA5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __TRISAbits_t;
extern volatile __TRISAbits_t __at(TRISA_ADDR) TRISAbits;

// ----- TXSTA bits --------------------
typedef union {
  struct {
    unsigned char TX9D:1;
    unsigned char TRMT:1;
    unsigned char BRGH:1;
    unsigned char SENDB:1;
    unsigned char SYNC:1;
    unsigned char TXEN:1;
    unsigned char TX9:1;
    unsigned char CSRC:1;
  };
} __TXSTAbits_t;
extern volatile __TXSTAbits_t __at(TXSTA_ADDR) TXSTAbits;

// ----- WDTCON bits --------------------
typedef union {
  struct {
    unsigned char SWDTEN:1;
    unsigned char WDTPS0:1;
    unsigned char WDTPS1:1;
    unsigned char WDTPS2:1;
    unsigned char WDTPS3:1;
    unsigned char WDTPS4:1;
    unsigned char :1;
    unsigned char :1;
  };
} __WDTCONbits_t;
extern volatile __WDTCONbits_t __at(WDTCON_ADDR) WDTCONbits;

// ----- WPUA bits --------------------
typedef union {
  struct {
    unsigned char WPUA0:1;
    unsigned char WPUA1:1;
    unsigned char WPUA2:1;
    unsigned char WPUA3:1;
    unsigned char WPUA4:1;
    unsigned char WPUA5:1;
    unsigned char :1;
    unsigned char :1;
  };
} __WPUAbits_t;
extern volatile __WPUAbits_t __at(WPUA_ADDR) WPUAbits;


#ifndef NO_BIT_DEFINES

#define ADON                 ADCON0bits.ADON                /* bit 0 */
#define ADGO                 ADCON0bits.ADGO                /* bit 1 */
#define GO                   ADCON0bits.GO                  /* bit 1 */
#define GO_NOT_DONE          ADCON0bits.GO_NOT_DONE         /* bit 1 */
#define NOT_DONE             ADCON0bits.NOT_DONE            /* bit 1 */
#define CHS0                 ADCON0bits.CHS0                /* bit 2 */
#define CHS1                 ADCON0bits.CHS1                /* bit 3 */
#define CHS2                 ADCON0bits.CHS2                /* bit 4 */
#define CHS3                 ADCON0bits.CHS3                /* bit 5 */
#define CHS4                 ADCON0bits.CHS4                /* bit 6 */

#define ADPREF0              ADCON1bits.ADPREF0             /* bit 0 */
#define ADPREF1              ADCON1bits.ADPREF1             /* bit 1 */
#define ADCS0                ADCON1bits.ADCS0               /* bit 4 */
#define ADCS1                ADCON1bits.ADCS1               /* bit 5 */
#define ADCS2                ADCON1bits.ADCS2               /* bit 6 */
#define ADFM                 ADCON1bits.ADFM                /* bit 7 */

#define ANSA0                ANSELAbits.ANSA0               /* bit 0 */
#define ANSA1                ANSELAbits.ANSA1               /* bit 1 */
#define ANSA2                ANSELAbits.ANSA2               /* bit 2 */
#define ANSA4                ANSELAbits.ANSA4               /* bit 4 */

#define CCP1SEL              APFCONbits.CCP1SEL             /* bit 0, shadows bit in APFCON0bits */
#define P1BSEL               APFCONbits.P1BSEL              /* bit 1, shadows bit in APFCON0bits */
#define TXCKSEL              APFCONbits.TXCKSEL             /* bit 2, shadows bit in APFCON0bits */
#define T1GSEL               APFCONbits.T1GSEL              /* bit 3, shadows bit in APFCON0bits */
#define SS1SEL               APFCONbits.SS1SEL              /* bit 5, shadows bit in APFCON0bits */
#define SSSEL                APFCONbits.SSSEL               /* bit 5, shadows bit in APFCON0bits */
#define SDO1SEL              APFCONbits.SDO1SEL             /* bit 6, shadows bit in APFCON0bits */
#define SDOSEL               APFCONbits.SDOSEL              /* bit 6, shadows bit in APFCON0bits */
#define RXDTSEL              APFCONbits.RXDTSEL             /* bit 7, shadows bit in APFCON0bits */

#define ABDEN                BAUDCONbits.ABDEN              /* bit 0 */
#define WUE                  BAUDCONbits.WUE                /* bit 1 */
#define BRG16                BAUDCONbits.BRG16              /* bit 3 */
#define SCKP                 BAUDCONbits.SCKP               /* bit 4 */
#define RCIDL                BAUDCONbits.RCIDL              /* bit 6 */
#define ABDOVF               BAUDCONbits.ABDOVF             /* bit 7 */

#define BORRDY               BORCONbits.BORRDY              /* bit 0 */
#define SBOREN               BORCONbits.SBOREN              /* bit 7 */

#define BSR0                 BSRbits.BSR0                   /* bit 0 */
#define BSR1                 BSRbits.BSR1                   /* bit 1 */
#define BSR2                 BSRbits.BSR2                   /* bit 2 */
#define BSR3                 BSRbits.BSR3                   /* bit 3 */
#define BSR4                 BSRbits.BSR4                   /* bit 4 */

#define PSS1BD0              CCP1ASbits.PSS1BD0             /* bit 0, shadows bit in ECCP1ASbits */
#define PSS1BD1              CCP1ASbits.PSS1BD1             /* bit 1, shadows bit in ECCP1ASbits */
#define PSS1AC0              CCP1ASbits.PSS1AC0             /* bit 2, shadows bit in ECCP1ASbits */
#define PSS1AC1              CCP1ASbits.PSS1AC1             /* bit 3, shadows bit in ECCP1ASbits */
#define CCP1AS0              CCP1ASbits.CCP1AS0             /* bit 4, shadows bit in ECCP1ASbits */
#define CCP1AS1              CCP1ASbits.CCP1AS1             /* bit 5, shadows bit in ECCP1ASbits */
#define CCP1AS2              CCP1ASbits.CCP1AS2             /* bit 6, shadows bit in ECCP1ASbits */
#define CCP1ASE              CCP1ASbits.CCP1ASE             /* bit 7, shadows bit in ECCP1ASbits */

#define CCP1M0               CCP1CONbits.CCP1M0             /* bit 0 */
#define CCP1M1               CCP1CONbits.CCP1M1             /* bit 1 */
#define CCP1M2               CCP1CONbits.CCP1M2             /* bit 2 */
#define CCP1M3               CCP1CONbits.CCP1M3             /* bit 3 */
#define DC1B0                CCP1CONbits.DC1B0              /* bit 4 */
#define DC1B1                CCP1CONbits.DC1B1              /* bit 5 */
#define P1M0                 CCP1CONbits.P1M0               /* bit 6 */
#define P1M1                 CCP1CONbits.P1M1               /* bit 7 */

#define CLKRDIV0             CLKRCONbits.CLKRDIV0           /* bit 0 */
#define CLKRDIV1             CLKRCONbits.CLKRDIV1           /* bit 1 */
#define CLKRDIV2             CLKRCONbits.CLKRDIV2           /* bit 2 */
#define CLKRDC0              CLKRCONbits.CLKRDC0            /* bit 3 */
#define CLKRDC1              CLKRCONbits.CLKRDC1            /* bit 4 */
#define CLKRSLR              CLKRCONbits.CLKRSLR            /* bit 5 */
#define CLKROE               CLKRCONbits.CLKROE             /* bit 6 */
#define CLKREN               CLKRCONbits.CLKREN             /* bit 7 */

#define C1SYNC               CM1CON0bits.C1SYNC             /* bit 0 */
#define C1HYS                CM1CON0bits.C1HYS              /* bit 1 */
#define C1SP                 CM1CON0bits.C1SP               /* bit 2 */
#define C1POL                CM1CON0bits.C1POL              /* bit 4 */
#define C1OE                 CM1CON0bits.C1OE               /* bit 5 */
#define C1OUT_CM1CON0        CM1CON0bits.C1OUT_CM1CON0      /* bit 6 */
#define C1ON                 CM1CON0bits.C1ON               /* bit 7 */

#define C1NCH0               CM1CON1bits.C1NCH0             /* bit 0 */
#define C1PCH0               CM1CON1bits.C1PCH0             /* bit 4 */
#define C1PCH1               CM1CON1bits.C1PCH1             /* bit 5 */
#define C1INTN               CM1CON1bits.C1INTN             /* bit 6 */
#define C1INTP               CM1CON1bits.C1INTP             /* bit 7 */

#define MC1OUT               CMOUTbits.MC1OUT               /* bit 0 */

#define T0XCS                CPSCON0bits.T0XCS              /* bit 0 */
#define CPSOUT               CPSCON0bits.CPSOUT             /* bit 1 */
#define CPSRNG0              CPSCON0bits.CPSRNG0            /* bit 2 */
#define CPSRNG1              CPSCON0bits.CPSRNG1            /* bit 3 */
#define CPSRM                CPSCON0bits.CPSRM              /* bit 6 */
#define CPSON                CPSCON0bits.CPSON              /* bit 7 */

#define CPSCH0               CPSCON1bits.CPSCH0             /* bit 0 */
#define CPSCH1               CPSCON1bits.CPSCH1             /* bit 1 */

#define DACPSS0              DACCON0bits.DACPSS0            /* bit 2 */
#define DACPSS1              DACCON0bits.DACPSS1            /* bit 3 */
#define DACOE                DACCON0bits.DACOE              /* bit 5 */
#define DACLPS               DACCON0bits.DACLPS             /* bit 6 */
#define DACEN                DACCON0bits.DACEN              /* bit 7 */

#define DACR0                DACCON1bits.DACR0              /* bit 0 */
#define DACR1                DACCON1bits.DACR1              /* bit 1 */
#define DACR2                DACCON1bits.DACR2              /* bit 2 */
#define DACR3                DACCON1bits.DACR3              /* bit 3 */
#define DACR4                DACCON1bits.DACR4              /* bit 4 */

#define RD                   EECON1bits.RD                  /* bit 0 */
#define WR                   EECON1bits.WR                  /* bit 1 */
#define WREN                 EECON1bits.WREN                /* bit 2 */
#define WRERR                EECON1bits.WRERR               /* bit 3 */
#define FREE                 EECON1bits.FREE                /* bit 4 */
#define LWLO                 EECON1bits.LWLO                /* bit 5 */
#define CFGS                 EECON1bits.CFGS                /* bit 6 */
#define EEPGD                EECON1bits.EEPGD               /* bit 7 */

#define ADFVR0               FVRCONbits.ADFVR0              /* bit 0 */
#define ADFVR1               FVRCONbits.ADFVR1              /* bit 1 */
#define CDAFVR0              FVRCONbits.CDAFVR0             /* bit 2 */
#define CDAFVR1              FVRCONbits.CDAFVR1             /* bit 3 */
#define TSRNG                FVRCONbits.TSRNG               /* bit 4 */
#define TSEN                 FVRCONbits.TSEN                /* bit 5 */
#define FVRRDY               FVRCONbits.FVRRDY              /* bit 6 */
#define FVREN                FVRCONbits.FVREN               /* bit 7 */

#define IOCIF                INTCONbits.IOCIF               /* bit 0 */
#define INTF                 INTCONbits.INTF                /* bit 1 */
#define T0IF                 INTCONbits.T0IF                /* bit 2 */
#define TMR0IF               INTCONbits.TMR0IF              /* bit 2 */
#define IOCIE                INTCONbits.IOCIE               /* bit 3 */
#define INTE                 INTCONbits.INTE                /* bit 4 */
#define T0IE                 INTCONbits.T0IE                /* bit 5 */
#define TMR0IE               INTCONbits.TMR0IE              /* bit 5 */
#define PEIE                 INTCONbits.PEIE                /* bit 6 */
#define GIE                  INTCONbits.GIE                 /* bit 7 */

#define IOCAF0               IOCAFbits.IOCAF0               /* bit 0 */
#define IOCAF1               IOCAFbits.IOCAF1               /* bit 1 */
#define IOCAF2               IOCAFbits.IOCAF2               /* bit 2 */
#define IOCAF3               IOCAFbits.IOCAF3               /* bit 3 */
#define IOCAF4               IOCAFbits.IOCAF4               /* bit 4 */
#define IOCAF5               IOCAFbits.IOCAF5               /* bit 5 */

#define IOCAN0               IOCANbits.IOCAN0               /* bit 0 */
#define IOCAN1               IOCANbits.IOCAN1               /* bit 1 */
#define IOCAN2               IOCANbits.IOCAN2               /* bit 2 */
#define IOCAN3               IOCANbits.IOCAN3               /* bit 3 */
#define IOCAN4               IOCANbits.IOCAN4               /* bit 4 */
#define IOCAN5               IOCANbits.IOCAN5               /* bit 5 */

#define IOCAP0               IOCAPbits.IOCAP0               /* bit 0 */
#define IOCAP1               IOCAPbits.IOCAP1               /* bit 1 */
#define IOCAP2               IOCAPbits.IOCAP2               /* bit 2 */
#define IOCAP3               IOCAPbits.IOCAP3               /* bit 3 */
#define IOCAP4               IOCAPbits.IOCAP4               /* bit 4 */
#define IOCAP5               IOCAPbits.IOCAP5               /* bit 5 */

#define LATA0                LATAbits.LATA0                 /* bit 0 */
#define LATA1                LATAbits.LATA1                 /* bit 1 */
#define LATA2                LATAbits.LATA2                 /* bit 2 */
#define LATA4                LATAbits.LATA4                 /* bit 4 */
#define LATA5                LATAbits.LATA5                 /* bit 5 */

#define MDCH0                MDCARHbits.MDCH0               /* bit 0 */
#define MDCH1                MDCARHbits.MDCH1               /* bit 1 */
#define MDCH2                MDCARHbits.MDCH2               /* bit 2 */
#define MDCH3                MDCARHbits.MDCH3               /* bit 3 */
#define MDCHSYNC             MDCARHbits.MDCHSYNC            /* bit 5 */
#define MDCHPOL              MDCARHbits.MDCHPOL             /* bit 6 */
#define MDCHODIS             MDCARHbits.MDCHODIS            /* bit 7 */

#define MDCL0                MDCARLbits.MDCL0               /* bit 0 */
#define MDCL1                MDCARLbits.MDCL1               /* bit 1 */
#define MDCL2                MDCARLbits.MDCL2               /* bit 2 */
#define MDCL3                MDCARLbits.MDCL3               /* bit 3 */
#define MDCLSYNC             MDCARLbits.MDCLSYNC            /* bit 5 */
#define MDCLPOL              MDCARLbits.MDCLPOL             /* bit 6 */
#define MDCLODIS             MDCARLbits.MDCLODIS            /* bit 7 */

#define MDBIT                MDCONbits.MDBIT                /* bit 0 */
#define MDOUT_MDCON          MDCONbits.MDOUT_MDCON          /* bit 3 */
#define MDOPOL               MDCONbits.MDOPOL               /* bit 4 */
#define MDSLR                MDCONbits.MDSLR                /* bit 5 */
#define MDOE                 MDCONbits.MDOE                 /* bit 6 */
#define MDEN                 MDCONbits.MDEN                 /* bit 7 */

#define MDMS0                MDSRCbits.MDMS0                /* bit 0 */
#define MDMS1                MDSRCbits.MDMS1                /* bit 1 */
#define MDMS2                MDSRCbits.MDMS2                /* bit 2 */
#define MDMS3                MDSRCbits.MDMS3                /* bit 3 */
#define MDMSODIS             MDSRCbits.MDMSODIS             /* bit 7 */

#define PS0                  OPTION_REGbits.PS0             /* bit 0 */
#define PS1                  OPTION_REGbits.PS1             /* bit 1 */
#define PS2                  OPTION_REGbits.PS2             /* bit 2 */
#define PSA                  OPTION_REGbits.PSA             /* bit 3 */
#define T0SE                 OPTION_REGbits.T0SE            /* bit 4 */
#define TMR0SE               OPTION_REGbits.TMR0SE          /* bit 4 */
#define T0CS                 OPTION_REGbits.T0CS            /* bit 5 */
#define TMR0CS               OPTION_REGbits.TMR0CS          /* bit 5 */
#define INTEDG               OPTION_REGbits.INTEDG          /* bit 6 */
#define NOT_WPUEN            OPTION_REGbits.NOT_WPUEN       /* bit 7 */

#define SCS0                 OSCCONbits.SCS0                /* bit 0 */
#define SCS1                 OSCCONbits.SCS1                /* bit 1 */
#define IRCF0                OSCCONbits.IRCF0               /* bit 3 */
#define IRCF1                OSCCONbits.IRCF1               /* bit 4 */
#define IRCF2                OSCCONbits.IRCF2               /* bit 5 */
#define IRCF3                OSCCONbits.IRCF3               /* bit 6 */
#define SPLLEN               OSCCONbits.SPLLEN              /* bit 7 */

#define HFIOFS               OSCSTATbits.HFIOFS             /* bit 0 */
#define LFIOFR               OSCSTATbits.LFIOFR             /* bit 1 */
#define MFIOFR               OSCSTATbits.MFIOFR             /* bit 2 */
#define HFIOFL               OSCSTATbits.HFIOFL             /* bit 3 */
#define HFIOFR               OSCSTATbits.HFIOFR             /* bit 4 */
#define OSTS                 OSCSTATbits.OSTS               /* bit 5 */
#define PLLR                 OSCSTATbits.PLLR               /* bit 6 */
#define T1OSCR               OSCSTATbits.T1OSCR             /* bit 7 */

#define TUN0                 OSCTUNEbits.TUN0               /* bit 0 */
#define TUN1                 OSCTUNEbits.TUN1               /* bit 1 */
#define TUN2                 OSCTUNEbits.TUN2               /* bit 2 */
#define TUN3                 OSCTUNEbits.TUN3               /* bit 3 */
#define TUN4                 OSCTUNEbits.TUN4               /* bit 4 */
#define TUN5                 OSCTUNEbits.TUN5               /* bit 5 */

#define NOT_BOR              PCONbits.NOT_BOR               /* bit 0 */
#define NOT_POR              PCONbits.NOT_POR               /* bit 1 */
#define NOT_RI               PCONbits.NOT_RI                /* bit 2 */
#define NOT_RMCLR            PCONbits.NOT_RMCLR             /* bit 3 */
#define STKUNF               PCONbits.STKUNF                /* bit 6 */
#define STKOVF               PCONbits.STKOVF                /* bit 7 */

#define TMR1IE               PIE1bits.TMR1IE                /* bit 0 */
#define TMR2IE               PIE1bits.TMR2IE                /* bit 1 */
#define CCP1IE               PIE1bits.CCP1IE                /* bit 2 */
#define SSP1IE               PIE1bits.SSP1IE                /* bit 3 */
#define TXIE                 PIE1bits.TXIE                  /* bit 4 */
#define RCIE                 PIE1bits.RCIE                  /* bit 5 */
#define ADIE                 PIE1bits.ADIE                  /* bit 6 */
#define TMR1GIE              PIE1bits.TMR1GIE               /* bit 7 */

#define BCL1IE               PIE2bits.BCL1IE                /* bit 3 */
#define EEIE                 PIE2bits.EEIE                  /* bit 4 */
#define C1IE                 PIE2bits.C1IE                  /* bit 5 */
#define OSFIE                PIE2bits.OSFIE                 /* bit 7 */

#define TMR1IF               PIR1bits.TMR1IF                /* bit 0 */
#define TMR2IF               PIR1bits.TMR2IF                /* bit 1 */
#define CCP1IF               PIR1bits.CCP1IF                /* bit 2 */
#define SSP1IF               PIR1bits.SSP1IF                /* bit 3 */
#define TXIF                 PIR1bits.TXIF                  /* bit 4 */
#define RCIF                 PIR1bits.RCIF                  /* bit 5 */
#define ADIF                 PIR1bits.ADIF                  /* bit 6 */
#define TMR1GIF              PIR1bits.TMR1GIF               /* bit 7 */

#define BCL1IF               PIR2bits.BCL1IF                /* bit 3 */
#define EEIF                 PIR2bits.EEIF                  /* bit 4 */
#define C1IF                 PIR2bits.C1IF                  /* bit 5 */
#define OSFIF                PIR2bits.OSFIF                 /* bit 7 */

#define AN0                  PORTAbits.AN0                  /* bit 0 */
#define C1INP                PORTAbits.C1INP                /* bit 0 */
#define CPS0                 PORTAbits.CPS0                 /* bit 0 */
#define DACOUT               PORTAbits.DACOUT               /* bit 0 */
#define MDOUT_PORTA          PORTAbits.MDOUT_PORTA          /* bit 0 */
#define RA0                  PORTAbits.RA0                  /* bit 0 */
#define AN1                  PORTAbits.AN1                  /* bit 1 */
#define C1IN0N               PORTAbits.C1IN0N               /* bit 1 */
#define CPS1                 PORTAbits.CPS1                 /* bit 1 */
#define MDMIN                PORTAbits.MDMIN                /* bit 1 */
#define RA1                  PORTAbits.RA1                  /* bit 1 */
#define SCK                  PORTAbits.SCK                  /* bit 1 */
#define SCL                  PORTAbits.SCL                  /* bit 1 */
#define SRI                  PORTAbits.SRI                  /* bit 1 */
#define AN2                  PORTAbits.AN2                  /* bit 2 */
#define C1OUT_PORTA          PORTAbits.C1OUT_PORTA          /* bit 2 */
#define CPS2                 PORTAbits.CPS2                 /* bit 2 */
#define FLT0                 PORTAbits.FLT0                 /* bit 2 */
#define MDCIN1               PORTAbits.MDCIN1               /* bit 2 */
#define RA2                  PORTAbits.RA2                  /* bit 2 */
#define SDA                  PORTAbits.SDA                  /* bit 2 */
#define SDI                  PORTAbits.SDI                  /* bit 2 */
#define SRQ                  PORTAbits.SRQ                  /* bit 2 */
#define T0CKI                PORTAbits.T0CKI                /* bit 2 */
#define NOT_MCLR             PORTAbits.NOT_MCLR             /* bit 3 */
#define RA3                  PORTAbits.RA3                  /* bit 3 */
#define AN3                  PORTAbits.AN3                  /* bit 4 */
#define C1IN1N               PORTAbits.C1IN1N               /* bit 4 */
#define CLKOUT               PORTAbits.CLKOUT               /* bit 4 */
#define CLKR                 PORTAbits.CLKR                 /* bit 4 */
#define CPS3                 PORTAbits.CPS3                 /* bit 4 */
#define MDCIN2               PORTAbits.MDCIN2               /* bit 4 */
#define OSC2                 PORTAbits.OSC2                 /* bit 4 */
#define RA4                  PORTAbits.RA4                  /* bit 4 */
#define T1OSO                PORTAbits.T1OSO                /* bit 4 */
#define CLKIN                PORTAbits.CLKIN                /* bit 5 */
#define OSC1                 PORTAbits.OSC1                 /* bit 5 */
#define RA5                  PORTAbits.RA5                  /* bit 5 */
#define SRNQ                 PORTAbits.SRNQ                 /* bit 5 */
#define T1CKI                PORTAbits.T1CKI                /* bit 5 */
#define T1OSI                PORTAbits.T1OSI                /* bit 5 */

#define STR1A                PSTR1CONbits.STR1A             /* bit 0 */
#define STR1B                PSTR1CONbits.STR1B             /* bit 1 */
#define STR1C                PSTR1CONbits.STR1C             /* bit 2 */
#define STR1D                PSTR1CONbits.STR1D             /* bit 3 */
#define STR1SYNC             PSTR1CONbits.STR1SYNC          /* bit 4 */

#define P1DC0                PWM1CONbits.P1DC0              /* bit 0 */
#define P1DC1                PWM1CONbits.P1DC1              /* bit 1 */
#define P1DC2                PWM1CONbits.P1DC2              /* bit 2 */
#define P1DC3                PWM1CONbits.P1DC3              /* bit 3 */
#define P1DC4                PWM1CONbits.P1DC4              /* bit 4 */
#define P1DC5                PWM1CONbits.P1DC5              /* bit 5 */
#define P1DC6                PWM1CONbits.P1DC6              /* bit 6 */
#define P1RSEN               PWM1CONbits.P1RSEN             /* bit 7 */

#define RX9D                 RCSTAbits.RX9D                 /* bit 0 */
#define OERR                 RCSTAbits.OERR                 /* bit 1 */
#define FERR                 RCSTAbits.FERR                 /* bit 2 */
#define ADDEN                RCSTAbits.ADDEN                /* bit 3 */
#define CREN                 RCSTAbits.CREN                 /* bit 4 */
#define SREN                 RCSTAbits.SREN                 /* bit 5 */
#define RX9                  RCSTAbits.RX9                  /* bit 6 */
#define SPEN                 RCSTAbits.SPEN                 /* bit 7 */

#define SRPR                 SRCON0bits.SRPR                /* bit 0 */
#define SRPS                 SRCON0bits.SRPS                /* bit 1 */
#define SRNQEN               SRCON0bits.SRNQEN              /* bit 2 */
#define SRQEN                SRCON0bits.SRQEN               /* bit 3 */
#define SRCLK0               SRCON0bits.SRCLK0              /* bit 4 */
#define SRCLK1               SRCON0bits.SRCLK1              /* bit 5 */
#define SRCLK2               SRCON0bits.SRCLK2              /* bit 6 */
#define SRLEN                SRCON0bits.SRLEN               /* bit 7 */

#define SRRC1E               SRCON1bits.SRRC1E              /* bit 0 */
#define SRRCKE               SRCON1bits.SRRCKE              /* bit 2 */
#define SRRPE                SRCON1bits.SRRPE               /* bit 3 */
#define SRSC1E               SRCON1bits.SRSC1E              /* bit 4 */
#define SRSCKE               SRCON1bits.SRSCKE              /* bit 6 */
#define SRSPE                SRCON1bits.SRSPE               /* bit 7 */

#define SSPM0                SSP1CON1bits.SSPM0             /* bit 0, shadows bit in SSPCONbits, SSPCON1bits */
#define SSPM1                SSP1CON1bits.SSPM1             /* bit 1, shadows bit in SSPCONbits, SSPCON1bits */
#define SSPM2                SSP1CON1bits.SSPM2             /* bit 2, shadows bit in SSPCONbits, SSPCON1bits */
#define SSPM3                SSP1CON1bits.SSPM3             /* bit 3, shadows bit in SSPCONbits, SSPCON1bits */
#define CKP                  SSP1CON1bits.CKP               /* bit 4, shadows bit in SSPCONbits, SSPCON1bits */
#define SSPEN                SSP1CON1bits.SSPEN             /* bit 5, shadows bit in SSPCONbits, SSPCON1bits */
#define SSPOV                SSP1CON1bits.SSPOV             /* bit 6, shadows bit in SSPCONbits, SSPCON1bits */
#define WCOL                 SSP1CON1bits.WCOL              /* bit 7, shadows bit in SSPCONbits, SSPCON1bits */

#define SEN                  SSP1CON2bits.SEN               /* bit 0, shadows bit in SSPCON2bits */
#define RSEN                 SSP1CON2bits.RSEN              /* bit 1, shadows bit in SSPCON2bits */
#define PEN                  SSP1CON2bits.PEN               /* bit 2, shadows bit in SSPCON2bits */
#define RCEN                 SSP1CON2bits.RCEN              /* bit 3, shadows bit in SSPCON2bits */
#define ACKEN                SSP1CON2bits.ACKEN             /* bit 4, shadows bit in SSPCON2bits */
#define ACKDT                SSP1CON2bits.ACKDT             /* bit 5, shadows bit in SSPCON2bits */
#define ACKSTAT              SSP1CON2bits.ACKSTAT           /* bit 6, shadows bit in SSPCON2bits */
#define GCEN                 SSP1CON2bits.GCEN              /* bit 7, shadows bit in SSPCON2bits */

#define DHEN                 SSP1CON3bits.DHEN              /* bit 0, shadows bit in SSPCON3bits */
#define AHEN                 SSP1CON3bits.AHEN              /* bit 1, shadows bit in SSPCON3bits */
#define SBCDE                SSP1CON3bits.SBCDE             /* bit 2, shadows bit in SSPCON3bits */
#define SDAHT                SSP1CON3bits.SDAHT             /* bit 3, shadows bit in SSPCON3bits */
#define BOEN                 SSP1CON3bits.BOEN              /* bit 4, shadows bit in SSPCON3bits */
#define SCIE                 SSP1CON3bits.SCIE              /* bit 5, shadows bit in SSPCON3bits */
#define PCIE                 SSP1CON3bits.PCIE              /* bit 6, shadows bit in SSPCON3bits */
#define ACKTIM               SSP1CON3bits.ACKTIM            /* bit 7, shadows bit in SSPCON3bits */

#define BF                   SSP1STATbits.BF                /* bit 0, shadows bit in SSPSTATbits */
#define UA                   SSP1STATbits.UA                /* bit 1, shadows bit in SSPSTATbits */
#define R_NOT_W              SSP1STATbits.R_NOT_W           /* bit 2, shadows bit in SSPSTATbits */
#define S                    SSP1STATbits.S                 /* bit 3, shadows bit in SSPSTATbits */
#define P                    SSP1STATbits.P                 /* bit 4, shadows bit in SSPSTATbits */
#define D_NOT_A              SSP1STATbits.D_NOT_A           /* bit 5, shadows bit in SSPSTATbits */
#define CKE                  SSP1STATbits.CKE               /* bit 6, shadows bit in SSPSTATbits */
#define SMP                  SSP1STATbits.SMP               /* bit 7, shadows bit in SSPSTATbits */

#define C_SHAD               STATUS_SHADbits.C_SHAD         /* bit 0 */
#define DC_SHAD              STATUS_SHADbits.DC_SHAD        /* bit 1 */
#define Z_SHAD               STATUS_SHADbits.Z_SHAD         /* bit 2 */

#define C                    STATUSbits.C                   /* bit 0 */
#define DC                   STATUSbits.DC                  /* bit 1 */
#define Z                    STATUSbits.Z                   /* bit 2 */
#define NOT_PD               STATUSbits.NOT_PD              /* bit 3 */
#define NOT_TO               STATUSbits.NOT_TO              /* bit 4 */

#define TMR1ON               T1CONbits.TMR1ON               /* bit 0 */
#define NOT_T1SYNC           T1CONbits.NOT_T1SYNC           /* bit 2 */
#define T1OSCEN              T1CONbits.T1OSCEN              /* bit 3 */
#define T1CKPS0              T1CONbits.T1CKPS0              /* bit 4 */
#define T1CKPS1              T1CONbits.T1CKPS1              /* bit 5 */
#define TMR1CS0              T1CONbits.TMR1CS0              /* bit 6 */
#define TMR1CS1              T1CONbits.TMR1CS1              /* bit 7 */

#define T1GSS0               T1GCONbits.T1GSS0              /* bit 0 */
#define T1GSS1               T1GCONbits.T1GSS1              /* bit 1 */
#define T1GVAL               T1GCONbits.T1GVAL              /* bit 2 */
#define T1GGO                T1GCONbits.T1GGO               /* bit 3 */
#define T1GGO_NOT_DONE       T1GCONbits.T1GGO_NOT_DONE      /* bit 3 */
#define T1GSPM               T1GCONbits.T1GSPM              /* bit 4 */
#define T1GTM                T1GCONbits.T1GTM               /* bit 5 */
#define T1GPOL               T1GCONbits.T1GPOL              /* bit 6 */
#define TMR1GE               T1GCONbits.TMR1GE              /* bit 7 */

#define T2CKPS0              T2CONbits.T2CKPS0              /* bit 0 */
#define T2CKPS1              T2CONbits.T2CKPS1              /* bit 1 */
#define TMR2ON               T2CONbits.TMR2ON               /* bit 2 */
#define T2OUTPS0             T2CONbits.T2OUTPS0             /* bit 3 */
#define T2OUTPS1             T2CONbits.T2OUTPS1             /* bit 4 */
#define T2OUTPS2             T2CONbits.T2OUTPS2             /* bit 5 */
#define T2OUTPS3             T2CONbits.T2OUTPS3             /* bit 6 */

#define TRISA0               TRISAbits.TRISA0               /* bit 0 */
#define TRISA1               TRISAbits.TRISA1               /* bit 1 */
#define TRISA2               TRISAbits.TRISA2               /* bit 2 */
#define TRISA3               TRISAbits.TRISA3               /* bit 3 */
#define TRISA4               TRISAbits.TRISA4               /* bit 4 */
#define TRISA5               TRISAbits.TRISA5               /* bit 5 */

#define TX9D                 TXSTAbits.TX9D                 /* bit 0 */
#define TRMT                 TXSTAbits.TRMT                 /* bit 1 */
#define BRGH                 TXSTAbits.BRGH                 /* bit 2 */
#define SENDB                TXSTAbits.SENDB                /* bit 3 */
#define SYNC                 TXSTAbits.SYNC                 /* bit 4 */
#define TXEN                 TXSTAbits.TXEN                 /* bit 5 */
#define TX9                  TXSTAbits.TX9                  /* bit 6 */
#define CSRC                 TXSTAbits.CSRC                 /* bit 7 */

#define SWDTEN               WDTCONbits.SWDTEN              /* bit 0 */
#define WDTPS0               WDTCONbits.WDTPS0              /* bit 1 */
#define WDTPS1               WDTCONbits.WDTPS1              /* bit 2 */
#define WDTPS2               WDTCONbits.WDTPS2              /* bit 3 */
#define WDTPS3               WDTCONbits.WDTPS3              /* bit 4 */
#define WDTPS4               WDTCONbits.WDTPS4              /* bit 5 */

#define WPUA0                WPUAbits.WPUA0                 /* bit 0 */
#define WPUA1                WPUAbits.WPUA1                 /* bit 1 */
#define WPUA2                WPUAbits.WPUA2                 /* bit 2 */
#define WPUA3                WPUAbits.WPUA3                 /* bit 3 */
#define WPUA4                WPUAbits.WPUA4                 /* bit 4 */
#define WPUA5                WPUAbits.WPUA5                 /* bit 5 */
#endif /* NO_BIT_DEFINES */

#endif
