⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pic16f685.h

📁 增加PICC支持PIC16F883,690等芯片
💻 H
📖 第 1 页 / 共 2 页
字号:
static          bank1 bit	T0SE		@ ((unsigned)&OPTION*8)+4;
static          bank1 bit	T0CS		@ ((unsigned)&OPTION*8)+5;
static          bank1 bit	INTEDG		@ ((unsigned)&OPTION*8)+6;
static          bank1 bit	RABPU		@ ((unsigned)&OPTION*8)+7;
// Alternate definition for backward compatibility
static          bank1 bit	RBPU		@ ((unsigned)&OPTION*8)+7;

/* Definitions for TRISA register */
static          bank1 bit	TRISA0		@ ((unsigned)&TRISA*8)+0;
static          bank1 bit	TRISA1		@ ((unsigned)&TRISA*8)+1;
static          bank1 bit	TRISA2		@ ((unsigned)&TRISA*8)+2;
static          bank1 bit	TRISA3		@ ((unsigned)&TRISA*8)+3;
static          bank1 bit	TRISA4		@ ((unsigned)&TRISA*8)+4;
static          bank1 bit	TRISA5		@ ((unsigned)&TRISA*8)+5;

/* Definitions for TRISB register */
static volatile bank1 bit	TRISB4		@ ((unsigned)&TRISB*8)+4;
static volatile bank1 bit	TRISB5		@ ((unsigned)&TRISB*8)+5;
static volatile bank1 bit	TRISB6		@ ((unsigned)&TRISB*8)+6;
static volatile bank1 bit	TRISB7		@ ((unsigned)&TRISB*8)+7;

/* Definitions for TRISC register */
static volatile bank1 bit	TRISC0		@ ((unsigned)&TRISC*8)+0;
static volatile bank1 bit	TRISC1		@ ((unsigned)&TRISC*8)+1;
static volatile bank1 bit	TRISC2		@ ((unsigned)&TRISC*8)+2;
static volatile bank1 bit	TRISC3		@ ((unsigned)&TRISC*8)+3;
static volatile bank1 bit	TRISC4		@ ((unsigned)&TRISC*8)+4;
static volatile bank1 bit	TRISC5		@ ((unsigned)&TRISC*8)+5;
static volatile bank1 bit	TRISC6		@ ((unsigned)&TRISC*8)+6;
static volatile bank1 bit	TRISC7		@ ((unsigned)&TRISC*8)+7;

/* Definitions for PIE1 register */
static          bank1 bit	TMR1IE		@ ((unsigned)&PIE1*8)+0;
#if defined(_16F685) || defined(_16F690)
static          bank1 bit	TMR2IE		@ ((unsigned)&PIE1*8)+1;
static          bank1 bit	CCP1IE		@ ((unsigned)&PIE1*8)+2;
#endif
#if defined(_16F687) || defined(_16F689) || defined(_16F690)
static          bank1 bit	SSPIE		@ ((unsigned)&PIE1*8)+3;
static          bank1 bit	TXIE		@ ((unsigned)&PIE1*8)+4;
static          bank1 bit	RCIE		@ ((unsigned)&PIE1*8)+5;
#endif
#if defined(_16F677) || defined(_16F685) || defined(_16F687) || defined(_16F689) || defined(_16F690)
static          bank1 bit	ADIE		@ ((unsigned)&PIE1*8)+6;
#endif

/* Definitions for PIE2 register */
static          bank1 bit	EEIE		@ ((unsigned)&PIE2*8)+4;
static          bank1 bit	C1IE		@ ((unsigned)&PIE2*8)+5;
static          bank1 bit	C2IE		@ ((unsigned)&PIE2*8)+6;
static          bank1 bit	OSFIE		@ ((unsigned)&PIE2*8)+7;

/* Definitions for PCON register */
static volatile bank1 bit	BOR		@ ((unsigned)&PCON*8)+0;
static volatile bank1 bit	POR		@ ((unsigned)&PCON*8)+1;
static          bank1 bit	SBOREN		@ ((unsigned)&PCON*8)+4;
static          bank1 bit	ULPWUE		@ ((unsigned)&PCON*8)+5;

/* Definitions for OSCCON register */
static          bank1 bit	SCS		@ ((unsigned)&OSCCON*8)+0;
static volatile bank1 bit	LTS		@ ((unsigned)&OSCCON*8)+1;
static volatile bank1 bit	HTS		@ ((unsigned)&OSCCON*8)+2;
static volatile bank1 bit	OSTS		@ ((unsigned)&OSCCON*8)+3;
static          bank1 bit	IRCF0		@ ((unsigned)&OSCCON*8)+4;
static          bank1 bit	IRCF1		@ ((unsigned)&OSCCON*8)+5;
static          bank1 bit	IRCF2		@ ((unsigned)&OSCCON*8)+6;

/* Definitions for OSCTUNE register */
static          bank1 bit	TUN0		@ ((unsigned)&OSCTUNE*8)+0;
static          bank1 bit	TUN1		@ ((unsigned)&OSCTUNE*8)+1;
static          bank1 bit	TUN2		@ ((unsigned)&OSCTUNE*8)+2;
static          bank1 bit	TUN3		@ ((unsigned)&OSCTUNE*8)+3;
static          bank1 bit	TUN4		@ ((unsigned)&OSCTUNE*8)+4;

#if defined(_16F677) || defined(_16F687) || defined(_16F689) || defined(_16F690)
/* Definitions for SSPSTAT register */
static volatile bank1 bit	BF		@ ((unsigned)&SSPSTAT*8)+0;
static volatile bank1 bit	UA		@ ((unsigned)&SSPSTAT*8)+1;
static volatile bank1 bit	RW		@ ((unsigned)&SSPSTAT*8)+2;
static volatile bank1 bit	START		@ ((unsigned)&SSPSTAT*8)+3;
static volatile bank1 bit	STOP		@ ((unsigned)&SSPSTAT*8)+4;
static volatile bank1 bit	DA		@ ((unsigned)&SSPSTAT*8)+5;
static          bank1 bit	CKE		@ ((unsigned)&SSPSTAT*8)+6;
static          bank1 bit	SMP		@ ((unsigned)&SSPSTAT*8)+7;
#endif

/* Definitions for WPUA register */
static          bank1 bit	WPUA0		@ ((unsigned)&WPUA*8)+0;
static          bank1 bit	WPUA1		@ ((unsigned)&WPUA*8)+1;
static          bank1 bit	WPUA2		@ ((unsigned)&WPUA*8)+2;
static          bank1 bit	WPUA4		@ ((unsigned)&WPUA*8)+4;
static          bank1 bit	WPUA5		@ ((unsigned)&WPUA*8)+5;

/* Definitions for IOCA register */
static          bank1 bit	IOCA0		@ ((unsigned)&IOCA*8)+0;
static          bank1 bit	IOCA1		@ ((unsigned)&IOCA*8)+1;
static          bank1 bit	IOCA2		@ ((unsigned)&IOCA*8)+2;
static          bank1 bit	IOCA3		@ ((unsigned)&IOCA*8)+3;
static          bank1 bit	IOCA4		@ ((unsigned)&IOCA*8)+4;
static          bank1 bit	IOCA5		@ ((unsigned)&IOCA*8)+5;

/* Definitions for WDTCON register */
static          bank1 bit	SWDTEN		@ ((unsigned)&WDTCON*8)+0;
static          bank1 bit	WDTPS0		@ ((unsigned)&WDTCON*8)+1;
static          bank1 bit	WDTPS1		@ ((unsigned)&WDTCON*8)+2;
static          bank1 bit	WDTPS2		@ ((unsigned)&WDTCON*8)+3;
static          bank1 bit	WDTPS3		@ ((unsigned)&WDTCON*8)+4;

#if defined(_16F687) || defined(_16F689) || defined(_16F690)
/* Definitions for TXSTA register */
static volatile bank1 bit	TX9D		@ ((unsigned)&TXSTA*8)+0;
static volatile bank1 bit	TRMT		@ ((unsigned)&TXSTA*8)+1;
static          bank1 bit	BRGH		@ ((unsigned)&TXSTA*8)+2;
static          bank1 bit	SENDB		@ ((unsigned)&TXSTA*8)+3;
static          bank1 bit	SYNC		@ ((unsigned)&TXSTA*8)+4;
static          bank1 bit	TXEN		@ ((unsigned)&TXSTA*8)+5;
static          bank1 bit	TX9		@ ((unsigned)&TXSTA*8)+6;
static          bank1 bit	CSRC		@ ((unsigned)&TXSTA*8)+7;

/* Definitions for SPBRG register */
static          bank1 bit	BRG0		@ ((unsigned)&SPBRG*8)+0;
static          bank1 bit	BRG1		@ ((unsigned)&SPBRG*8)+1;
static          bank1 bit	BRG2		@ ((unsigned)&SPBRG*8)+2;
static          bank1 bit	BRG3		@ ((unsigned)&SPBRG*8)+3;
static          bank1 bit	BRG4		@ ((unsigned)&SPBRG*8)+4;
static          bank1 bit	BRG5		@ ((unsigned)&SPBRG*8)+5;
static          bank1 bit	BRG6		@ ((unsigned)&SPBRG*8)+6;
static          bank1 bit	BRG7		@ ((unsigned)&SPBRG*8)+7;

/* Definitions for SPBRGH register */
static          bank1 bit	BRG8		@ ((unsigned)&SPBRGH*8)+0;
static          bank1 bit	BRG9		@ ((unsigned)&SPBRGH*8)+1;
static          bank1 bit	BRG10		@ ((unsigned)&SPBRGH*8)+2;
static          bank1 bit	BRG11		@ ((unsigned)&SPBRGH*8)+3;
static          bank1 bit	BRG12		@ ((unsigned)&SPBRGH*8)+4;
static          bank1 bit	BRG13		@ ((unsigned)&SPBRGH*8)+5;
static          bank1 bit	BRG14		@ ((unsigned)&SPBRGH*8)+6;
static          bank1 bit	BRG15		@ ((unsigned)&SPBRGH*8)+7;

/* Definitions for BAUDCTL register */
static volatile bank1 bit	ABDEN		@ ((unsigned)&BAUDCTL*8)+0;
static volatile bank1 bit	WUE		@ ((unsigned)&BAUDCTL*8)+1;
static          bank1 bit	BRG16		@ ((unsigned)&BAUDCTL*8)+3;
static volatile bank1 bit	SCKP		@ ((unsigned)&BAUDCTL*8)+4;
static volatile bank1 bit	RCIDL		@ ((unsigned)&BAUDCTL*8)+6;
static volatile bank1 bit	ABDOVF		@ ((unsigned)&BAUDCTL*8)+7;
#endif

#if defined(_16F677) || defined(_16F685) || defined(_16F687) || defined(_16F689) || defined(_16F690)
/* Definitions for ADCON1 register */
static          bank1 bit	ADCS0		@ ((unsigned)&ADCON1*8)+4;
static          bank1 bit	ADCS1		@ ((unsigned)&ADCON1*8)+5;
static          bank1 bit	ADCS2		@ ((unsigned)&ADCON1*8)+6;
#endif

/* Definitions for WPUB register */
static          bank2 bit	WPUB4		@ ((unsigned)&WPUB*8)+4;
static          bank2 bit	WPUB5		@ ((unsigned)&WPUB*8)+5;
static          bank2 bit	WPUB6		@ ((unsigned)&WPUB*8)+6;
static          bank2 bit	WPUB7		@ ((unsigned)&WPUB*8)+7;

/* Definitions for IOCB register */
static          bank2 bit	IOCB4		@ ((unsigned)&IOCB*8)+4;
static          bank2 bit	IOCB5		@ ((unsigned)&IOCB*8)+5;
static          bank2 bit	IOCB6		@ ((unsigned)&IOCB*8)+6;
static          bank2 bit	IOCB7		@ ((unsigned)&IOCB*8)+7;

/* Definitions for VRCON register */
static          bank2 bit	VR0		@ ((unsigned)&VRCON*8)+0;
static          bank2 bit	VR1		@ ((unsigned)&VRCON*8)+1;
static          bank2 bit	VR2		@ ((unsigned)&VRCON*8)+2;
static          bank2 bit	VR3		@ ((unsigned)&VRCON*8)+3;
static          bank2 bit	VP6EN		@ ((unsigned)&VRCON*8)+4;
static          bank2 bit	VRR		@ ((unsigned)&VRCON*8)+5;
static          bank2 bit	C2VREN		@ ((unsigned)&VRCON*8)+6;
static          bank2 bit	C1VREN		@ ((unsigned)&VRCON*8)+7;

/* Definitions for CM1CON0 register */
static          bank2 bit	C1CH0		@ ((unsigned)&CM1CON0*8)+0;
static          bank2 bit	C1CH1		@ ((unsigned)&CM1CON0*8)+1;
static          bank2 bit	C1R		@ ((unsigned)&CM1CON0*8)+2;
static          bank2 bit	C1POL		@ ((unsigned)&CM1CON0*8)+4;
static          bank2 bit	C1OE		@ ((unsigned)&CM1CON0*8)+5;
static volatile bank2 bit	C1OUT		@ ((unsigned)&CM1CON0*8)+6;
static          bank2 bit	C1ON		@ ((unsigned)&CM1CON0*8)+7;

/* Definitions for CM2CON0 register */
static          bank2 bit	C2CH0		@ ((unsigned)&CM2CON0*8)+0;
static          bank2 bit	C2CH1		@ ((unsigned)&CM2CON0*8)+1;
static          bank2 bit	C2R		@ ((unsigned)&CM2CON0*8)+2;
static          bank2 bit	C2POL		@ ((unsigned)&CM2CON0*8)+4;
static          bank2 bit	C2OE		@ ((unsigned)&CM2CON0*8)+5;
static volatile bank2 bit	C2OUT		@ ((unsigned)&CM2CON0*8)+6;
static          bank2 bit	C2ON		@ ((unsigned)&CM2CON0*8)+7;

/* Definitions for CM2CON1 register */
static          bank2 bit	C2SYNC		@ ((unsigned)&CM2CON1*8)+0;
static          bank2 bit	T1GSS		@ ((unsigned)&CM2CON1*8)+1;
static volatile bank2 bit	MC2OUT		@ ((unsigned)&CM2CON1*8)+6;
static volatile bank2 bit	MC1OUT		@ ((unsigned)&CM2CON1*8)+7;

/* Definitions for ANSEL register */
static          bank2 bit	ANS0		@ ((unsigned)&ANSEL*8)+0;
static          bank2 bit	ANS1		@ ((unsigned)&ANSEL*8)+1;
static          bank2 bit	ANS2		@ ((unsigned)&ANSEL*8)+2;
static          bank2 bit	ANS3		@ ((unsigned)&ANSEL*8)+3;
static          bank2 bit	ANS4		@ ((unsigned)&ANSEL*8)+4;
static          bank2 bit	ANS5		@ ((unsigned)&ANSEL*8)+5;
static          bank2 bit	ANS6		@ ((unsigned)&ANSEL*8)+6;
static          bank2 bit	ANS7		@ ((unsigned)&ANSEL*8)+7;

#if defined(_16F677) || defined(_16F685) || defined(_16F687) || defined(_16F689) || defined(_16F690)
/* Definitions for ANSELH register */
static          bank2 bit	ANS8		@ ((unsigned)&ANSELH*8)+0;
static          bank2 bit	ANS9		@ ((unsigned)&ANSELH*8)+1;
static          bank2 bit	ANS10		@ ((unsigned)&ANSELH*8)+2;
static          bank2 bit	ANS11		@ ((unsigned)&ANSELH*8)+3;
#endif

/* Definitions for EECON1 register */
static volatile bank3 bit	RD		@ ((unsigned)&EECON1*8)+0;
static volatile bank3 bit	WR		@ ((unsigned)&EECON1*8)+1;
static          bank3 bit	WREN		@ ((unsigned)&EECON1*8)+2;
static volatile bank3 bit	WRERR		@ ((unsigned)&EECON1*8)+3;
#if !defined(_16F687)
static          bank3 bit	EEPGD		@ ((unsigned)&EECON1*8)+7;
#endif

#if defined(_16F685) || defined(_16F690)
/* Definitions for PSTRCON register */
static          bank3 bit	STRA		@ ((unsigned)&PSTRCON*8)+0;
static          bank3 bit	STRB		@ ((unsigned)&PSTRCON*8)+1;
static          bank3 bit	STRC		@ ((unsigned)&PSTRCON*8)+2;
static          bank3 bit	STRD		@ ((unsigned)&PSTRCON*8)+3;
static          bank3 bit	STRSYNC		@ ((unsigned)&PSTRCON*8)+4;
#endif

/* Definitions for SRCON register */
static volatile bank3 bit	PULSR		@ ((unsigned)&SRCON*8)+2;
static volatile bank3 bit	PULSS		@ ((unsigned)&SRCON*8)+3;
static          bank3 bit	C2REN		@ ((unsigned)&SRCON*8)+4;
static          bank3 bit	C1SEN		@ ((unsigned)&SRCON*8)+5;
static          bank3 bit	SR0		@ ((unsigned)&SRCON*8)+6;
static          bank3 bit	SR1		@ ((unsigned)&SRCON*8)+7;

// Configuration Mask Definitions
#define CONFIG_ADDR	0x2007
// Oscillator 
#define EXTCLK		0x3FFF	// External RC Clockout
#define EXTIO		0x3FFE	// External RC No Clock
#define INTCLK		0x3FFD	// Internal RC Clockout
#define INTIO		0x3FFC	// Internal RC No Clock
#define EC		0x3FFB	// EC
#define HS		0x3FFA	// HS
#define XT		0x3FF9	// XT
#define LP		0x3FF8	// LP
// Watchdog Timer 
#define WDTEN		0x3FFF	// On
#define WDTDIS		0x3FF7	// Off
// Power Up Timer 
#define PWRTDIS		0x3FFF	// Off
#define PWRTEN		0x3FEF	// On
// Master Clear Enable 
#define MCLREN		0x3FFF	// MCLR function is enabled
#define MCLRDIS		0x3FDF	// MCLR functions as IO
// Code Protect 
#define UNPROTECT	0x3FFF	// Code is not protected
#define CP		0x3FBF	// Code is protected
// Data EE Read Protect 
#define UNPROTECT	0x3FFF	// Do not read protect EEPROM data
#define CPD		0x3F7F	// Read protect EEPROM data
// Brown Out Detect 
#define BORDIS		0x3CFF	// BOD and SBOREN disabled
#define SWBOREN		0x3DFF	// SBOREN controls BOR function (Software control)
#define BORXSLP		0x3EFF	// BOD enabled in run, disabled in sleep, SBOREN disabled
#define BOREN		0x3FFF	// BOD Enabled, SBOREN Disabled
// Internal External Switch Over Mode 
#define IESOEN		0x3FFF	// Enabled
#define IESODIS		0x3BFF	// Disabled
// Monitor Clock Fail-safe 
#define FCMEN		0x3FFF	// Enabled
#define FCMDIS		0x37FF	// Disabled

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -