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

📄 lpc213x.h

📁 philips arm7 lpc2103的常用功能的库函数第二部分
💻 H
📖 第 1 页 / 共 3 页
字号:
#define I21STAT        (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x04))
#define I21DAT         (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x08))
#define I21ADR         (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x0C))
#define I21SCLH        (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x10))
#define I21SCLL        (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x14))
#define I21CONCLR      (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x18))

/*********************************************************************************************************
   SPI总线接口的特殊寄存器
*********************************************************************************************************/
#define SPI0_BASE_ADDR		0xE0020000
#define S0SPCR         (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x00))
#define S0SPSR         (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x04))
#define S0SPDR         (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x08))
#define S0SPCCR        (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x0C))
#define S0SPINT        (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x1C))

/*********************************************************************************************************
   SSP总线接口的特殊寄存器
*********************************************************************************************************/
#define SSP0_BASE_ADDR		0xE0068000
#define SSP0CR0        (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x00))
#define SSP0CR1        (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x04))
#define SSP0DR         (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x08))
#define SSP0SR         (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x0C))
#define SSP0CPSR       (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x10))
#define SSP0IMSC       (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x14))
#define SSP0RIS        (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x18))
#define SSP0MIS        (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x1C))
#define SSP0ICR        (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x20))

/*********************************************************************************************************
   实时时钟的特殊寄存器
*********************************************************************************************************/
#define RTC_BASE_ADDR		0xE0024000
#define ILR            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x00))
#define CTC            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x04))
#define CCR            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x08))
#define CIIR           (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x0C))
#define AMR            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x10))
#define CTIME0         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x14))
#define CTIME1         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x18))
#define CTIME2         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x1C))
#define SEC            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x20))
#define MIN            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x24))
#define HOUR           (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x28))
#define DOM            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x2C))
#define DOW            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x30))
#define DOY            (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x34))
#define MONTH          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x38))
#define YEAR           (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x3C))
#define ALSEC          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x60))
#define ALMIN          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x64))
#define ALHOUR         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x68))
#define ALDOM          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x6C))
#define ALDOW          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x70))
#define ALDOY          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x74))
#define ALMON          (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x78))
#define ALYEAR         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x7C))
#define PREINT         (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x80))
#define PREFRAC        (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x84))


/*********************************************************************************************************
   A/D转换器0
*********************************************************************************************************/
#define AD0_BASE_ADDR		0xE0034000
#define AD0CR          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x00))
#define AD0GDR         (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x04))
#define AD0INTEN       (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x0C))
#define ADDR0          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x10))
#define ADDR1          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x14))
#define ADDR2          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x18))
#define ADDR3          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x1C))
#define ADDR4          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x20))
#define ADDR5          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x24))
#define ADDR6          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x28))
#define ADDR7          (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x2C))
#define AD0STAT        (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x30))

/*********************************************************************************************************
   A/D全局启动寄存器
*********************************************************************************************************/
#define ADGSR           (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x08))

/*********************************************************************************************************
   A/D转换器1
*********************************************************************************************************/
#define AD1_BASE_ADDR		0xE0060000
#define AD1CR          	(*(volatile unsigned long *)(AD1_BASE_ADDR + 0x00))
#define AD1GDR         	(*(volatile unsigned long *)(AD1_BASE_ADDR + 0x04))
#define AD1INTEN       	(*(volatile unsigned long *)(AD1_BASE_ADDR + 0x0C))
#define AD1DR0          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x10))
#define AD1DR1          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x14))
#define AD1DR2          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x18))
#define AD1DR3          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x1C))
#define AD1DR4          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x20))
#define AD1DR5          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x24))
#define AD1DR6          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x28))
#define AD1DR7          (*(volatile unsigned long *)(AD1_BASE_ADDR + 0x2C))
#define AD1STAT        	(*(volatile unsigned long *)(AD1_BASE_ADDR + 0x30))

/*********************************************************************************************************
   D/A转换器
*********************************************************************************************************/
#define DAC_BASE_ADDR		0xE006C000
#define DACR          	(*(volatile unsigned long *)(DAC_BASE_ADDR + 0x00))

/*********************************************************************************************************
   看门狗的特殊寄存器
*********************************************************************************************************/
#define WDG_BASE_ADDR		0xE0000000
#define WDMOD           (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x00))
#define WDTC            (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x04))
#define WDFEED          (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x08))
#define WDTV            (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x0C))


/*********************************************************************************************************
   214x:USB的特殊寄存器,USB中断状态寄存器
*********************************************************************************************************/
#define USB_INT_BASE_ADDR	0xE01FC1C0
#define USBIntSt	(*(volatile unsigned long *)(USB_INT_BASE_ADDR + 0x00))

/*********************************************************************************************************
   USB Base Address
*********************************************************************************************************/
#define USB_BASE_ADDR		0xE0090000		

/*********************************************************************************************************
   USB器件中断相关寄存器
*********************************************************************************************************/
#define USBDevIntSt	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x00))
#define USBDevIntEn	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x04))
#define USBDevIntClr	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x08))
#define USBDevIntSet	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x0C))
#define USBDevIntPri	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x2C))

/*********************************************************************************************************
   端点中断寄存器
*********************************************************************************************************/
#define USBEpIntSt	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x30))
#define USBEpIntEn	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x34))
#define USBEpIntClr	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x38))
#define USBEpIntSet	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x3C))
#define USBEpIntPri	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x40))

/*********************************************************************************************************
   端点使用寄存器
*********************************************************************************************************/
#define USBReEp		(*(volatile unsigned long *)(USB_BASE_ADDR + 0x44))
#define USBEpInd	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x48))
#define USBMaxPSize	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x4C))

/*********************************************************************************************************
   命令寄存器
*********************************************************************************************************/
#define USBCmdCode	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x10))
#define USBCmdData	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x14))

/*********************************************************************************************************
   传输寄存器
*********************************************************************************************************/
#define USBRxData	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x18))
#define USBTxData	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x1C))
#define USBRxPLen	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x20))
#define USBTxPLen	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x24))
#define USBCtrl		(*(volatile unsigned long *)(USB_BASE_ADDR + 0x28))

/*********************************************************************************************************
  DMA寄存器 (仅2146/2148)
*********************************************************************************************************/
#define USBDMARSt       	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x50))
#define USBDMARClr      	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x54))
#define USBDMARSet      	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x58))

#define USBUDCAH        	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x80))

#define USBEpDMASt      	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x84))
#define USBEpDMAEn   		(*(volatile unsigned long *)(USB_BASE_ADDR + 0x88))
#define USBEpDMADis     	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x8C))

#define USBDMAIntSt     	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x90))
#define USBDMAIntEn     	(*(volatile unsigned long *)(USB_BASE_ADDR + 0x94))

#define USBEoTIntSt     	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xA0))
#define USBEoTIntClr    	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xA4))
#define USBEoTIntSet    	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xA8))

#define USBNDDRIntSt    	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xAC))
#define USBNDDRIntClr   	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xB0))
#define USBNDDRIntSet   	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xB4))

#define USBSysErrIntSt  	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xB8))
#define USBSysErrIntClr 	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xBC))
#define USBSysErrIntSet 	(*(volatile unsigned long *)(USB_BASE_ADDR + 0xC0))

/*********************************************************************************************************
   定义固件函数
*********************************************************************************************************/
#define rm_init_entry()             	((void (*)())(0x7fffff91))()
#define rm_undef_handler()          	((void (*)())(0x7fffffa0))()
#define rm_prefetchabort_handler()  	((void (*)())(0x7fffffb0))()
#define rm_dataabort_handler()      	((void (*)())(0x7fffffc0))()
#define rm_irqhandler()             	((void (*)())(0x7fffffd0))()
#define rm_irqhandler2()            	((void (*)())(0x7fffffe0))()
#define iap_entry(a, b)             	((void (*)())(0x7ffffff1))(a, b)
#endif
/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

⌨️ 快捷键说明

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