📄 p18f6720-1.h
字号:
unsigned TMR2ON:1;
unsigned T2OUTPS0:1;
unsigned T2OUTPS1:1;
unsigned T2OUTPS2:1;
unsigned T2OUTPS3:1;
} T2CONbits;
extern volatile near unsigned char PR2;
extern volatile near unsigned char TMR2;
extern volatile near unsigned char T1CON;
extern volatile near union {
struct {
unsigned TMR1ON:1;
unsigned TMR1CS:1;
unsigned T1SYNC:1;
unsigned T1OSCEN:1;
unsigned T1CKPS0:1;
unsigned T1CKPS1:1;
unsigned :1;
unsigned RD16:1;
};
struct {
unsigned :2;
unsigned T1INSYNC:1;
};
struct {
unsigned :2;
unsigned NOT_T1SYNC:1;
};
} T1CONbits;
extern volatile near unsigned char TMR1L;
extern volatile near unsigned TMR1;
extern volatile near unsigned char TMR1H;
extern volatile near unsigned char RCON;
extern volatile near union {
struct {
unsigned NOT_BOR:1;
unsigned NOT_POR:1;
unsigned NOT_PD:1;
unsigned NOT_TO:1;
unsigned NOT_RI:1;
unsigned :2;
unsigned IPEN:1;
};
struct {
unsigned BOR:1;
unsigned POR:1;
unsigned PD:1;
unsigned TO:1;
unsigned RI:1;
};
} RCONbits;
extern volatile near unsigned char WDTCON;
extern volatile near union {
struct {
unsigned SWDTE:1;
};
struct {
unsigned SWDTEN:1;
};
} WDTCONbits;
extern volatile near unsigned char LVDCON;
extern volatile near union {
struct {
unsigned LVDL0:1;
unsigned LVDL1:1;
unsigned LVDL2:1;
unsigned LVDL3:1;
unsigned :1;
unsigned IRVST:1;
};
struct {
unsigned LVV0:1;
unsigned LVV1:1;
unsigned LVV2:1;
unsigned LVV3:1;
unsigned LVDEN:1;
unsigned BGST:1;
};
} LVDCONbits;
extern volatile near unsigned char OSCCON;
extern volatile near struct {
unsigned SCS:1;
} OSCCONbits;
extern volatile near unsigned char T0CON;
extern volatile near struct {
unsigned T0PS0:1;
unsigned T0PS1:1;
unsigned T0PS2:1;
unsigned PSA:1;
unsigned T0SE:1;
unsigned T0CS:1;
unsigned T08BIT:1;
unsigned TMR0ON:1;
} T0CONbits;
extern volatile near unsigned TMR0;
extern volatile near unsigned char TMR0L;
extern volatile near unsigned char TMR0H;
extern near unsigned char STATUS;
extern near struct {
unsigned C:1;
unsigned DC:1;
unsigned Z:1;
unsigned OV:1;
unsigned N:1;
} STATUSbits;
extern near unsigned FSR2;
extern near unsigned char FSR2L;
extern near unsigned char FSR2H;
extern volatile near unsigned char PLUSW2;
extern volatile near unsigned char PREINC2;
extern volatile near unsigned char POSTDEC2;
extern volatile near unsigned char POSTINC2;
extern near unsigned char INDF2;
extern near unsigned char BSR;
extern near unsigned FSR1;
extern near unsigned char FSR1L;
extern near unsigned char FSR1H;
extern volatile near unsigned char PLUSW1;
extern volatile near unsigned char PREINC1;
extern volatile near unsigned char POSTDEC1;
extern volatile near unsigned char POSTINC1;
extern near unsigned char INDF1;
extern near unsigned char WREG;
extern near unsigned char FSR0L;
extern near unsigned FSR0;
extern near unsigned char FSR0H;
extern volatile near unsigned char PLUSW0;
extern volatile near unsigned char PREINC0;
extern volatile near unsigned char POSTDEC0;
extern volatile near unsigned char POSTINC0;
extern near unsigned char INDF0;
extern volatile near unsigned char INTCON3;
extern volatile near union {
struct {
unsigned INT1F:1;
unsigned INT2F:1;
unsigned INT3F:1;
unsigned INT1E:1;
unsigned INT2E:1;
unsigned INT3E:1;
unsigned INT1P:1;
unsigned INT2P:1;
};
struct {
unsigned INT1IF:1;
unsigned INT2IF:1;
unsigned INT3IF:1;
unsigned INT1IE:1;
unsigned INT2IE:1;
unsigned INT3IE:1;
unsigned INT1IP:1;
unsigned INT2IP:1;
};
} INTCON3bits;
extern volatile near unsigned char INTCON2;
extern volatile near union {
struct {
unsigned RBIP:1;
unsigned INT3P:1;
unsigned T0IP:1;
unsigned INTEDG3:1;
unsigned INTEDG2:1;
unsigned INTEDG1:1;
unsigned INTEDG0:1;
unsigned NOT_RBPU:1;
};
struct {
unsigned :2;
unsigned TMR0IP:1;
unsigned :4;
unsigned RBPU:1;
};
} INTCON2bits;
extern volatile near unsigned char INTCON;
extern volatile near union {
struct {
unsigned RBIF:1;
unsigned INT0F:1;
unsigned T0IF:1;
unsigned RBIE:1;
unsigned INT0E:1;
unsigned T0IE:1;
unsigned PEIE:1;
unsigned GIE:1;
};
struct {
unsigned :1;
unsigned INT0IF:1;
unsigned TMR0IF:1;
unsigned :1;
unsigned INT0IE:1;
unsigned TMR0IE:1;
unsigned GIEL:1;
unsigned GIEH:1;
};
} INTCONbits;
extern near unsigned char PRODL;
extern near unsigned PROD;
extern near unsigned char PRODH;
extern volatile near unsigned char TABLAT;
extern volatile near unsigned char TBLPTRL;
extern volatile near unsigned short long TBLPTR;
extern volatile near unsigned char TBLPTRH;
extern volatile near unsigned char TBLPTRU;
extern volatile near unsigned char PCL;
extern volatile near unsigned short long PC;
extern volatile near unsigned char PCLATH;
extern volatile near unsigned char PCLATU;
extern volatile near unsigned char STKPTR;
extern volatile near struct {
unsigned STKPTR0:1;
unsigned STKPTR1:1;
unsigned STKPTR2:1;
unsigned STKPTR3:1;
unsigned STKPTR4:1;
unsigned :1;
unsigned STKUNF:1;
unsigned STKOVF:1;
} STKPTRbits;
extern near unsigned char TOSL;
extern near unsigned short long TOS;
extern near unsigned char TOSH;
extern near unsigned char TOSU;
/*-------------------------------------------------------------------------
* Some useful defines for inline assembly stuff
*-------------------------------------------------------------------------*/
#define ACCESS 0
#define BANKED 1
/*-------------------------------------------------------------------------
* Some useful macros for inline assembly stuff
*-------------------------------------------------------------------------*/
#define Nop() {_asm nop _endasm}
#define ClrWdt() {_asm clrwdt _endasm}
#define Sleep() {_asm sleep _endasm}
#define Reset() {_asm reset _endasm}
#define Rlcf(f,dest,access) {_asm movlb f rlcf f,dest,access _endasm}
#define Rlncf(f,dest,access) {_asm movlb f rlncf f,dest,access _endasm}
#define Rrcf(f,dest,access) {_asm movlb f rrcf f,dest,access _endasm}
#define Rrncf(f,dest,access) {_asm movlb f rrncf f,dest,access _endasm}
#define Swapf(f,dest,access) {_asm movlb f swapf f,dest,access _endasm }
/*-------------------------------------------------------------------------
* A fairly inclusive set of registers to save for interrupts.
* These are locations which are commonly used by the compiler.
*-------------------------------------------------------------------------*/
#define INTSAVELOCS TBLPTR, TABLAT, PROD
/*-------------------------------------------------------------------------
* Defines for configuration words:
* _CONFIG_DECL should be placed between a #pragma romdata CONFIG
* and a #pragma romdata. For example: ,
* #pragma romdata CONFIG
* _CONFIG_DECL(...)
* #pragma romdata
* NOTE: This macro only works when using the default linker script files
* and the CONFIG section exists.
*-------------------------------------------------------------------------*/
#define _CONFIG_DECL(_CONFIG1H, \
_CONFIG2L, \
_CONFIG2H, \
_CONFIG3H, \
_CONFIG4L, \
_CONFIG5L, \
_CONFIG5H, \
_CONFIG6L, \
_CONFIG6H, \
_CONFIG7L, \
_CONFIG7H) \
const rom unsigned char _configuration[14] = { \
0xFF, \
_CONFIG1H, \
_CONFIG2L, \
_CONFIG2H, \
0xFF, \
_CONFIG3H, \
_CONFIG4L, \
0xFF, \
_CONFIG5L, \
_CONFIG5H, \
_CONFIG6L, \
_CONFIG6H, \
_CONFIG7L, \
_CONFIG7H \
}
/*-------------------------------------------------------------------------
* CONFIG1H (0x300001)
*-------------------------------------------------------------------------*/
#define _CONFIG1H_DEFAULT 0x27
#define _OSC_EC_1H 0xFC
#define _OSC_ECIO_1H 0xFD
#define _OSC_HS_1H 0xFA
#define _OSC_HSPLL_1H 0xFE
#define _OSC_LP_1H 0xF8
#define _OSC_RC_1H 0xFB
#define _OSC_RCIO_1H 0xFF
#define _OSC_XT_1H 0xF9
#define _OSCS_OFF_1H 0xFF
#define _OSCS_ON_1H 0xDF
/*-------------------------------------------------------------------------
* CONFIG2L (0x300002)
*-------------------------------------------------------------------------*/
#define _CONFIG2L_DEFAULT 0x0F
#define _PWRT_OFF_2L 0xFF
#define _PWRT_ON_2L 0xFE
#define _BOR_OFF_2L 0xFD
#define _BOR_ON_2L 0xFF
#define _BORV_25_2L 0xFF
#define _BORV_27_2L 0xFB
#define _BORV_42_2L 0xF7
#define _BORV_45_2L 0xF3
/*-------------------------------------------------------------------------
* CONFIG2H (0x300003)
*-------------------------------------------------------------------------*/
#define _CONFIG2H_DEFAULT 0x0F
#define _WDT_OFF_2H 0xFE
#define _WDT_ON_2H 0xFF
#define _WDTPS_1_2H 0xF1
#define _WDTPS_128_2H 0xFF
#define _WDTPS_16_2H 0xF9
#define _WDTPS_2_2H 0xF3
#define _WDTPS_32_2H 0xFB
#define _WDTPS_4_2H 0xF5
#define _WDTPS_64_2H 0xFD
#define _WDTPS_8_2H 0xF7
/*-------------------------------------------------------------------------
* CONFIG3H (0x300005)
*-------------------------------------------------------------------------*/
#define _CONFIG3H_DEFAULT 0x01
#define _CCP2MUX_OFF_3H 0xFE
#define _CCP2MUX_ON_3H 0xFF
/*-------------------------------------------------------------------------
* CONFIG4L (0x300006)
*-------------------------------------------------------------------------*/
#define _CONFIG4L_DEFAULT 0x85
#define _STVR_OFF_4L 0xFE
#define _STVR_ON_4L 0xFF
#define _LVP_OFF_4L 0xFB
#define _LVP_ON_4L 0xFF
#define _DEBUG_OFF_4L 0xFF
#define _DEBUG_ON_4L 0x7F
/*-------------------------------------------------------------------------
* CONFIG5L (0x300008)
*-------------------------------------------------------------------------*/
#define _CONFIG5L_DEFAULT 0xFF
#define _CP0_OFF_5L 0xFF
#define _CP0_ON_5L 0xFE
#define _CP1_OFF_5L 0xFF
#define _CP1_ON_5L 0xFD
#define _CP2_OFF_5L 0xFF
#define _CP2_ON_5L 0xFB
#define _CP3_OFF_5L 0xFF
#define _CP3_ON_5L 0xF7
#define _CP4_OFF_5L 0xFF
#define _CP4_ON_5L 0xEF
#define _CP5_OFF_5L 0xFF
#define _CP5_ON_5L 0xDF
#define _CP6_OFF_5L 0xFF
#define _CP6_ON_5L 0xBF
#define _CP7_OFF_5L 0xFF
#define _CP7_ON_5L 0x7F
/*-------------------------------------------------------------------------
* CONFIG5H (0x300009)
*-------------------------------------------------------------------------*/
#define _CONFIG5H_DEFAULT 0xC0
#define _CPB_OFF_5H 0xFF
#define _CPB_ON_5H 0xBF
#define _CPD_OFF_5H 0xFF
#define _CPD_ON_5H 0x7F
/*-------------------------------------------------------------------------
* CONFIG6L (0x30000a)
*-------------------------------------------------------------------------*/
#define _CONFIG6L_DEFAULT 0xFF
#define _WRT0_OFF_6L 0xFF
#define _WRT0_ON_6L 0xFE
#define _WRT1_OFF_6L 0xFF
#define _WRT1_ON_6L 0xFD
#define _WRT2_OFF_6L 0xFF
#define _WRT2_ON_6L 0xFB
#define _WRT3_OFF_6L 0xFF
#define _WRT3_ON_6L 0xF7
#define _WRT4_OFF_6L 0xFF
#define _WRT4_ON_6L 0xEF
#define _WRT5_OFF_6L 0xFF
#define _WRT5_ON_6L 0xDF
#define _WRT6_OFF_6L 0xFF
#define _WRT6_ON_6L 0xBF
#define _WRT7_OFF_6L 0xFF
#define _WRT7_ON_6L 0x7F
/*-------------------------------------------------------------------------
* CONFIG6H (0x30000b)
*-------------------------------------------------------------------------*/
#define _CONFIG6H_DEFAULT 0xE0
#define _WRTC_OFF_6H 0xFF
#define _WRTC_ON_6H 0xDF
#define _WRTB_OFF_6H 0xFF
#define _WRTB_ON_6H 0xBF
#define _WRTD_OFF_6H 0xFF
#define _WRTD_ON_6H 0x7F
/*-------------------------------------------------------------------------
* CONFIG7L (0x30000c)
*-------------------------------------------------------------------------*/
#define _CONFIG7L_DEFAULT 0x0F
#define _EBTR0_OFF_7L 0xFF
#define _EBTR0_ON_7L 0xFE
#define _EBTR1_OFF_7L 0xFF
#define _EBTR1_ON_7L 0xFD
#define _EBTR2_OFF_7L 0xFF
#define _EBTR2_ON_7L 0xFB
#define _EBTR3_OFF_7L 0xFF
#define _EBTR3_ON_7L 0xF7
#define _EBTR4_OFF_7L 0xFF
#define _EBTR4_ON_7L 0xEF
#define _EBTR5_OFF_7L 0xFF
#define _EBTR5_ON_7L 0xDF
#define _EBTR6_OFF_7L 0xFF
#define _EBTR6_ON_7L 0xBF
#define _EBTR7_OFF_7L 0xFF
#define _EBTR7_ON_7L 0x7F
/*-------------------------------------------------------------------------
* CONFIG7H (0x30000d)
*-------------------------------------------------------------------------*/
#define _CONFIG7H_DEFAULT 0x40
#define _EBTRB_OFF_7H 0xFF
#define _EBTRB_ON_7H 0xBF
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -