Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-------------------------------------------------------------------------
- * MPLAB-Cxx PIC24F16KA102 processor header
- *
- * (c) Copyright 1999-2010 Microchip Technology, All rights reserved
- *-------------------------------------------------------------------------*/
- #ifndef __PIC24F16KA102__
- #error "Include file does not match processor setting"
- #endif
- #ifndef __24F16KA102_H
- #define __24F16KA102_H
- extern volatile unsigned int WREG0 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG1 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG2 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG3 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG4 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG5 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG6 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG7 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG8 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG9 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG10 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG11 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG12 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG13 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG14 __attribute__((__sfr__,__deprecated__,__unsafe__));
- extern volatile unsigned int WREG15 __attribute__((__sfr__,__deprecated__,__unsafe__));
- /* SPLIM: Stack Pointer Limit */
- extern volatile unsigned int SPLIM __attribute__((__sfr__));
- extern volatile unsigned int PCL __attribute__((__sfr__));
- extern volatile unsigned int PCH __attribute__((__sfr__));
- extern volatile unsigned int TBLPAG __attribute__((__sfr__));
- extern volatile unsigned int PSVPAG __attribute__((__sfr__));
- extern volatile unsigned int RCOUNT __attribute__((__sfr__));
- extern volatile unsigned int SR __attribute__((__sfr__));
- __extension__ typedef struct tagSRBITS {
- union {
- struct {
- unsigned C:1;
- unsigned Z:1; /* Sticky Zero flag */
- unsigned OV:1;
- unsigned N:1;
- unsigned RA:1;
- unsigned IPL0:1;
- unsigned IPL1:1;
- unsigned IPL2:1;
- unsigned DC:1;
- };
- struct {
- unsigned :5;
- unsigned IPL:3;
- };
- };
- } SRBITS;
- extern volatile SRBITS SRbits __attribute__((__sfr__));
- extern volatile unsigned int CORCON __attribute__((__sfr__));
- typedef struct tagCORCONBITS {
- unsigned :2;
- unsigned PSV:1;
- unsigned IPL3:1;
- } CORCONBITS;
- extern volatile CORCONBITS CORCONbits __attribute__((__sfr__));
- extern volatile unsigned int DISICNT __attribute__((__sfr__));
- extern volatile unsigned int CNEN1 __attribute__((__sfr__));
- typedef struct tagCNEN1BITS {
- unsigned CN0IE:1;
- unsigned CN1IE:1;
- unsigned CN2IE:1;
- unsigned CN3IE:1;
- unsigned CN4IE:1;
- unsigned CN5IE:1;
- unsigned CN6IE:1;
- unsigned CN7IE:1;
- unsigned CN8IE:1;
- unsigned CN9IE:1;
- unsigned :1;
- unsigned CN11IE:1;
- unsigned CN12IE:1;
- unsigned CN13IE:1;
- unsigned CN14IE:1;
- unsigned CN15IE:1;
- } CNEN1BITS;
- extern volatile CNEN1BITS CNEN1bits __attribute__((__sfr__));
- extern volatile unsigned int CNEN2 __attribute__((__sfr__));
- typedef struct tagCNEN2BITS {
- unsigned CN16IE:1;
- unsigned :4;
- unsigned CN21IE:1;
- unsigned CN22IE:1;
- unsigned CN23IE:1;
- unsigned CN24IE:1;
- unsigned :2;
- unsigned CN27IE:1;
- unsigned :1;
- unsigned CN29IE:1;
- unsigned CN30IE:1;
- } CNEN2BITS;
- extern volatile CNEN2BITS CNEN2bits __attribute__((__sfr__));
- extern volatile unsigned int CNPU1 __attribute__((__sfr__));
- typedef struct tagCNPU1BITS {
- unsigned CN0PUE:1;
- unsigned CN1PUE:1;
- unsigned CN2PUE:1;
- unsigned CN3PUE:1;
- unsigned CN4PUE:1;
- unsigned CN5PUE:1;
- unsigned CN6PUE:1;
- unsigned CN7PUE:1;
- unsigned CN8PUE:1;
- unsigned CN9PUE:1;
- unsigned :1;
- unsigned CN11PUE:1;
- unsigned CN12PUE:1;
- unsigned CN13PUE:1;
- unsigned CN14PUE:1;
- unsigned CN15PUE:1;
- } CNPU1BITS;
- extern volatile CNPU1BITS CNPU1bits __attribute__((__sfr__));
- extern volatile unsigned int CNPU2 __attribute__((__sfr__));
- typedef struct tagCNPU2BITS {
- unsigned CN16PUE:1;
- unsigned :4;
- unsigned CN21PUE:1;
- unsigned CN22PUE:1;
- unsigned CN23PUE:1;
- unsigned CN24PUE:1;
- unsigned :2;
- unsigned CN27PUE:1;
- unsigned :1;
- unsigned CN29PUE:1;
- unsigned CN30PUE:1;
- } CNPU2BITS;
- extern volatile CNPU2BITS CNPU2bits __attribute__((__sfr__));
- extern volatile unsigned int CNPD1 __attribute__((__sfr__));
- typedef struct tagCNPD1BITS {
- unsigned CN0PDE:1;
- unsigned CN1PDE:1;
- unsigned CN2PDE:1;
- unsigned CN3PDE:1;
- unsigned CN4PDE:1;
- unsigned CN5PDE:1;
- unsigned CN6PDE:1;
- unsigned CN7PDE:1;
- unsigned CN8PDE:1;
- unsigned CN9PDE:1;
- unsigned :1;
- unsigned CN11PDE:1;
- unsigned CN12PDE:1;
- unsigned CN13PDE:1;
- unsigned CN14PDE:1;
- unsigned CN15PDE:1;
- } CNPD1BITS;
- extern volatile CNPD1BITS CNPD1bits __attribute__((__sfr__));
- extern volatile unsigned int CNPD2 __attribute__((__sfr__));
- typedef struct tagCNPD2BITS {
- unsigned CN16PDE:1;
- unsigned :4;
- unsigned CN21PDE:1;
- unsigned CN22PDE:1;
- unsigned CN23PDE:1;
- unsigned CN24PDE:1;
- unsigned :2;
- unsigned CN27PDE:1;
- unsigned :1;
- unsigned CN29PDE:1;
- unsigned CN30PDE:1;
- } CNPD2BITS;
- extern volatile CNPD2BITS CNPD2bits __attribute__((__sfr__));
- extern volatile unsigned int INTCON1 __attribute__((__sfr__));
- typedef struct tagINTCON1BITS {
- unsigned :1;
- unsigned OSCFAIL:1;
- unsigned STKERR:1;
- unsigned ADDRERR:1;
- unsigned MATHERR:1;
- unsigned :10;
- unsigned NSTDIS:1;
- } INTCON1BITS;
- extern volatile INTCON1BITS INTCON1bits __attribute__((__sfr__));
- extern volatile unsigned int INTCON2 __attribute__((__sfr__));
- typedef struct tagINTCON2BITS {
- unsigned INT0EP:1;
- unsigned INT1EP:1;
- unsigned INT2EP:1;
- unsigned :11;
- unsigned DISI:1;
- unsigned ALTIVT:1;
- } INTCON2BITS;
- extern volatile INTCON2BITS INTCON2bits __attribute__((__sfr__));
- extern volatile unsigned int IFS0 __attribute__((__sfr__));
- typedef struct tagIFS0BITS {
- unsigned INT0IF:1;
- unsigned IC1IF:1;
- unsigned OC1IF:1;
- unsigned T1IF:1;
- unsigned :3;
- unsigned T2IF:1;
- unsigned T3IF:1;
- unsigned SPF1IF:1;
- unsigned SPI1IF:1;
- unsigned U1RXIF:1;
- unsigned U1TXIF:1;
- unsigned AD1IF:1;
- unsigned :1;
- unsigned NVMIF:1;
- } IFS0BITS;
- extern volatile IFS0BITS IFS0bits __attribute__((__sfr__));
- extern volatile unsigned int IFS1 __attribute__((__sfr__));
- typedef struct tagIFS1BITS {
- unsigned SI2C1IF:1;
- unsigned MI2C1IF:1;
- unsigned CMIF:1;
- unsigned CNIF:1;
- unsigned INT1IF:1;
- unsigned :8;
- unsigned INT2IF:1;
- unsigned U2RXIF:1;
- unsigned U2TXIF:1;
- } IFS1BITS;
- extern volatile IFS1BITS IFS1bits __attribute__((__sfr__));
- extern volatile unsigned int IFS3 __attribute__((__sfr__));
- typedef struct tagIFS3BITS {
- unsigned :14;
- unsigned RTCIF:1;
- } IFS3BITS;
- extern volatile IFS3BITS IFS3bits __attribute__((__sfr__));
- extern volatile unsigned int IFS4 __attribute__((__sfr__));
- typedef struct tagIFS4BITS {
- unsigned :1;
- unsigned U1ERIF:1;
- unsigned U2ERIF:1;
- unsigned CRCIF:1;
- unsigned :4;
- unsigned HLVDIF:1;
- unsigned :4;
- unsigned CTMUIF:1;
- } IFS4BITS;
- extern volatile IFS4BITS IFS4bits __attribute__((__sfr__));
- extern volatile unsigned int IEC0 __attribute__((__sfr__));
- typedef struct tagIEC0BITS {
- unsigned INT0IE:1;
- unsigned IC1IE:1;
- unsigned OC1IE:1;
- unsigned T1IE:1;
- unsigned :3;
- unsigned T2IE:1;
- unsigned T3IE:1;
- unsigned SPF1IE:1;
- unsigned SPI1IE:1;
- unsigned U1RXIE:1;
- unsigned U1TXIE:1;
- unsigned AD1IE:1;
- unsigned :1;
- unsigned NVMIE:1;
- } IEC0BITS;
- extern volatile IEC0BITS IEC0bits __attribute__((__sfr__));
- extern volatile unsigned int IEC1 __attribute__((__sfr__));
- typedef struct tagIEC1BITS {
- unsigned SI2C1IE:1;
- unsigned MI2C1IE:1;
- unsigned CMIE:1;
- unsigned CNIE:1;
- unsigned INT1IE:1;
- unsigned :8;
- unsigned INT2IE:1;
- unsigned U2RXIE:1;
- unsigned U2TXIE:1;
- } IEC1BITS;
- extern volatile IEC1BITS IEC1bits __attribute__((__sfr__));
- extern volatile unsigned int IEC3 __attribute__((__sfr__));
- typedef struct tagIEC3BITS {
- unsigned :14;
- unsigned RTCIE:1;
- } IEC3BITS;
- extern volatile IEC3BITS IEC3bits __attribute__((__sfr__));
- extern volatile unsigned int IEC4 __attribute__((__sfr__));
- typedef struct tagIEC4BITS {
- unsigned :1;
- unsigned U1ERIE:1;
- unsigned U2ERIE:1;
- unsigned CRCIE:1;
- unsigned :4;
- unsigned HLVDIE:1;
- unsigned :4;
- unsigned CTMUIE:1;
- } IEC4BITS;
- extern volatile IEC4BITS IEC4bits __attribute__((__sfr__));
- extern volatile unsigned int IPC0 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC0BITS {
- union {
- struct {
- unsigned INT0IP0:1;
- unsigned INT0IP1:1;
- unsigned INT0IP2:1;
- unsigned :1;
- unsigned IC1IP0:1;
- unsigned IC1IP1:1;
- unsigned IC1IP2:1;
- unsigned :1;
- unsigned OC1IP0:1;
- unsigned OC1IP1:1;
- unsigned OC1IP2:1;
- unsigned :1;
- unsigned T1IP0:1;
- unsigned T1IP1:1;
- unsigned T1IP2:1;
- };
- struct {
- unsigned INT0IP:3;
- unsigned :1;
- unsigned IC1IP:3;
- unsigned :1;
- unsigned OC1IP:3;
- unsigned :1;
- unsigned T1IP:3;
- };
- };
- } IPC0BITS;
- extern volatile IPC0BITS IPC0bits __attribute__((__sfr__));
- extern volatile unsigned int IPC1 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC1BITS {
- union {
- struct {
- unsigned :12;
- unsigned T2IP0:1;
- unsigned T2IP1:1;
- unsigned T2IP2:1;
- };
- struct {
- unsigned :12;
- unsigned T2IP:3;
- };
- };
- } IPC1BITS;
- extern volatile IPC1BITS IPC1bits __attribute__((__sfr__));
- extern volatile unsigned int IPC2 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC2BITS {
- union {
- struct {
- unsigned T3IP0:1;
- unsigned T3IP1:1;
- unsigned T3IP2:1;
- unsigned :1;
- unsigned SPF1IP0:1;
- unsigned SPF1IP1:1;
- unsigned SPF1IP2:1;
- unsigned :1;
- unsigned SPI1IP0:1;
- unsigned SPI1IP1:1;
- unsigned SPI1IP2:1;
- unsigned :1;
- unsigned U1RXIP0:1;
- unsigned U1RXIP1:1;
- unsigned U1RXIP2:1;
- };
- struct {
- unsigned T3IP:3;
- unsigned :1;
- unsigned SPF1IP:3;
- unsigned :1;
- unsigned SPI1IP:3;
- unsigned :1;
- unsigned U1RXIP:3;
- };
- };
- } IPC2BITS;
- extern volatile IPC2BITS IPC2bits __attribute__((__sfr__));
- extern volatile unsigned int IPC3 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC3BITS {
- union {
- struct {
- unsigned U1TXIP0:1;
- unsigned U1TXIP1:1;
- unsigned U1TXIP2:1;
- unsigned :1;
- unsigned AD1IP0:1;
- unsigned AD1IP1:1;
- unsigned AD1IP2:1;
- unsigned :5;
- unsigned NVMIP0:1;
- unsigned NVMIP1:1;
- unsigned NVMIP2:1;
- };
- struct {
- unsigned U1TXIP:3;
- unsigned :1;
- unsigned AD1IP:3;
- };
- };
- } IPC3BITS;
- extern volatile IPC3BITS IPC3bits __attribute__((__sfr__));
- extern volatile unsigned int IPC4 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC4BITS {
- union {
- struct {
- unsigned SI2C1IP0:1;
- unsigned SI2C1IP1:1;
- unsigned SI2C1IP2:1;
- unsigned :1;
- unsigned MI2C1IP0:1;
- unsigned MI2C1IP1:1;
- unsigned MI2C1IP2:1;
- unsigned :1;
- unsigned CMIP0:1;
- unsigned CMIP1:1;
- unsigned CMIP2:1;
- unsigned :1;
- unsigned CNIP0:1;
- unsigned CNIP1:1;
- unsigned CNIP2:1;
- };
- struct {
- unsigned SI2C1IP:3;
- unsigned :1;
- unsigned MI2C1IP:3;
- unsigned :1;
- unsigned CMIP:3;
- unsigned :1;
- unsigned CNIP:3;
- };
- struct {
- unsigned SI2C1P0:1;
- unsigned SI2C1P1:1;
- unsigned SI2C1P2:1;
- unsigned :1;
- unsigned MI2C1P0:1;
- unsigned MI2C1P1:1;
- unsigned MI2C1P2:1;
- };
- struct {
- unsigned SI2C1P:3;
- unsigned :1;
- unsigned MI2C1P:3;
- };
- };
- } IPC4BITS;
- extern volatile IPC4BITS IPC4bits __attribute__((__sfr__));
- extern volatile unsigned int IPC5 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC5BITS {
- union {
- struct {
- unsigned INT1IP0:1;
- unsigned INT1IP1:1;
- unsigned INT1IP2:1;
- };
- struct {
- unsigned INT1IP:3;
- };
- };
- } IPC5BITS;
- extern volatile IPC5BITS IPC5bits __attribute__((__sfr__));
- extern volatile unsigned int IPC7 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC7BITS {
- union {
- struct {
- unsigned :4;
- unsigned INT2IP0:1;
- unsigned INT2IP1:1;
- unsigned INT2IP2:1;
- unsigned :1;
- unsigned U2RXIP0:1;
- unsigned U2RXIP1:1;
- unsigned U2RXIP2:1;
- unsigned :1;
- unsigned U2TXIP0:1;
- unsigned U2TXIP1:1;
- unsigned U2TXIP2:1;
- };
- struct {
- unsigned :4;
- unsigned INT2IP:3;
- unsigned :1;
- unsigned U2RXIP:3;
- unsigned :1;
- unsigned U2TXIP:3;
- };
- };
- } IPC7BITS;
- extern volatile IPC7BITS IPC7bits __attribute__((__sfr__));
- extern volatile unsigned int IPC15 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC15BITS {
- union {
- struct {
- unsigned :8;
- unsigned RTCIP0:1;
- unsigned RTCIP1:1;
- unsigned RTCIP2:1;
- };
- struct {
- unsigned :8;
- unsigned RTCIP:3;
- };
- };
- } IPC15BITS;
- extern volatile IPC15BITS IPC15bits __attribute__((__sfr__));
- extern volatile unsigned int IPC16 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC16BITS {
- union {
- struct {
- unsigned :4;
- unsigned U1ERIP0:1;
- unsigned U1ERIP1:1;
- unsigned U1ERIP2:1;
- unsigned :1;
- unsigned U2ERIP0:1;
- unsigned U2ERIP1:1;
- unsigned U2ERIP2:1;
- unsigned :1;
- unsigned CRCIP0:1;
- unsigned CRCIP1:1;
- unsigned CRCIP2:1;
- };
- struct {
- unsigned :4;
- unsigned U1ERIP:3;
- unsigned :1;
- unsigned U2ERIP:3;
- unsigned :1;
- unsigned CRCIP:3;
- };
- };
- } IPC16BITS;
- extern volatile IPC16BITS IPC16bits __attribute__((__sfr__));
- extern volatile unsigned int IPC18 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC18BITS {
- union {
- struct {
- unsigned HLVDIP0:1;
- unsigned HLVDIP1:1;
- unsigned HLVDIP2:1;
- };
- struct {
- unsigned HLVDIP:3;
- };
- };
- } IPC18BITS;
- extern volatile IPC18BITS IPC18bits __attribute__((__sfr__));
- extern volatile unsigned int IPC19 __attribute__((__sfr__));
- __extension__ typedef struct tagIPC19BITS {
- union {
- struct {
- unsigned :4;
- unsigned CTMUIP0:1;
- unsigned CTMUIP1:1;
- unsigned CTMUIP2:1;
- };
- struct {
- unsigned :4;
- unsigned CTMUIP:3;
- };
- };
- } IPC19BITS;
- extern volatile IPC19BITS IPC19bits __attribute__((__sfr__));
- extern volatile unsigned int INTTREG __attribute__((__sfr__));
- typedef struct tagINTTREGBITS {
- unsigned VECNUM0:1;
- unsigned VECNUM1:1;
- unsigned VECNUM2:1;
- unsigned VECNUM3:1;
- unsigned VECNUM4:1;
- unsigned VECNUM5:1;
- unsigned VECNUM6:1;
- unsigned :1;
- unsigned ILR0:1;
- unsigned ILR1:1;
- unsigned ILR2:1;
- unsigned ILR3:1;
- unsigned :1;
- unsigned VHOLD:1;
- unsigned :1;
- unsigned CPUIRQ:1;
- } INTTREGBITS;
- extern volatile INTTREGBITS INTTREGbits __attribute__((__sfr__));
- extern volatile unsigned int TMR1 __attribute__((__sfr__));
- extern volatile unsigned int PR1 __attribute__((__sfr__));
- extern volatile unsigned int T1CON __attribute__((__sfr__));
- __extension__ typedef struct tagT1CONBITS {
- union {
- struct {
- unsigned :1;
- unsigned TCS:1;
- unsigned TSYNC:1;
- unsigned :1;
- unsigned TCKPS0:1;
- unsigned TCKPS1:1;
- unsigned TGATE:1;
- unsigned :6;
- unsigned TSIDL:1;
- unsigned :1;
- unsigned TON:1;
- };
- struct {
- unsigned :4;
- unsigned TCKPS:2;
- };
- };
- } T1CONBITS;
- extern volatile T1CONBITS T1CONbits __attribute__((__sfr__));
- extern volatile unsigned int TMR2 __attribute__((__sfr__));
- extern volatile unsigned int TMR3HLD __attribute__((__sfr__));
- extern volatile unsigned int TMR3 __attribute__((__sfr__));
- extern volatile unsigned int PR2 __attribute__((__sfr__));
- extern volatile unsigned int PR3 __attribute__((__sfr__));
- extern volatile unsigned int T2CON __attribute__((__sfr__));
- __extension__ typedef struct tagT2CONBITS {
- union {
- struct {
- unsigned :1;
- unsigned TCS:1;
- unsigned :1;
- unsigned T32:1;
- unsigned TCKPS0:1;
- unsigned TCKPS1:1;
- unsigned TGATE:1;
- unsigned :6;
- unsigned TSIDL:1;
- unsigned :1;
- unsigned TON:1;
- };
- struct {
- unsigned :4;
- unsigned TCKPS:2;
- };
- };
- } T2CONBITS;
- extern volatile T2CONBITS T2CONbits __attribute__((__sfr__));
- extern volatile unsigned int T3CON __attribute__((__sfr__));
- __extension__ typedef struct tagT3CONBITS {
- union {
- struct {
- unsigned :1;
- unsigned TCS:1;
- unsigned :2;
- unsigned TCKPS0:1;
- unsigned TCKPS1:1;
- unsigned TGATE:1;
- unsigned :6;
- unsigned TSIDL:1;
- unsigned :1;
- unsigned TON:1;
- };
- struct {
- unsigned :4;
- unsigned TCKPS:2;
- };
- };
- } T3CONBITS;
- extern volatile T3CONBITS T3CONbits __attribute__((__sfr__));
- /* Generic structure of entire SFR area for Input Capture modules */
- typedef struct tagIC {
- unsigned int icxbuf;
- unsigned int icxcon;
- } IC, *PIC;
- /* SFR blocks for Input Capture modules */
- extern volatile IC IC1 __attribute__((__sfr__));
- extern volatile IC IC2 __attribute__((__sfr__));
- extern volatile IC IC3 __attribute__((__sfr__));
- extern volatile IC IC4 __attribute__((__sfr__));
- extern volatile IC IC5 __attribute__((__sfr__));
- extern volatile unsigned int IC1BUF __attribute__((__sfr__));
- extern volatile unsigned int IC1CON __attribute__((__sfr__));
- __extension__ typedef struct tagIC1CONBITS {
- union {
- struct {
- unsigned ICM0:1;
- unsigned ICM1:1;
- unsigned ICM2:1;
- unsigned ICBNE:1;
- unsigned ICOV:1;
- unsigned ICI0:1;
- unsigned ICI1:1;
- unsigned ICTMR:1;
- unsigned :5;
- unsigned ICSIDL:1;
- };
- struct {
- unsigned ICM:3;
- unsigned :2;
- unsigned ICI:2;
- };
- };
- } IC1CONBITS;
- extern volatile IC1CONBITS IC1CONbits __attribute__((__sfr__));
- /* Generic structure of entire SFR area for Output Compare modules */
- typedef struct tagOC {
- unsigned int ocxrs;
- unsigned int ocxr;
- unsigned int ocxcon;
- } OC, *POC;
- /* SFR blocks for Output Compare modules */
- extern volatile OC OC1 __attribute__((__sfr__));
- extern volatile OC OC2 __attribute__((__sfr__));
- extern volatile OC OC3 __attribute__((__sfr__));
- extern volatile OC OC4 __attribute__((__sfr__));
- extern volatile OC OC5 __attribute__((__sfr__));
- extern volatile unsigned int OC1RS __attribute__((__sfr__));
- extern volatile unsigned int OC1R __attribute__((__sfr__));
- extern volatile unsigned int OC1CON __attribute__((__sfr__));
- __extension__ typedef struct tagOC1CONBITS {
- union {
- struct {
- unsigned OCM:3;
- unsigned OCTSEL:1;
- unsigned OCFLT:1;
- unsigned :8;
- unsigned OCSIDL:1;
- };
- struct {
- unsigned OCM0:1;
- unsigned OCM1:1;
- unsigned OCM2:1;
- };
- };
- } OC1CONBITS;
- extern volatile OC1CONBITS OC1CONbits __attribute__((__sfr__));
- extern volatile unsigned int I2C1RCV __attribute__((__sfr__));
- extern volatile unsigned int I2C1TRN __attribute__((__sfr__));
- extern volatile unsigned int I2C1BRG __attribute__((__sfr__));
- extern volatile unsigned int I2C1CON __attribute__((__sfr__));
- typedef struct tagI2C1CONBITS {
- unsigned SEN:1;
- unsigned RSEN:1;
- unsigned PEN:1;
- unsigned RCEN:1;
- unsigned ACKEN:1;
- unsigned ACKDT:1;
- unsigned STREN:1;
- unsigned GCEN:1;
- unsigned SMEN:1;
- unsigned DISSLW:1;
- unsigned A10M:1;
- unsigned IPMIEN:1;
- unsigned SCLREL:1;
- unsigned I2CSIDL:1;
- unsigned :1;
- unsigned I2CEN:1;
- } I2C1CONBITS;
- extern volatile I2C1CONBITS I2C1CONbits __attribute__((__sfr__));
- extern volatile unsigned int I2C1STAT __attribute__((__sfr__));
- typedef struct tagI2C1STATBITS {
- unsigned TBF:1;
- unsigned RBF:1;
- unsigned R_W:1;
- unsigned S:1;
- unsigned P:1;
- unsigned D_A:1;
- unsigned I2COV:1;
- unsigned IWCOL:1;
- unsigned ADD10:1;
- unsigned GCSTAT:1;
- unsigned BCL:1;
- unsigned :3;
- unsigned TRSTAT:1;
- unsigned ACKSTAT:1;
- } I2C1STATBITS;
- extern volatile I2C1STATBITS I2C1STATbits __attribute__((__sfr__));
- extern volatile unsigned int I2C1ADD __attribute__((__sfr__));
- extern volatile unsigned int I2C1MSK __attribute__((__sfr__));
- /* Generic structure of entire SFR area for each UART module */
- typedef struct tagUART {
- unsigned int uxmode;
- unsigned int uxsta;
- unsigned int uxtxreg;
- unsigned int uxrxreg;
- unsigned int uxbrg;
- } UART, *PUART;
- #define UxMODEBITS U1MODEBITS
- #define UxSTABITS U1STABITS
- #define UxTXREGBITS U1TXREGBITS
- #define UxRXREGBITS U1RXREGBITS
- #define UxBRGBITS U1BRGBITS
- /* SFR blocks for each UART module */
- extern volatile UART UART1 __attribute__((__sfr__));
- extern volatile UART UART2 __attribute__((__sfr__));
- extern volatile unsigned int U1MODE __attribute__((__sfr__));
- __extension__ typedef struct tagU1MODEBITS {
- union {
- struct {
- unsigned STSEL:1;
- unsigned PDSEL0:1;
- unsigned PDSEL1:1;
- unsigned BRGH:1;
- unsigned RXINV:1;
- unsigned ABAUD:1;
- unsigned LPBACK:1;
- unsigned WAKE:1;
- unsigned UEN0:1;
- unsigned UEN1:1;
- unsigned :1;
- unsigned RTSMD:1;
- unsigned IREN:1;
- unsigned USIDL:1;
- unsigned :1;
- unsigned UARTEN:1;
- };
- struct {
- unsigned :1;
- unsigned PDSEL:2;
- unsigned :5;
- unsigned UEN:2;
- };
- };
- } U1MODEBITS;
- extern volatile U1MODEBITS U1MODEbits __attribute__((__sfr__));
- extern volatile unsigned int U1STA __attribute__((__sfr__));
- __extension__ typedef struct tagU1STABITS {
- union {
- struct {
- unsigned URXDA:1;
- unsigned OERR:1;
- unsigned FERR:1;
- unsigned PERR:1;
- unsigned RIDLE:1;
- unsigned ADDEN:1;
- unsigned URXISEL0:1;
- unsigned URXISEL1:1;
- unsigned TRMT:1;
- unsigned UTXBF:1;
- unsigned UTXEN:1;
- unsigned UTXBRK:1;
- unsigned :1;
- unsigned UTXISEL0:1;
- unsigned UTXINV:1;
- unsigned UTXISEL1:1;
- };
- struct {
- unsigned :6;
- unsigned URXISEL:2;
- };
- };
- } U1STABITS;
- extern volatile U1STABITS U1STAbits __attribute__((__sfr__));
- extern volatile unsigned int U1TXREG __attribute__((__sfr__));
- extern volatile unsigned int U1RXREG __attribute__((__sfr__));
- extern volatile unsigned int U1BRG __attribute__((__sfr__));
- extern volatile unsigned int U2MODE __attribute__((__sfr__));
- __extension__ typedef struct tagU2MODEBITS {
- union {
- struct {
- unsigned STSEL:1;
- unsigned PDSEL0:1;
- unsigned PDSEL1:1;
- unsigned BRGH:1;
- unsigned RXINV:1;
- unsigned ABAUD:1;
- unsigned LPBACK:1;
- unsigned WAKE:1;
- unsigned UEN0:1;
- unsigned UEN1:1;
- unsigned :1;
- unsigned RTSMD:1;
- unsigned IREN:1;
- unsigned USIDL:1;
- unsigned :1;
- unsigned UARTEN:1;
- };
- struct {
- unsigned :1;
- unsigned PDSEL:2;
- unsigned :5;
- unsigned UEN:2;
- };
- };
- } U2MODEBITS;
- extern volatile U2MODEBITS U2MODEbits __attribute__((__sfr__));
- extern volatile unsigned int U2STA __attribute__((__sfr__));
- __extension__ typedef struct tagU2STABITS {
- union {
- struct {
- unsigned URXDA:1;
- unsigned OERR:1;
- unsigned FERR:1;
- unsigned PERR:1;
- unsigned RIDLE:1;
- unsigned ADDEN:1;
- unsigned URXISEL0:1;
- unsigned URXISEL1:1;
- unsigned TRMT:1;
- unsigned UTXBF:1;
- unsigned UTXEN:1;
- unsigned UTXBRK:1;
- unsigned :1;
- unsigned UTXISEL0:1;
- unsigned UTXINV:1;
- unsigned UTXISEL1:1;
- };
- struct {
- unsigned :6;
- unsigned URXISEL:2;
- };
- };
- } U2STABITS;
- extern volatile U2STABITS U2STAbits __attribute__((__sfr__));
- extern volatile unsigned int U2TXREG __attribute__((__sfr__));
- extern volatile unsigned int U2RXREG __attribute__((__sfr__));
- extern volatile unsigned int U2BRG __attribute__((__sfr__));
- /* Generic structure of entire SFR area for each SPI module */
- typedef struct tagSPI {
- unsigned int spixstat;
- unsigned int spixcon1;
- unsigned int spixcon2;
- unsigned int unused;
- unsigned int spixbuf;
- } SPI, *PSPI;
- #define SPIxSTATBITS SPI1STATBITS
- #define SPIxCONBITS SPI1CONBITS
- /* SFR blocks for each SPI module */
- extern volatile SPI SPI1 __attribute__((__sfr__));
- extern volatile SPI SPI2 __attribute__((__sfr__));
- extern volatile unsigned int SPI1STAT __attribute__((__sfr__));
- __extension__ typedef struct tagSPI1STATBITS {
- union {
- struct {
- unsigned SPIRBF:1;
- unsigned SPITBF:1;
- unsigned SISEL:3;
- unsigned SR1MPT:1;
- unsigned SPIROV:1;
- unsigned SRMPT:1;
- unsigned SPIBEC:3;
- unsigned :2;
- unsigned SPISIDL:1;
- unsigned :1;
- unsigned SPIEN:1;
- };
- struct {
- unsigned :2;
- unsigned SISEL0:1;
- unsigned SISEL1:1;
- unsigned SISEL2:1;
- unsigned :3;
- unsigned SPIBEC0:1;
- unsigned SPIBEC1:1;
- unsigned SPIBEC2:1;
- };
- };
- } SPI1STATBITS;
- extern volatile SPI1STATBITS SPI1STATbits __attribute__((__sfr__));
- extern volatile unsigned int SPI1CON1 __attribute__((__sfr__));
- __extension__ typedef struct tagSPI1CON1BITS {
- union {
- struct {
- unsigned PPRE0:1;
- unsigned PPRE1:1;
- unsigned SPRE:3;
- unsigned MSTEN:1;
- unsigned CKP:1;
- unsigned SSEN:1;
- unsigned CKE:1;
- unsigned SMP:1;
- unsigned MODE16:1;
- unsigned DISSDO:1;
- unsigned DISSCK:1;
- };
- struct {
- unsigned PPRE:2;
- unsigned SPRE0:1;
- unsigned SPRE1:1;
- unsigned SPRE2:1;
- };
- };
- } SPI1CON1BITS;
- extern volatile SPI1CON1BITS SPI1CON1bits __attribute__((__sfr__));
- extern volatile unsigned int SPI1CON2 __attribute__((__sfr__));
- typedef struct tagSPI1CON2BITS {
- unsigned SPIBEN:1;
- unsigned SPIFE:1;
- unsigned :11;
- unsigned SPIFPOL:1;
- unsigned SPIFSD:1;
- unsigned FRMEN:1;
- } SPI1CON2BITS;
- extern volatile SPI1CON2BITS SPI1CON2bits __attribute__((__sfr__));
- extern volatile unsigned int SPI1BUF __attribute__((__sfr__));
- extern volatile unsigned int TRISA __attribute__((__sfr__));
- typedef struct tagTRISABITS {
- unsigned TRISA0:1;
- unsigned TRISA1:1;
- unsigned TRISA2:1;
- unsigned TRISA3:1;
- unsigned TRISA4:1;
- unsigned TRISA5:1;
- unsigned TRISA6:1;
- unsigned TRISA7:1;
- } TRISABITS;
- extern volatile TRISABITS TRISAbits __attribute__((__sfr__));
- extern volatile unsigned int PORTA __attribute__((__sfr__));
- typedef struct tagPORTABITS {
- unsigned RA0:1;
- unsigned RA1:1;
- unsigned RA2:1;
- unsigned RA3:1;
- unsigned RA4:1;
- unsigned RA5:1;
- unsigned RA6:1;
- unsigned RA7:1;
- } PORTABITS;
- extern volatile PORTABITS PORTAbits __attribute__((__sfr__));
- extern volatile unsigned int LATA __attribute__((__sfr__));
- typedef struct tagLATABITS {
- unsigned LATA0:1;
- unsigned LATA1:1;
- unsigned LATA2:1;
- unsigned LATA3:1;
- unsigned LATA4:1;
- unsigned LATA5:1;
- unsigned LATA6:1;
- unsigned LATA7:1;
- } LATABITS;
- extern volatile LATABITS LATAbits __attribute__((__sfr__));
- extern volatile unsigned int ODCA __attribute__((__sfr__));
- typedef struct tagODCABITS {
- unsigned ODA0:1;
- unsigned ODA1:1;
- unsigned ODA2:1;
- unsigned ODA3:1;
- unsigned ODA4:1;
- unsigned ODA5:1;
- unsigned ODA6:1;
- unsigned ODA7:1;
- } ODCABITS;
- extern volatile ODCABITS ODCAbits __attribute__((__sfr__));
- extern volatile unsigned int TRISB __attribute__((__sfr__));
- typedef struct tagTRISBBITS {
- unsigned TRISB0:1;
- unsigned TRISB1:1;
- unsigned TRISB2:1;
- unsigned TRISB3:1;
- unsigned TRISB4:1;
- unsigned TRISB5:1;
- unsigned TRISB6:1;
- unsigned TRISB7:1;
- unsigned TRISB8:1;
- unsigned TRISB9:1;
- unsigned TRISB10:1;
- unsigned TRISB11:1;
- unsigned TRISB12:1;
- unsigned TRISB13:1;
- unsigned TRISB14:1;
- unsigned TRISB15:1;
- } TRISBBITS;
- extern volatile TRISBBITS TRISBbits __attribute__((__sfr__));
- extern volatile unsigned int PORTB __attribute__((__sfr__));
- typedef struct tagPORTBBITS {
- unsigned RB0:1;
- unsigned RB1:1;
- unsigned RB2:1;
- unsigned RB3:1;
- unsigned RB4:1;
- unsigned RB5:1;
- unsigned RB6:1;
- unsigned RB7:1;
- unsigned RB8:1;
- unsigned RB9:1;
- unsigned RB10:1;
- unsigned RB11:1;
- unsigned RB12:1;
- unsigned RB13:1;
- unsigned RB14:1;
- unsigned RB15:1;
- } PORTBBITS;
- extern volatile PORTBBITS PORTBbits __attribute__((__sfr__));
- extern volatile unsigned int LATB __attribute__((__sfr__));
- typedef struct tagLATBBITS {
- unsigned LATB0:1;
- unsigned LATB1:1;
- unsigned LATB2:1;
- unsigned LATB3:1;
- unsigned LATB4:1;
- unsigned LATB5:1;
- unsigned LATB6:1;
- unsigned LATB7:1;
- unsigned LATB8:1;
- unsigned LATB9:1;
- unsigned LATB10:1;
- unsigned LATB11:1;
- unsigned LATB12:1;
- unsigned LATB13:1;
- unsigned LATB14:1;
- unsigned LATB15:1;
- } LATBBITS;
- extern volatile LATBBITS LATBbits __attribute__((__sfr__));
- extern volatile unsigned int ODCB __attribute__((__sfr__));
- typedef struct tagODCBBITS {
- unsigned ODB0:1;
- unsigned ODB1:1;
- unsigned ODB2:1;
- unsigned ODB3:1;
- unsigned ODB4:1;
- unsigned ODB5:1;
- unsigned ODB6:1;
- unsigned ODB7:1;
- unsigned ODB8:1;
- unsigned ODB9:1;
- unsigned ODB10:1;
- unsigned ODB11:1;
- unsigned ODB12:1;
- unsigned ODB13:1;
- unsigned ODB14:1;
- unsigned ODB15:1;
- } ODCBBITS;
- extern volatile ODCBBITS ODCBbits __attribute__((__sfr__));
- extern volatile unsigned int PADCFG1 __attribute__((__sfr__));
- __extension__ typedef struct tagPADCFG1BITS {
- union {
- struct {
- unsigned :1;
- unsigned RTSECSEL:2;
- unsigned OC1TRIS:1;
- unsigned SMBUSDEL:1;
- };
- struct {
- unsigned :1;
- unsigned RTSECSEL0:1;
- unsigned RTSECSEL1:1;
- };
- };
- } PADCFG1BITS;
- extern volatile PADCFG1BITS PADCFG1bits __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF0 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF1 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF2 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF3 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF4 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF5 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF6 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF7 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF8 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUF9 __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFA __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFB __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFC __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFD __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFE __attribute__((__sfr__));
- extern volatile unsigned int ADC1BUFF __attribute__((__sfr__));
- extern volatile unsigned int AD1CON1 __attribute__((__sfr__));
- __extension__ typedef struct tagAD1CON1BITS {
- union {
- struct {
- unsigned DONE:1;
- unsigned SAMP:1;
- unsigned ASAM:1;
- unsigned :2;
- unsigned SSRC:3;
- unsigned FORM0:1;
- unsigned FORM1:1;
- unsigned :3;
- unsigned ADSIDL:1;
- unsigned :1;
- unsigned ADON:1;
- };
- struct {
- unsigned :5;
- unsigned SSRC0:1;
- unsigned SSRC1:1;
- unsigned SSRC2:1;
- unsigned FORM:2;
- };
- };
- } AD1CON1BITS;
- extern volatile AD1CON1BITS AD1CON1bits __attribute__((__sfr__));
- extern volatile unsigned int AD1CON2 __attribute__((__sfr__));
- __extension__ typedef struct tagAD1CON2BITS {
- union {
- struct {
- unsigned ALTS:1;
- unsigned BUFM:1;
- unsigned SMPI:4;
- unsigned :1;
- unsigned BUFS:1;
- unsigned :2;
- unsigned CSCNA:1;
- unsigned :1;
- unsigned OFFCAL:1;
- unsigned VCFG:3;
- };
- struct {
- unsigned :2;
- unsigned SMPI0:1;
- unsigned SMPI1:1;
- unsigned SMPI2:1;
- unsigned SMPI3:1;
- unsigned :7;
- unsigned VCFG0:1;
- unsigned VCFG1:1;
- unsigned VCFG2:1;
- };
- };
- } AD1CON2BITS;
- extern volatile AD1CON2BITS AD1CON2bits __attribute__((__sfr__));
- extern volatile unsigned int AD1CON3 __attribute__((__sfr__));
- __extension__ typedef struct tagAD1CON3BITS {
- union {
- struct {
- unsigned ADCS:8;
- unsigned SAMC:5;
- unsigned PUMPEN:1;
- unsigned EXTSAM:1;
- unsigned ADRC:1;
- };
- struct {
- unsigned ADCS0:1;
- unsigned ADCS1:1;
- unsigned ADCS2:1;
- unsigned ADCS3:1;
- unsigned ADCS4:1;
- unsigned ADCS5:1;
- unsigned ADCS6:1;
- unsigned ADCS7:1;
- unsigned SAMC0:1;
- unsigned SAMC1:1;
- unsigned SAMC2:1;
- unsigned SAMC3:1;
- unsigned SAMC4:1;
- };
- };
- } AD1CON3BITS;
- extern volatile AD1CON3BITS AD1CON3bits __attribute__((__sfr__));
- extern volatile unsigned int AD1CHS __attribute__((__sfr__));
- __extension__ typedef struct tagAD1CHSBITS {
- union {
- struct {
- unsigned CH0SA:5;
- unsigned :2;
- unsigned CH0NA:1;
- unsigned CH0SB:4;
- unsigned :3;
- unsigned CH0NB:1;
- };
- struct {
- unsigned CH0SA0:1;
- unsigned CH0SA1:1;
- unsigned CH0SA2:1;
- unsigned CH0SA3:1;
- unsigned CH0SA4:1;
- unsigned :3;
- unsigned CH0SB0:1;
- unsigned CH0SB1:1;
- unsigned CH0SB2:1;
- unsigned CH0SB3:1;
- };
- };
- } AD1CHSBITS;
- extern volatile AD1CHSBITS AD1CHSbits __attribute__((__sfr__));
- extern volatile unsigned int AD1PCFG __attribute__((__sfr__));
- typedef struct tagAD1PCFGBITS {
- unsigned PCFG0:1;
- unsigned PCFG1:1;
- unsigned PCFG2:1;
- unsigned PCFG3:1;
- unsigned PCFG4:1;
- unsigned PCFG5:1;
- unsigned :4;
- unsigned PCFG10:1;
- unsigned PCFG11:1;
- unsigned PCFG12:1;
- } AD1PCFGBITS;
- extern volatile AD1PCFGBITS AD1PCFGbits __attribute__((__sfr__));
- extern volatile unsigned int AD1CSSL __attribute__((__sfr__));
- typedef struct tagAD1CSSLBITS {
- unsigned CSSL0:1;
- unsigned CSSL1:1;
- unsigned CSSL2:1;
- unsigned CSSL3:1;
- unsigned CSSL4:1;
- unsigned CSSL5:1;
- unsigned :4;
- unsigned CSSL10:1;
- unsigned CSSL11:1;
- unsigned CSSL12:1;
- } AD1CSSLBITS;
- extern volatile AD1CSSLBITS AD1CSSLbits __attribute__((__sfr__));
- extern volatile unsigned int CTMUCON __attribute__((__sfr__));
- __extension__ typedef struct tagCTMUCONBITS {
- union {
- struct {
- unsigned EDG1STAT:1;
- unsigned EDG2STAT:1;
- unsigned EDG1SEL:2;
- unsigned EDG1POL:1;
- unsigned EDG2SEL:2;
- unsigned EDG2POL:1;
- unsigned CTTRIG:1;
- unsigned IDISSEN:1;
- unsigned EDGSEQEN:1;
- unsigned EDGEN:1;
- unsigned TGEN:1;
- unsigned CTMUSIDL:1;
- unsigned :1;
- unsigned CTMUEN:1;
- };
- struct {
- unsigned :2;
- unsigned EDG1SEL0:1;
- unsigned EDG1SEL1:1;
- unsigned :1;
- unsigned EDG2SEL0:1;
- unsigned EDG2SEL1:1;
- };
- };
- } CTMUCONBITS;
- extern volatile CTMUCONBITS CTMUCONbits __attribute__((__sfr__));
- extern volatile unsigned int CTMUICON __attribute__((__sfr__));
- __extension__ typedef struct tagCTMUICONBITS {
- union {
- struct {
- unsigned :8;
- unsigned IRNG:2;
- unsigned ITRIM:6;
- };
- struct {
- unsigned :8;
- unsigned IRNG0:1;
- unsigned IRNG1:1;
- unsigned ITRIM0:1;
- unsigned ITRIM1:1;
- unsigned ITRIM2:1;
- unsigned ITRIM3:1;
- unsigned ITRIM4:1;
- unsigned ITRIM5:1;
- };
- };
- } CTMUICONBITS;
- extern volatile CTMUICONBITS CTMUICONbits __attribute__((__sfr__));
- extern volatile unsigned int ALRMVAL __attribute__((__sfr__));
- extern volatile unsigned int ALCFGRPT __attribute__((__sfr__));
- __extension__ typedef struct tagALCFGRPTBITS {
- union {
- struct {
- unsigned ARPT:8;
- unsigned ALRMPTR0:1;
- unsigned ALRMPTR1:1;
- unsigned AMASK:4;
- unsigned CHIME:1;
- unsigned ALRMEN:1;
- };
- struct {
- unsigned ARPT0:1;
- unsigned ARPT1:1;
- unsigned ARPT2:1;
- unsigned ARPT3:1;
- unsigned ARPT4:1;
- unsigned ARPT5:1;
- unsigned ARPT6:1;
- unsigned ARPT7:1;
- unsigned ALRMPTR:2;
- unsigned AMASK0:1;
- unsigned AMASK1:1;
- unsigned AMASK2:1;
- unsigned AMASK3:1;
- };
- };
- } ALCFGRPTBITS;
- extern volatile ALCFGRPTBITS ALCFGRPTbits __attribute__((__sfr__));
- extern volatile unsigned int RTCVAL __attribute__((__sfr__));
- extern volatile unsigned int RCFGCAL __attribute__((__sfr__));
- __extension__ typedef struct tagRCFGCALBITS {
- union {
- struct {
- unsigned CAL:8;
- unsigned RTCPTR0:1;
- unsigned RTCPTR1:1;
- unsigned RTCOE:1;
- unsigned HALFSEC:1;
- unsigned RTCSYNC:1;
- unsigned RTCWREN:1;
- unsigned :1;
- unsigned RTCEN:1;
- };
- struct {
- unsigned CAL0:1;
- unsigned CAL1:1;
- unsigned CAL2:1;
- unsigned CAL3:1;
- unsigned CAL4:1;
- unsigned CAL5:1;
- unsigned CAL6:1;
- unsigned CAL7:1;
- unsigned RTCPTR:2;
- };
- };
- } RCFGCALBITS;
- extern volatile RCFGCALBITS RCFGCALbits __attribute__((__sfr__));
- extern volatile unsigned int CMSTAT __attribute__((__sfr__));
- typedef struct tagCMSTATBITS {
- unsigned C1OUT:1;
- unsigned C2OUT:1;
- unsigned :6;
- unsigned C1EVT:1;
- unsigned C2EVT:1;
- unsigned :5;
- unsigned CMIDL:1;
- } CMSTATBITS;
- extern volatile CMSTATBITS CMSTATbits __attribute__((__sfr__));
- extern volatile unsigned int CVRCON __attribute__((__sfr__));
- __extension__ typedef struct tagCVRCONBITS {
- union {
- struct {
- unsigned CVR:4;
- unsigned CVRSS:1;
- unsigned CVRR:1;
- unsigned CVROE:1;
- unsigned CVREN:1;
- };
- struct {
- unsigned CVR0:1;
- unsigned CVR1:1;
- unsigned CVR2:1;
- unsigned CVR3:1;
- };
- };
- } CVRCONBITS;
- extern volatile CVRCONBITS CVRCONbits __attribute__((__sfr__));
- extern volatile unsigned int CM1CON __attribute__((__sfr__));
- __extension__ typedef struct tagCM1CONBITS {
- union {
- struct {
- unsigned CCH:2;
- unsigned :2;
- unsigned CREF:1;
- unsigned :1;
- unsigned EVPOL:2;
- unsigned COUT:1;
- unsigned CEVT:1;
- unsigned :2;
- unsigned CLPWR:1;
- unsigned CPOL:1;
- unsigned COE:1;
- unsigned CON:1;
- };
- struct {
- unsigned CCH0:1;
- unsigned CCH1:1;
- unsigned :4;
- unsigned EVPOL0:1;
- unsigned EVPOL1:1;
- };
- };
- } CM1CONBITS;
- extern volatile CM1CONBITS CM1CONbits __attribute__((__sfr__));
- extern volatile unsigned int CM2CON __attribute__((__sfr__));
- __extension__ typedef struct tagCM2CONBITS {
- union {
- struct {
- unsigned CCH:2;
- unsigned :2;
- unsigned CREF:1;
- unsigned :1;
- unsigned EVPOL:2;
- unsigned COUT:1;
- unsigned CEVT:1;
- unsigned :2;
- unsigned CLPWR:1;
- unsigned CPOL:1;
- unsigned COE:1;
- unsigned CON:1;
- };
- struct {
- unsigned CCH0:1;
- unsigned CCH1:1;
- unsigned :4;
- unsigned EVPOL0:1;
- unsigned EVPOL1:1;
- };
- };
- } CM2CONBITS;
- extern volatile CM2CONBITS CM2CONbits __attribute__((__sfr__));
- extern volatile unsigned int CRCCON __attribute__((__sfr__));
- __extension__ typedef struct tagCRCCONBITS {
- union {
- struct {
- unsigned PLEN:4;
- unsigned CRCGO:1;
- unsigned :1;
- unsigned CRCMPT:1;
- unsigned CRCFUL:1;
- unsigned VWORD:5;
- unsigned CSIDL:1;
- };
- struct {
- unsigned PLEN0:1;
- unsigned PLEN1:1;
- unsigned PLEN2:1;
- unsigned PLEN3:1;
- unsigned :4;
- unsigned VWORD0:1;
- unsigned VWORD1:1;
- unsigned VWORD2:1;
- unsigned VWORD3:1;
- unsigned VWORD4:1;
- };
- };
- } CRCCONBITS;
- extern volatile CRCCONBITS CRCCONbits __attribute__((__sfr__));
- extern volatile unsigned int CRCXOR __attribute__((__sfr__));
- extern volatile unsigned int CRCDAT __attribute__((__sfr__));
- extern volatile unsigned int CRCWDAT __attribute__((__sfr__));
- extern volatile unsigned int RCON __attribute__((__sfr__));
- __extension__ typedef struct tagRCONBITS {
- union {
- struct {
- unsigned POR:1;
- unsigned BOR:1;
- unsigned IDLE:1;
- unsigned SLEEP:1;
- unsigned WDTO:1;
- unsigned SWDTEN:1;
- unsigned SWR:1;
- unsigned EXTR:1;
- unsigned PMSLP:1;
- unsigned :1;
- unsigned DPSLP:1;
- unsigned :2;
- unsigned SBOREN:1;
- unsigned IOPUWR:1;
- unsigned TRAPR:1;
- };
- struct {
- unsigned :8;
- unsigned VREGS:1;
- };
- };
- } RCONBITS;
- extern volatile RCONBITS RCONbits __attribute__((__sfr__));
- extern volatile unsigned int OSCCON __attribute__((__sfr__));
- __extension__ typedef struct tagOSCCONBITS {
- union {
- struct {
- unsigned OSWEN:1;
- unsigned SOSCEN:1;
- unsigned :1;
- unsigned CF:1;
- unsigned :1;
- unsigned LOCK:1;
- unsigned :1;
- unsigned CLKLOCK:1;
- unsigned NOSC:3;
- unsigned :1;
- unsigned COSC:3;
- };
- struct {
- unsigned :8;
- unsigned NOSC0:1;
- unsigned NOSC1:1;
- unsigned NOSC2:1;
- unsigned :1;
- unsigned COSC0:1;
- unsigned COSC1:1;
- unsigned COSC2:1;
- };
- };
- } OSCCONBITS;
- extern volatile OSCCONBITS OSCCONbits __attribute__((__sfr__));
- extern volatile unsigned int CLKDIV __attribute__((__sfr__));
- __extension__ typedef struct tagCLKDIVBITS {
- union {
- struct {
- unsigned :8;
- unsigned RCDIV:3;
- unsigned DOZEN:1;
- unsigned DOZE:3;
- unsigned ROI:1;
- };
- struct {
- unsigned :8;
- unsigned RCDIV0:1;
- unsigned RCDIV1:1;
- unsigned RCDIV2:1;
- unsigned :1;
- unsigned DOZE0:1;
- unsigned DOZE1:1;
- unsigned DOZE2:1;
- };
- };
- } CLKDIVBITS;
- extern volatile CLKDIVBITS CLKDIVbits __attribute__((__sfr__));
- extern volatile unsigned int OSCTUN __attribute__((__sfr__));
- __extension__ typedef struct tagOSCTUNBITS {
- union {
- struct {
- unsigned TUN:6;
- };
- struct {
- unsigned TUN0:1;
- unsigned TUN1:1;
- unsigned TUN2:1;
- unsigned TUN3:1;
- unsigned TUN4:1;
- unsigned TUN5:1;
- };
- };
- } OSCTUNBITS;
- extern volatile OSCTUNBITS OSCTUNbits __attribute__((__sfr__));
- extern volatile unsigned int REFOCON __attribute__((__sfr__));
- __extension__ typedef struct tagREFOCONBITS {
- union {
- struct {
- unsigned :8;
- unsigned RODIV:4;
- unsigned ROSEL:1;
- unsigned ROSSLP:1;
- unsigned :1;
- unsigned ROEN:1;
- };
- struct {
- unsigned :8;
- unsigned RODIV0:1;
- unsigned RODIV1:1;
- unsigned RODIV2:1;
- unsigned RODIV3:1;
- };
- };
- } REFOCONBITS;
- extern volatile REFOCONBITS REFOCONbits __attribute__((__sfr__));
- extern volatile unsigned int HLVDCON __attribute__((__sfr__));
- __extension__ typedef struct tagHLVDCONBITS {
- union {
- struct {
- unsigned HLVDL:4;
- unsigned :1;
- unsigned IRVST:1;
- unsigned BGVST:1;
- unsigned VDIR:1;
- unsigned :5;
- unsigned HLSIDL:1;
- unsigned :1;
- unsigned HLVDEN:1;
- };
- struct {
- unsigned :8;
- unsigned HLVDL0:1;
- unsigned HLVDL1:1;
- unsigned HLVDL2:1;
- unsigned HLVDL3:1;
- };
- };
- } HLVDCONBITS;
- extern volatile HLVDCONBITS HLVDCONbits __attribute__((__sfr__));
- extern volatile unsigned int DSCON __attribute__((__sfr__));
- typedef struct tagDSCONBITS {
- unsigned RELEASE:1;
- unsigned DSBOR:1;
- unsigned :13;
- unsigned DSEN:1;
- } DSCONBITS;
- extern volatile DSCONBITS DSCONbits __attribute__((__sfr__));
- extern volatile unsigned int DSWSRC __attribute__((__sfr__));
- typedef struct tagDSWSRCBITS {
- unsigned DSPOR:1;
- unsigned :1;
- unsigned DSMCLR:1;
- unsigned DSRTCC:1;
- unsigned DSWDT:1;
- unsigned :2;
- unsigned DSFLT:1;
- unsigned DSINT0:1;
- } DSWSRCBITS;
- extern volatile DSWSRCBITS DSWSRCbits __attribute__((__sfr__));
- extern volatile unsigned int DSGPR0 __attribute__((__sfr__));
- extern volatile unsigned int DSGPR1 __attribute__((__sfr__));
- extern volatile unsigned int NVMCON __attribute__((__sfr__));
- __extension__ typedef struct tagNVMCONBITS {
- union {
- struct {
- unsigned NVMOP:6;
- unsigned ERASE:1;
- unsigned :5;
- unsigned PGMONLY:1;
- unsigned WRERR:1;
- unsigned WREN:1;
- unsigned WR:1;
- };
- struct {
- unsigned NVMOP0:1;
- unsigned NVMOP1:1;
- unsigned NVMOP2:1;
- unsigned NVMOP3:1;
- unsigned NVMOP4:1;
- unsigned NVMOP5:1;
- };
- };
- } NVMCONBITS;
- extern volatile NVMCONBITS NVMCONbits __attribute__((__sfr__));
- extern volatile unsigned int NVMKEY __attribute__((__sfr__));
- __extension__ typedef struct tagNVMKEYBITS {
- union {
- struct {
- unsigned NVMKEY:8;
- };
- struct {
- unsigned NVMKEY0:1;
- unsigned NVMKEY1:1;
- unsigned NVMKEY2:1;
- unsigned NVMKEY3:1;
- unsigned NVMKEY4:1;
- unsigned NVMKEY5:1;
- unsigned NVMKEY6:1;
- unsigned NVMKEY7:1;
- };
- };
- } NVMKEYBITS;
- extern volatile NVMKEYBITS NVMKEYbits __attribute__((__sfr__));
- extern volatile unsigned int PMD1 __attribute__((__sfr__));
- typedef struct tagPMD1BITS {
- unsigned ADC1MD:1;
- unsigned :2;
- unsigned SPI1MD:1;
- unsigned :1;
- unsigned U1MD:1;
- unsigned U2MD:1;
- unsigned I2C1MD:1;
- unsigned :3;
- unsigned T1MD:1;
- unsigned T2MD:1;
- unsigned T3MD:1;
- } PMD1BITS;
- extern volatile PMD1BITS PMD1bits __attribute__((__sfr__));
- extern volatile unsigned int PMD2 __attribute__((__sfr__));
- typedef struct tagPMD2BITS {
- unsigned OC1MD:1;
- unsigned :7;
- unsigned IC1MD:1;
- } PMD2BITS;
- extern volatile PMD2BITS PMD2bits __attribute__((__sfr__));
- extern volatile unsigned int PMD3 __attribute__((__sfr__));
- typedef struct tagPMD3BITS {
- unsigned :7;
- unsigned CRCPMD:1;
- unsigned :1;
- unsigned RTCCMD:1;
- unsigned CMPMD:1;
- } PMD3BITS;
- extern volatile PMD3BITS PMD3bits __attribute__((__sfr__));
- extern volatile unsigned int PMD4 __attribute__((__sfr__));
- typedef struct tagPMD4BITS {
- unsigned :1;
- unsigned HLVDMD:1;
- unsigned CTMUMD:1;
- unsigned REFOMD:1;
- unsigned EEMD:1;
- } PMD4BITS;
- extern volatile PMD4BITS PMD4bits __attribute__((__sfr__));
- /* ---------------------------------------------------------- */
- /* Defines for unique SFR bit names */
- /* ---------------------------------------------------------- */
- /* SR */
- #define _C SRbits.C
- #define _Z SRbits.Z
- #define _OV SRbits.OV
- #define _N SRbits.N
- #define _RA SRbits.RA
- #define _IPL0 SRbits.IPL0
- #define _IPL1 SRbits.IPL1
- #define _IPL2 SRbits.IPL2
- #define _DC SRbits.DC
- #define _IPL SRbits.IPL
- /* CORCON */
- #define _PSV CORCONbits.PSV
- #define _IPL3 CORCONbits.IPL3
- /* CNEN1 */
- #define _CN0IE CNEN1bits.CN0IE
- #define _CN1IE CNEN1bits.CN1IE
- #define _CN2IE CNEN1bits.CN2IE
- #define _CN3IE CNEN1bits.CN3IE
- #define _CN4IE CNEN1bits.CN4IE
- #define _CN5IE CNEN1bits.CN5IE
- #define _CN6IE CNEN1bits.CN6IE
- #define _CN7IE CNEN1bits.CN7IE
- #define _CN8IE CNEN1bits.CN8IE
- #define _CN9IE CNEN1bits.CN9IE
- #define _CN11IE CNEN1bits.CN11IE
- #define _CN12IE CNEN1bits.CN12IE
- #define _CN13IE CNEN1bits.CN13IE
- #define _CN14IE CNEN1bits.CN14IE
- #define _CN15IE CNEN1bits.CN15IE
- /* CNEN2 */
- #define _CN16IE CNEN2bits.CN16IE
- #define _CN21IE CNEN2bits.CN21IE
- #define _CN22IE CNEN2bits.CN22IE
- #define _CN23IE CNEN2bits.CN23IE
- #define _CN24IE CNEN2bits.CN24IE
- #define _CN27IE CNEN2bits.CN27IE
- #define _CN29IE CNEN2bits.CN29IE
- #define _CN30IE CNEN2bits.CN30IE
- /* CNPU1 */
- #define _CN0PUE CNPU1bits.CN0PUE
- #define _CN1PUE CNPU1bits.CN1PUE
- #define _CN2PUE CNPU1bits.CN2PUE
- #define _CN3PUE CNPU1bits.CN3PUE
- #define _CN4PUE CNPU1bits.CN4PUE
- #define _CN5PUE CNPU1bits.CN5PUE
- #define _CN6PUE CNPU1bits.CN6PUE
- #define _CN7PUE CNPU1bits.CN7PUE
- #define _CN8PUE CNPU1bits.CN8PUE
- #define _CN9PUE CNPU1bits.CN9PUE
- #define _CN11PUE CNPU1bits.CN11PUE
- #define _CN12PUE CNPU1bits.CN12PUE
- #define _CN13PUE CNPU1bits.CN13PUE
- #define _CN14PUE CNPU1bits.CN14PUE
- #define _CN15PUE CNPU1bits.CN15PUE
- /* CNPU2 */
- #define _CN16PUE CNPU2bits.CN16PUE
- #define _CN21PUE CNPU2bits.CN21PUE
- #define _CN22PUE CNPU2bits.CN22PUE
- #define _CN23PUE CNPU2bits.CN23PUE
- #define _CN24PUE CNPU2bits.CN24PUE
- #define _CN27PUE CNPU2bits.CN27PUE
- #define _CN29PUE CNPU2bits.CN29PUE
- #define _CN30PUE CNPU2bits.CN30PUE
- /* CNPD1 */
- #define _CN0PDE CNPD1bits.CN0PDE
- #define _CN1PDE CNPD1bits.CN1PDE
- #define _CN2PDE CNPD1bits.CN2PDE
- #define _CN3PDE CNPD1bits.CN3PDE
- #define _CN4PDE CNPD1bits.CN4PDE
- #define _CN5PDE CNPD1bits.CN5PDE
- #define _CN6PDE CNPD1bits.CN6PDE
- #define _CN7PDE CNPD1bits.CN7PDE
- #define _CN8PDE CNPD1bits.CN8PDE
- #define _CN9PDE CNPD1bits.CN9PDE
- #define _CN11PDE CNPD1bits.CN11PDE
- #define _CN12PDE CNPD1bits.CN12PDE
- #define _CN13PDE CNPD1bits.CN13PDE
- #define _CN14PDE CNPD1bits.CN14PDE
- #define _CN15PDE CNPD1bits.CN15PDE
- /* CNPD2 */
- #define _CN16PDE CNPD2bits.CN16PDE
- #define _CN21PDE CNPD2bits.CN21PDE
- #define _CN22PDE CNPD2bits.CN22PDE
- #define _CN23PDE CNPD2bits.CN23PDE
- #define _CN24PDE CNPD2bits.CN24PDE
- #define _CN27PDE CNPD2bits.CN27PDE
- #define _CN29PDE CNPD2bits.CN29PDE
- #define _CN30PDE CNPD2bits.CN30PDE
- /* INTCON1 */
- #define _OSCFAIL INTCON1bits.OSCFAIL
- #define _STKERR INTCON1bits.STKERR
- #define _ADDRERR INTCON1bits.ADDRERR
- #define _MATHERR INTCON1bits.MATHERR
- #define _NSTDIS INTCON1bits.NSTDIS
- /* INTCON2 */
- #define _INT0EP INTCON2bits.INT0EP
- #define _INT1EP INTCON2bits.INT1EP
- #define _INT2EP INTCON2bits.INT2EP
- #define _DISI INTCON2bits.DISI
- #define _ALTIVT INTCON2bits.ALTIVT
- /* IFS0 */
- #define _INT0IF IFS0bits.INT0IF
- #define _IC1IF IFS0bits.IC1IF
- #define _OC1IF IFS0bits.OC1IF
- #define _T1IF IFS0bits.T1IF
- #define _T2IF IFS0bits.T2IF
- #define _T3IF IFS0bits.T3IF
- #define _SPF1IF IFS0bits.SPF1IF
- #define _SPI1IF IFS0bits.SPI1IF
- #define _U1RXIF IFS0bits.U1RXIF
- #define _U1TXIF IFS0bits.U1TXIF
- #define _AD1IF IFS0bits.AD1IF
- #define _NVMIF IFS0bits.NVMIF
- /* IFS1 */
- #define _SI2C1IF IFS1bits.SI2C1IF
- #define _MI2C1IF IFS1bits.MI2C1IF
- #define _CMIF IFS1bits.CMIF
- #define _CNIF IFS1bits.CNIF
- #define _INT1IF IFS1bits.INT1IF
- #define _INT2IF IFS1bits.INT2IF
- #define _U2RXIF IFS1bits.U2RXIF
- #define _U2TXIF IFS1bits.U2TXIF
- /* IFS3 */
- #define _RTCIF IFS3bits.RTCIF
- /* IFS4 */
- #define _U1ERIF IFS4bits.U1ERIF
- #define _U2ERIF IFS4bits.U2ERIF
- #define _CRCIF IFS4bits.CRCIF
- #define _HLVDIF IFS4bits.HLVDIF
- #define _CTMUIF IFS4bits.CTMUIF
- /* IEC0 */
- #define _INT0IE IEC0bits.INT0IE
- #define _IC1IE IEC0bits.IC1IE
- #define _OC1IE IEC0bits.OC1IE
- #define _T1IE IEC0bits.T1IE
- #define _T2IE IEC0bits.T2IE
- #define _T3IE IEC0bits.T3IE
- #define _SPF1IE IEC0bits.SPF1IE
- #define _SPI1IE IEC0bits.SPI1IE
- #define _U1RXIE IEC0bits.U1RXIE
- #define _U1TXIE IEC0bits.U1TXIE
- #define _AD1IE IEC0bits.AD1IE
- #define _NVMIE IEC0bits.NVMIE
- /* IEC1 */
- #define _SI2C1IE IEC1bits.SI2C1IE
- #define _MI2C1IE IEC1bits.MI2C1IE
- #define _CMIE IEC1bits.CMIE
- #define _CNIE IEC1bits.CNIE
- #define _INT1IE IEC1bits.INT1IE
- #define _INT2IE IEC1bits.INT2IE
- #define _U2RXIE IEC1bits.U2RXIE
- #define _U2TXIE IEC1bits.U2TXIE
- /* IEC3 */
- #define _RTCIE IEC3bits.RTCIE
- /* IEC4 */
- #define _U1ERIE IEC4bits.U1ERIE
- #define _U2ERIE IEC4bits.U2ERIE
- #define _CRCIE IEC4bits.CRCIE
- #define _HLVDIE IEC4bits.HLVDIE
- #define _CTMUIE IEC4bits.CTMUIE
- /* IPC0 */
- #define _INT0IP0 IPC0bits.INT0IP0
- #define _INT0IP1 IPC0bits.INT0IP1
- #define _INT0IP2 IPC0bits.INT0IP2
- #define _IC1IP0 IPC0bits.IC1IP0
- #define _IC1IP1 IPC0bits.IC1IP1
- #define _IC1IP2 IPC0bits.IC1IP2
- #define _OC1IP0 IPC0bits.OC1IP0
- #define _OC1IP1 IPC0bits.OC1IP1
- #define _OC1IP2 IPC0bits.OC1IP2
- #define _T1IP0 IPC0bits.T1IP0
- #define _T1IP1 IPC0bits.T1IP1
- #define _T1IP2 IPC0bits.T1IP2
- #define _INT0IP IPC0bits.INT0IP
- #define _IC1IP IPC0bits.IC1IP
- #define _OC1IP IPC0bits.OC1IP
- #define _T1IP IPC0bits.T1IP
- /* IPC1 */
- #define _T2IP0 IPC1bits.T2IP0
- #define _T2IP1 IPC1bits.T2IP1
- #define _T2IP2 IPC1bits.T2IP2
- #define _T2IP IPC1bits.T2IP
- /* IPC2 */
- #define _T3IP0 IPC2bits.T3IP0
- #define _T3IP1 IPC2bits.T3IP1
- #define _T3IP2 IPC2bits.T3IP2
- #define _SPF1IP0 IPC2bits.SPF1IP0
- #define _SPF1IP1 IPC2bits.SPF1IP1
- #define _SPF1IP2 IPC2bits.SPF1IP2
- #define _SPI1IP0 IPC2bits.SPI1IP0
- #define _SPI1IP1 IPC2bits.SPI1IP1
- #define _SPI1IP2 IPC2bits.SPI1IP2
- #define _U1RXIP0 IPC2bits.U1RXIP0
- #define _U1RXIP1 IPC2bits.U1RXIP1
- #define _U1RXIP2 IPC2bits.U1RXIP2
- #define _T3IP IPC2bits.T3IP
- #define _SPF1IP IPC2bits.SPF1IP
- #define _SPI1IP IPC2bits.SPI1IP
- #define _U1RXIP IPC2bits.U1RXIP
- /* IPC3 */
- #define _U1TXIP0 IPC3bits.U1TXIP0
- #define _U1TXIP1 IPC3bits.U1TXIP1
- #define _U1TXIP2 IPC3bits.U1TXIP2
- #define _AD1IP0 IPC3bits.AD1IP0
- #define _AD1IP1 IPC3bits.AD1IP1
- #define _AD1IP2 IPC3bits.AD1IP2
- #define _NVMIP0 IPC3bits.NVMIP0
- #define _NVMIP1 IPC3bits.NVMIP1
- #define _NVMIP2 IPC3bits.NVMIP2
- #define _U1TXIP IPC3bits.U1TXIP
- #define _AD1IP IPC3bits.AD1IP
- /* IPC4 */
- #define _SI2C1IP0 IPC4bits.SI2C1IP0
- #define _SI2C1IP1 IPC4bits.SI2C1IP1
- #define _SI2C1IP2 IPC4bits.SI2C1IP2
- #define _MI2C1IP0 IPC4bits.MI2C1IP0
- #define _MI2C1IP1 IPC4bits.MI2C1IP1
- #define _MI2C1IP2 IPC4bits.MI2C1IP2
- #define _CMIP0 IPC4bits.CMIP0
- #define _CMIP1 IPC4bits.CMIP1
- #define _CMIP2 IPC4bits.CMIP2
- #define _CNIP0 IPC4bits.CNIP0
- #define _CNIP1 IPC4bits.CNIP1
- #define _CNIP2 IPC4bits.CNIP2
- #define _SI2C1IP IPC4bits.SI2C1IP
- #define _MI2C1IP IPC4bits.MI2C1IP
- #define _CMIP IPC4bits.CMIP
- #define _CNIP IPC4bits.CNIP
- #define _SI2C1P0 IPC4bits.SI2C1P0
- #define _SI2C1P1 IPC4bits.SI2C1P1
- #define _SI2C1P2 IPC4bits.SI2C1P2
- #define _MI2C1P0 IPC4bits.MI2C1P0
- #define _MI2C1P1 IPC4bits.MI2C1P1
- #define _MI2C1P2 IPC4bits.MI2C1P2
- #define _SI2C1P IPC4bits.SI2C1P
- #define _MI2C1P IPC4bits.MI2C1P
- /* IPC5 */
- #define _INT1IP0 IPC5bits.INT1IP0
- #define _INT1IP1 IPC5bits.INT1IP1
- #define _INT1IP2 IPC5bits.INT1IP2
- #define _INT1IP IPC5bits.INT1IP
- /* IPC7 */
- #define _INT2IP0 IPC7bits.INT2IP0
- #define _INT2IP1 IPC7bits.INT2IP1
- #define _INT2IP2 IPC7bits.INT2IP2
- #define _U2RXIP0 IPC7bits.U2RXIP0
- #define _U2RXIP1 IPC7bits.U2RXIP1
- #define _U2RXIP2 IPC7bits.U2RXIP2
- #define _U2TXIP0 IPC7bits.U2TXIP0
- #define _U2TXIP1 IPC7bits.U2TXIP1
- #define _U2TXIP2 IPC7bits.U2TXIP2
- #define _INT2IP IPC7bits.INT2IP
- #define _U2RXIP IPC7bits.U2RXIP
- #define _U2TXIP IPC7bits.U2TXIP
- /* IPC15 */
- #define _RTCIP0 IPC15bits.RTCIP0
- #define _RTCIP1 IPC15bits.RTCIP1
- #define _RTCIP2 IPC15bits.RTCIP2
- #define _RTCIP IPC15bits.RTCIP
- /* IPC16 */
- #define _U1ERIP0 IPC16bits.U1ERIP0
- #define _U1ERIP1 IPC16bits.U1ERIP1
- #define _U1ERIP2 IPC16bits.U1ERIP2
- #define _U2ERIP0 IPC16bits.U2ERIP0
- #define _U2ERIP1 IPC16bits.U2ERIP1
- #define _U2ERIP2 IPC16bits.U2ERIP2
- #define _CRCIP0 IPC16bits.CRCIP0
- #define _CRCIP1 IPC16bits.CRCIP1
- #define _CRCIP2 IPC16bits.CRCIP2
- #define _U1ERIP IPC16bits.U1ERIP
- #define _U2ERIP IPC16bits.U2ERIP
- #define _CRCIP IPC16bits.CRCIP
- /* IPC18 */
- #define _HLVDIP0 IPC18bits.HLVDIP0
- #define _HLVDIP1 IPC18bits.HLVDIP1
- #define _HLVDIP2 IPC18bits.HLVDIP2
- #define _HLVDIP IPC18bits.HLVDIP
- /* IPC19 */
- #define _CTMUIP0 IPC19bits.CTMUIP0
- #define _CTMUIP1 IPC19bits.CTMUIP1
- #define _CTMUIP2 IPC19bits.CTMUIP2
- #define _CTMUIP IPC19bits.CTMUIP
- /* INTTREG */
- #define _VECNUM0 INTTREGbits.VECNUM0
- #define _VECNUM1 INTTREGbits.VECNUM1
- #define _VECNUM2 INTTREGbits.VECNUM2
- #define _VECNUM3 INTTREGbits.VECNUM3
- #define _VECNUM4 INTTREGbits.VECNUM4
- #define _VECNUM5 INTTREGbits.VECNUM5
- #define _VECNUM6 INTTREGbits.VECNUM6
- #define _ILR0 INTTREGbits.ILR0
- #define _ILR1 INTTREGbits.ILR1
- #define _ILR2 INTTREGbits.ILR2
- #define _ILR3 INTTREGbits.ILR3
- #define _VHOLD INTTREGbits.VHOLD
- #define _CPUIRQ INTTREGbits.CPUIRQ
- /* T1CON */
- #define _TCS T1CONbits.TCS
- #define _TSYNC T1CONbits.TSYNC
- #define _TCKPS0 T1CONbits.TCKPS0
- #define _TCKPS1 T1CONbits.TCKPS1
- #define _TGATE T1CONbits.TGATE
- #define _TSIDL T1CONbits.TSIDL
- #define _TON T1CONbits.TON
- #define _TCKPS T1CONbits.TCKPS
- /* T2CON */
- /* Bitname _TCS cannot be defined because it is used by more than one SFR */
- #define _T32 T2CONbits.T32
- /* Bitname _TCKPS0 cannot be defined because it is used by more than one SFR */
- /* Bitname _TCKPS1 cannot be defined because it is used by more than one SFR */
- /* Bitname _TGATE cannot be defined because it is used by more than one SFR */
- /* Bitname _TSIDL cannot be defined because it is used by more than one SFR */
- /* Bitname _TON cannot be defined because it is used by more than one SFR */
- /* Bitname _TCKPS cannot be defined because it is used by more than one SFR */
- /* T3CON */
- /* Bitname _TCS cannot be defined because it is used by more than one SFR */
- /* Bitname _TCKPS0 cannot be defined because it is used by more than one SFR */
- /* Bitname _TCKPS1 cannot be defined because it is used by more than one SFR */
- /* Bitname _TGATE cannot be defined because it is used by more than one SFR */
- /* Bitname _TSIDL cannot be defined because it is used by more than one SFR */
- /* Bitname _TON cannot be defined because it is used by more than one SFR */
- /* Bitname _TCKPS cannot be defined because it is used by more than one SFR */
- /* IC1CON */
- #define _ICM0 IC1CONbits.ICM0
- #define _ICM1 IC1CONbits.ICM1
- #define _ICM2 IC1CONbits.ICM2
- #define _ICBNE IC1CONbits.ICBNE
- #define _ICOV IC1CONbits.ICOV
- #define _ICI0 IC1CONbits.ICI0
- #define _ICI1 IC1CONbits.ICI1
- #define _ICTMR IC1CONbits.ICTMR
- #define _ICSIDL IC1CONbits.ICSIDL
- #define _ICM IC1CONbits.ICM
- #define _ICI IC1CONbits.ICI
- /* OC1CON */
- #define _OCM OC1CONbits.OCM
- #define _OCTSEL OC1CONbits.OCTSEL
- #define _OCFLT OC1CONbits.OCFLT
- #define _OCSIDL OC1CONbits.OCSIDL
- #define _OCM0 OC1CONbits.OCM0
- #define _OCM1 OC1CONbits.OCM1
- #define _OCM2 OC1CONbits.OCM2
- /* I2C1CON */
- #define _SEN I2C1CONbits.SEN
- #define _RSEN I2C1CONbits.RSEN
- #define _PEN I2C1CONbits.PEN
- #define _RCEN I2C1CONbits.RCEN
- #define _ACKEN I2C1CONbits.ACKEN
- #define _ACKDT I2C1CONbits.ACKDT
- #define _STREN I2C1CONbits.STREN
- #define _GCEN I2C1CONbits.GCEN
- #define _SMEN I2C1CONbits.SMEN
- #define _DISSLW I2C1CONbits.DISSLW
- #define _A10M I2C1CONbits.A10M
- #define _IPMIEN I2C1CONbits.IPMIEN
- #define _SCLREL I2C1CONbits.SCLREL
- #define _I2CSIDL I2C1CONbits.I2CSIDL
- #define _I2CEN I2C1CONbits.I2CEN
- /* I2C1STAT */
- #define _TBF I2C1STATbits.TBF
- #define _RBF I2C1STATbits.RBF
- #define _R_W I2C1STATbits.R_W
- #define _S I2C1STATbits.S
- #define _P I2C1STATbits.P
- #define _D_A I2C1STATbits.D_A
- #define _I2COV I2C1STATbits.I2COV
- #define _IWCOL I2C1STATbits.IWCOL
- #define _ADD10 I2C1STATbits.ADD10
- #define _GCSTAT I2C1STATbits.GCSTAT
- #define _BCL I2C1STATbits.BCL
- #define _TRSTAT I2C1STATbits.TRSTAT
- #define _ACKSTAT I2C1STATbits.ACKSTAT
- /* U1MODE */
- #define _STSEL U1MODEbits.STSEL
- #define _PDSEL0 U1MODEbits.PDSEL0
- #define _PDSEL1 U1MODEbits.PDSEL1
- #define _BRGH U1MODEbits.BRGH
- #define _RXINV U1MODEbits.RXINV
- #define _ABAUD U1MODEbits.ABAUD
- #define _LPBACK U1MODEbits.LPBACK
- #define _WAKE U1MODEbits.WAKE
- #define _UEN0 U1MODEbits.UEN0
- #define _UEN1 U1MODEbits.UEN1
- #define _RTSMD U1MODEbits.RTSMD
- #define _IREN U1MODEbits.IREN
- #define _USIDL U1MODEbits.USIDL
- #define _UARTEN U1MODEbits.UARTEN
- #define _PDSEL U1MODEbits.PDSEL
- #define _UEN U1MODEbits.UEN
- /* U1STA */
- #define _URXDA U1STAbits.URXDA
- #define _OERR U1STAbits.OERR
- #define _FERR U1STAbits.FERR
- #define _PERR U1STAbits.PERR
- #define _RIDLE U1STAbits.RIDLE
- #define _ADDEN U1STAbits.ADDEN
- #define _URXISEL0 U1STAbits.URXISEL0
- #define _URXISEL1 U1STAbits.URXISEL1
- #define _TRMT U1STAbits.TRMT
- #define _UTXBF U1STAbits.UTXBF
- #define _UTXEN U1STAbits.UTXEN
- #define _UTXBRK U1STAbits.UTXBRK
- #define _UTXISEL0 U1STAbits.UTXISEL0
- #define _UTXINV U1STAbits.UTXINV
- #define _UTXISEL1 U1STAbits.UTXISEL1
- #define _URXISEL U1STAbits.URXISEL
- /* U2MODE */
- /* Bitname _STSEL cannot be defined because it is used by more than one SFR */
- /* Bitname _PDSEL0 cannot be defined because it is used by more than one SFR */
- /* Bitname _PDSEL1 cannot be defined because it is used by more than one SFR */
- /* Bitname _BRGH cannot be defined because it is used by more than one SFR */
- /* Bitname _RXINV cannot be defined because it is used by more than one SFR */
- /* Bitname _ABAUD cannot be defined because it is used by more than one SFR */
- /* Bitname _LPBACK cannot be defined because it is used by more than one SFR */
- /* Bitname _WAKE cannot be defined because it is used by more than one SFR */
- /* Bitname _UEN0 cannot be defined because it is used by more than one SFR */
- /* Bitname _UEN1 cannot be defined because it is used by more than one SFR */
- /* Bitname _RTSMD cannot be defined because it is used by more than one SFR */
- /* Bitname _IREN cannot be defined because it is used by more than one SFR */
- /* Bitname _USIDL cannot be defined because it is used by more than one SFR */
- /* Bitname _UARTEN cannot be defined because it is used by more than one SFR */
- /* Bitname _PDSEL cannot be defined because it is used by more than one SFR */
- /* Bitname _UEN cannot be defined because it is used by more than one SFR */
- /* U2STA */
- /* Bitname _URXDA cannot be defined because it is used by more than one SFR */
- /* Bitname _OERR cannot be defined because it is used by more than one SFR */
- /* Bitname _FERR cannot be defined because it is used by more than one SFR */
- /* Bitname _PERR cannot be defined because it is used by more than one SFR */
- /* Bitname _RIDLE cannot be defined because it is used by more than one SFR */
- /* Bitname _ADDEN cannot be defined because it is used by more than one SFR */
- /* Bitname _URXISEL0 cannot be defined because it is used by more than one SFR */
- /* Bitname _URXISEL1 cannot be defined because it is used by more than one SFR */
- /* Bitname _TRMT cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXBF cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXEN cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXBRK cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXISEL0 cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXINV cannot be defined because it is used by more than one SFR */
- /* Bitname _UTXISEL1 cannot be defined because it is used by more than one SFR */
- /* Bitname _URXISEL cannot be defined because it is used by more than one SFR */
- /* SPI1STAT */
- #define _SPIRBF SPI1STATbits.SPIRBF
- #define _SPITBF SPI1STATbits.SPITBF
- #define _SISEL SPI1STATbits.SISEL
- #define _SR1MPT SPI1STATbits.SR1MPT
- #define _SPIROV SPI1STATbits.SPIROV
- #define _SRMPT SPI1STATbits.SRMPT
- #define _SPIBEC SPI1STATbits.SPIBEC
- #define _SPISIDL SPI1STATbits.SPISIDL
- #define _SPIEN SPI1STATbits.SPIEN
- #define _SISEL0 SPI1STATbits.SISEL0
- #define _SISEL1 SPI1STATbits.SISEL1
- #define _SISEL2 SPI1STATbits.SISEL2
- #define _SPIBEC0 SPI1STATbits.SPIBEC0
- #define _SPIBEC1 SPI1STATbits.SPIBEC1
- #define _SPIBEC2 SPI1STATbits.SPIBEC2
- /* SPI1CON1 */
- #define _PPRE0 SPI1CON1bits.PPRE0
- #define _PPRE1 SPI1CON1bits.PPRE1
- #define _SPRE SPI1CON1bits.SPRE
- #define _MSTEN SPI1CON1bits.MSTEN
- #define _CKP SPI1CON1bits.CKP
- #define _SSEN SPI1CON1bits.SSEN
- #define _CKE SPI1CON1bits.CKE
- #define _SMP SPI1CON1bits.SMP
- #define _MODE16 SPI1CON1bits.MODE16
- #define _DISSDO SPI1CON1bits.DISSDO
- #define _DISSCK SPI1CON1bits.DISSCK
- #define _PPRE SPI1CON1bits.PPRE
- #define _SPRE0 SPI1CON1bits.SPRE0
- #define _SPRE1 SPI1CON1bits.SPRE1
- #define _SPRE2 SPI1CON1bits.SPRE2
- /* SPI1CON2 */
- #define _SPIBEN SPI1CON2bits.SPIBEN
- #define _SPIFE SPI1CON2bits.SPIFE
- #define _SPIFPOL SPI1CON2bits.SPIFPOL
- #define _SPIFSD SPI1CON2bits.SPIFSD
- #define _FRMEN SPI1CON2bits.FRMEN
- /* TRISA */
- #define _TRISA0 TRISAbits.TRISA0
- #define _TRISA1 TRISAbits.TRISA1
- #define _TRISA2 TRISAbits.TRISA2
- #define _TRISA3 TRISAbits.TRISA3
- #define _TRISA4 TRISAbits.TRISA4
- #define _TRISA5 TRISAbits.TRISA5
- #define _TRISA6 TRISAbits.TRISA6
- #define _TRISA7 TRISAbits.TRISA7
- /* PORTA */
- #define _RA0 PORTAbits.RA0
- #define _RA1 PORTAbits.RA1
- #define _RA2 PORTAbits.RA2
- #define _RA3 PORTAbits.RA3
- #define _RA4 PORTAbits.RA4
- #define _RA5 PORTAbits.RA5
- #define _RA6 PORTAbits.RA6
- #define _RA7 PORTAbits.RA7
- /* LATA */
- #define _LATA0 LATAbits.LATA0
- #define _LATA1 LATAbits.LATA1
- #define _LATA2 LATAbits.LATA2
- #define _LATA3 LATAbits.LATA3
- #define _LATA4 LATAbits.LATA4
- #define _LATA5 LATAbits.LATA5
- #define _LATA6 LATAbits.LATA6
- #define _LATA7 LATAbits.LATA7
- /* ODCA */
- #define _ODA0 ODCAbits.ODA0
- #define _ODA1 ODCAbits.ODA1
- #define _ODA2 ODCAbits.ODA2
- #define _ODA3 ODCAbits.ODA3
- #define _ODA4 ODCAbits.ODA4
- #define _ODA5 ODCAbits.ODA5
- #define _ODA6 ODCAbits.ODA6
- #define _ODA7 ODCAbits.ODA7
- /* TRISB */
- #define _TRISB0 TRISBbits.TRISB0
- #define _TRISB1 TRISBbits.TRISB1
- #define _TRISB2 TRISBbits.TRISB2
- #define _TRISB3 TRISBbits.TRISB3
- #define _TRISB4 TRISBbits.TRISB4
- #define _TRISB5 TRISBbits.TRISB5
- #define _TRISB6 TRISBbits.TRISB6
- #define _TRISB7 TRISBbits.TRISB7
- #define _TRISB8 TRISBbits.TRISB8
- #define _TRISB9 TRISBbits.TRISB9
- #define _TRISB10 TRISBbits.TRISB10
- #define _TRISB11 TRISBbits.TRISB11
- #define _TRISB12 TRISBbits.TRISB12
- #define _TRISB13 TRISBbits.TRISB13
- #define _TRISB14 TRISBbits.TRISB14
- #define _TRISB15 TRISBbits.TRISB15
- /* PORTB */
- #define _RB0 PORTBbits.RB0
- #define _RB1 PORTBbits.RB1
- #define _RB2 PORTBbits.RB2
- #define _RB3 PORTBbits.RB3
- #define _RB4 PORTBbits.RB4
- #define _RB5 PORTBbits.RB5
- #define _RB6 PORTBbits.RB6
- #define _RB7 PORTBbits.RB7
- #define _RB8 PORTBbits.RB8
- #define _RB9 PORTBbits.RB9
- #define _RB10 PORTBbits.RB10
- #define _RB11 PORTBbits.RB11
- #define _RB12 PORTBbits.RB12
- #define _RB13 PORTBbits.RB13
- #define _RB14 PORTBbits.RB14
- #define _RB15 PORTBbits.RB15
- /* LATB */
- #define _LATB0 LATBbits.LATB0
- #define _LATB1 LATBbits.LATB1
- #define _LATB2 LATBbits.LATB2
- #define _LATB3 LATBbits.LATB3
- #define _LATB4 LATBbits.LATB4
- #define _LATB5 LATBbits.LATB5
- #define _LATB6 LATBbits.LATB6
- #define _LATB7 LATBbits.LATB7
- #define _LATB8 LATBbits.LATB8
- #define _LATB9 LATBbits.LATB9
- #define _LATB10 LATBbits.LATB10
- #define _LATB11 LATBbits.LATB11
- #define _LATB12 LATBbits.LATB12
- #define _LATB13 LATBbits.LATB13
- #define _LATB14 LATBbits.LATB14
- #define _LATB15 LATBbits.LATB15
- /* ODCB */
- #define _ODB0 ODCBbits.ODB0
- #define _ODB1 ODCBbits.ODB1
- #define _ODB2 ODCBbits.ODB2
- #define _ODB3 ODCBbits.ODB3
- #define _ODB4 ODCBbits.ODB4
- #define _ODB5 ODCBbits.ODB5
- #define _ODB6 ODCBbits.ODB6
- #define _ODB7 ODCBbits.ODB7
- #define _ODB8 ODCBbits.ODB8
- #define _ODB9 ODCBbits.ODB9
- #define _ODB10 ODCBbits.ODB10
- #define _ODB11 ODCBbits.ODB11
- #define _ODB12 ODCBbits.ODB12
- #define _ODB13 ODCBbits.ODB13
- #define _ODB14 ODCBbits.ODB14
- #define _ODB15 ODCBbits.ODB15
- /* PADCFG1 */
- #define _RTSECSEL PADCFG1bits.RTSECSEL
- #define _OC1TRIS PADCFG1bits.OC1TRIS
- #define _SMBUSDEL PADCFG1bits.SMBUSDEL
- #define _RTSECSEL0 PADCFG1bits.RTSECSEL0
- #define _RTSECSEL1 PADCFG1bits.RTSECSEL1
- /* AD1CON1 */
- #define _DONE AD1CON1bits.DONE
- #define _SAMP AD1CON1bits.SAMP
- #define _ASAM AD1CON1bits.ASAM
- #define _SSRC AD1CON1bits.SSRC
- #define _FORM0 AD1CON1bits.FORM0
- #define _FORM1 AD1CON1bits.FORM1
- #define _ADSIDL AD1CON1bits.ADSIDL
- #define _ADON AD1CON1bits.ADON
- #define _SSRC0 AD1CON1bits.SSRC0
- #define _SSRC1 AD1CON1bits.SSRC1
- #define _SSRC2 AD1CON1bits.SSRC2
- #define _FORM AD1CON1bits.FORM
- /* AD1CON2 */
- #define _ALTS AD1CON2bits.ALTS
- #define _BUFM AD1CON2bits.BUFM
- #define _SMPI AD1CON2bits.SMPI
- #define _BUFS AD1CON2bits.BUFS
- #define _CSCNA AD1CON2bits.CSCNA
- #define _OFFCAL AD1CON2bits.OFFCAL
- #define _VCFG AD1CON2bits.VCFG
- #define _SMPI0 AD1CON2bits.SMPI0
- #define _SMPI1 AD1CON2bits.SMPI1
- #define _SMPI2 AD1CON2bits.SMPI2
- #define _SMPI3 AD1CON2bits.SMPI3
- #define _VCFG0 AD1CON2bits.VCFG0
- #define _VCFG1 AD1CON2bits.VCFG1
- #define _VCFG2 AD1CON2bits.VCFG2
- /* AD1CON3 */
- #define _ADCS AD1CON3bits.ADCS
- #define _SAMC AD1CON3bits.SAMC
- #define _PUMPEN AD1CON3bits.PUMPEN
- #define _EXTSAM AD1CON3bits.EXTSAM
- #define _ADRC AD1CON3bits.ADRC
- #define _ADCS0 AD1CON3bits.ADCS0
- #define _ADCS1 AD1CON3bits.ADCS1
- #define _ADCS2 AD1CON3bits.ADCS2
- #define _ADCS3 AD1CON3bits.ADCS3
- #define _ADCS4 AD1CON3bits.ADCS4
- #define _ADCS5 AD1CON3bits.ADCS5
- #define _ADCS6 AD1CON3bits.ADCS6
- #define _ADCS7 AD1CON3bits.ADCS7
- #define _SAMC0 AD1CON3bits.SAMC0
- #define _SAMC1 AD1CON3bits.SAMC1
- #define _SAMC2 AD1CON3bits.SAMC2
- #define _SAMC3 AD1CON3bits.SAMC3
- #define _SAMC4 AD1CON3bits.SAMC4
- /* AD1CHS */
- #define _CH0SA AD1CHSbits.CH0SA
- #define _CH0NA AD1CHSbits.CH0NA
- #define _CH0SB AD1CHSbits.CH0SB
- #define _CH0NB AD1CHSbits.CH0NB
- #define _CH0SA0 AD1CHSbits.CH0SA0
- #define _CH0SA1 AD1CHSbits.CH0SA1
- #define _CH0SA2 AD1CHSbits.CH0SA2
- #define _CH0SA3 AD1CHSbits.CH0SA3
- #define _CH0SA4 AD1CHSbits.CH0SA4
- #define _CH0SB0 AD1CHSbits.CH0SB0
- #define _CH0SB1 AD1CHSbits.CH0SB1
- #define _CH0SB2 AD1CHSbits.CH0SB2
- #define _CH0SB3 AD1CHSbits.CH0SB3
- /* AD1PCFG */
- #define _PCFG0 AD1PCFGbits.PCFG0
- #define _PCFG1 AD1PCFGbits.PCFG1
- #define _PCFG2 AD1PCFGbits.PCFG2
- #define _PCFG3 AD1PCFGbits.PCFG3
- #define _PCFG4 AD1PCFGbits.PCFG4
- #define _PCFG5 AD1PCFGbits.PCFG5
- #define _PCFG10 AD1PCFGbits.PCFG10
- #define _PCFG11 AD1PCFGbits.PCFG11
- #define _PCFG12 AD1PCFGbits.PCFG12
- /* AD1CSSL */
- #define _CSSL0 AD1CSSLbits.CSSL0
- #define _CSSL1 AD1CSSLbits.CSSL1
- #define _CSSL2 AD1CSSLbits.CSSL2
- #define _CSSL3 AD1CSSLbits.CSSL3
- #define _CSSL4 AD1CSSLbits.CSSL4
- #define _CSSL5 AD1CSSLbits.CSSL5
- #define _CSSL10 AD1CSSLbits.CSSL10
- #define _CSSL11 AD1CSSLbits.CSSL11
- #define _CSSL12 AD1CSSLbits.CSSL12
- /* CTMUCON */
- #define _EDG1STAT CTMUCONbits.EDG1STAT
- #define _EDG2STAT CTMUCONbits.EDG2STAT
- #define _EDG1SEL CTMUCONbits.EDG1SEL
- #define _EDG1POL CTMUCONbits.EDG1POL
- #define _EDG2SEL CTMUCONbits.EDG2SEL
- #define _EDG2POL CTMUCONbits.EDG2POL
- #define _CTTRIG CTMUCONbits.CTTRIG
- #define _IDISSEN CTMUCONbits.IDISSEN
- #define _EDGSEQEN CTMUCONbits.EDGSEQEN
- #define _EDGEN CTMUCONbits.EDGEN
- #define _TGEN CTMUCONbits.TGEN
- #define _CTMUSIDL CTMUCONbits.CTMUSIDL
- #define _CTMUEN CTMUCONbits.CTMUEN
- #define _EDG1SEL0 CTMUCONbits.EDG1SEL0
- #define _EDG1SEL1 CTMUCONbits.EDG1SEL1
- #define _EDG2SEL0 CTMUCONbits.EDG2SEL0
- #define _EDG2SEL1 CTMUCONbits.EDG2SEL1
- /* CTMUICON */
- #define _IRNG CTMUICONbits.IRNG
- #define _ITRIM CTMUICONbits.ITRIM
- #define _IRNG0 CTMUICONbits.IRNG0
- #define _IRNG1 CTMUICONbits.IRNG1
- #define _ITRIM0 CTMUICONbits.ITRIM0
- #define _ITRIM1 CTMUICONbits.ITRIM1
- #define _ITRIM2 CTMUICONbits.ITRIM2
- #define _ITRIM3 CTMUICONbits.ITRIM3
- #define _ITRIM4 CTMUICONbits.ITRIM4
- #define _ITRIM5 CTMUICONbits.ITRIM5
- /* ALCFGRPT */
- #define _ARPT ALCFGRPTbits.ARPT
- #define _ALRMPTR0 ALCFGRPTbits.ALRMPTR0
- #define _ALRMPTR1 ALCFGRPTbits.ALRMPTR1
- #define _AMASK ALCFGRPTbits.AMASK
- #define _CHIME ALCFGRPTbits.CHIME
- #define _ALRMEN ALCFGRPTbits.ALRMEN
- #define _ARPT0 ALCFGRPTbits.ARPT0
- #define _ARPT1 ALCFGRPTbits.ARPT1
- #define _ARPT2 ALCFGRPTbits.ARPT2
- #define _ARPT3 ALCFGRPTbits.ARPT3
- #define _ARPT4 ALCFGRPTbits.ARPT4
- #define _ARPT5 ALCFGRPTbits.ARPT5
- #define _ARPT6 ALCFGRPTbits.ARPT6
- #define _ARPT7 ALCFGRPTbits.ARPT7
- #define _ALRMPTR ALCFGRPTbits.ALRMPTR
- #define _AMASK0 ALCFGRPTbits.AMASK0
- #define _AMASK1 ALCFGRPTbits.AMASK1
- #define _AMASK2 ALCFGRPTbits.AMASK2
- #define _AMASK3 ALCFGRPTbits.AMASK3
- /* RCFGCAL */
- #define _CAL RCFGCALbits.CAL
- #define _RTCPTR0 RCFGCALbits.RTCPTR0
- #define _RTCPTR1 RCFGCALbits.RTCPTR1
- #define _RTCOE RCFGCALbits.RTCOE
- #define _HALFSEC RCFGCALbits.HALFSEC
- #define _RTCSYNC RCFGCALbits.RTCSYNC
- #define _RTCWREN RCFGCALbits.RTCWREN
- #define _RTCEN RCFGCALbits.RTCEN
- #define _CAL0 RCFGCALbits.CAL0
- #define _CAL1 RCFGCALbits.CAL1
- #define _CAL2 RCFGCALbits.CAL2
- #define _CAL3 RCFGCALbits.CAL3
- #define _CAL4 RCFGCALbits.CAL4
- #define _CAL5 RCFGCALbits.CAL5
- #define _CAL6 RCFGCALbits.CAL6
- #define _CAL7 RCFGCALbits.CAL7
- #define _RTCPTR RCFGCALbits.RTCPTR
- /* CMSTAT */
- #define _C1OUT CMSTATbits.C1OUT
- #define _C2OUT CMSTATbits.C2OUT
- #define _C1EVT CMSTATbits.C1EVT
- #define _C2EVT CMSTATbits.C2EVT
- #define _CMIDL CMSTATbits.CMIDL
- /* CVRCON */
- #define _CVR CVRCONbits.CVR
- #define _CVRSS CVRCONbits.CVRSS
- #define _CVRR CVRCONbits.CVRR
- #define _CVROE CVRCONbits.CVROE
- #define _CVREN CVRCONbits.CVREN
- #define _CVR0 CVRCONbits.CVR0
- #define _CVR1 CVRCONbits.CVR1
- #define _CVR2 CVRCONbits.CVR2
- #define _CVR3 CVRCONbits.CVR3
- /* CM1CON */
- /* Bitname _CCH cannot be defined because it is used by more than one SFR */
- /* Bitname _CREF cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL cannot be defined because it is used by more than one SFR */
- /* Bitname _COUT cannot be defined because it is used by more than one SFR */
- /* Bitname _CEVT cannot be defined because it is used by more than one SFR */
- /* Bitname _CLPWR cannot be defined because it is used by more than one SFR */
- /* Bitname _CPOL cannot be defined because it is used by more than one SFR */
- /* Bitname _COE cannot be defined because it is used by more than one SFR */
- /* Bitname _CON cannot be defined because it is used by more than one SFR */
- /* Bitname _CCH0 cannot be defined because it is used by more than one SFR */
- /* Bitname _CCH1 cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL0 cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL1 cannot be defined because it is used by more than one SFR */
- /* CM2CON */
- /* Bitname _CCH cannot be defined because it is used by more than one SFR */
- /* Bitname _CREF cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL cannot be defined because it is used by more than one SFR */
- /* Bitname _COUT cannot be defined because it is used by more than one SFR */
- /* Bitname _CEVT cannot be defined because it is used by more than one SFR */
- /* Bitname _CLPWR cannot be defined because it is used by more than one SFR */
- /* Bitname _CPOL cannot be defined because it is used by more than one SFR */
- /* Bitname _COE cannot be defined because it is used by more than one SFR */
- /* Bitname _CON cannot be defined because it is used by more than one SFR */
- /* Bitname _CCH0 cannot be defined because it is used by more than one SFR */
- /* Bitname _CCH1 cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL0 cannot be defined because it is used by more than one SFR */
- /* Bitname _EVPOL1 cannot be defined because it is used by more than one SFR */
- /* CRCCON */
- #define _PLEN CRCCONbits.PLEN
- #define _CRCGO CRCCONbits.CRCGO
- #define _CRCMPT CRCCONbits.CRCMPT
- #define _CRCFUL CRCCONbits.CRCFUL
- #define _VWORD CRCCONbits.VWORD
- #define _CSIDL CRCCONbits.CSIDL
- #define _PLEN0 CRCCONbits.PLEN0
- #define _PLEN1 CRCCONbits.PLEN1
- #define _PLEN2 CRCCONbits.PLEN2
- #define _PLEN3 CRCCONbits.PLEN3
- #define _VWORD0 CRCCONbits.VWORD0
- #define _VWORD1 CRCCONbits.VWORD1
- #define _VWORD2 CRCCONbits.VWORD2
- #define _VWORD3 CRCCONbits.VWORD3
- #define _VWORD4 CRCCONbits.VWORD4
- /* RCON */
- #define _POR RCONbits.POR
- #define _BOR RCONbits.BOR
- #define _IDLE RCONbits.IDLE
- #define _SLEEP RCONbits.SLEEP
- #define _WDTO RCONbits.WDTO
- #define _SWDTEN RCONbits.SWDTEN
- #define _SWR RCONbits.SWR
- #define _EXTR RCONbits.EXTR
- #define _PMSLP RCONbits.PMSLP
- #define _DPSLP RCONbits.DPSLP
- #define _SBOREN RCONbits.SBOREN
- #define _IOPUWR RCONbits.IOPUWR
- #define _TRAPR RCONbits.TRAPR
- #define _VREGS RCONbits.VREGS
- /* OSCCON */
- #define _OSWEN OSCCONbits.OSWEN
- #define _SOSCEN OSCCONbits.SOSCEN
- #define _CF OSCCONbits.CF
- #define _LOCK OSCCONbits.LOCK
- #define _CLKLOCK OSCCONbits.CLKLOCK
- #define _NOSC OSCCONbits.NOSC
- #define _COSC OSCCONbits.COSC
- #define _NOSC0 OSCCONbits.NOSC0
- #define _NOSC1 OSCCONbits.NOSC1
- #define _NOSC2 OSCCONbits.NOSC2
- #define _COSC0 OSCCONbits.COSC0
- #define _COSC1 OSCCONbits.COSC1
- #define _COSC2 OSCCONbits.COSC2
- /* CLKDIV */
- #define _RCDIV CLKDIVbits.RCDIV
- #define _DOZEN CLKDIVbits.DOZEN
- #define _DOZE CLKDIVbits.DOZE
- #define _ROI CLKDIVbits.ROI
- #define _RCDIV0 CLKDIVbits.RCDIV0
- #define _RCDIV1 CLKDIVbits.RCDIV1
- #define _RCDIV2 CLKDIVbits.RCDIV2
- #define _DOZE0 CLKDIVbits.DOZE0
- #define _DOZE1 CLKDIVbits.DOZE1
- #define _DOZE2 CLKDIVbits.DOZE2
- /* OSCTUN */
- #define _TUN OSCTUNbits.TUN
- #define _TUN0 OSCTUNbits.TUN0
- #define _TUN1 OSCTUNbits.TUN1
- #define _TUN2 OSCTUNbits.TUN2
- #define _TUN3 OSCTUNbits.TUN3
- #define _TUN4 OSCTUNbits.TUN4
- #define _TUN5 OSCTUNbits.TUN5
- /* REFOCON */
- #define _RODIV REFOCONbits.RODIV
- #define _ROSEL REFOCONbits.ROSEL
- #define _ROSSLP REFOCONbits.ROSSLP
- #define _ROEN REFOCONbits.ROEN
- #define _RODIV0 REFOCONbits.RODIV0
- #define _RODIV1 REFOCONbits.RODIV1
- #define _RODIV2 REFOCONbits.RODIV2
- #define _RODIV3 REFOCONbits.RODIV3
- /* HLVDCON */
- #define _HLVDL HLVDCONbits.HLVDL
- #define _IRVST HLVDCONbits.IRVST
- #define _BGVST HLVDCONbits.BGVST
- #define _VDIR HLVDCONbits.VDIR
- #define _HLSIDL HLVDCONbits.HLSIDL
- #define _HLVDEN HLVDCONbits.HLVDEN
- #define _HLVDL0 HLVDCONbits.HLVDL0
- #define _HLVDL1 HLVDCONbits.HLVDL1
- #define _HLVDL2 HLVDCONbits.HLVDL2
- #define _HLVDL3 HLVDCONbits.HLVDL3
- /* DSCON */
- #define _RELEASE DSCONbits.RELEASE
- #define _DSBOR DSCONbits.DSBOR
- #define _DSEN DSCONbits.DSEN
- /* DSWSRC */
- #define _DSPOR DSWSRCbits.DSPOR
- #define _DSMCLR DSWSRCbits.DSMCLR
- #define _DSRTCC DSWSRCbits.DSRTCC
- #define _DSWDT DSWSRCbits.DSWDT
- #define _DSFLT DSWSRCbits.DSFLT
- #define _DSINT0 DSWSRCbits.DSINT0
- /* NVMCON */
- #define _NVMOP NVMCONbits.NVMOP
- #define _ERASE NVMCONbits.ERASE
- #define _PGMONLY NVMCONbits.PGMONLY
- #define _WRERR NVMCONbits.WRERR
- #define _WREN NVMCONbits.WREN
- #define _WR NVMCONbits.WR
- #define _NVMOP0 NVMCONbits.NVMOP0
- #define _NVMOP1 NVMCONbits.NVMOP1
- #define _NVMOP2 NVMCONbits.NVMOP2
- #define _NVMOP3 NVMCONbits.NVMOP3
- #define _NVMOP4 NVMCONbits.NVMOP4
- #define _NVMOP5 NVMCONbits.NVMOP5
- /* NVMKEY */
- #define _NVMKEY NVMKEYbits.NVMKEY
- #define _NVMKEY0 NVMKEYbits.NVMKEY0
- #define _NVMKEY1 NVMKEYbits.NVMKEY1
- #define _NVMKEY2 NVMKEYbits.NVMKEY2
- #define _NVMKEY3 NVMKEYbits.NVMKEY3
- #define _NVMKEY4 NVMKEYbits.NVMKEY4
- #define _NVMKEY5 NVMKEYbits.NVMKEY5
- #define _NVMKEY6 NVMKEYbits.NVMKEY6
- #define _NVMKEY7 NVMKEYbits.NVMKEY7
- /* PMD1 */
- #define _ADC1MD PMD1bits.ADC1MD
- #define _SPI1MD PMD1bits.SPI1MD
- #define _U1MD PMD1bits.U1MD
- #define _U2MD PMD1bits.U2MD
- #define _I2C1MD PMD1bits.I2C1MD
- #define _T1MD PMD1bits.T1MD
- #define _T2MD PMD1bits.T2MD
- #define _T3MD PMD1bits.T3MD
- /* PMD2 */
- #define _OC1MD PMD2bits.OC1MD
- #define _IC1MD PMD2bits.IC1MD
- /* PMD3 */
- #define _CRCPMD PMD3bits.CRCPMD
- #define _RTCCMD PMD3bits.RTCCMD
- #define _CMPMD PMD3bits.CMPMD
- /* PMD4 */
- #define _HLVDMD PMD4bits.HLVDMD
- #define _CTMUMD PMD4bits.CTMUMD
- #define _REFOMD PMD4bits.REFOMD
- #define _EEMD PMD4bits.EEMD
- /* ---------------------------------------------------------- */
- /* Some useful macros for inline assembler instructions */
- /* ---------------------------------------------------------- */
- #define Nop() __builtin_nop()
- #define ClrWdt() {__asm__ volatile ("clrwdt");}
- #define Sleep() {__asm__ volatile ("pwrsav #0");}
- #define Idle() {__asm__ volatile ("pwrsav #1");}
- /*----------------------------------------------------------- */
- /* Some useful macros for allocating data memory */
- /*----------------------------------------------------------- */
- /* The following macros require an argument N that specifies */
- /* alignment. N must a power of two, minimum value = 2. */
- /* For example, to declare an uninitialized array that is */
- /* aligned to a 32 byte address: */
- /* */
- /* int _BSS(32) buf[16]; */
- /* */
- /* To declare an initialized array without special */
- /* alignment: */
- /* */
- /* int _DATA(2) table1[] = {0, 1, 1, 2, 3, 5, 8, 13, 21}; */
- /* */
- #define _BSS(N) __attribute__((aligned(N)))
- #define _DATA(N) __attribute__((aligned(N)))
- /* The following macros do not require an argument. They can */
- /* be used to locate a variable in persistent data memory or */
- /* in near data memory. For example, to declare two variables */
- /* that retain their values across a device reset: */
- /* */
- /* int _PERSISTENT var1,var2; */
- /* */
- #define _PERSISTENT __attribute__((persistent))
- #define _NEAR __attribute__((near))
- /* ---------------------------------------------------------- */
- /* Some useful macros for declaring functions */
- /* ---------------------------------------------------------- */
- /* The following macros can be used to declare interrupt */
- /* service routines (ISRs). For example, to declare an ISR */
- /* for the timer1 interrupt: */
- /* */
- /* void _ISR _T1Interrupt(void); */
- /* */
- /* To declare an ISR for the SPI1 interrupt with fast */
- /* context save: */
- /* */
- /* void _ISRFAST _SPI1Interrupt(void); */
- /* */
- /* Note: ISRs will be installed into the interrupt vector */
- /* tables automatically if the reserved names listed in the */
- /* MPLAB C30 Compiler User's Guide (DS51284) are used. */
- /* */
- #define _ISR __attribute__((interrupt))
- #define _ISRFAST __attribute__((interrupt, shadow))
- /* ---------------------------------------------------------- */
- /* Some useful macros for changing the CPU IPL */
- /* ---------------------------------------------------------- */
- /* The following macros can be used to modify the current CPU */
- /* IPL. The definition of the macro may vary from device to */
- /* device. */
- /* */
- /* To safely set the CPU IPL, use SET_CPU_IPL(ipl); the */
- /* valid range of ipl is 0-7, it may be any expression. */
- /* */
- /* SET_CPU_IPL(7); */
- /* */
- /* To preserve the current IPL and save it use */
- /* SET_AND_SAVE_CPU_IPL(save_to, ipl); the valid range of ipl */
- /* is 0-7 and may be any expression, save_to should denote */
- /* some temporary storage. */
- /* */
- /* int old_ipl; */
- /* */
- /* SET_AND_SAVE_CPU_IPL(old_ipl, 7); */
- /* */
- /* The IPL can be restored with RESTORE_CPU_IPL(saved_to) */
- /* */
- /* RESTORE_CPU_IPL(old_ipl); */
- #define SET_CPU_IPL(ipl) { \
- int DISI_save; \
- \
- DISI_save = DISICNT; \
- asm volatile ("disi #0x3FFF"); \
- SRbits.IPL = ipl; \
- DISICNT = DISI_save; } (void) 0;
- #define SET_AND_SAVE_CPU_IPL(save_to, ipl) { \
- save_to = SRbits.IPL; \
- SET_CPU_IPL(ipl); } (void) 0;
- #define RESTORE_CPU_IPL(saved_to) SET_CPU_IPL(saved_to)
- /* -------------------------------------------------------- */
- /* Macros for setting device configuration registers */
- /* -------------------------------------------------------- */
- /* Register FBS (0xf80000) */
- extern __attribute__((space(prog))) int _FBS;
- #define _FBS(x) __attribute__((section("__FBS.sec"),space(prog))) int _FBS = (x);
- /*
- ** Only one invocation of FBS should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FBS.
- ** Multiple options may be combined, as shown:
- **
- ** _FBS( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Boot Segment Code Protect:
- ** BSS_HI2K High Security Boot Protect 000000 - 002BFE
- ** BSS_HI1K High Security Boot Protect 000000 - 000AFE
- ** BSS_STD2K Standard Security Boot Protect 000000 - 002BFE
- ** BSS_STD1K Standard Security Boot Protect 000000 - 000AFE
- ** BSS_OFF Disabled
- **
- ** Boot Segment Write Protect Enable:
- ** BWRP_ON Enabled
- ** BWRP_OFF Disabled
- **
- */
- #define BSS_HI2K 0xFFF3
- #define BSS_HI1K 0xFFF5
- #define BSS_STD2K 0xFFFB
- #define BSS_STD1K 0xFFFD
- #define BSS_OFF 0xFFFF
- #define BWRP_ON 0xFFFE
- #define BWRP_OFF 0xFFFF
- /* Register FGS (0xf80004) */
- extern __attribute__((space(prog))) int _FGS;
- #define _FGS(x) __attribute__((section("__FGS.sec"),space(prog))) int _FGS = (x);
- /*
- ** Only one invocation of FGS should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FGS.
- ** Multiple options may be combined, as shown:
- **
- ** _FGS( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** General Segment Code Protect:
- ** GCP_ON Enabled
- ** GCP_OFF Disabled
- **
- ** General Segment Write Protect Enable:
- ** GWRP_ON Enabled
- ** GWRP_OFF Disabled
- **
- */
- #define GCP_ON 0xFFFD
- #define GCP_OFF 0xFFFF
- #define GWRP_ON 0xFFFE
- #define GWRP_OFF 0xFFFF
- /* Register FOSCSEL (0xf80006) */
- extern __attribute__((space(prog))) int _FOSCSEL;
- #define _FOSCSEL(x) __attribute__((section("__FOSCSEL.sec"),space(prog))) int _FOSCSEL = (x);
- /*
- ** Only one invocation of FOSCSEL should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FOSCSEL.
- ** Multiple options may be combined, as shown:
- **
- ** _FOSCSEL( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Initial Oscillator Select:
- ** FNOSC_FRC Fast RC Oscillator (FRC)
- ** FNOSC_FRCPLL Fast RC Oscillator with PLL Module (FRCPLL)
- ** FNOSC_PRI Primary Oscillator (MS, HS, EC)
- ** FNOSC_PRIPLL Primary Oscillator with PLL Module (MSPLL, HSPLL, ECPLL)
- ** FNOSC_SOSC Secondary Oscillator (SOSC)
- ** FNOSC_LPRC Low Power RC Oscillator (LPRC)
- ** FNOSC_LPFRC Low Power Fast RC Oscillator With Postscaler - 500kHz (LPFRC)
- ** FNOSC_FRCDIV Fast RC Oscillator With Postscaler (FRCDIV)
- **
- ** Two Speed Start-up:
- ** IESO_OFF Disabled
- ** IESO_ON Enabled
- **
- */
- #define FNOSC_FRC 0xFFF8
- #define FNOSC_FRCPLL 0xFFF9
- #define FNOSC_PRI 0xFFFA
- #define FNOSC_PRIPLL 0xFFFB
- #define FNOSC_SOSC 0xFFFC
- #define FNOSC_LPRC 0xFFFD
- #define FNOSC_LPFRC 0xFFFE
- #define FNOSC_FRCDIV 0xFFFF
- #define IESO_OFF 0xFF7F
- #define IESO_ON 0xFFFF
- /* Register FOSC (0xf80008) */
- extern __attribute__((space(prog))) int _FOSC;
- #define _FOSC(x) __attribute__((section("__FOSC.sec"),space(prog))) int _FOSC = (x);
- /*
- ** Only one invocation of FOSC should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FOSC.
- ** Multiple options may be combined, as shown:
- **
- ** _FOSC( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Clock switching and Fail-Safe Clock monitor:
- ** FCKSM_CSECME Both Clock Switching and Monitor Enabled
- ** FCKSM_CSECMD Clock Switching Enabled, Clock Monitor Disabled
- ** FCKSM_CSDCMD Both Clock Switching and Monitor Disabled
- **
- ** Secondary Oscillator Select:
- ** SOSCSEL_SOSCLP Low Power Secondary Oscillator
- ** SOSCSEL_SOSCHP High Power Secondary Oscillator
- **
- ** Primary Oscillator Frequency Range:
- ** POSCFREQ_LS Low Speed (< 100kHz)
- ** POSCFREQ_MS Mid Speed (100kHz - 8MHz)
- ** POSCFREQ_HS High Speed (> 8MHz)
- **
- ** OSCO Pin Configuration:
- ** OSCIOFNC_ON OSCO Pin Has Digital I/O Function (RA3)
- ** OSCIOFNC_OFF OSCO Pin Has Clock Out Function (CLKO)
- **
- ** Oscillator Selection:
- ** POSCMOD_EC External clock
- ** POSCMOD_XT XT oscillator
- ** POSCMOD_HS HS oscillator
- ** POSCMOD_NONE Primary disabled
- **
- */
- #define FCKSM_CSECME 0xFF3F
- #define FCKSM_CSECMD 0xFF7F
- #define FCKSM_CSDCMD 0xFFBF
- #define SOSCSEL_SOSCLP 0xFFDF
- #define SOSCSEL_SOSCHP 0xFFFF
- #define POSCFREQ_LS 0xFFEF
- #define POSCFREQ_MS 0xFFF7
- #define POSCFREQ_HS 0xFFFF
- #define OSCIOFNC_ON 0xFFFB
- #define OSCIOFNC_OFF 0xFFFF
- #define POSCMOD_EC 0xFFFC
- #define POSCMOD_XT 0xFFFD
- #define POSCMOD_HS 0xFFFE
- #define POSCMOD_NONE 0xFFFF
- /* Register FWDT (0xf8000a) */
- extern __attribute__((space(prog))) int _FWDT;
- #define _FWDT(x) __attribute__((section("__FWDT.sec"),space(prog))) int _FWDT = (x);
- /*
- ** Only one invocation of FWDT should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FWDT.
- ** Multiple options may be combined, as shown:
- **
- ** _FWDT( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Watchdog Timer:
- ** FWDTEN_OFF Disabled
- ** FWDTEN_ON Enabled
- **
- ** Windowed WDT:
- ** WINDIS_ON Window Mode
- ** WINDIS_OFF Non-Window Mode
- **
- ** Watchdog prescaler:
- ** FWPSA_PR32 1:32
- ** FWPSA_PR128 1:128
- **
- ** Watchdog postscale:
- ** WDTPS_PS1 1:1
- ** WDTPS_PS2 1:2
- ** WDTPS_PS4 1:4
- ** WDTPS_PS8 1:8
- ** WDTPS_PS16 1:16
- ** WDTPS_PS32 1:32
- ** WDTPS_PS64 1:64
- ** WDTPS_PS128 1:128
- ** WDTPS_PS256 1:256
- ** WDTPS_PS512 1:512
- ** WDTPS_PS1024 1:1,024
- ** WDTPS_PS2048 1:2,048
- ** WDTPS_PS4096 1:4,096
- ** WDTPS_PS8192 1:8,192
- ** WDTPS_PS16384 1:16,384
- ** WDTPS_PS32768 1:32,768
- **
- */
- #define FWDTEN_OFF 0xFF7F
- #define FWDTEN_ON 0xFFFF
- #define WINDIS_ON 0xFFBF
- #define WINDIS_OFF 0xFFFF
- #define FWPSA_PR32 0xFFEF
- #define FWPSA_PR128 0xFFFF
- #define WDTPS_PS1 0xFFF0
- #define WDTPS_PS2 0xFFF1
- #define WDTPS_PS4 0xFFF2
- #define WDTPS_PS8 0xFFF3
- #define WDTPS_PS16 0xFFF4
- #define WDTPS_PS32 0xFFF5
- #define WDTPS_PS64 0xFFF6
- #define WDTPS_PS128 0xFFF7
- #define WDTPS_PS256 0xFFF8
- #define WDTPS_PS512 0xFFF9
- #define WDTPS_PS1024 0xFFFA
- #define WDTPS_PS2048 0xFFFB
- #define WDTPS_PS4096 0xFFFC
- #define WDTPS_PS8192 0xFFFD
- #define WDTPS_PS16384 0xFFFE
- #define WDTPS_PS32768 0xFFFF
- /* Register FPOR (0xf8000c) */
- extern __attribute__((space(prog))) int _FPOR;
- #define _FPOR(x) __attribute__((section("__FPOR.sec"),space(prog))) int _FPOR = (x);
- /*
- ** Only one invocation of FPOR should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FPOR.
- ** Multiple options may be combined, as shown:
- **
- ** _FPOR( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Master Clear Enable:
- ** MCLRE_OFF MCLR Disaled, RA5 Enabled
- ** MCLRE_ON MCLR Enabled, RA5 Disabled
- **
- ** Brown Out Voltage:
- ** BORV_LPBOR Low Power BOR
- ** BORV_V27 2.7V
- ** BORV_V20 2.0V
- ** BORV_V18 1.8V
- **
- ** I2C1 pins Select:
- ** I2C1SEL_SEC Use ASCL1/ASDA1 Pins For I2C1
- ** I2C1SEL_PRI Use SCL1/SDA1 Pins For I2C1
- **
- ** Power Up Timer:
- ** PWRTEN_OFF Disabled
- ** PWRTEN_ON Enabled
- **
- ** Brown Out Reset:
- ** BOREN_BOR0 Disabled in hardware, SBOREN bit disabled
- ** BOREN_BOR1 Software controlled by SBOREN bit
- ** BOREN_BOR2 Disabled only when in SLEEP, SBOREN bit disabled
- ** BOREN_BOR3 Enabled in hardware, SBOREN bit disabled
- **
- */
- #define MCLRE_OFF 0xFF7F
- #define MCLRE_ON 0xFFFF
- #define BORV_LPBOR 0xFF9F
- #define BORV_V27 0xFFBF
- #define BORV_V20 0xFFDF
- #define BORV_V18 0xFFFF
- #define I2C1SEL_SEC 0xFFEF
- #define I2C1SEL_PRI 0xFFFF
- #define PWRTEN_OFF 0xFFF7
- #define PWRTEN_ON 0xFFFF
- #define BOREN_BOR0 0xFFFC
- #define BOREN_BOR1 0xFFFD
- #define BOREN_BOR2 0xFFFE
- #define BOREN_BOR3 0xFFFF
- /* Register FICD (0xf8000e) */
- extern __attribute__((space(prog))) int _FICD;
- #define _FICD(x) __attribute__((section("__FICD.sec"),space(prog))) int _FICD = (x);
- /*
- ** Only one invocation of FICD should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FICD.
- ** Multiple options may be combined, as shown:
- **
- ** _FICD( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Background Debugger:
- ** BKBUG_ON Enabled
- ** BKBUG_OFF Disabled
- **
- ** ICD pins select:
- ** ICS_PGx3 EMUC/EMUD share PGC3/PGD3
- ** ICS_PGx2 EMUC/EMUD share PGC2/PGD2
- ** ICS_PGx1 EMUC/EMUD share PGC1/PGD1
- **
- */
- #define BKBUG_ON 0xFF7F
- #define BKBUG_OFF 0xFFFF
- #define ICS_PGx3 0xFFFD
- #define ICS_PGx2 0xFFFE
- #define ICS_PGx1 0xFFFF
- /* Register FDS (0xf80010) */
- extern __attribute__((space(prog))) int _FDS;
- #define _FDS(x) __attribute__((section("__FDS.sec"),space(prog))) int _FDS = (x);
- /*
- ** Only one invocation of FDS should appear in a project,
- ** at the top of a C source file (outside of any function).
- **
- ** The following constants can be used to set FDS.
- ** Multiple options may be combined, as shown:
- **
- ** _FDS( OPT1_ON & OPT2_OFF & OPT3_PLL )
- **
- ** Deep Sleep Watchdog Timer:
- ** DSWDTEN_OFF Disabled
- ** DSWDTEN_ON Enabled
- **
- ** Deep Sleep BOR:
- ** DSBOREN_OFF Disabled
- ** DSBOREN_ON Enabled
- **
- ** RTCC Reference Oscillator Select:
- ** RTCOSC_LPRC Low Power RC Oscillator (LPRC)
- ** RTCOSC_SOSC Secondary Oscillator (SOSC)
- **
- ** Deep Sleep Watchdog Oscillator Clock Select:
- ** DSWDTOSC_LPRC Secondary Oscillator (SOSC)
- ** DSWDTOSC_SOSC Low Power RC Oscillator (LPRC)
- **
- ** Deep Sleep Watchdog Postscale Select Bits:
- ** DSWDTPS_DSWDTPS0 1:2 (2.1 ms)
- ** DSWDTPS_DSWDTPS1 1:8 (8.3 ms)
- ** DSWDTPS_DSWDTPS2 1:32 (33 ms)
- ** DSWDTPS_DSWDTPS3 1:128 (132 ms)
- ** DSWDTPS_DSWDTPS4 1:512 (528 ms)
- ** DSWDTPS_DSWDTPS5 1:2048 (2.1 Seconds)
- ** DSWDTPS_DSWDTPS6 1:8192 (8.5 Seconds)
- ** DSWDTPS_DSWDTPS7 1:32,768 (34 Seconds)
- ** DSWDTPS_DSWDTPS8 1:131,072 (135 Seconds)
- ** DSWDTPS_DSWDTPS9 1:524,288 (9 Minutes)
- ** DSWDTPS_DSWDTPSA 1:2,097,152 (36 Minutes)
- ** DSWDTPS_DSWDTPSB 1:8,388,608 (2.4 Hours)
- ** DSWDTPS_DSWDTPSC 1:33,554,432 (9.6 Hours)
- ** DSWDTPS_DSWDTPSD 1:134,217,728 (38.5 Hours)
- ** DSWDTPS_DSWDTPSE 1:536,870,912 (6.4 Days)
- ** DSWDTPS_DSWDTPSF 1:2,147,483,648 (25.7 Days)
- **
- */
- #define DSWDTEN_OFF 0xFF7F
- #define DSWDTEN_ON 0xFFFF
- #define DSBOREN_OFF 0xFFBF
- #define DSBOREN_ON 0xFFFF
- #define RTCOSC_LPRC 0xFFDF
- #define RTCOSC_SOSC 0xFFFF
- #define DSWDTOSC_LPRC 0xFFEF
- #define DSWDTOSC_SOSC 0xFFFF
- #define DSWDTPS_DSWDTPS0 0xFFF0
- #define DSWDTPS_DSWDTPS1 0xFFF1
- #define DSWDTPS_DSWDTPS2 0xFFF2
- #define DSWDTPS_DSWDTPS3 0xFFF3
- #define DSWDTPS_DSWDTPS4 0xFFF4
- #define DSWDTPS_DSWDTPS5 0xFFF5
- #define DSWDTPS_DSWDTPS6 0xFFF6
- #define DSWDTPS_DSWDTPS7 0xFFF7
- #define DSWDTPS_DSWDTPS8 0xFFF8
- #define DSWDTPS_DSWDTPS9 0xFFF9
- #define DSWDTPS_DSWDTPSA 0xFFFA
- #define DSWDTPS_DSWDTPSB 0xFFFB
- #define DSWDTPS_DSWDTPSC 0xFFFC
- #define DSWDTPS_DSWDTPSD 0xFFFD
- #define DSWDTPS_DSWDTPSE 0xFFFE
- #define DSWDTPS_DSWDTPSF 0xFFFF
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement