//   ***************************************
//   BoostC Header file for PIC16F1784
//   Author(s): David Hobday
//  
//   Copyright (C) 2003-2010 Pavel Baranov
//   Copyright (C) 2003-2010 David Hobday
//   All Rights Reserved
//   ***************************************

#ifndef _PIC16F1784_H_
#define _PIC16F1784_H_

////////////////////////////////////////////////////////////////////////////
//  
//         Register Definitions
//  
////////////////////////////////////////////////////////////////////////////

#define W                     0x0000 
#define F                     0x0001 

//////// Register Files /////////////////////////////////////////////////////

////////Bank0//////////////////
#define INDF0                 0x0000 
#define INDF1                 0x0001 
#define PCL                   0x0002 
#define STATUS                0x0003 
#define FSR0                  0x0004 
#define FSR0L                 0x0004 
#define FSR0H                 0x0005 
#define FSR1                  0x0006 
#define FSR1L                 0x0006 
#define FSR1H                 0x0007 
#define BSR                   0x0008 
#define WREG                  0x0009 
#define PCLATH                0x000A 
#define INTCON                0x000B 
#define PORTA                 0x000C 
#define PORTB                 0x000D 
#define PORTC                 0x000E 
#define PORTD                 0x000F 
#define PORTE                 0x0010 
#define PIR1                  0x0011 
#define PIR2                  0x0012 
#define PIR4                  0x0014 
#define TMR0                  0x0015 
#define TMR1                  0x0016 
#define TMR1L                 0x0016 
#define TMR1H                 0x0017 
#define T1CON                 0x0018 
#define T1GCON                0x0019 
#define TMR2                  0x001A 
#define PR2                   0x001B 
#define T2CON                 0x001C 

////////Bank1//////////////////
#define TRISA                 0x008C 
#define TRISB                 0x008D 
#define TRISC                 0x008E 
#define TRISD                 0x008F 
#define TRISE                 0x0090 
#define PIE1                  0x0091 
#define PIE2                  0x0092 
#define PIE3                  0x0093 
#define PIE4                  0x0094 
#define OPTION_REG            0x0095 
#define PCON                  0x0096 
#define WDTCON                0x0097 
#define OSCTUNE               0x0098 
#define OSCCON                0x0099 
#define OSCSTAT               0x009A 
#define ADRES                 0x009B 
#define ADRESL                0x009B 
#define ADRESH                0x009C 
#define ADCON0                0x009D 
#define ADCON1                0x009E 
#define ADCON2                0x009F 

////////Bank2//////////////////
#define LATA                  0x010C 
#define LATB                  0x010D 
#define LATC                  0x010E 
#define LATD                  0x010F 
#define LATE                  0x0110 
#define CM1CON0               0x0111 
#define CM1CON1               0x0112 
#define CM2CON0               0x0113 
#define CM2CON1               0x0114 
#define CMOUT                 0x0115 
#define BORCON                0x0116 
#define FVRCON                0x0117 
#define DAC1CON0              0x0118 
#define DAC1CON1              0x0119 
#define CM4CON0               0x011A 
#define CM4CON1               0x011B 
#define APFCON2               0x011C 
#define APFCON1               0x011D 
#define APFCON0               0x011D 
#define CM3CON0               0x011E 
#define CM3CON1               0x011F 

////////Bank3//////////////////
#define ANSELA                0x018C 
#define ANSELB                0x018D 
#define ANSELD                0x018F 
#define ANSELE                0x0190 
#define EEADR                 0x0191 
#define EEADRL                0x0191 
#define EEADRH                0x0192 
#define EEDATA                0x0193 
#define EEDATL                0x0193 
#define EEDATH                0x0194 
#define EECON1                0x0195 
#define EECON2                0x0196 
#define VREGCON               0x0197 
#define RC1REG                0x0199 
#define RCREG                 0x0199 
#define RCREG1                0x0199 
#define TX1REG                0x019A 
#define TXREG                 0x019A 
#define TXREG1                0x019A 
#define SP1BRG                0x019B 
#define SP1BRGL               0x019B 
#define SPBRG                 0x019B 
#define SPBRG1                0x019B 
#define SPBRGL                0x019B 
#define SP1BRGH               0x019C 
#define SPBRGH                0x019C 
#define SPBRGH1               0x019C 
#define RC1STA                0x019D 
#define RCSTA                 0x019D 
#define RCSTA1                0x019D 
#define TX1STA                0x019E 
#define TXSTA                 0x019E 
#define TXSTA1                0x019E 
#define BAUD1CON              0x019F 
#define BAUDCON               0x019F 
#define BAUDCON1              0x019F 
#define BAUDCTL               0x019F 
#define BAUDCTL1              0x019F 

////////Bank4//////////////////
#define WPUA                  0x020C 
#define WPUB                  0x020D 
#define WPUC                  0x020E 
#define WPUD                  0x020F 
#define WPUE                  0x0210 
#define SSP1BUF               0x0211 
#define SSPBUF                0x0211 
#define SSP1ADD               0x0212 
#define SSPADD                0x0212 
#define SSP1MSK               0x0213 
#define SSPMSK                0x0213 
#define SSP1STAT              0x0214 
#define SSPSTAT               0x0214 
#define SSP1CON1              0x0215 
#define SSPCON                0x0215 
#define SSPCON1               0x0215 
#define SSP1CON2              0x0216 
#define SSPCON2               0x0216 
#define SSP1CON3              0x0217 
#define SSPCON3               0x0217 

////////Bank5//////////////////
#define ODCONA                0x028C 
#define ODCONB                0x028D 
#define ODCONC                0x028E 
#define ODCOND                0x028F 
#define ODCONE                0x0290 
#define CCPR1                 0x0291 
#define CCPR1L                0x0291 
#define CCPR1H                0x0292 
#define CCP1CON               0x0293 
#define CCPR2                 0x0298 
#define CCPR2L                0x0298 
#define CCPR2H                0x0299 
#define CCP2CON               0x029A 

////////Bank6//////////////////
#define SLRCONA               0x030C 
#define SLRCONB               0x030D 
#define SLRCONC               0x030E 
#define SLRCOND               0x030F 
#define SLRCONE               0x0310 
#define CCPR3                 0x0311 
#define CCPR3L                0x0311 
#define CCPR3H                0x0312 
#define CCPR3CON              0x0313 

////////Bank7//////////////////
#define INLVLA                0x038C 
#define INLVLB                0x038D 
#define INLVLC                0x038E 
#define INLVLD                0x038F 
#define INLVLE                0x0390 
#define IOCAP                 0x0391 
#define IOCAN                 0x0392 
#define IOCAF                 0x0393 
#define IOCBP                 0x0394 
#define IOCBN                 0x0395 
#define IOCBF                 0x0396 
#define IOCCP                 0x0397 
#define IOCCN                 0x0398 
#define IOCCF                 0x0399 
#define IOCEP                 0x039D 
#define IOCEN                 0x039E 
#define IOCEF                 0x039F 

////////Bank10//////////////////
#define OPA1CON               0x0511 
#define OPA2CON               0x0513 
#define CLKRCON               0x051A 

////////Bank16//////////////////
#define PSMC1CON              0x0811 
#define PSMC1MDL              0x0812 
#define PSMC1SYNC             0x0813 
#define PSMC1CLK              0x0814 
#define PSMC1OEN              0x0815 
#define PSMC1POL              0x0816 
#define PSMC1BLNK             0x0817 
#define PSMC1REBS             0x0818 
#define PSMC1FEBS             0x0819 
#define PSMC1PHS              0x081A 
#define PSMC1DCS              0x081B 
#define PSMC1PRS              0x081C 
#define PSMC1ASDC             0x081D 
#define PSMC1ASDL             0x081E 
#define PSMC1ASDS             0x081F 
#define PSMC1INT              0x0820 
#define PSMC1PH               0x0821 
#define PSMC1PHL              0x0821 
#define PSMC1PHH              0x0822 
#define PSMC1DC               0x0823 
#define PSMC1DCL              0x0823 
#define PSMC1DCH              0x0824 
#define PSMC1PR               0x0825 
#define PSMC1PRL              0x0825 
#define PSMC1PRH              0x0826 
#define PSMC1TMR              0x0827 
#define PSMC1TMRL             0x0827 
#define PSMC1TMRH             0x0828 
#define PSMC1DBR              0x0829 
#define PSMC1DBF              0x082A 
#define PSMC1BLKR             0x082B 
#define PSMC1BLKF             0x082C 
#define PSMC1FFA              0x082D 
#define PSMC1STR0             0x082E 
#define PSMC1STR1             0x082F 
#define PSMC2CON              0x0831 
#define PSMC2MDL              0x0832 
#define PSMC2SYNC             0x0833 
#define PSMC2CLK              0x0834 
#define PSMC2OEN              0x0835 
#define PSMC2POL              0x0836 
#define PSMC2BLNK             0x0837 
#define PSMC2REBS             0x0838 
#define PSMC2FEBS             0x0839 
#define PSMC2PHS              0x083A 
#define PSMC2DCS              0x083B 
#define PSMC2PRS              0x083C 
#define PSMC2ASDC             0x083D 
#define PSMC2ASDL             0x083E 
#define PSMC2ASDS             0x083F 
#define PSMC2INT              0x0840 
#define PSMC2PH               0x0841 
#define PSMC2PHL              0x0841 
#define PSMC2PHH              0x0842 
#define PSMC2DC               0x0843 
#define PSMC2DCL              0x0843 
#define PSMC2DCH              0x0844 
#define PSMC2PR               0x0845 
#define PSMC2PRL              0x0845 
#define PSMC2PRH              0x0846 
#define PSMC2TMR              0x0847 
#define PSMC2TMRL             0x0847 
#define PSMC2TMRH             0x0848 
#define PSMC2DBR              0x0849 
#define PSMC2DBF              0x084A 
#define PSMC2BLKR             0x084B 
#define PSMC2BLKF             0x084C 
#define PSMC2FFA              0x084D 
#define PSMC2STR0             0x084E 
#define PSMC2STR1             0x084F 
#define PSMC3CON              0x0851 
#define PSMC3MDL              0x0852 
#define PSMC3SYNC             0x0853 
#define PSMC3CLK              0x0854 
#define PSMC3OEN              0x0855 
#define PSMC3POL              0x0856 
#define PSMC3BLNK             0x0857 
#define PSMC3REBS             0x0858 
#define PSMC3FEBS             0x0859 
#define PSMC3PHS              0x085A 
#define PSMC3DCS              0x085B 
#define PSMC3PRS              0x085C 
#define PSMC3ASDC             0x085D 
#define PSMC3ASDL             0x085E 
#define PSMC3ASDS             0x085F 
#define PSMC3INT              0x0860 
#define PSMC3PH               0x0861 
#define PSMC3PHL              0x0861 
#define PSMC3PHH              0x0862 
#define PSMC3DC               0x0863 
#define PSMC3DCL              0x0863 
#define PSMC3DCH              0x0864 
#define PSMC3PR               0x0865 
#define PSMC3PRL              0x0865 
#define PSMC3PRH              0x0866 
#define PSMC3TMR              0x0867 
#define PSMC3TMRL             0x0867 
#define PSMC3TMRH             0x0868 
#define PSMC3DBR              0x0869 
#define PSMC3DBF              0x086A 
#define PSMC3BLKR             0x086B 
#define PSMC3BLKF             0x086C 
#define PSMC3FFA              0x086D 
#define PSMC3STR0             0x086E 
#define PSMC3STR1             0x086F 

////////Bank31//////////////////
#define STATUS_SHAD           0x0FE4 
#define WREG_SHAD             0x0FE5 
#define BSR_SHAD              0x0FE6 
#define PCLATH_SHAD           0x0FE7 
#define FSR0L_SHAD            0x0FE8 
#define FSR0H_SHAD            0x0FE9 
#define FSR1L_SHAD            0x0FEA 
#define FSR1H_SHAD            0x0FEB 
#define STKPTR                0x0FED 
#define TOSL                  0x0FEE 
#define TOSH                  0x0FEF 

//////// STATUS Bits /////////////////////////////////////////////////////
#define C                     0x0000 
#define DC                    0x0001 
#define Z                     0x0002 
#define NOT_PD                0x0003 
#define NOT_TO                0x0004 

//////// BSR Bits /////////////////////////////////////////////////////
#define BSR0                  0x0000 
#define BSR1                  0x0001 
#define BSR2                  0x0002 
#define BSR3                  0x0003 
#define BSR4                  0x0004 

//////// INTCON Bits /////////////////////////////////////////////////////
#define IOCIF                 0x0000 
#define INTF                  0x0001 
#define TMR0IF                0x0002 
#define IOCIE                 0x0003 
#define INTE                  0x0004 
#define TMR0IE                0x0005 
#define PEIE                  0x0006 
#define GIE                   0x0007 
#define T0IF                  0x0002 
#define T0IE                  0x0005 

//////// PORTA Bits /////////////////////////////////////////////////////
#define RA0                   0x0000 
#define RA1                   0x0001 
#define RA2                   0x0002 
#define RA3                   0x0003 
#define RA4                   0x0004 
#define RA5                   0x0005 
#define RA6                   0x0006 
#define RA7                   0x0007 

//////// PORTB Bits /////////////////////////////////////////////////////
#define RB0                   0x0000 
#define RB1                   0x0001 
#define RB2                   0x0002 
#define RB3                   0x0003 
#define RB4                   0x0004 
#define RB5                   0x0005 
#define RB6                   0x0006 
#define RB7                   0x0007 


//////// PORTC Bits /////////////////////////////////////////////////////
#define RC0                   0x0000 
#define RC1                   0x0001 
#define RC2                   0x0002 
#define RC3                   0x0003 
#define RC4                   0x0004 
#define RC5                   0x0005 
#define RC6                   0x0006 
#define RC7                   0x0007 

//////// PORTD Bits /////////////////////////////////////////////////////
#define RD0                   0x0000 
#define RD1                   0x0001 
#define RD2                   0x0002 
#define RD3                   0x0003 
#define RD4                   0x0004 
#define RD5                   0x0005 
#define RD6                   0x0006 
#define RD7                   0x0007 

//////// PORTE Bits /////////////////////////////////////////////////////
#define RE0                   0x0000 
#define RE1                   0x0001 
#define RE2                   0x0002 
#define RE3                   0x0003 

//////// PIR1 Bits /////////////////////////////////////////////////////
#define TMR1IF                0x0000 
#define TMR2IF                0x0001 
#define CCP1IF                0x0002 
#define SSP1IF                0x0003 
#define TXIF                  0x0004 
#define RCIF                  0x0005 
#define ADIF                  0x0006 
#define TMR1GIF               0x0007 

//////// PIR2 Bits /////////////////////////////////////////////////////
#define CCP2IF                0x0000 
#define C3IF                  0x0001 
#define C4IF                  0x0002 
#define BCL1IF                0x0003 
#define EEIF                  0x0004 
#define C1IF                  0x0005 
#define C2IF                  0x0006 
#define OSFIF                 0x0007 

//////// PIR3 Bits /////////////////////////////////////////////////////
#define CCP3IF                0x0004 

//////// PIR4 Bits /////////////////////////////////////////////////////
#define PSMC1SIF              0x0000 
#define PSMC2SIF              0x0001 
#define PSMC3SIF              0x0002 
#define PSMC1TIF              0x0004 
#define PSMC2TIF              0x0005 
#define PSMC3TIF              0x0006 


//////// T1CON Bits /////////////////////////////////////////////////////
#define TMR1ON                0x0000 
#define NOT_T1SYNC            0x0002 
#define T1OSCEN               0x0003 
#define T1CKPS0               0x0004 
#define T1CKPS1               0x0005 
#define TMR1CS0               0x0006 
#define TMR1CS1               0x0007 

//////// T1GCON Bits /////////////////////////////////////////////////////
#define T1GSS0                0x0000 
#define T1GSS1                0x0001 
#define T1GVAL                0x0002 
#define T1GGO                 0x0003 
#define T1GSPM                0x0004 
#define T1GTM                 0x0005 
#define T1GPOL                0x0006 
#define TMR1GE                0x0007 

//////// T2CON Bits /////////////////////////////////////////////////////
#define T2CKPS0               0x0000 
#define T2CKPS1               0x0001 
#define TMR2ON                0x0002 
#define T2OUTPS0              0x0003 
#define T2OUTPS1              0x0004 
#define T2OUTPS2              0x0005 
#define T2OUTPS3              0x0006 

//////// TRISA Bits /////////////////////////////////////////////////////
#define TRISA0                0x0000 
#define TRISA1                0x0001 
#define TRISA2                0x0002 
#define TRISA3                0x0003 
#define TRISA4                0x0004 
#define TRISA5                0x0005 
#define TRISA6                0x0006 
#define TRISA7                0x0007 

//////// TRISB Bits /////////////////////////////////////////////////////
#define TRISB0                0x0000 
#define TRISB1                0x0001 
#define TRISB2                0x0002 
#define TRISB3                0x0003 
#define TRISB4                0x0004 
#define TRISB5                0x0005 
#define TRISB6                0x0006 
#define TRISB7                0x0007 

//////// TRISC Bits /////////////////////////////////////////////////////
#define TRISC0                0x0000 
#define TRISC1                0x0001 
#define TRISC2                0x0002 
#define TRISC3                0x0003 
#define TRISC4                0x0004 
#define TRISC5                0x0005 
#define TRISC6                0x0006 
#define TRISC7                0x0007 

//////// TRISD Bits /////////////////////////////////////////////////////
#define TRISD0                0x0000 
#define TRISD1                0x0001 
#define TRISD2                0x0002 
#define TRISD3                0x0003 
#define TRISD4                0x0004 
#define TRISD5                0x0005 
#define TRISD6                0x0006 
#define TRISD7                0x0007 

//////// TRISE Bits /////////////////////////////////////////////////////
#define TRISE0                0x0000 
#define TRISE1                0x0001 
#define TRISE2                0x0002 
#define TRISE3                0x0003 

//////// PIE1 Bits /////////////////////////////////////////////////////
#define TMR1IE                0x0000 
#define TMR2IE                0x0001 
#define CCP1IE                0x0002 
#define SSP1IE                0x0003 
#define TXIE                  0x0004 
#define RCIE                  0x0005 
#define ADIE                  0x0006 
#define TMR1GIE               0x0007 

//////// PIE2 Bits /////////////////////////////////////////////////////
#define CCP2IE                0x0000 
#define C3IE                  0x0001 
#define C4IE                  0x0002 
#define BCL1IE                0x0003 
#define EEIE                  0x0004 
#define C1IE                  0x0005 
#define C2IE                  0x0006 
#define OSFIE                 0x0007 

//////// PIE3 Bits /////////////////////////////////////////////////////
#define CCP3IE                0x0004 

//////// PIE4 Bits /////////////////////////////////////////////////////
#define PSMC1SIE              0x0000 
#define PSMC2SIE              0x0001 
#define PSMC3SIE              0x0002 
#define PSMC1TIE              0x0004 
#define PSMC2TIE              0x0005 
#define PSMC3TIE              0x0006 

//////// OPTION_REG Bits /////////////////////////////////////////////////////
#define PS0                   0x0000 
#define PS1                   0x0001 
#define PS2                   0x0002 
#define PSA                   0x0003 
#define TMR0SE                0x0004 
#define TMR0CS                0x0005 
#define INTEDG                0x0006 
#define NOT_WPUEN             0x0007 
#define T0SE                  0x0004 
#define T0CS                  0x0005 

//////// PCON Bits /////////////////////////////////////////////////////
#define NOT_BOR               0x0000 
#define NOT_POR               0x0001 
#define NOT_RI                0x0002 
#define NOT_RMCLR             0x0003 
#define NOT_RWDT              0x0004 
#define STKUNF                0x0006 
#define STKOVF                0x0007 

//////// WDTCON Bits /////////////////////////////////////////////////////
#define SWDTEN                0x0000 
#define WDTPS0                0x0001 
#define WDTPS1                0x0002 
#define WDTPS2                0x0003 
#define WDTPS3                0x0004 
#define WDTPS4                0x0005 

//////// OSCTUNE Bits /////////////////////////////////////////////////////
#define TUN0                  0x0000 
#define TUN1                  0x0001 
#define TUN2                  0x0002 
#define TUN3                  0x0003 
#define TUN4                  0x0004 
#define TUN5                  0x0005 

//////// OSCCON Bits /////////////////////////////////////////////////////
#define SCS0                  0x0000 
#define SCS1                  0x0001 
#define IRCF0                 0x0003 
#define IRCF1                 0x0004 
#define IRCF2                 0x0005 
#define IRCF3                 0x0006 
#define SPLLEN                0x0007 

//////// OSCSTAT Bits /////////////////////////////////////////////////////
#define HFIOFS                0x0000 
#define LFIOFR                0x0001 
#define MFIOFR                0x0002 
#define HFIOFL                0x0003 
#define HFIOFR                0x0004 
#define OSTS                  0x0005 
#define PLLR                  0x0006 
#define T1OSCR                0x0007 

//////// ADCON0 Bits /////////////////////////////////////////////////////
#define ADON                  0x0000 
#define GO_NOT_DONE           0x0001 
#define CHS0                  0x0002 
#define CHS1                  0x0003 
#define CHS2                  0x0004 
#define CHS3                  0x0005 
#define CHS4                  0x0006 
#define ADGO                  0x0001 
#define GO                    0x0001 
#define DONE                  0x0001 

//////// ADCON1 Bits /////////////////////////////////////////////////////
#define ADPREF0               0x0000 
#define ADPREF1               0x0001 
#define ADNREF                0x0002 
#define ADCS0                 0x0004 
#define ADCS1                 0x0005 
#define ADCS2                 0x0006 
#define ADFM                  0x0007 

//////// ADCON2 Bits /////////////////////////////////////////////////////
#define CHSN0                 0x0000 
#define CHSN1                 0x0001 
#define CHSN2                 0x0002 
#define CHSN3                 0x0003 
#define TRIGSEL0              0x0004 
#define TRIGSEL1              0x0005 
#define TRIGSEL2              0x0006 
#define TRIGSEL3              0x0007 

//////// LATA Bits /////////////////////////////////////////////////////
#define LATA0                 0x0000 
#define LATA1                 0x0001 
#define LATA2                 0x0002 
#define LATA3                 0x0003 
#define LATA4                 0x0004 
#define LATA5                 0x0005 
#define LATA6                 0x0006 
#define LATA7                 0x0007 

//////// LATB Bits /////////////////////////////////////////////////////
#define LATB0                 0x0000 
#define LATB1                 0x0001 
#define LATB2                 0x0002 
#define LATB3                 0x0003 
#define LATB4                 0x0004 
#define LATB5                 0x0005 
#define LATB6                 0x0006 
#define LATB7                 0x0007 

//////// LATC Bits /////////////////////////////////////////////////////
#define LATC0                 0x0000 
#define LATC1                 0x0001 
#define LATC2                 0x0002 
#define LATC3                 0x0003 
#define LATC4                 0x0004 
#define LATC5                 0x0005 
#define LATC6                 0x0006 
#define LATC7                 0x0007 

//////// LATD Bits /////////////////////////////////////////////////////
#define LATD0                 0x0000 
#define LATD1                 0x0001 
#define LATD2                 0x0002 
#define LATD3                 0x0003 
#define LATD4                 0x0004 
#define LATD5                 0x0005 
#define LATD6                 0x0006 
#define LATD7                 0x0007 

//////// LATE Bits /////////////////////////////////////////////////////
#define LATE0                 0x0000 
#define LATE1                 0x0001 
#define LATE2                 0x0002 

//////// CM1CON0 Bits /////////////////////////////////////////////////////
#define C1SYNC                0x0000 
#define C1HYS                 0x0001 
#define C1SP                  0x0002 
#define C1ZLF                 0x0003 
#define C1POL                 0x0004 
#define C1OE                  0x0005 
#define C1OUT                 0x0006 
#define C1ON                  0x0007 

//////// CM1CON1 Bits /////////////////////////////////////////////////////
#define C1NCH0                0x0000 
#define C1NCH1                0x0001 
#define C1NCH2                0x0002 
#define C1PCH0                0x0003 
#define C1PCH1                0x0004 
#define C1PCH2                0x0005 
#define C1INTN                0x0006 
#define C1INTP                0x0007 

//////// CM2CON0 Bits /////////////////////////////////////////////////////
#define C2SYNC                0x0000 
#define C2HYS                 0x0001 
#define C2SP                  0x0002 
#define C2ZLF                 0x0003 
#define C2POL                 0x0004 
#define C2OE                  0x0005 
#define C2OUT                 0x0006 
#define C2ON                  0x0007 

//////// CM2CON1 Bits /////////////////////////////////////////////////////
#define C2NCH0                0x0000 
#define C2NCH1                0x0001 
#define C2NCH2                0x0002 
#define C2PCH0                0x0003 
#define C2PCH1                0x0004 
#define C2PCH2                0x0005 
#define C2INTN                0x0006 
#define C2INTP                0x0007 

//////// CMOUT Bits /////////////////////////////////////////////////////
#define MC1OUT                0x0000 
#define MC2OUT                0x0001 
#define MC3OUT                0x0002 
#define MC4OUT                0x0003 

//////// BORCON Bits /////////////////////////////////////////////////////
#define BORRDY                0x0000 
#define BORFS                 0x0006 
#define SBOREN                0x0007 

//////// FVRCON Bits /////////////////////////////////////////////////////
#define ADFVR0                0x0000 
#define ADFVR1                0x0001 
#define CDAFVR0               0x0002 
#define CDAFVR1               0x0003 
#define TSRNG                 0x0004
#define TSEN                  0x0005
#define FVRRDY                0x0006 
#define FVREN                 0x0007 

//////// DAC1CON0 Bits /////////////////////////////////////////////////////
#define DAC1NSS               0x0000 
#define DAC1PSS0              0x0002 
#define DAC1PSS1              0x0003 
#define DAC1OE2               0x0004 
#define DAC1OE1               0x0005 
#define DAC1EN                0x0007 

//////// DAC1CON1 Bits /////////////////////////////////////////////////////
#define DAC1R0                0x0000 
#define DAC1R1                0x0001 
#define DAC1R2                0x0002 
#define DAC1R3                0x0003 
#define DAC1R4                0x0004 
#define DAC1R5                0x0005 
#define DAC1R6                0x0006 
#define DAC1R7                0x0007 

//////// CM4CON0 Bits /////////////////////////////////////////////////////
#define C4SYNC                0x0000 
#define C4HYS                 0x0001 
#define C4SP                  0x0002 
#define C4ZLF                 0x0003 
#define C4POL                 0x0004 
#define C4OE                  0x0005 
#define C4OUT                 0x0006 
#define C4ON                  0x0007 

//////// CM4CON1 Bits /////////////////////////////////////////////////////
#define C4NCH0                0x0000 
#define C4NCH1                0x0001 
#define C4PCH0                0x0004 
#define C4PCH1                0x0005 
#define C4INTN                0x0006 
#define C4INTP                0x0007 

//////// APFCON2 Bits /////////////////////////////////////////////////////
#define CCP3SEL               0x0000 

//////// APFCON1 Bits /////////////////////////////////////////////////////
#define CCP2SEL               0x0000 
#define RXSEL                 0x0001 
#define TXSEL                 0x0002 
#define SDISEL                0x0003 
#define SCKSEL                0x0004 
#define SDOSEL                0x0005 
#define CCP1SEL               0x0006 
#define C2OUTSEL              0x0007 

//////// CM3CON0 Bits /////////////////////////////////////////////////////
#define C3SYNC                0x0000 
#define C3HYS                 0x0001 
#define C3SP                  0x0002 
#define C3ZLF                 0x0003 
#define C3POL                 0x0004 
#define C3OE                  0x0005 
#define C3OUT                 0x0006 
#define C3ON                  0x0007 

//////// CM3CON1 Bits /////////////////////////////////////////////////////
#define C3NCH0                0x0000 
#define C3NCH1                0x0001 
#define C3NCH2                0x0002 
#define C3PCH0                0x0003 
#define C3PCH1                0x0004 
#define C3PCH2                0x0005 
#define C3INTN                0x0006 
#define C3INTP                0x0007 

//////// ANSELA Bits /////////////////////////////////////////////////////
#define ANSA0                 0x0000 
#define ANSA1                 0x0001 
#define ANSA2                 0x0002 
#define ANSA3                 0x0003 
#define ANSA4                 0x0004 
#define ANSA5                 0x0005 
#define ANSA7                 0x0007 

//////// ANSELB Bits /////////////////////////////////////////////////////
#define ANSB0                 0x0000 
#define ANSB1                 0x0001 
#define ANSB2                 0x0002 
#define ANSB3                 0x0003 
#define ANSB4                 0x0004 
#define ANSB5                 0x0005 
#define ANSB6                 0x0006 

//////// ANSELD Bits /////////////////////////////////////////////////////
#define ANSD0                 0x0000 
#define ANSD1                 0x0001 
#define ANSD2                 0x0002 

//////// ANSELE Bits /////////////////////////////////////////////////////
#define ANSE0                 0x0000 
#define ANSE1                 0x0001 
#define ANSE2                 0x0002 

//////// EECON1 Bits /////////////////////////////////////////////////////
#define RD                    0x0000 
#define WR                    0x0001 
#define WREN                  0x0002 
#define WRERR                 0x0003 
#define FREE                  0x0004 
#define LWLO                  0x0005 
#define CFGS                  0x0006 
#define EEPGD                 0x0007 

//////// VREGCON Bits /////////////////////////////////////////////////////
#define VREGPM0               0x0000 
#define VREGPM1               0x0001 

//////// RC1STA Bits /////////////////////////////////////////////////////
#define RX9D                  0x0000 
#define OERR                  0x0001 
#define FERR                  0x0002 
#define ADDEN                 0x0003 
#define CREN                  0x0004 
#define SREN                  0x0005 
#define RX9                   0x0006 
#define SPEN                  0x0007 

//////// RCSTA Bits /////////////////////////////////////////////////////
#define RX9D                  0x0000 
#define OERR                  0x0001 
#define FERR                  0x0002 
#define ADDEN                 0x0003 
#define CREN                  0x0004 
#define SREN                  0x0005 
#define RX9                   0x0006 
#define SPEN                  0x0007 

//////// RCSTA1 Bits /////////////////////////////////////////////////////
#define RX9D                  0x0000 
#define OERR                  0x0001 
#define FERR                  0x0002 
#define ADDEN                 0x0003 
#define CREN                  0x0004 
#define SREN                  0x0005 
#define RX9                   0x0006 
#define SPEN                  0x0007 

//////// TX1STA Bits /////////////////////////////////////////////////////
#define TX9D                  0x0000 
#define TRMT                  0x0001 
#define BRGH                  0x0002 
#define SENDB                 0x0003 
#define SYNC                  0x0004 
#define TXEN                  0x0005 
#define TX9                   0x0006 
#define CSRC                  0x0007 

//////// TXSTA Bits /////////////////////////////////////////////////////
#define TX9D                  0x0000 
#define TRMT                  0x0001 
#define BRGH                  0x0002 
#define SENDB                 0x0003 
#define SYNC                  0x0004 
#define TXEN                  0x0005 
#define TX9                   0x0006 
#define CSRC                  0x0007 

//////// TXSTA1 Bits /////////////////////////////////////////////////////
#define TX9D                  0x0000 
#define TRMT                  0x0001 
#define BRGH                  0x0002 
#define SENDB                 0x0003 
#define SYNC                  0x0004 
#define TXEN                  0x0005 
#define TX9                   0x0006 
#define CSRC                  0x0007 

//////// BAUD1CON Bits /////////////////////////////////////////////////////
#define ABDEN                 0x0000 
#define WUE                   0x0001 
#define BRG16                 0x0003 
#define SCKP                  0x0004 
#define RCIDL                 0x0006 
#define ABDOVF                0x0007 

//////// BAUDCON Bits /////////////////////////////////////////////////////
#define ABDEN                 0x0000 
#define WUE                   0x0001 
#define BRG16                 0x0003 
#define SCKP                  0x0004 
#define RCIDL                 0x0006 
#define ABDOVF                0x0007 

//////// BAUDCON1 Bits /////////////////////////////////////////////////////
#define ABDEN                 0x0000 
#define WUE                   0x0001 
#define BRG16                 0x0003 
#define SCKP                  0x0004 
#define RCIDL                 0x0006 
#define ABDOVF                0x0007 

//////// BAUDCTL Bits /////////////////////////////////////////////////////
#define ABDEN                 0x0000 
#define WUE                   0x0001 
#define BRG16                 0x0003 
#define SCKP                  0x0004 
#define RCIDL                 0x0006 
#define ABDOVF                0x0007 

//////// BAUDCTL1 Bits /////////////////////////////////////////////////////
#define ABDEN                 0x0000 
#define WUE                   0x0001 
#define BRG16                 0x0003 
#define SCKP                  0x0004 
#define RCIDL                 0x0006 
#define ABDOVF                0x0007 

//////// WPUA Bits /////////////////////////////////////////////////////
#define WPUA0                 0x0000 
#define WPUA1                 0x0001 
#define WPUA2                 0x0002 
#define WPUA3                 0x0003 
#define WPUA4                 0x0004 
#define WPUA5                 0x0005 
#define WPUA6                 0x0006 
#define WPUA7                 0x0007 

//////// WPUB Bits /////////////////////////////////////////////////////
#define WPUB0                 0x0000 
#define WPUB1                 0x0001 
#define WPUB2                 0x0002 
#define WPUB3                 0x0003 
#define WPUB4                 0x0004 
#define WPUB5                 0x0005 
#define WPUB6                 0x0006 
#define WPUB7                 0x0007 

//////// WPUC Bits /////////////////////////////////////////////////////
#define WPUC0                 0x0000 
#define WPUC1                 0x0001 
#define WPUC2                 0x0002 
#define WPUC3                 0x0003 
#define WPUC4                 0x0004 
#define WPUC5                 0x0005 
#define WPUC6                 0x0006 
#define WPUC7                 0x0007 

//////// WPUD Bits /////////////////////////////////////////////////////
#define WPUD0                 0x0000 
#define WPUD1                 0x0001 
#define WPUD2                 0x0002 
#define WPUD3                 0x0003 
#define WPUD4                 0x0004 
#define WPUD5                 0x0005 
#define WPUD6                 0x0006 
#define WPUD7                 0x0007 

//////// WPUE Bits /////////////////////////////////////////////////////
#define WPUE0                 0x0000 
#define WPUE1                 0x0001 
#define WPUE2                 0x0002 
#define WPUE3                 0x0003 

//////// SSP1STAT Bits /////////////////////////////////////////////////////
#define BF                    0x0000 
#define UA                    0x0001 
#define R_NOT_W               0x0002 
#define S                     0x0003 
#define P                     0x0004 
#define D_NOT_A               0x0005 
#define CKE                   0x0006 
#define SMP                   0x0007 

//////// SSPSTAT Bits /////////////////////////////////////////////////////
#define BF                    0x0000 
#define UA                    0x0001 
#define R_NOT_W               0x0002 
#define S                     0x0003 
#define P                     0x0004 
#define D_NOT_A               0x0005 
#define CKE                   0x0006 
#define SMP                   0x0007 

//////// SSP1CON1 Bits /////////////////////////////////////////////////////
#define SSPM0                 0x0000 
#define SSPM1                 0x0001 
#define SSPM2                 0x0002 
#define SSPM3                 0x0003 
#define CKP                   0x0004 
#define SSPEN                 0x0005 
#define SSPOV                 0x0006 
#define WCOL                  0x0007 

//////// SSPCON Bits /////////////////////////////////////////////////////
#define SSPM0                 0x0000 
#define SSPM1                 0x0001 
#define SSPM2                 0x0002 
#define SSPM3                 0x0003 
#define CKP                   0x0004 
#define SSPEN                 0x0005 
#define SSPOV                 0x0006 
#define WCOL                  0x0007 

//////// SSPCON1 Bits /////////////////////////////////////////////////////
#define SSPM0                 0x0000 
#define SSPM1                 0x0001 
#define SSPM2                 0x0002 
#define SSPM3                 0x0003 
#define CKP                   0x0004 
#define SSPEN                 0x0005 
#define SSPOV                 0x0006 
#define WCOL                  0x0007 

//////// SSP1CON2 Bits /////////////////////////////////////////////////////
#define SEN                   0x0000 
#define RSEN                  0x0001 
#define PEN                   0x0002 
#define RCEN                  0x0003 
#define ACKEN                 0x0004 
#define ACKDT                 0x0005 
#define ACKSTAT               0x0006 
#define GCEN                  0x0007 

//////// SSPCON2 Bits /////////////////////////////////////////////////////
#define SEN                   0x0000 
#define RSEN                  0x0001 
#define PEN                   0x0002 
#define RCEN                  0x0003 
#define ACKEN                 0x0004 
#define ACKDT                 0x0005 
#define ACKSTAT               0x0006 
#define GCEN                  0x0007 

//////// SSP1CON3 Bits /////////////////////////////////////////////////////
#define DHEN                  0x0000 
#define AHEN                  0x0001 
#define SBCDE                 0x0002 
#define SDAHT                 0x0003 
#define BOEN                  0x0004 
#define SCIE                  0x0005 
#define PCIE                  0x0006 
#define ACKTIM                0x0007 

//////// SSPCON3 Bits /////////////////////////////////////////////////////
#define DHEN                  0x0000 
#define AHEN                  0x0001 
#define SBCDE                 0x0002 
#define SDAHT                 0x0003 
#define BOEN                  0x0004 
#define SCIE                  0x0005 
#define PCIE                  0x0006 
#define ACKTIM                0x0007 

//////// ODCONA Bits /////////////////////////////////////////////////////
#define ODA0                  0x0000 
#define ODA1                  0x0001 
#define ODA2                  0x0002 
#define ODA3                  0x0003 
#define ODA4                  0x0004 
#define ODA5                  0x0005 
#define ODA6                  0x0006 
#define ODA7                  0x0007 

//////// ODCONB Bits /////////////////////////////////////////////////////
#define ODB0                  0x0000 
#define ODB1                  0x0001 
#define ODB2                  0x0002 
#define ODB3                  0x0003 
#define ODB4                  0x0004 
#define ODB5                  0x0005 
#define ODB6                  0x0006 
#define ODB7                  0x0007 

//////// ODCONC Bits /////////////////////////////////////////////////////
#define ODC0                  0x0000 
#define ODC1                  0x0001 
#define ODC2                  0x0002 
#define ODC3                  0x0003 
#define ODC4                  0x0004 
#define ODC5                  0x0005 
#define ODC6                  0x0006 
#define ODC7                  0x0007 

//////// ODCOND Bits /////////////////////////////////////////////////////
#define ODD0                  0x0000 
#define ODD1                  0x0001 
#define ODD2                  0x0002 
#define ODD3                  0x0003 
#define ODD4                  0x0004 
#define ODD5                  0x0005 
#define ODD6                  0x0006 
#define ODD7                  0x0007  

//////// ODCONE Bits /////////////////////////////////////////////////////
#define ODE0                  0x0000 
#define ODE1                  0x0001 
#define ODE2                  0x0002 

//////// CCP1CON Bits /////////////////////////////////////////////////////
#define CCP1M0                0x0000 
#define CCP1M1                0x0001 
#define CCP1M2                0x0002 
#define CCP1M3                0x0003 
#define DC1B0                 0x0004 
#define DC1B1                 0x0005 
#define P1M0                  0x0006 
#define P1M1                  0x0007 

//////// CCP2CON Bits /////////////////////////////////////////////////////
#define CCP2M0                0x0000 
#define CCP2M1                0x0001 
#define CCP2M2                0x0002 
#define CCP2M3                0x0003 
#define DC2B0                 0x0004 
#define DC2B1                 0x0005 
#define P2M0                  0x0006 
#define P2M1                  0x0007 

//////// SLRCONA Bits /////////////////////////////////////////////////////
#define SLRA0                 0x0000 
#define SLRA1                 0x0001 
#define SLRA2                 0x0002 
#define SLRA3                 0x0003 
#define SLRA4                 0x0004 
#define SLRA5                 0x0005 
#define SLRA6                 0x0006 
#define SLRA7                 0x0007 

//////// SLRCONB Bits /////////////////////////////////////////////////////
#define SLRB0                 0x0000 
#define SLRB1                 0x0001 
#define SLRB2                 0x0002 
#define SLRB3                 0x0003 
#define SLRB4                 0x0004 
#define SLRB5                 0x0005 
#define SLRB6                 0x0006 
#define SLRB7                 0x0007 

//////// SLRCONC Bits /////////////////////////////////////////////////////
#define SLRC0                 0x0000 
#define SLRC1                 0x0001 
#define SLRC2                 0x0002 
#define SLRC3                 0x0003 
#define SLRC4                 0x0004 
#define SLRC5                 0x0005 
#define SLRC6                 0x0006 
#define SLRC7                 0x0007 

//////// SLRCOND Bits /////////////////////////////////////////////////////
#define SLRD0                 0x0000 
#define SLRD1                 0x0001 
#define SLRD2                 0x0002 
#define SLRD3                 0x0003 
#define SLRD4                 0x0004 
#define SLRD5                 0x0005 
#define SLRD6                 0x0006 
#define SLRD7                 0x0007 

//////// SLRCONE Bits /////////////////////////////////////////////////////
#define SLRE0                 0x0000 
#define SLRE1                 0x0001 
#define SLRE2                 0x0002 

//////// CCP3CON Bits /////////////////////////////////////////////////////
#define CCP3M0                0x0000 
#define CCP3M1                0x0001 
#define CCP3M2                0x0002 
#define CCP3M3                0x0003 
#define DC3B0                 0x0004 
#define DC3B1                 0x0005 
#define P3M0                  0x0006 
#define P3M1                  0x0007 


//////// INLVLA Bits /////////////////////////////////////////////////////
#define INLVLA0               0x0000 
#define INLVLA1               0x0001 
#define INLVLA2               0x0002 
#define INLVLA3               0x0003 
#define INLVLA4               0x0004 
#define INLVLA5               0x0005 
#define INLVLA6               0x0006 
#define INLVLA7               0x0007 

//////// INLVLB Bits /////////////////////////////////////////////////////
#define INLVLB0               0x0000 
#define INLVLB1               0x0001 
#define INLVLB2               0x0002 
#define INLVLB3               0x0003 
#define INLVLB4               0x0004 
#define INLVLB5               0x0005 
#define INLVLB6               0x0006 
#define INLVLB7               0x0007 

//////// INLVLC Bits /////////////////////////////////////////////////////
#define INLVLC0               0x0000 
#define INLVLC1               0x0001 
#define INLVLC2               0x0002 
#define INLVLC3               0x0003 
#define INLVLC4               0x0004 
#define INLVLC5               0x0005 
#define INLVLC6               0x0006 
#define INLVLC7               0x0007 

//////// INLVLD Bits /////////////////////////////////////////////////////
#define INLVLD0               0x0000 
#define INLVLD1               0x0001 
#define INLVLD2               0x0002 
#define INLVLD3               0x0003 
#define INLVLD4               0x0004 
#define INLVLD5               0x0005 
#define INLVLD6               0x0006 
#define INLVLD7               0x0007 

//////// INLVLE Bits /////////////////////////////////////////////////////
#define INLVLE0               0x0000 
#define INLVLE1               0x0001
#define INLVLE2               0x0002 
#define INLVLE3               0x0003 

//////// IOCAP Bits /////////////////////////////////////////////////////
#define IOCAP0                0x0000 
#define IOCAP1                0x0001 
#define IOCAP2                0x0002 
#define IOCAP3                0x0003 
#define IOCAP4                0x0004 
#define IOCAP5                0x0005 
#define IOCAP6                0x0006 
#define IOCAP7                0x0007 

//////// IOCAN Bits /////////////////////////////////////////////////////
#define IOCAN0                0x0000 
#define IOCAN1                0x0001 
#define IOCAN2                0x0002 
#define IOCAN3                0x0003 
#define IOCAN4                0x0004 
#define IOCAN5                0x0005 
#define IOCAN6                0x0006 
#define IOCAN7                0x0007 

//////// IOCAF Bits /////////////////////////////////////////////////////
#define IOCAF0                0x0000 
#define IOCAF1                0x0001 
#define IOCAF2                0x0002 
#define IOCAF3                0x0003 
#define IOCAF4                0x0004 
#define IOCAF5                0x0005 
#define IOCAF6                0x0006 
#define IOCAF7                0x0007 

//////// IOCBP Bits /////////////////////////////////////////////////////
#define IOCBP0                0x0000 
#define IOCBP1                0x0001 
#define IOCBP2                0x0002 
#define IOCBP3                0x0003 
#define IOCBP4                0x0004 
#define IOCBP5                0x0005 
#define IOCBP6                0x0006 
#define IOCBP7                0x0007 

//////// IOCBN Bits /////////////////////////////////////////////////////
#define IOCBN0                0x0000 
#define IOCBN1                0x0001 
#define IOCBN2                0x0002 
#define IOCBN3                0x0003 
#define IOCBN4                0x0004 
#define IOCBN5                0x0005 
#define IOCBN6                0x0006 
#define IOCBN7                0x0007 

//////// IOCBF Bits /////////////////////////////////////////////////////
#define IOCBF0                0x0000 
#define IOCBF1                0x0001 
#define IOCBF2                0x0002 
#define IOCBF3                0x0003 
#define IOCBF4                0x0004 
#define IOCBF5                0x0005 
#define IOCBF6                0x0006 
#define IOCBF7                0x0007 

//////// IOCCP Bits /////////////////////////////////////////////////////
#define IOCCP0                0x0000 
#define IOCCP1                0x0001 
#define IOCCP2                0x0002 
#define IOCCP3                0x0003 
#define IOCCP4                0x0004 
#define IOCCP5                0x0005 
#define IOCCP6                0x0006 
#define IOCCP7                0x0007 

//////// IOCCN Bits /////////////////////////////////////////////////////
#define IOCCN0                0x0000 
#define IOCCN1                0x0001 
#define IOCCN2                0x0002 
#define IOCCN3                0x0003 
#define IOCCN4                0x0004 
#define IOCCN5                0x0005 
#define IOCCN6                0x0006 
#define IOCCN7                0x0007 

//////// IOCCF Bits /////////////////////////////////////////////////////
#define IOCCF0                0x0000 
#define IOCCF1                0x0001 
#define IOCCF2                0x0002 
#define IOCCF3                0x0003 
#define IOCCF4                0x0004 
#define IOCCF5                0x0005 
#define IOCCF6                0x0006 
#define IOCCF7                0x0007 

//////// IOCEP Bits /////////////////////////////////////////////////////
#define IOCEP3                0x0003 

//////// IOCEN Bits /////////////////////////////////////////////////////
#define IOCEN3                0x0003 

//////// IOCEF Bits /////////////////////////////////////////////////////
#define IOCEF3                0x0003 

//////// OPA1CON Bits /////////////////////////////////////////////////////
#define OPA1PCH0              0x0000 
#define OPA1PCH1              0x0001 
#define OPA1SP                0x0006 
#define OPA1EN                0x0007 

//////// OPA2CON Bits /////////////////////////////////////////////////////
#define OPA2PCH0              0x0000 
#define OPA2PCH1              0x0001 
#define OPA2SP                0x0006 
#define OPA2EN                0x0007 

//////// OPA3CON Bits /////////////////////////////////////////////////////
#define OPA3PCH0              0x0000 
#define OPA3PCH1              0x0001 
#define OPA3SP                0x0006 
#define OPA3EN                0x0007 

//////// CLKRCON Bits /////////////////////////////////////////////////////
#define CLKRDIV0              0x0000 
#define CLKRDIV1              0x0001 
#define CLKRDIV2              0x0002 
#define CLKRDC0               0x0003 
#define CLKRDC1               0x0004 
#define CLKRSLR               0x0005 
#define CLKROE                0x0006 
#define CLKREN                0x0007 

//////// PSMC1CON Bits /////////////////////////////////////////////////////
#define P1MODE0               0x0000 
#define P1MODE1               0x0001 
#define P1MODE2               0x0002 
#define P1MODE3               0x0003 
#define P1DBRE                0x0004 
#define P1DBFE                0x0005 
#define PSMC1LD               0x0006 
#define PSMC1EN               0x0007 

//////// PSMC1MDL Bits /////////////////////////////////////////////////////
#define P1MSRC0               0x0000 
#define P1MSRC1               0x0001 
#define P1MSRC2               0x0002 
#define P1MSRC3               0x0003 
#define P1MDLBIT              0x0005 
#define P1MDLPOL              0x0006 
#define P1MDLEN               0x0007 

//////// PSMC1SYNC Bits /////////////////////////////////////////////////////
#define P1SYNC0               0x0000 
#define P1SYNC1               0x0001 
#define P1DCPOL               0x0005 
#define P1PRPOL               0x0006 
#define P1POFST               0x0007 

//////// PSMC1CLK Bits /////////////////////////////////////////////////////
#define P1CSRC0               0x0000 
#define P1CSRC1               0x0001 
#define P1CPRE0               0x0004 
#define P1CPRE1               0x0005 

//////// PSMC1OEN Bits /////////////////////////////////////////////////////
#define P1OEA                 0x0000 
#define P1OEB                 0x0001 
#define P1OEC                 0x0002 
#define P1OED                 0x0003 
#define P1OEE                 0x0004 
#define P1OEF                 0x0005 

//////// PSMC1POL Bits /////////////////////////////////////////////////////
#define P1POLA                0x0000 
#define P1POLB                0x0001 
#define P1POLC                0x0002 
#define P1POLD                0x0003 
#define P1POLE                0x0004 
#define P1POLF                0x0005 
#define P1INPOL               0x0006 

//////// PSMC1BLNK Bits /////////////////////////////////////////////////////
#define P1REBM0               0x0000 
#define P1REBM1               0x0001 
#define P1FEBM0               0x0004 
#define P1FEBM1               0x0005 

//////// PSMC1REBS Bits /////////////////////////////////////////////////////
#define P1REBSC1              0x0001 
#define P1REBSC2              0x0002 
#define P1REBSC3              0x0003 
#define P1REBSC4              0x0004 
#define P1REBSIN              0x0007 

//////// PSMC1FEBS Bits /////////////////////////////////////////////////////
#define P1FEBSC1              0x0001 
#define P1FEBSC2              0x0002 
#define P1FEBSC3              0x0003 
#define P1FEBSC4              0x0004 
#define P1FEBSIN              0x0007 

//////// PSMC1PHS Bits /////////////////////////////////////////////////////
#define P1PHST                0x0000 
#define P1PHSC1               0x0001 
#define P1PHSC2               0x0002 
#define P1PHSC3               0x0003 
#define P1PHSC4               0x0004 
#define P1PHSIN               0x0007 

//////// PSMC1DCS Bits /////////////////////////////////////////////////////
#define P1DCST                0x0000 
#define P1DCSC1               0x0001 
#define P1DCSC2               0x0002 
#define P1DCSC3               0x0003 
#define P1DCSC4               0x0004 
#define P1DCSIN               0x0007 

//////// PSMC1PRS Bits /////////////////////////////////////////////////////
#define P1PRST                0x0000 
#define P1PRSC1               0x0001 
#define P1PRSC2               0x0002 
#define P1PRSC3               0x0003 
#define P1PRSC4               0x0004 
#define P1PRSIN               0x0007 

//////// PSMC1ASDC Bits /////////////////////////////////////////////////////
#define P1ASDOV               0x0000 
#define P1ARSEN               0x0005 
#define P1ASDEN               0x0006 
#define P1ASE                 0x0007 

//////// PSMC1ASDL Bits /////////////////////////////////////////////////////
#define P1ASDLA               0x0000 
#define P1ASDLB               0x0001 
#define P1ASDLC               0x0002 
#define P1ASDLD               0x0003 
#define P1ASDLE               0x0004 
#define P1ASDLF               0x0005 

//////// PSMC1ASDS Bits /////////////////////////////////////////////////////
#define P1ASDSC1              0x0001 
#define P1ASDSC2              0x0002 
#define P1ASDSC3              0x0003 
#define P1ASDSC4              0x0004 
#define P1ASDSIN              0x0007 

//////// PSMC1INT Bits /////////////////////////////////////////////////////
#define P1TPRIF               0x0000 
#define P1TDCIF               0x0001 
#define P1TPHIF               0x0002 
#define P1TOVIF               0x0003 
#define P1TPRIE               0x0004 
#define P1TDCIE               0x0005 
#define P1TPHIE               0x0006 
#define P1TOVIE               0x0007 

//////// PSMC1PHL Bits /////////////////////////////////////////////////////
#define PSMC1PH0              0x0000 
#define PSMC1PH1              0x0001 
#define PSMC1PH2              0x0002 
#define PSMC1PH3              0x0003 
#define PSMC1PH4              0x0004 
#define PSMC1PH5              0x0005 
#define PSMC1PH6              0x0006 
#define PSMC1PH7              0x0007 

//////// PSMC1PHH Bits /////////////////////////////////////////////////////
#define PSMC1PH8              0x0000 
#define PSMC1PH9              0x0001 
#define PSMC1PH10             0x0002 
#define PSMC1PH11             0x0003 
#define PSMC1PH12             0x0004 
#define PSMC1PH13             0x0005 
#define PSMC1PH14             0x0006 
#define PSMC1PH15             0x0007 

//////// PSMC1DCL Bits /////////////////////////////////////////////////////
#define PSMC1DC0              0x0000 
#define PSMC1DC1              0x0001 
#define PSMC1DC2              0x0002 
#define PSMC1DC3              0x0003 
#define PSMC1DC4              0x0004 
#define PSMC1DC5              0x0005 
#define PSMC1DC6              0x0006 
#define PSMC1DC7              0x0007 

//////// PSMC1DCH Bits /////////////////////////////////////////////////////
#define PSMC1DC8              0x0000 
#define PSMC1DC9              0x0001 
#define PSMC1DC10             0x0002 
#define PSMC1DC11             0x0003 
#define PSMC1DC12             0x0004 
#define PSMC1DC13             0x0005 
#define PSMC1DC14             0x0006 
#define PSMC1DC15             0x0007 

//////// PSMC1PRL Bits /////////////////////////////////////////////////////
#define PSMC1PR0              0x0000 
#define PSMC1PR1              0x0001 
#define PSMC1PR2              0x0002 
#define PSMC1PR3              0x0003 
#define PSMC1PR4              0x0004 
#define PSMC1PR5              0x0005 
#define PSMC1PR6              0x0006 
#define PSMC1PR7              0x0007 

//////// PSMC1PRH Bits /////////////////////////////////////////////////////
#define PSMC1PR8              0x0000 
#define PSMC1PR9              0x0001 
#define PSMC1PR10             0x0002 
#define PSMC1PR11             0x0003 
#define PSMC1PR12             0x0004 
#define PSMC1PR13             0x0005 
#define PSMC1PR14             0x0006 
#define PSMC1PR15             0x0007 

//////// PSMC1TMRL Bits /////////////////////////////////////////////////////
#define PSMC1TMR0             0x0000 
#define PSMC1TMR1             0x0001 
#define PSMC1TMR2             0x0002 
#define PSMC1TMR3             0x0003 
#define PSMC1TMR4             0x0004 
#define PSMC1TMR5             0x0005 
#define PSMC1TMR6             0x0006 
#define PSMC1TMR7             0x0007 

//////// PSMC1TMRH Bits /////////////////////////////////////////////////////
#define PSMC1TMR8             0x0000 
#define PSMC1TMR9             0x0001 
#define PSMC1TMR10            0x0002 
#define PSMC1TMR11            0x0003 
#define PSMC1TMR12            0x0004 
#define PSMC1TMR13            0x0005 
#define PSMC1TMR14            0x0006 
#define PSMC1TMR15            0x0007 

//////// PSMC1DBR Bits /////////////////////////////////////////////////////
#define PSMC1DBR0             0x0000 
#define PSMC1DBR1             0x0001 
#define PSMC1DBR2             0x0002 
#define PSMC1DBR3             0x0003 
#define PSMC1DBR4             0x0004 
#define PSMC1DBR5             0x0005 
#define PSMC1DBR6             0x0006 
#define PSMC1DBR7             0x0007 

//////// PSMC1DBF Bits /////////////////////////////////////////////////////
#define PSMC1DBF0             0x0000 
#define PSMC1DBF1             0x0001 
#define PSMC1DBF2             0x0002 
#define PSMC1DBF3             0x0003 
#define PSMC1DBF4             0x0004 
#define PSMC1DBF5             0x0005 
#define PSMC1DBF6             0x0006 
#define PSMC1DBF7             0x0007 

//////// PSMC1BLKR Bits /////////////////////////////////////////////////////
#define PSMC1BLKR0            0x0000 
#define PSMC1BLKR1            0x0001 
#define PSMC1BLKR2            0x0002 
#define PSMC1BLKR3            0x0003 
#define PSMC1BLKR4            0x0004 
#define PSMC1BLKR5            0x0005 
#define PSMC1BLKR6            0x0006 
#define PSMC1BLKR7            0x0007 

//////// PSMC1BLKF Bits /////////////////////////////////////////////////////
#define PSMC1BLKF0            0x0000 
#define PSMC1BLKF1            0x0001 
#define PSMC1BLKF2            0x0002 
#define PSMC1BLKF3            0x0003 
#define PSMC1BLKF4            0x0004 
#define PSMC1BLKF5            0x0005 
#define PSMC1BLKF6            0x0006 
#define PSMC1BLKF7            0x0007 

//////// PSMC1FFA Bits /////////////////////////////////////////////////////
#define PSMC1FFA0             0x0000 
#define PSMC1FFA1             0x0001 
#define PSMC1FFA2             0x0002 
#define PSMC1FFA3             0x0003 

//////// PSMC1STR0 Bits /////////////////////////////////////////////////////
#define P1STRA                0x0000 
#define P1STRB                0x0001 
#define P1STRC                0x0002 
#define P1STRD                0x0003 
#define P1STRE                0x0004 
#define P1STRF                0x0005 

//////// PSMC1STR1 Bits /////////////////////////////////////////////////////
#define P1HSMEN               0x0000 
#define P1LSMEN               0x0001 
#define P1SSYNC               0x0007 
 
//////// PSMC2CON Bits /////////////////////////////////////////////////////
#define P2MODE0               0x0000 
#define P2MODE1               0x0001 
#define P2MODE2               0x0002 
#define P2MODE3               0x0003 
#define P2DBRE                0x0004 
#define P2DBFE                0x0005 
#define PSMC2LD               0x0006 
#define PSMC2EN               0x0007 

//////// PSMC2MDL Bits /////////////////////////////////////////////////////
#define P2MSRC0               0x0000 
#define P2MSRC1               0x0001 
#define P2MSRC2               0x0002 
#define P2MSRC3               0x0003 
#define P2MDLBIT              0x0005 
#define P2MDLPOL              0x0006 
#define P2MDLEN               0x0007 

//////// PSMC2SYNC Bits /////////////////////////////////////////////////////
#define P2SYNC0               0x0000 
#define P2SYNC1               0x0001 
#define P2DCPOL               0x0005 
#define P2PRPOL               0x0006 
#define P2POFST               0x0007 

//////// PSMC2CLK Bits /////////////////////////////////////////////////////
#define P2CSRC0               0x0000 
#define P2CSRC1               0x0001 
#define P2CPRE0               0x0004 
#define P2CPRE1               0x0005 

//////// PSMC2OEN Bits /////////////////////////////////////////////////////
#define P2OEA                 0x0000 
#define P2OEB                 0x0001 

//////// PSMC2POL Bits /////////////////////////////////////////////////////
#define P2POLA                0x0000 
#define P2POLB                0x0001 
#define P2INPOL               0x0006 

//////// PSMC2BLNK Bits /////////////////////////////////////////////////////
#define P2REBM0               0x0000 
#define P2REBM1               0x0001 
#define P2FEBM0               0x0004 
#define P2FEBM1               0x0005 

//////// PSMC2REBS Bits /////////////////////////////////////////////////////
#define P2REBSC1              0x0001 
#define P2REBSC2              0x0002 
#define P2REBSC3              0x0003 
#define P2REBSC4              0x0004 
#define P2REBSIN              0x0007 

//////// PSMC2FEBS Bits /////////////////////////////////////////////////////
#define P2FEBSC1              0x0001 
#define P2FEBSC2              0x0002 
#define P2FEBSC3              0x0003 
#define P2FEBSC4              0x0004 
#define P2FEBSIN              0x0007 

//////// PSMC2PHS Bits /////////////////////////////////////////////////////
#define P2PHST                0x0000 
#define P2PHSC1               0x0001 
#define P2PHSC2               0x0002 
#define P2PHSC3               0x0003 
#define P2PHSC4               0x0004 
#define P2PHSIN               0x0007 

//////// PSMC2DCS Bits /////////////////////////////////////////////////////
#define P2DCST                0x0000 
#define P2DCSC1               0x0001 
#define P2DCSC2               0x0002 
#define P2DCSC3               0x0003 
#define P2DCSC4               0x0004 
#define P2DCSIN               0x0007 

//////// PSMC2PRS Bits /////////////////////////////////////////////////////
#define P2PRST                0x0000 
#define P2PRSC1               0x0001 
#define P2PRSC2               0x0002 
#define P2PRSC3               0x0003 
#define P2PRSC4               0x0004 
#define P2PRSIN               0x0007 

//////// PSMC2ASDC Bits /////////////////////////////////////////////////////
#define P2ASDOV               0x0000 
#define P2ARSEN               0x0005 
#define P2ASDEN               0x0006 
#define P2ASE                 0x0007 

//////// PSMC2ASDL Bits /////////////////////////////////////////////////////
#define P2ASDLA               0x0000 
#define P2ASDLB               0x0001 
#define P2ASDLC               0x0002 
#define P2ASDLD               0x0003 
#define P2ASDLE               0x0004 
#define P2ASDLF               0x0005 

//////// PSMC2ASDS Bits /////////////////////////////////////////////////////
#define P2ASDSC1              0x0001 
#define P2ASDSC2              0x0002 
#define P2ASDSC3              0x0003 
#define P2ASDSC4              0x0004 
#define P2ASDSIN              0x0007 

//////// PSMC2INT Bits /////////////////////////////////////////////////////
#define P2TPRIF               0x0000 
#define P2TDCIF               0x0001 
#define P2TPHIF               0x0002 
#define P2TOVIF               0x0003 
#define P2TPRIE               0x0004 
#define P2TDCIE               0x0005 
#define P2TPHIE               0x0006 
#define P2TOVIE               0x0007 

//////// PSMC2PHL Bits /////////////////////////////////////////////////////
#define PSMC2PH0              0x0000 
#define PSMC2PH1              0x0001 
#define PSMC2PH2              0x0002 
#define PSMC2PH3              0x0003 
#define PSMC2PH4              0x0004 
#define PSMC2PH5              0x0005 
#define PSMC2PH6              0x0006 
#define PSMC2PH7              0x0007 

//////// PSMC2PHH Bits /////////////////////////////////////////////////////
#define PSMC2PH8              0x0000 
#define PSMC2PH9              0x0001 
#define PSMC2PH10             0x0002 
#define PSMC2PH11             0x0003 
#define PSMC2PH12             0x0004 
#define PSMC2PH13             0x0005 
#define PSMC2PH14             0x0006 
#define PSMC2PH15             0x0007 

//////// PSMC2DCL Bits /////////////////////////////////////////////////////
#define PSMC2DC0              0x0000 
#define PSMC2DC1              0x0001 
#define PSMC2DC2              0x0002 
#define PSMC2DC3              0x0003 
#define PSMC2DC4              0x0004 
#define PSMC2DC5              0x0005 
#define PSMC2DC6              0x0006 
#define PSMC2DC7              0x0007 

//////// PSMC2DCH Bits /////////////////////////////////////////////////////
#define PSMC2DC8              0x0000 
#define PSMC2DC9              0x0001 
#define PSMC2DC10             0x0002 
#define PSMC2DC11             0x0003 
#define PSMC2DC12             0x0004 
#define PSMC2DC13             0x0005 
#define PSMC2DC14             0x0006 
#define PSMC2DC15             0x0007 

//////// PSMC2PRL Bits /////////////////////////////////////////////////////
#define PSMC2PR0              0x0000 
#define PSMC2PR1              0x0001 
#define PSMC2PR2              0x0002 
#define PSMC2PR3              0x0003 
#define PSMC2PR4              0x0004 
#define PSMC2PR5              0x0005 
#define PSMC2PR6              0x0006 
#define PSMC2PR7              0x0007 

//////// PSMC2PRH Bits /////////////////////////////////////////////////////
#define PSMC2PR8              0x0000 
#define PSMC2PR9              0x0001 
#define PSMC2PR10             0x0002 
#define PSMC2PR11             0x0003 
#define PSMC2PR12             0x0004 
#define PSMC2PR13             0x0005 
#define PSMC2PR14             0x0006 
#define PSMC2PR15             0x0007 

//////// PSMC2TMRL Bits /////////////////////////////////////////////////////
#define PSMC2TMR0             0x0000 
#define PSMC2TMR1             0x0001 
#define PSMC2TMR2             0x0002 
#define PSMC2TMR3             0x0003 
#define PSMC2TMR4             0x0004 
#define PSMC2TMR5             0x0005 
#define PSMC2TMR6             0x0006 
#define PSMC2TMR7             0x0007 

//////// PSMC2TMRH Bits /////////////////////////////////////////////////////
#define PSMC2TMR8             0x0000 
#define PSMC2TMR9             0x0001 
#define PSMC2TMR10            0x0002 
#define PSMC2TMR11            0x0003 
#define PSMC2TMR12            0x0004 
#define PSMC2TMR13            0x0005 
#define PSMC2TMR14            0x0006 
#define PSMC2TMR15            0x0007 

//////// PSMC2DBR Bits /////////////////////////////////////////////////////
#define PSMC2DBR0             0x0000 
#define PSMC2DBR1             0x0001 
#define PSMC2DBR2             0x0002 
#define PSMC2DBR3             0x0003 
#define PSMC2DBR4             0x0004 
#define PSMC2DBR5             0x0005 
#define PSMC2DBR6             0x0006 
#define PSMC2DBR7             0x0007 

//////// PSMC2DBF Bits /////////////////////////////////////////////////////
#define PSMC2DBF0             0x0000 
#define PSMC2DBF1             0x0001 
#define PSMC2DBF2             0x0002 
#define PSMC2DBF3             0x0003 
#define PSMC2DBF4             0x0004 
#define PSMC2DBF5             0x0005 
#define PSMC2DBF6             0x0006 
#define PSMC2DBF7             0x0007 

//////// PSMC2BLKR Bits /////////////////////////////////////////////////////
#define PSMC2BLKR0            0x0000 
#define PSMC2BLKR1            0x0001 
#define PSMC2BLKR2            0x0002 
#define PSMC2BLKR3            0x0003 
#define PSMC2BLKR4            0x0004 
#define PSMC2BLKR5            0x0005 
#define PSMC2BLKR6            0x0006 
#define PSMC2BLKR7            0x0007 

//////// PSMC2BLKF Bits /////////////////////////////////////////////////////
#define PSMC2BLKF0            0x0000 
#define PSMC2BLKF1            0x0001 
#define PSMC2BLKF2            0x0002 
#define PSMC2BLKF3            0x0003 
#define PSMC2BLKF4            0x0004 
#define PSMC2BLKF5            0x0005 
#define PSMC2BLKF6            0x0006 
#define PSMC2BLKF7            0x0007 

//////// PSMC2FFA Bits /////////////////////////////////////////////////////
#define PSMC2FFA0             0x0000 
#define PSMC2FFA1             0x0001 
#define PSMC2FFA2             0x0002 
#define PSMC2FFA3             0x0003 

//////// PSMC2STR0 Bits /////////////////////////////////////////////////////
#define P2STRA                0x0000 
#define P2STRB                0x0001 

//////// PSMC3STR1 Bits /////////////////////////////////////////////////////
#define P2HSMEN               0x0000 
#define P2LSMEN               0x0001 
#define P2SSYNC               0x0007 

//////// PSMC3CON Bits /////////////////////////////////////////////////////
#define P3MODE0               0x0000 
#define P3MODE1               0x0001 
#define P3MODE2               0x0002 
#define P3MODE3               0x0003 
#define P3DBRE                0x0004 
#define P3DBFE                0x0005 
#define PSMC3LD               0x0006 
#define PSMC3EN               0x0007 

//////// PSMC3MDL Bits /////////////////////////////////////////////////////
#define P3MSRC0               0x0000 
#define P3MSRC1               0x0001 
#define P3MSRC2               0x0002 
#define P3MSRC3               0x0003 
#define P3MDLBIT              0x0005 
#define P3MDLPOL              0x0006 
#define P3MDLEN               0x0007 

//////// PSMC3SYNC Bits /////////////////////////////////////////////////////
#define P3SYNC0               0x0000 
#define P3SYNC1               0x0001 
#define P3DCPOL               0x0005 
#define P3PRPOL               0x0006 
#define P3POFST               0x0007 

//////// PSMC3CLK Bits /////////////////////////////////////////////////////
#define P3CSRC0               0x0000 
#define P3CSRC1               0x0001 
#define P3CPRE0               0x0004 
#define P3CPRE1               0x0005 

//////// PSMC3OEN Bits /////////////////////////////////////////////////////
#define P3OEA                 0x0000 
#define P3OEB                 0x0001 

//////// PSMC3POL Bits /////////////////////////////////////////////////////
#define P3POLA                0x0000 
#define P3POLB                0x0001 
#define P3INPOL               0x0006 

//////// PSMC3BLNK Bits /////////////////////////////////////////////////////
#define P3REBM0               0x0000 
#define P3REBM1               0x0001 
#define P3FEBM0               0x0004 
#define P3FEBM1               0x0005 

//////// PSMC3REBS Bits /////////////////////////////////////////////////////
#define P3REBSC1              0x0001 
#define P3REBSC2              0x0002 
#define P3REBSC3              0x0003 
#define P3REBSC4              0x0004 
#define P3REBSIN              0x0007 

//////// PSMC3FEBS Bits /////////////////////////////////////////////////////
#define P3FEBSC1              0x0001 
#define P3FEBSC2              0x0002 
#define P3FEBSC3              0x0003 
#define P3FEBSC4              0x0004 
#define P3FEBSIN              0x0007 

//////// PSMC3PHS Bits /////////////////////////////////////////////////////
#define P3PHST                0x0000 
#define P3PHSC1               0x0001 
#define P3PHSC2               0x0002 
#define P3PHSC3               0x0003 
#define P3PHSC4               0x0004 
#define P3PHSIN               0x0007 

//////// PSMC3DCS Bits /////////////////////////////////////////////////////
#define P3DCST                0x0000 
#define P3DCSC1               0x0001 
#define P3DCSC2               0x0002 
#define P3DCSC3               0x0003 
#define P3DCSC4               0x0004 
#define P3DCSIN               0x0007 

//////// PSMC3PRS Bits /////////////////////////////////////////////////////
#define P3PRST                0x0000 
#define P3PRSC1               0x0001 
#define P3PRSC2               0x0002 
#define P3PRSC3               0x0003 
#define P3PRSC4               0x0004 
#define P3PRSIN               0x0007 

//////// PSMC3ASDC Bits /////////////////////////////////////////////////////
#define P3ASDOV               0x0000 
#define P3ARSEN               0x0005 
#define P3ASDEN               0x0006 
#define P3ASE                 0x0007 

//////// PSMC3ASDL Bits /////////////////////////////////////////////////////
#define P3ASDLA               0x0000 
#define P3ASDLB               0x0001 

//////// PSMC3ASDS Bits /////////////////////////////////////////////////////
#define P3ASDSC1              0x0001 
#define P3ASDSC2              0x0002 
#define P3ASDSC3              0x0003 
#define P3ASDSC4              0x0004 
#define P3ASDSIN              0x0007 

//////// PSMC3INT Bits /////////////////////////////////////////////////////
#define P3TPRIF               0x0000 
#define P3TDCIF               0x0001 
#define P3TPHIF               0x0002 
#define P3TOVIF               0x0003 
#define P3TPRIE               0x0004 
#define P3TDCIE               0x0005 
#define P3TPHIE               0x0006 
#define P3TOVIE               0x0007 

//////// PSMC3PHL Bits /////////////////////////////////////////////////////
#define PSMC3PH0              0x0000 
#define PSMC3PH1              0x0001 
#define PSMC3PH2              0x0002 
#define PSMC3PH3              0x0003 
#define PSMC3PH4              0x0004 
#define PSMC3PH5              0x0005 
#define PSMC3PH6              0x0006 
#define PSMC3PH7              0x0007 

//////// PSMC3PHH Bits /////////////////////////////////////////////////////
#define PSMC3PH8              0x0000 
#define PSMC3PH9              0x0001 
#define PSMC3PH10             0x0002 
#define PSMC3PH11             0x0003 
#define PSMC3PH12             0x0004 
#define PSMC3PH13             0x0005 
#define PSMC3PH14             0x0006 
#define PSMC3PH15             0x0007 

//////// PSMC3DCL Bits /////////////////////////////////////////////////////
#define PSMC3DC0              0x0000 
#define PSMC3DC1              0x0001 
#define PSMC3DC2              0x0002 
#define PSMC3DC3              0x0003 
#define PSMC3DC4              0x0004 
#define PSMC3DC5              0x0005 
#define PSMC3DC6              0x0006 
#define PSMC3DC7              0x0007 

//////// PSMC3DCH Bits /////////////////////////////////////////////////////
#define PSMC3DC8              0x0000 
#define PSMC3DC9              0x0001 
#define PSMC3DC10             0x0002 
#define PSMC3DC11             0x0003 
#define PSMC3DC12             0x0004 
#define PSMC3DC13             0x0005 
#define PSMC3DC14             0x0006 
#define PSMC3DC15             0x0007 

//////// PSMC3PRL Bits /////////////////////////////////////////////////////
#define PSMC3PR0              0x0000 
#define PSMC3PR1              0x0001 
#define PSMC3PR2              0x0002 
#define PSMC3PR3              0x0003 
#define PSMC3PR4              0x0004 
#define PSMC3PR5              0x0005 
#define PSMC3PR6              0x0006 
#define PSMC3PR7              0x0007 

//////// PSMC3PRH Bits /////////////////////////////////////////////////////
#define PSMC3PR8              0x0000 
#define PSMC3PR9              0x0001 
#define PSMC3PR10             0x0002 
#define PSMC3PR11             0x0003 
#define PSMC3PR12             0x0004 
#define PSMC3PR13             0x0005 
#define PSMC3PR14             0x0006 
#define PSMC3PR15             0x0007 

//////// PSMC3TMRL Bits /////////////////////////////////////////////////////
#define PSMC3TMR0             0x0000 
#define PSMC3TMR1             0x0001 
#define PSMC3TMR2             0x0002 
#define PSMC3TMR3             0x0003 
#define PSMC3TMR4             0x0004 
#define PSMC3TMR5             0x0005 
#define PSMC3TMR6             0x0006 
#define PSMC3TMR7             0x0007 

//////// PSMC3TMRH Bits /////////////////////////////////////////////////////
#define PSMC3TMR8             0x0000 
#define PSMC3TMR9             0x0001 
#define PSMC3TMR10            0x0002 
#define PSMC3TMR11            0x0003 
#define PSMC3TMR12            0x0004 
#define PSMC3TMR13            0x0005 
#define PSMC3TMR14            0x0006 
#define PSMC3TMR15            0x0007 

//////// PSMC3DBR Bits /////////////////////////////////////////////////////
#define PSMC3DBR0             0x0000 
#define PSMC3DBR1             0x0001 
#define PSMC3DBR2             0x0002 
#define PSMC3DBR3             0x0003 
#define PSMC3DBR4             0x0004 
#define PSMC3DBR5             0x0005 
#define PSMC3DBR6             0x0006 
#define PSMC3DBR7             0x0007 

//////// PSMC3DBF Bits /////////////////////////////////////////////////////
#define PSMC3DBF0             0x0000 
#define PSMC3DBF1             0x0001 
#define PSMC3DBF2             0x0002 
#define PSMC3DBF3             0x0003 
#define PSMC3DBF4             0x0004 
#define PSMC3DBF5             0x0005 
#define PSMC3DBF6             0x0006 
#define PSMC3DBF7             0x0007 

//////// PSMC3BLKR Bits /////////////////////////////////////////////////////
#define PSMC3BLKR0            0x0000 
#define PSMC3BLKR1            0x0001 
#define PSMC3BLKR2            0x0002 
#define PSMC3BLKR3            0x0003 
#define PSMC3BLKR4            0x0004 
#define PSMC3BLKR5            0x0005 
#define PSMC3BLKR6            0x0006 
#define PSMC3BLKR7            0x0007 

//////// PSMC3BLKF Bits /////////////////////////////////////////////////////
#define PSMC3BLKF0            0x0000 
#define PSMC3BLKF1            0x0001 
#define PSMC3BLKF2            0x0002 
#define PSMC3BLKF3            0x0003 
#define PSMC3BLKF4            0x0004 
#define PSMC3BLKF5            0x0005 
#define PSMC3BLKF6            0x0006 
#define PSMC3BLKF7            0x0007 

//////// PSMC3FFA Bits /////////////////////////////////////////////////////
#define PSMC3FFA0             0x0000 
#define PSMC3FFA1             0x0001 
#define PSMC3FFA2             0x0002 
#define PSMC3FFA3             0x0003 

//////// PSMC3STR0 Bits /////////////////////////////////////////////////////
#define P3STRA                0x0000 
#define P3STRB                0x0001 

//////// PSMC3STR1 Bits /////////////////////////////////////////////////////
#define P3HSMEN               0x0000 
#define P3LSMEN               0x0001 
#define P3SSYNC               0x0007 
 
//////// STATUS_SHAD Bits /////////////////////////////////////////////////////
#define C_SHAD                0x0000 
#define DC_SHAD               0x0001 
#define Z_SHAD                0x0002 

/// The following is an assignment of address values for all of the

/// configuration registers for the purpose of table reads

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

#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 FFFh write protected, no addresses may be modified by EECON control
#define _WRT_HALF             0xFFFD // 000h to 7FFh write protected, 800h to FFFh may be modified by EECON control
#define _WRT_BOOT             0xFFFE // 000h to 1FFh write protected, 200h to FFFh may be modified by EECON control
#define _WRT_OFF              0xFFFF // Write protection off
#define _VCAPEN0_ON           0xFFEF // Vcap functionality is enabled on RA0 (Vddcore is connected to the pad)
#define _VCAPEN0_OFF          0xFFFF // Vcap functionality is disabled on RA0.
#define _VCAPEN1_ON           0xFFDF // Vcap functionality is enabled on RA6 (Vddcore is connected to the pad)
#define _VCAPEN1_OFF          0xFFFF // Vcap finctionality is disabled on RA6
#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 2.4V
#define _LPBOR_ON             0xF7FF // Low power brown-out is enabled
#define _LPBOR_OFF            0xFFFF // Low power brown-out is disabled
#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 

//////////////////////////////////////////////////
/// EEPROM Base Address when programing
//////////////////////////////////////////////////
/// To initialise EEPROM when a device is programmed
/// use #pragma DATA _EEPROM, 12, 34, 56 
#define _EEPROM               0xF000

volatile char indf0           @INDF0;         
volatile char indf1           @INDF1;         
volatile char pcl             @PCL;           
volatile char status          @STATUS;        
volatile char fsr0            @FSR0;          
volatile char fsr0l           @FSR0L;         
volatile char fsr0h           @FSR0H;         
volatile char fsr1            @FSR1;          
volatile char fsr1l           @FSR1L;         
volatile char fsr1h           @FSR1H;         
volatile char bsr             @BSR;           
volatile char wreg            @WREG;          
volatile char pclath          @PCLATH;        
volatile char intcon          @INTCON;        
volatile char porta           @PORTA;         
volatile char portb           @PORTB;         
volatile char portc           @PORTC;         
volatile char portd           @PORTD;         
volatile char porte           @PORTE;         
volatile char pir1            @PIR1;          
volatile char pir2            @PIR2;          
volatile char pir3            @PIR3;          
volatile char pir4            @PIR4;          
volatile char tmr0            @TMR0;          
volatile char tmr1            @TMR1;          
volatile char tmr1l           @TMR1L;         
volatile char tmr1h           @TMR1H;         
volatile char t1con           @T1CON;         
volatile char t1gcon          @T1GCON;        
volatile char tmr2            @TMR2;          
volatile char pr2             @PR2;           
volatile char t2con           @T2CON;         
volatile char trisa           @TRISA;         
volatile char trisb           @TRISB;         
volatile char trisc           @TRISC;         
volatile char trisd           @TRISD;         
volatile char trise           @TRISE;         
volatile char pie1            @PIE1;          
volatile char pie2            @PIE2;          
volatile char pie3            @PIE3;          
volatile char pie4            @PIE4;          
volatile char option_reg      @OPTION_REG;    
volatile char pcon            @PCON;          
volatile char wdtcon          @WDTCON;        
volatile char osctune         @OSCTUNE;       
volatile char osccon          @OSCCON;        
volatile char oscstat         @OSCSTAT;       
volatile char adres           @ADRES;         
volatile char adresl          @ADRESL;        
volatile char adresh          @ADRESH;        
volatile char adcon0          @ADCON0;        
volatile char adcon1          @ADCON1;        
volatile char adcon2          @ADCON2;        
volatile char lata            @LATA;          
volatile char latb            @LATB;          
volatile char latc            @LATC;          
volatile char latd            @LATD;          
volatile char late            @LATE;          
volatile char cm1con0         @CM1CON0;       
volatile char cm1con1         @CM1CON1;       
volatile char cm2con0         @CM2CON0;       
volatile char cm2con1         @CM2CON1;       
volatile char cmout           @CMOUT;         
volatile char borcon          @BORCON;        
volatile char fvrcon          @FVRCON;        
volatile char dac1con0        @DAC1CON0;      
volatile char cm4con0         @CM4CON0;       
volatile char cm4con1         @CM4CON1;       
volatile char dac1con1        @DAC2CON1;      
volatile char apfcon2         @APFCON2;       
volatile char apfcon1         @APFCON1;       
volatile char cm3con0         @CM3CON0;       
volatile char cm3con1         @CM3CON1;       
volatile char ansela          @ANSELA;        
volatile char anselb          @ANSELB;        
volatile char anseld          @ANSELD;        
volatile char ansele          @ANSELE;        
volatile char eeadr           @EEADR;         
volatile char eeadrl          @EEADRL;        
volatile char eeadrh          @EEADRH;        
volatile char eedata          @EEDATA;        
volatile char eedatl          @EEDATL;        
volatile char eedath          @EEDATH;        
volatile char eecon1          @EECON1;        
volatile char eecon2          @EECON2;        
volatile char vregcon         @VREGCON;       
volatile char rc1reg          @RC1REG;        
volatile char rcreg           @RCREG;         
volatile char rcreg1          @RCREG1;        
volatile char tx1reg          @TX1REG;        
volatile char txreg           @TXREG;         
volatile char txreg1          @TXREG1;        
volatile char sp1brg          @SP1BRG;        
volatile char sp1brgl         @SP1BRGL;       
volatile char spbrg           @SPBRG;         
volatile char spbrg1          @SPBRG1;        
volatile char spbrgl          @SPBRGL;        
volatile char sp1brgh         @SP1BRGH;       
volatile char spbrgh          @SPBRGH;        
volatile char spbrgh1         @SPBRGH1;       
volatile char rc1sta          @RC1STA;        
volatile char rcsta           @RCSTA;         
volatile char rcsta1          @RCSTA1;        
volatile char tx1sta          @TX1STA;        
volatile char txsta           @TXSTA;         
volatile char txsta1          @TXSTA1;        
volatile char baud1con        @BAUD1CON;      
volatile char baudcon         @BAUDCON;       
volatile char baudcon1        @BAUDCON1;      
volatile char baudctl         @BAUDCTL;       
volatile char baudctl1        @BAUDCTL1;      
volatile char wpua            @WPUA;          
volatile char wpub            @WPUB;         
volatile char wpuc            @WPUC;          
volatile char wpud            @WPUD;          
volatile char wpue            @WPUE;          
volatile char ssp1buf         @SSP1BUF;       
volatile char sspbuf          @SSPBUF;        
volatile char ssp1add         @SSP1ADD;       
volatile char sspadd          @SSPADD;        
volatile char ssp1msk         @SSP1MSK;       
volatile char sspmsk          @SSPMSK;        
volatile char ssp1stat        @SSP1STAT;      
volatile char sspstat         @SSPSTAT;       
volatile char ssp1con         @SSP1CON;       
volatile char sspcon          @SSPCON;        
volatile char sspcon1         @SSPCON1;       
volatile char ssp1con2        @SSP1CON2;      
volatile char sspcon2         @SSPCON2;       
volatile char ssp1con3        @SSP1CON3;      
volatile char sspcon3         @SSPCON3;       
volatile char odcona          @ODCONA;        
volatile char odconb          @ODCONB;        
volatile char odconc          @ODCONC;        
volatile char odcond          @ODCOND;        
volatile char odcone          @ODCONE;        
volatile char ccpr1           @CCPR1;         
volatile char ccpr1l          @CCPR1L;        
volatile char ccpr1h          @CCPR1H;        
volatile char ccp1con         @CCP1CON;       
volatile char ccpr2           @CCPR2;         
volatile char ccpr2l          @CCPR2L;        
volatile char ccpr2h          @CCPR2H;        
volatile char ccp2con         @CCP2CON;       
volatile char slrcona         @SLRCONA;       
volatile char slrconb         @SLRCONB;       
volatile char slrconc         @SLRCONC;       
volatile char slrcond         @SLRCOND;       
volatile char slrcone         @SLRCONE;       
volatile char ccpr3           @CCPR3;         
volatile char ccpr3l          @CCPR3L;        
volatile char ccpr3h          @CCPR3H;        
volatile char ccp3con         @CCP3CON;       
volatile char inlvla          @INLVLA;        
volatile char inlvlb          @INLVLB;        
volatile char inlvlc          @INLVLC;        
volatile char inlvld          @INLVLD;        
volatile char inlvle          @INLVLE;        
volatile char iocap           @IOCAP;         
volatile char iocan           @IOCAN;         
volatile char iocaf           @IOCAF;         
volatile char iocbp           @IOCBP;         
volatile char iocbn           @IOCBN;         
volatile char iocbf           @IOCBF;         
volatile char ioccp           @IOCCP;         
volatile char ioccn           @IOCCN;         
volatile char ioccf           @IOCCF;         
volatile char iocep           @IOCEP;         
volatile char iocen           @IOCEN;         
volatile char iocef           @IOCEF;         
volatile char opa1con         @OPA1CON;       
volatile char opa2con         @OPA2CON;       
volatile char clkrcon         @CLKRCON;       
volatile char psmc1con        @PSMC1CON;      
volatile char psmc1mdl        @PSMC1MDL;      
volatile char psmc1sync       @PSMC1SYNC;     
volatile char psmc1clk        @PSMC1CLK;      
volatile char psmc1oen        @PSMC1OEN;      
volatile char psmc1pol        @PSMC1POL;      
volatile char psmc1blnk       @PSMC1BLNK;     
volatile char psmc1rebs       @PSMC1REBS;     
volatile char psmc1febs       @PSMC1FEBS;     
volatile char psmc1phs        @PSMC1PHS;      
volatile char psmc1dcs        @PSMC1DCS;      
volatile char psmc1prs        @PSMC1PRS;      
volatile char psmc1asdc       @PSMC1ASDC;     
volatile char psmc1asdl       @PSMC1ASDL;     
volatile char psmc1asds       @PSMC1ASDS;     
volatile char psmc1int        @PSMC1INT;      
volatile char psmc1ph         @PSMC1PH;       
volatile char psmc1phl        @PSMC1PHL;      
volatile char psmc1phh        @PSMC1PHH;      
volatile char psmc1dc         @PSMC1DC;       
volatile char psmc1dcl        @PSMC1DCL;      
volatile char psmc1dch        @PSMC1DCH;      
volatile char psmc1pr         @PSMC1PR;       
volatile char psmc1prl        @PSMC1PRL;      
volatile char psmc1prh        @PSMC1PRH;      
volatile char psmc1tmr        @PSMC1TMR;      
volatile char psmc1tmrl       @PSMC1TMRL;     
volatile char psmc1tmrh       @PSMC1TMRH;     
volatile char psmc1dbr        @PSMC1DBR;      
volatile char psmc1dbf        @PSMC1DBF;      
volatile char psmc1blkr       @PSMC1BLKR;     
volatile char psmc1blkf       @PSMC1BLKF;     
volatile char psmc1ffa        @PSMC1FFA;      
volatile char psmc1str0       @PSMC1STR0;     
volatile char psmc1str1       @PSMC1STR1;     
volatile char psmc2con        @PSMC2CON;      
volatile char psmc2mdl        @PSMC2MDL;      
volatile char psmc2sync       @PSMC2SYNC;     
volatile char psmc2clk        @PSMC2CLK;      
volatile char psmc2oen        @PSMC2OEN;      
volatile char psmc2pol        @PSMC2POL;      
volatile char psmc2blnk       @PSMC2BLNK;     
volatile char psmc2rebs       @PSMC2REBS;     
volatile char psmc2febs       @PSMC2FEBS;     
volatile char psmc2phs        @PSMC2PHS;      
volatile char psmc2dcs        @PSMC2DCS;      
volatile char psmc2prs        @PSMC2PRS;      
volatile char psmc2asdc       @PSMC2ASDC;     
volatile char psmc2asdl       @PSMC2ASDL;     
volatile char psmc2asds       @PSMC2ASDS;     
volatile char psmc2int        @PSMC2INT;      
volatile char psmc2ph         @PSMC2PH;       
volatile char psmc2phl        @PSMC2PHL;      
volatile char psmc2phh        @PSMC2PHH;      
volatile char psmc2dc         @PSMC2DC;       
volatile char psmc2dcl        @PSMC2DCL;      
volatile char psmc2dch        @PSMC2DCH;      
volatile char psmc2pr         @PSMC2PR;       
volatile char psmc2prl        @PSMC2PRL;      
volatile char psmc2prh        @PSMC2PRH;      
volatile char psmc2tmr        @PSMC2TMR;      
volatile char psmc2tmrl       @PSMC2TMRL;     
volatile char psmc2tmrh       @PSMC2TMRH;     
volatile char psmc2dbr        @PSMC2DBR;      
volatile char psmc2dbf        @PSMC2DBF;      
volatile char psmc2blkr       @PSMC2BLKR;     
volatile char psmc2blkf       @PSMC2BLKF;     
volatile char psmc2ffa        @PSMC2FFA;      
volatile char psmc2str0       @PSMC2STR0;     
volatile char psmc2str1       @PSMC2STR1;     
volatile char psmc3con        @PSMC3CON;      
volatile char psmc3mdl        @PSMC3MDL;      
volatile char psmc3sync       @PSMC3SYNC;     
volatile char psmc3clk        @PSMC3CLK;      
volatile char psmc3oen        @PSMC3OEN;      
volatile char psmc3pol        @PSMC3POL;      
volatile char psmc3blnk       @PSMC3BLNK;     
volatile char psmc3rebs       @PSMC3REBS;     
volatile char psmc3febs       @PSMC3FEBS;     
volatile char psmc3phs        @PSMC3PHS;      
volatile char psmc3dcs        @PSMC3DCS;      
volatile char psmc3prs        @PSMC3PRS;      
volatile char psmc3asdc       @PSMC3ASDC;     
volatile char psmc3asdl       @PSMC3ASDL;     
volatile char psmc3asds       @PSMC3ASDS;     
volatile char psmc3int        @PSMC3INT;      
volatile char psmc3ph         @PSMC3PH;       
volatile char psmc3phl        @PSMC3PHL;      
volatile char psmc3phh        @PSMC3PHH;      
volatile char psmc3dc         @PSMC3DC;       
volatile char psmc3dcl        @PSMC3DCL;      
volatile char psmc3dch        @PSMC3DCH;      
volatile char psmc3pr         @PSMC3PR;       
volatile char psmc3prl        @PSMC3PRL;      
volatile char psmc3prh        @PSMC3PRH;      
volatile char psmc3tmr        @PSMC3TMR;      
volatile char psmc3tmrl       @PSMC3TMRL;     
volatile char psmc3tmrh       @PSMC3TMRH;     
volatile char psmc3dbr        @PSMC3DBR;      
volatile char psmc3dbf        @PSMC3DBF;      
volatile char psmc3blkr       @PSMC3BLKR;     
volatile char psmc3blkf       @PSMC3BLKF;     
volatile char psmc3ffa        @PSMC3FFA;      
volatile char psmc3str0       @PSMC3STR0;     
volatile char psmc3str1       @PSMC3STR1;     
volatile char status_shad     @STATUS_SHAD;   
volatile char wreg_shad       @WREG_SHAD;     
volatile char bsr_shad        @BSR_SHAD;     
volatile char pclath_shad     @PCLATH_SHAD;   
volatile char fsr0l_shad      @FSR0L_SHAD;    
volatile char fsr0h_shad      @FSR0H_SHAD;    
volatile char fsr1l_shad      @FSR1L_SHAD;    
volatile char fsr1h_shad      @FSR1H_SHAD;    
volatile char stkptr          @STKPTR;        
volatile char tosl            @TOSL;          
volatile char tosh            @TOSH;          

#endif // _PIC16F1784