📄 p30f6012a.h
字号:
/*-------------------------------------------------------------------------
*
* MPLAB-C30 dsPIC30F6012A processor header
*
* (c) Copyright 2005 Microchip Technology, All rights reserved
*
* File Description / Notes:
* =========================
* 1] This header file defines special function registers (SFR), and useful
* macros for the C30Fxxxx Family of Digital Signal
* Controllers (also referred to as the dsPIC).
* 2] The register and bit names used in this file match the
* dsPIC30Fxxxx data sheets as closely as possible.
* 3] The memory locations of the registers defined in this header file are
* specified in the respective linker scripts.
* 4] SFR definitions are listed in the ascending order of memory addresses
* and are grouped based on the module they belong to. For e.g., WREG10
* is listed before ACCAL, and the Core SFRs are grouped separately
* from the Interrupt Controller SFRs or the General Purpose Timer SFRs.
*
* Revision History:
* =================
* --------------------------------------------------------------------------
* Rev: Date: Details: Who:
* --------------------------------------------------------------------------
* 1.0 25 Oct 2004 New file P Sinha
* 4.1 22 Dec 2004 Corrected a typo in the _U1RXIE definition P Sinha
* 4.2 4 Apr 2005 Renamed EC_IO to ECIO and ERC_IO to ERCIO P Sinha
* 4.2a 27 Jun 2005 Fixed typos in comments regarding macros G McCar
* 4.3 1 Jul 2005 Updated section syntax in config macros P Sinha
* --------------------------------------------------------------------------
*
* ------------------------------------------------------------------------*/
#ifndef __30F6012A_H
#define __30F6012A_H
/* ------------------------- */
/* Core Register Definitions */
/* ------------------------- */
/* W registers W0-W15 */
extern volatile unsigned int WREG0 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG1 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG2 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG3 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG4 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG5 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG6 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG7 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG8 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG9 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG10 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG11 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG12 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG13 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG14 __attribute__((__near__,__deprecated__,__unsafe__));
extern volatile unsigned int WREG15 __attribute__((__near__,__deprecated__,__unsafe__));
/* SPLIM: Stack Pointer Limit */
extern volatile unsigned int SPLIM __attribute__((__near__));
/* Alternative access structure for the 40-bit accumulators */
typedef struct tagACC {
unsigned int L;
unsigned int H;
unsigned char U;
} ACC;
/* Acc A<15:0> */
extern volatile unsigned int ACCAL __attribute__((__near__));
/* Acc A<31:16> */
extern volatile unsigned int ACCAH __attribute__((__near__));
/* Acc A<39:32> */
extern volatile unsigned char ACCAU __attribute__((__near__));
/* Acc A defined as a structure consisting of the 3 parts */
extern volatile ACC ACCA __attribute__((__near__));
/* Acc B<15:0> */
extern volatile unsigned int ACCBL __attribute__((__near__));
/* Acc B<31:16> */
extern volatile unsigned int ACCBH __attribute__((__near__));
/* Acc B<39:32> */
extern volatile unsigned char ACCBU __attribute__((__near__));
/* Acc B defined as a structure consisting of the 3 parts */
extern volatile ACC ACCB __attribute__((__near__));
/* PCL: Program Counter low word */
extern volatile unsigned int PCL __attribute__((__near__));
/* PCH: Program Counter high byte */
extern volatile unsigned char PCH __attribute__((__near__));
/* TBLPAG: Table Page Register */
extern volatile unsigned char TBLPAG __attribute__((__near__));
/* PSVPAG: Program Space Visibility Page Register */
extern volatile unsigned char PSVPAG __attribute__((__near__));
/* RCOUNT: REPEAT loop count */
extern volatile unsigned int RCOUNT __attribute__((__near__));
/* DCOUNT: DO loop count */
extern volatile unsigned int DCOUNT __attribute__((__near__));
/* DOSTARTL: DO loop start address bits <15:0> */
extern volatile unsigned int DOSTARTL __attribute__((__near__));
/* DOSTARTH: DO loop start address bits <23:16> */
extern volatile unsigned int DOSTARTH __attribute__((__near__));
/* DOENDL: DO loop end address bits <15:0> */
extern volatile unsigned int DOENDL __attribute__((__near__));
/* DOENDH: DO loop end address bits <23:16> */
extern volatile unsigned int DOENDH __attribute__((__near__));
/* SR: Status Register */
extern volatile unsigned int SR __attribute__((__near__));
typedef struct tagSRBITS {
unsigned C :1; /* Carry flag */
unsigned Z :1; /* Sticky Zero flag */
unsigned OV :1; /* Overflow flag */
unsigned N :1; /* Negative flag */
unsigned RA :1; /* REPEAT loop active flag */
unsigned IPL :3; /* CPU Interrupt Priority Level */
unsigned DC :1; /* Digit Carry flag */
unsigned DA :1; /* DO loop active flag */
unsigned SAB :1; /* Combined A/B saturation flag */
unsigned OAB :1; /* Combined A/B overflow flag */
unsigned SB :1; /* Acc B saturation flag */
unsigned SA :1; /* Acc A saturation flag */
unsigned OB :1; /* Acc B overflow flag */
unsigned OA :1; /* Acc A overflow flag */
} SRBITS;
extern volatile SRBITS SRbits __attribute__((__near__));
/* CORCON: CPU Mode control Register */
extern volatile unsigned int CORCON __attribute__((__near__));
typedef struct tagCORCONBITS {
unsigned IF :1; /* Integer/Fractional mode */
unsigned RND :1; /* Rounding mode */
unsigned PSV :1; /* Program Space Visibility enable */
unsigned IPL3 :1; /* CPU Interrupt Priority Level bit 3 */
unsigned ACCSAT :1; /* Acc saturation mode */
unsigned SATDW :1; /* Data space write saturation enable */
unsigned SATB :1; /* Acc B saturation enable */
unsigned SATA :1; /* Acc A saturation enable */
unsigned DL :3; /* DO loop nesting level status */
unsigned EDT :1; /* Early DO loop termination control */
unsigned US :1; /* Signed/Unsigned mode */
unsigned :3;
} CORCONBITS;
extern volatile CORCONBITS CORCONbits __attribute__((__near__));
/* MODCON: Modulo Addressing Control Register */
extern volatile unsigned int MODCON __attribute__((__near__));
typedef struct tagMODCONBITS {
unsigned XWM :4; /* X-RAGU/X-WAGU modulo addressing register select */
unsigned YWM :4; /* Y-RAGU modulo addressing register select */
unsigned BWM :4; /* Bit-reversed addressing register select */
unsigned :2;
unsigned YMODEN :1; /* Y-RAGU modulo addressing enable */
unsigned XMODEN :1; /* X-RAGU/X-WAGU modulo addressing enable */
} MODCONBITS;
extern volatile MODCONBITS MODCONbits __attribute__((__near__));
/* XMODSRT: X-RAGU/X-WAGU modulo buffer start address */
extern volatile unsigned int XMODSRT __attribute__((__near__));
/* XMODEND: X-RAGU/X-WAGU modulo buffer end address */
extern volatile unsigned int XMODEND __attribute__((__near__));
/* YMODSRT: Y-RAGU modulo buffer start address */
extern volatile unsigned int YMODSRT __attribute__((__near__));
/* YMODEND: Y-RAGU modulo buffer end address */
extern volatile unsigned int YMODEND __attribute__((__near__));
/* XBREV: X-WAGU Bit-reversed Addressing Control Register */
extern volatile unsigned int XBREV __attribute__((__near__));
typedef struct tagXBREVBITS {
unsigned XB :15; /* Bit-reversed addressing register select */
unsigned BREN :1; /* Bit-reversed addressing enable */
} XBREVBITS;
extern volatile XBREVBITS XBREVbits __attribute__((__near__));
/* DISICNT: Disable Interrupt Cycle Count */
extern volatile unsigned int DISICNT __attribute__((__near__));
typedef struct tagDISICNTBITS {
unsigned DISICNT:14;
unsigned :2;
} DISICNTBITS;
extern volatile DISICNTBITS DISICNTbits __attribute__((__near__));
/* ----------------------------------------- */
/* Interrupt Controller register definitions */
/* ----------------------------------------- */
/* INTCON1: Interrupt Control Register 1 */
extern volatile unsigned int INTCON1 __attribute__((__near__));
typedef struct tagINTCON1BITS {
unsigned :1;
unsigned OSCFAIL:1;
unsigned STKERR :1;
unsigned ADDRERR:1;
unsigned MATHERR:1;
unsigned :3;
unsigned COVTE :1;
unsigned OVBTE :1;
unsigned OVATE :1;
unsigned :4;
unsigned NSTDIS :1;
} INTCON1BITS;
extern volatile INTCON1BITS INTCON1bits __attribute__((__near__));
/* INTCON2: Interrupt Control Register 2 */
extern volatile unsigned int INTCON2 __attribute__((__near__));
typedef struct tagINTCON2BITS {
unsigned INT0EP :1;
unsigned INT1EP :1;
unsigned INT2EP :1;
unsigned INT3EP :1;
unsigned INT4EP :1;
unsigned :9;
unsigned DISI :1;
unsigned ALTIVT :1;
} INTCON2BITS;
extern volatile INTCON2BITS INTCON2bits __attribute__((__near__));
/* IFS0: Interrupt Flag Status Register 0 */
extern volatile unsigned int IFS0 __attribute__((__near__));
typedef struct tagIFS0BITS {
unsigned INT0IF :1;
unsigned IC1IF :1;
unsigned OC1IF :1;
unsigned T1IF :1;
unsigned IC2IF :1;
unsigned OC2IF :1;
unsigned T2IF :1;
unsigned T3IF :1;
unsigned IF :1;
unsigned U1RXIF :1;
unsigned U1TXIF :1;
unsigned ADIF :1;
unsigned NVMIF :1;
unsigned SI2CIF :1;
unsigned MI2CIF :1;
unsigned CNIF :1;
} IFS0BITS;
extern volatile IFS0BITS IFS0bits __attribute__((__near__));
/* IFS1: Interrupt Flag Status Register 1 */
extern volatile unsigned int IFS1 __attribute__((__near__));
typedef struct tagIFS1BITS {
unsigned INT1IF :1;
unsigned IC7IF :1;
unsigned IC8IF :1;
unsigned OC3IF :1;
unsigned OC4IF :1;
unsigned T4IF :1;
unsigned T5IF :1;
unsigned INT2IF :1;
unsigned U2RXIF :1;
unsigned U2TXIF :1;
unsigned SPI2IF :1;
unsigned C1IF :1;
unsigned IC3IF :1;
unsigned IC4IF :1;
unsigned IC5IF :1;
unsigned IC6IF :1;
} IFS1BITS;
extern volatile IFS1BITS IFS1bits __attribute__((__near__));
/* IFS2: Interrupt Flag Status Register 2 */
extern volatile unsigned int IFS2 __attribute__((__near__));
typedef struct tagIFS2BITS {
unsigned OC5IF :1;
unsigned OC6IF :1;
unsigned OC7IF :1;
unsigned OC8IF :1;
unsigned INT3IF :1;
unsigned INT4IF :1;
unsigned C2IF :1;
unsigned :2;
unsigned DCIIF :1;
unsigned LVDIF :1;
unsigned :5;
} IFS2BITS;
extern volatile IFS2BITS IFS2bits __attribute__((__near__));
/* IEC0: Interrupt Enable Control Register 0 */
extern volatile unsigned int IEC0 __attribute__((__near__));
typedef struct tagIEC0BITS {
unsigned INT0IE :1;
unsigned IC1IE :1;
unsigned OC1IE :1;
unsigned T1IE :1;
unsigned IC2IE :1;
unsigned OC2IE :1;
unsigned T2IE :1;
unsigned T3IE :1;
unsigned SPI1IE :1;
unsigned U1RXIE :1;
unsigned U1TXIE :1;
unsigned ADIE :1;
unsigned NVMIE :1;
unsigned SI2CIE :1;
unsigned MI2CIE :1;
unsigned CNIE :1;
} IEC0BITS;
extern volatile IEC0BITS IEC0bits __attribute__((__near__));
/* IEC1: Interrupt Enable Control Register 1 */
extern volatile unsigned int IEC1 __attribute__((__near__));
typedef struct tagIEC1BITS {
unsigned INT1IE :1;
unsigned IC7IE :1;
unsigned IC8IE :1;
unsigned OC3IE :1;
unsigned OC4IE :1;
unsigned T4IE :1;
unsigned T5IE :1;
unsigned INT2IE :1;
unsigned U2RXIE :1;
unsigned U2TXIE :1;
unsigned SPI2IE :1;
unsigned C1IE :1;
unsigned IC3IE :1;
unsigned IC4IE :1;
unsigned IC5IE :1;
unsigned IC6IE :1;
} IEC1BITS;
extern volatile IEC1BITS IEC1bits __attribute__((__near__));
/* IEC2: Interrupt Enable Control Register 2 */
extern volatile unsigned int IEC2 __attribute__((__near__));
typedef struct tagIEC2BITS {
unsigned OC5IE :1;
unsigned OC6IE :1;
unsigned OC7IE :1;
unsigned OC8IE :1;
unsigned INT3IE :1;
unsigned INT4IE :1;
unsigned C2IE :1;
unsigned :2;
unsigned DCIIE :1;
unsigned LVDIE :1;
unsigned :5;
} IEC2BITS;
extern volatile IEC2BITS IEC2bits __attribute__((__near__));
/* IPC0: Interrupt Priority Control Register 0 */
extern volatile unsigned int IPC0 __attribute__((__near__));
typedef struct tagIPC0BITS {
unsigned INT0IP :3;
unsigned :1;
unsigned IC1IP :3;
unsigned :1;
unsigned OC1IP :3;
unsigned :1;
unsigned T1IP :3;
unsigned :1;
} IPC0BITS;
extern volatile IPC0BITS IPC0bits __attribute__((__near__));
/* IPC1: Interrupt Priority Control Register 1 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -