📄 config.h
字号:
/********************************************************************************************************/
typedef unsigned char Uchar8; /* 无符号8位整型变量 */
typedef signed char Schar8; /* 有符号8位整型变量 */
typedef unsigned short Ushort16; /* 无符号16位整型变量 */
typedef signed short Sshort16; /* 有符号16位整型变量 */
typedef unsigned int Uint32; /* 无符号32位整型变量 */
typedef signed int Sint32; /* 有符号32位整型变量 */
typedef float fp32; /* 单精度浮点数(32位长度) */
typedef double fp64; /* 双精度浮点数(64位长度) */
/********************************/
/* ARM的特殊代码 */
/********************************/
#include "LPC214x.H"
/* 系统设置, Fosc、Fcclk、Fcco、Fpclk必须定义*/
#define Fosc 12000000 //晶振频率,10MHz~25MHz,应当与实际一至
#define Fcclk (Fosc * 4) //系统频率,必须为Fosc的整数倍(1~32),且<=60MHZ
#define Fcco (Fcclk * 4) //CCO频率,必须为Fcclk的2、4、8、16倍,范围为156MHz~320MHz
#define Fpclk (Fcclk / 4) //VPB时钟频率,只能为(Fcclk / 4)的1 ~ 4倍
#define FI2c 200000 //I2C0的工作频率,不能大于400KHz
#include "target.h" //这一句不能删除
/************INTERUPT*****************/
#define Interrupt_WDT 0x01 << 0 //看门狗中断
#define Interrupt_TIMER0 0x01 << 4 //定时器0
#define Interrupt_TIMER1 0x01 << 5 //定时器1
#define Interrupt_UART0 0x01 << 6 //串口0
#define Interrupt_UART1 0x01 << 7 //串口1
#define Interrupt_PWN0 0x01 << 8 //PWN
#define Interrupt_I2C0 0x01 << 9
#define Interrupt_SPI0 0x01 << 10
#define Interrupt_SPI1 0x01 << 11
#define Interrupt_PLL 0x01 << 12
#define Interrupt_RTC 0x01 << 13
#define Interrupt_EINT0 0x01 << 14
#define Interrupt_EINT1 0x01 << 15
#define Interrupt_EINT2 0x01 << 16
#define Interrupt_EINT3 0x01 << 17
#define Interrupt_AD0 0x01 << 18
#define Interrupt_I2C1 0x01 << 19
#define Interrupt_BOD 0x01 << 20
#define Interrupt_AD1 0x01 << 21
#define Interrupt_USB 0x01 << 22
/************INTERUPT_CODE*****************/
#define VIC_WDT 0 //看门狗中断
#define VIC_TIMER0 4 //定时器0
#define VIC_TIMER1 5 //定时器1
#define VIC_UART0 6 //串口0
#define VIC_UART1 7 //串口1
#define VIC_PWN0 8 //PWN
#define VIC_I2C0 9
#define VIC_SPI0 10
#define VIC_SPI1 11
#define VIC_PLL 12
#define VIC_RTC 13
#define VIC_EINT0 14
#define VIC_EINT1 15
#define VIC_EINT2 16
#define VIC_EINT3 17
#define VIC_AD0 18
#define VIC_I2C1 19
#define VIC_BOD 20
#define VIC_AD1 21
#define VIC_USB 22
#define Interrupt_ALL Interrupt_UART0 | Interrupt_UART1 | Interrupt_I2C | Interrupt_TIMER0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -