LPC17xx.h 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. /**************************************************************************//**
  2. * @file LPC17xx.h
  3. * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File for
  4. * NXP LPC17xx Device Series
  5. * @version V1.07
  6. * @date 19. October 2009
  7. *
  8. * @note
  9. * Copyright (C) 2009 ARM Limited. All rights reserved.
  10. *
  11. * @par
  12. * ARM Limited (ARM) is supplying this software for use with Cortex-M
  13. * processor based microcontrollers. This file can be freely distributed
  14. * within development tools that are supporting such ARM based processors.
  15. *
  16. * @par
  17. * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  18. * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  19. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  20. * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  21. * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  22. *
  23. ******************************************************************************/
  24. #ifndef __LPC17xx_H__
  25. #define __LPC17xx_H__
  26. /*
  27. * ==========================================================================
  28. * ---------- Interrupt Number Definition -----------------------------------
  29. * ==========================================================================
  30. */
  31. typedef enum IRQn
  32. {
  33. /****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
  34. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  35. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
  36. BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
  37. UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
  38. SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
  39. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
  40. PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
  41. SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
  42. /****** LPC17xx Specific Interrupt Numbers *******************************************************/
  43. WDT_IRQn = 0, /*!< Watchdog Timer Interrupt */
  44. TIMER0_IRQn = 1, /*!< Timer0 Interrupt */
  45. TIMER1_IRQn = 2, /*!< Timer1 Interrupt */
  46. TIMER2_IRQn = 3, /*!< Timer2 Interrupt */
  47. TIMER3_IRQn = 4, /*!< Timer3 Interrupt */
  48. UART0_IRQn = 5, /*!< UART0 Interrupt */
  49. UART1_IRQn = 6, /*!< UART1 Interrupt */
  50. UART2_IRQn = 7, /*!< UART2 Interrupt */
  51. UART3_IRQn = 8, /*!< UART3 Interrupt */
  52. PWM1_IRQn = 9, /*!< PWM1 Interrupt */
  53. I2C0_IRQn = 10, /*!< I2C0 Interrupt */
  54. I2C1_IRQn = 11, /*!< I2C1 Interrupt */
  55. I2C2_IRQn = 12, /*!< I2C2 Interrupt */
  56. SPI_IRQn = 13, /*!< SPI Interrupt */
  57. SSP0_IRQn = 14, /*!< SSP0 Interrupt */
  58. SSP1_IRQn = 15, /*!< SSP1 Interrupt */
  59. PLL0_IRQn = 16, /*!< PLL0 Lock (Main PLL) Interrupt */
  60. RTC_IRQn = 17, /*!< Real Time Clock Interrupt */
  61. EINT0_IRQn = 18, /*!< External Interrupt 0 Interrupt */
  62. EINT1_IRQn = 19, /*!< External Interrupt 1 Interrupt */
  63. EINT2_IRQn = 20, /*!< External Interrupt 2 Interrupt */
  64. EINT3_IRQn = 21, /*!< External Interrupt 3 Interrupt */
  65. ADC_IRQn = 22, /*!< A/D Converter Interrupt */
  66. BOD_IRQn = 23, /*!< Brown-Out Detect Interrupt */
  67. USB_IRQn = 24, /*!< USB Interrupt */
  68. CAN_IRQn = 25, /*!< CAN Interrupt */
  69. DMA_IRQn = 26, /*!< General Purpose DMA Interrupt */
  70. I2S_IRQn = 27, /*!< I2S Interrupt */
  71. ENET_IRQn = 28, /*!< Ethernet Interrupt */
  72. RIT_IRQn = 29, /*!< Repetitive Interrupt Timer Interrupt */
  73. MCPWM_IRQn = 30, /*!< Motor Control PWM Interrupt */
  74. QEI_IRQn = 31, /*!< Quadrature Encoder Interface Interrupt */
  75. PLL1_IRQn = 32, /*!< PLL1 Lock (USB PLL) Interrupt */
  76. } IRQn_Type;
  77. /*
  78. * ==========================================================================
  79. * ----------- Processor and Core Peripheral Section ------------------------
  80. * ==========================================================================
  81. */
  82. /* Configuration of the Cortex-M3 Processor and Core Peripherals */
  83. #define __MPU_PRESENT 1 /*!< MPU present or not */
  84. #define __NVIC_PRIO_BITS 5 /*!< Number of Bits used for Priority Levels */
  85. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  86. #include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
  87. #include "system_LPC17xx.h" /* System Header */
  88. /******************************************************************************/
  89. /* Device Specific Peripheral registers structures */
  90. /******************************************************************************/
  91. #if defined ( __CC_ARM )
  92. #pragma anon_unions
  93. #endif
  94. /*------------- System Control (SC) ------------------------------------------*/
  95. typedef struct
  96. {
  97. __IO uint32_t FLASHCFG; /* Flash Accelerator Module */
  98. uint32_t RESERVED0[31];
  99. __IO uint32_t PLL0CON; /* Clocking and Power Control */
  100. __IO uint32_t PLL0CFG;
  101. __I uint32_t PLL0STAT;
  102. __O uint32_t PLL0FEED;
  103. uint32_t RESERVED1[4];
  104. __IO uint32_t PLL1CON;
  105. __IO uint32_t PLL1CFG;
  106. __I uint32_t PLL1STAT;
  107. __O uint32_t PLL1FEED;
  108. uint32_t RESERVED2[4];
  109. __IO uint32_t PCON;
  110. __IO uint32_t PCONP;
  111. uint32_t RESERVED3[15];
  112. __IO uint32_t CCLKCFG;
  113. __IO uint32_t USBCLKCFG;
  114. __IO uint32_t CLKSRCSEL;
  115. uint32_t RESERVED4[12];
  116. __IO uint32_t EXTINT; /* External Interrupts */
  117. uint32_t RESERVED5;
  118. __IO uint32_t EXTMODE;
  119. __IO uint32_t EXTPOLAR;
  120. uint32_t RESERVED6[12];
  121. __IO uint32_t RSID; /* Reset */
  122. uint32_t RESERVED7[7];
  123. __IO uint32_t SCS; /* Syscon Miscellaneous Registers */
  124. __IO uint32_t IRCTRIM; /* Clock Dividers */
  125. __IO uint32_t PCLKSEL0;
  126. __IO uint32_t PCLKSEL1;
  127. uint32_t RESERVED8[4];
  128. __IO uint32_t USBIntSt; /* USB Device/OTG Interrupt Register */
  129. __IO uint32_t DMAREQSEL;
  130. __IO uint32_t CLKOUTCFG; /* Clock Output Configuration */
  131. } LPC_SC_TypeDef;
  132. /*------------- Pin Connect Block (PINCON) -----------------------------------*/
  133. typedef struct
  134. {
  135. __IO uint32_t PINSEL0;
  136. __IO uint32_t PINSEL1;
  137. __IO uint32_t PINSEL2;
  138. __IO uint32_t PINSEL3;
  139. __IO uint32_t PINSEL4;
  140. __IO uint32_t PINSEL5;
  141. __IO uint32_t PINSEL6;
  142. __IO uint32_t PINSEL7;
  143. __IO uint32_t PINSEL8;
  144. __IO uint32_t PINSEL9;
  145. __IO uint32_t PINSEL10;
  146. uint32_t RESERVED0[5];
  147. __IO uint32_t PINMODE0;
  148. __IO uint32_t PINMODE1;
  149. __IO uint32_t PINMODE2;
  150. __IO uint32_t PINMODE3;
  151. __IO uint32_t PINMODE4;
  152. __IO uint32_t PINMODE5;
  153. __IO uint32_t PINMODE6;
  154. __IO uint32_t PINMODE7;
  155. __IO uint32_t PINMODE8;
  156. __IO uint32_t PINMODE9;
  157. __IO uint32_t PINMODE_OD0;
  158. __IO uint32_t PINMODE_OD1;
  159. __IO uint32_t PINMODE_OD2;
  160. __IO uint32_t PINMODE_OD3;
  161. __IO uint32_t PINMODE_OD4;
  162. __IO uint32_t I2CPADCFG;
  163. } LPC_PINCON_TypeDef;
  164. /*------------- General Purpose Input/Output (GPIO) --------------------------*/
  165. typedef struct
  166. {
  167. union {
  168. __IO uint32_t FIODIR;
  169. struct {
  170. __IO uint16_t FIODIRL;
  171. __IO uint16_t FIODIRH;
  172. };
  173. struct {
  174. __IO uint8_t FIODIR0;
  175. __IO uint8_t FIODIR1;
  176. __IO uint8_t FIODIR2;
  177. __IO uint8_t FIODIR3;
  178. };
  179. };
  180. uint32_t RESERVED0[3];
  181. union {
  182. __IO uint32_t FIOMASK;
  183. struct {
  184. __IO uint16_t FIOMASKL;
  185. __IO uint16_t FIOMASKH;
  186. };
  187. struct {
  188. __IO uint8_t FIOMASK0;
  189. __IO uint8_t FIOMASK1;
  190. __IO uint8_t FIOMASK2;
  191. __IO uint8_t FIOMASK3;
  192. };
  193. };
  194. union {
  195. __IO uint32_t FIOPIN;
  196. struct {
  197. __IO uint16_t FIOPINL;
  198. __IO uint16_t FIOPINH;
  199. };
  200. struct {
  201. __IO uint8_t FIOPIN0;
  202. __IO uint8_t FIOPIN1;
  203. __IO uint8_t FIOPIN2;
  204. __IO uint8_t FIOPIN3;
  205. };
  206. };
  207. union {
  208. __IO uint32_t FIOSET;
  209. struct {
  210. __IO uint16_t FIOSETL;
  211. __IO uint16_t FIOSETH;
  212. };
  213. struct {
  214. __IO uint8_t FIOSET0;
  215. __IO uint8_t FIOSET1;
  216. __IO uint8_t FIOSET2;
  217. __IO uint8_t FIOSET3;
  218. };
  219. };
  220. union {
  221. __O uint32_t FIOCLR;
  222. struct {
  223. __O uint16_t FIOCLRL;
  224. __O uint16_t FIOCLRH;
  225. };
  226. struct {
  227. __O uint8_t FIOCLR0;
  228. __O uint8_t FIOCLR1;
  229. __O uint8_t FIOCLR2;
  230. __O uint8_t FIOCLR3;
  231. };
  232. };
  233. } LPC_GPIO_TypeDef;
  234. typedef struct
  235. {
  236. __I uint32_t IntStatus;
  237. __I uint32_t IO0IntStatR;
  238. __I uint32_t IO0IntStatF;
  239. __O uint32_t IO0IntClr;
  240. __IO uint32_t IO0IntEnR;
  241. __IO uint32_t IO0IntEnF;
  242. uint32_t RESERVED0[3];
  243. __I uint32_t IO2IntStatR;
  244. __I uint32_t IO2IntStatF;
  245. __O uint32_t IO2IntClr;
  246. __IO uint32_t IO2IntEnR;
  247. __IO uint32_t IO2IntEnF;
  248. } LPC_GPIOINT_TypeDef;
  249. /*------------- Timer (TIM) --------------------------------------------------*/
  250. typedef struct
  251. {
  252. __IO uint32_t IR;
  253. __IO uint32_t TCR;
  254. __IO uint32_t TC;
  255. __IO uint32_t PR;
  256. __IO uint32_t PC;
  257. __IO uint32_t MCR;
  258. __IO uint32_t MR0;
  259. __IO uint32_t MR1;
  260. __IO uint32_t MR2;
  261. __IO uint32_t MR3;
  262. __IO uint32_t CCR;
  263. __I uint32_t CR0;
  264. __I uint32_t CR1;
  265. uint32_t RESERVED0[2];
  266. __IO uint32_t EMR;
  267. uint32_t RESERVED1[12];
  268. __IO uint32_t CTCR;
  269. } LPC_TIM_TypeDef;
  270. /*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
  271. typedef struct
  272. {
  273. __IO uint32_t IR;
  274. __IO uint32_t TCR;
  275. __IO uint32_t TC;
  276. __IO uint32_t PR;
  277. __IO uint32_t PC;
  278. __IO uint32_t MCR;
  279. __IO uint32_t MR0;
  280. __IO uint32_t MR1;
  281. __IO uint32_t MR2;
  282. __IO uint32_t MR3;
  283. __IO uint32_t CCR;
  284. __I uint32_t CR0;
  285. __I uint32_t CR1;
  286. __I uint32_t CR2;
  287. __I uint32_t CR3;
  288. uint32_t RESERVED0;
  289. __IO uint32_t MR4;
  290. __IO uint32_t MR5;
  291. __IO uint32_t MR6;
  292. __IO uint32_t PCR;
  293. __IO uint32_t LER;
  294. uint32_t RESERVED1[7];
  295. __IO uint32_t CTCR;
  296. } LPC_PWM_TypeDef;
  297. /*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
  298. typedef struct
  299. {
  300. union {
  301. __I uint8_t RBR;
  302. __O uint8_t THR;
  303. __IO uint8_t DLL;
  304. uint32_t RESERVED0;
  305. };
  306. union {
  307. __IO uint8_t DLM;
  308. __IO uint32_t IER;
  309. };
  310. union {
  311. __I uint32_t IIR;
  312. __O uint8_t FCR;
  313. };
  314. __IO uint8_t LCR;
  315. uint8_t RESERVED1[7];
  316. __I uint8_t LSR;
  317. uint8_t RESERVED2[7];
  318. __IO uint8_t SCR;
  319. uint8_t RESERVED3[3];
  320. __IO uint32_t ACR;
  321. __IO uint8_t ICR;
  322. uint8_t RESERVED4[3];
  323. __IO uint8_t FDR;
  324. uint8_t RESERVED5[7];
  325. __IO uint8_t TER;
  326. uint8_t RESERVED6[39];
  327. __I uint8_t FIFOLVL;
  328. } LPC_UART_TypeDef;
  329. typedef struct
  330. {
  331. union {
  332. __I uint8_t RBR;
  333. __O uint8_t THR;
  334. __IO uint8_t DLL;
  335. uint32_t RESERVED0;
  336. };
  337. union {
  338. __IO uint8_t DLM;
  339. __IO uint32_t IER;
  340. };
  341. union {
  342. __I uint32_t IIR;
  343. __O uint8_t FCR;
  344. };
  345. __IO uint8_t LCR;
  346. uint8_t RESERVED1[7];
  347. __I uint8_t LSR;
  348. uint8_t RESERVED2[7];
  349. __IO uint8_t SCR;
  350. uint8_t RESERVED3[3];
  351. __IO uint32_t ACR;
  352. __IO uint8_t ICR;
  353. uint8_t RESERVED4[3];
  354. __IO uint8_t FDR;
  355. uint8_t RESERVED5[7];
  356. __IO uint8_t TER;
  357. uint8_t RESERVED6[39];
  358. __I uint8_t FIFOLVL;
  359. } LPC_UART0_TypeDef;
  360. typedef struct
  361. {
  362. union {
  363. __I uint8_t RBR;
  364. __O uint8_t THR;
  365. __IO uint8_t DLL;
  366. uint32_t RESERVED0;
  367. };
  368. union {
  369. __IO uint8_t DLM;
  370. __IO uint32_t IER;
  371. };
  372. union {
  373. __I uint32_t IIR;
  374. __O uint8_t FCR;
  375. };
  376. __IO uint8_t LCR;
  377. uint8_t RESERVED1[3];
  378. __IO uint8_t MCR;
  379. uint8_t RESERVED2[3];
  380. __I uint8_t LSR;
  381. uint8_t RESERVED3[3];
  382. __I uint8_t MSR;
  383. uint8_t RESERVED4[3];
  384. __IO uint8_t SCR;
  385. uint8_t RESERVED5[3];
  386. __IO uint32_t ACR;
  387. uint32_t RESERVED6;
  388. __IO uint32_t FDR;
  389. uint32_t RESERVED7;
  390. __IO uint8_t TER;
  391. uint8_t RESERVED8[27];
  392. __IO uint8_t RS485CTRL;
  393. uint8_t RESERVED9[3];
  394. __IO uint8_t ADRMATCH;
  395. uint8_t RESERVED10[3];
  396. __IO uint8_t RS485DLY;
  397. uint8_t RESERVED11[3];
  398. __I uint8_t FIFOLVL;
  399. } LPC_UART1_TypeDef;
  400. /*------------- Serial Peripheral Interface (SPI) ----------------------------*/
  401. typedef struct
  402. {
  403. __IO uint32_t SPCR;
  404. __I uint32_t SPSR;
  405. __IO uint32_t SPDR;
  406. __IO uint32_t SPCCR;
  407. uint32_t RESERVED0[3];
  408. __IO uint32_t SPINT;
  409. } LPC_SPI_TypeDef;
  410. /*------------- Synchronous Serial Communication (SSP) -----------------------*/
  411. typedef struct
  412. {
  413. __IO uint32_t CR0;
  414. __IO uint32_t CR1;
  415. __IO uint32_t DR;
  416. __I uint32_t SR;
  417. __IO uint32_t CPSR;
  418. __IO uint32_t IMSC;
  419. __IO uint32_t RIS;
  420. __IO uint32_t MIS;
  421. __IO uint32_t ICR;
  422. __IO uint32_t DMACR;
  423. } LPC_SSP_TypeDef;
  424. /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
  425. typedef struct
  426. {
  427. __IO uint32_t I2CONSET;
  428. __I uint32_t I2STAT;
  429. __IO uint32_t I2DAT;
  430. __IO uint32_t I2ADR0;
  431. __IO uint32_t I2SCLH;
  432. __IO uint32_t I2SCLL;
  433. __O uint32_t I2CONCLR;
  434. __IO uint32_t MMCTRL;
  435. __IO uint32_t I2ADR1;
  436. __IO uint32_t I2ADR2;
  437. __IO uint32_t I2ADR3;
  438. __I uint32_t I2DATA_BUFFER;
  439. __IO uint32_t I2MASK0;
  440. __IO uint32_t I2MASK1;
  441. __IO uint32_t I2MASK2;
  442. __IO uint32_t I2MASK3;
  443. } LPC_I2C_TypeDef;
  444. /*------------- Inter IC Sound (I2S) -----------------------------------------*/
  445. typedef struct
  446. {
  447. __IO uint32_t I2SDAO;
  448. __IO uint32_t I2SDAI;
  449. __O uint32_t I2STXFIFO;
  450. __I uint32_t I2SRXFIFO;
  451. __I uint32_t I2SSTATE;
  452. __IO uint32_t I2SDMA1;
  453. __IO uint32_t I2SDMA2;
  454. __IO uint32_t I2SIRQ;
  455. __IO uint32_t I2STXRATE;
  456. __IO uint32_t I2SRXRATE;
  457. __IO uint32_t I2STXBITRATE;
  458. __IO uint32_t I2SRXBITRATE;
  459. __IO uint32_t I2STXMODE;
  460. __IO uint32_t I2SRXMODE;
  461. } LPC_I2S_TypeDef;
  462. /*------------- Repetitive Interrupt Timer (RIT) -----------------------------*/
  463. typedef struct
  464. {
  465. __IO uint32_t RICOMPVAL;
  466. __IO uint32_t RIMASK;
  467. __IO uint8_t RICTRL;
  468. uint8_t RESERVED0[3];
  469. __IO uint32_t RICOUNTER;
  470. } LPC_RIT_TypeDef;
  471. /*------------- Real-Time Clock (RTC) ----------------------------------------*/
  472. typedef struct
  473. {
  474. __IO uint8_t ILR;
  475. uint8_t RESERVED0[7];
  476. __IO uint8_t CCR;
  477. uint8_t RESERVED1[3];
  478. __IO uint8_t CIIR;
  479. uint8_t RESERVED2[3];
  480. __IO uint8_t AMR;
  481. uint8_t RESERVED3[3];
  482. __I uint32_t CTIME0;
  483. __I uint32_t CTIME1;
  484. __I uint32_t CTIME2;
  485. __IO uint8_t SEC;
  486. uint8_t RESERVED4[3];
  487. __IO uint8_t MIN;
  488. uint8_t RESERVED5[3];
  489. __IO uint8_t HOUR;
  490. uint8_t RESERVED6[3];
  491. __IO uint8_t DOM;
  492. uint8_t RESERVED7[3];
  493. __IO uint8_t DOW;
  494. uint8_t RESERVED8[3];
  495. __IO uint16_t DOY;
  496. uint16_t RESERVED9;
  497. __IO uint8_t MONTH;
  498. uint8_t RESERVED10[3];
  499. __IO uint16_t YEAR;
  500. uint16_t RESERVED11;
  501. __IO uint32_t CALIBRATION;
  502. __IO uint32_t GPREG0;
  503. __IO uint32_t GPREG1;
  504. __IO uint32_t GPREG2;
  505. __IO uint32_t GPREG3;
  506. __IO uint32_t GPREG4;
  507. __IO uint8_t RTC_AUXEN;
  508. uint8_t RESERVED12[3];
  509. __IO uint8_t RTC_AUX;
  510. uint8_t RESERVED13[3];
  511. __IO uint8_t ALSEC;
  512. uint8_t RESERVED14[3];
  513. __IO uint8_t ALMIN;
  514. uint8_t RESERVED15[3];
  515. __IO uint8_t ALHOUR;
  516. uint8_t RESERVED16[3];
  517. __IO uint8_t ALDOM;
  518. uint8_t RESERVED17[3];
  519. __IO uint8_t ALDOW;
  520. uint8_t RESERVED18[3];
  521. __IO uint16_t ALDOY;
  522. uint16_t RESERVED19;
  523. __IO uint8_t ALMON;
  524. uint8_t RESERVED20[3];
  525. __IO uint16_t ALYEAR;
  526. uint16_t RESERVED21;
  527. } LPC_RTC_TypeDef;
  528. /*------------- Watchdog Timer (WDT) -----------------------------------------*/
  529. typedef struct
  530. {
  531. __IO uint8_t WDMOD;
  532. uint8_t RESERVED0[3];
  533. __IO uint32_t WDTC;
  534. __O uint8_t WDFEED;
  535. uint8_t RESERVED1[3];
  536. __I uint32_t WDTV;
  537. __IO uint32_t WDCLKSEL;
  538. } LPC_WDT_TypeDef;
  539. /*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
  540. typedef struct
  541. {
  542. __IO uint32_t ADCR;
  543. __IO uint32_t ADGDR;
  544. uint32_t RESERVED0;
  545. __IO uint32_t ADINTEN;
  546. __I uint32_t ADDR0;
  547. __I uint32_t ADDR1;
  548. __I uint32_t ADDR2;
  549. __I uint32_t ADDR3;
  550. __I uint32_t ADDR4;
  551. __I uint32_t ADDR5;
  552. __I uint32_t ADDR6;
  553. __I uint32_t ADDR7;
  554. __I uint32_t ADSTAT;
  555. __IO uint32_t ADTRM;
  556. } LPC_ADC_TypeDef;
  557. /*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
  558. typedef struct
  559. {
  560. __IO uint32_t DACR;
  561. __IO uint32_t DACCTRL;
  562. __IO uint16_t DACCNTVAL;
  563. } LPC_DAC_TypeDef;
  564. /*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
  565. typedef struct
  566. {
  567. __I uint32_t MCCON;
  568. __O uint32_t MCCON_SET;
  569. __O uint32_t MCCON_CLR;
  570. __I uint32_t MCCAPCON;
  571. __O uint32_t MCCAPCON_SET;
  572. __O uint32_t MCCAPCON_CLR;
  573. __IO uint32_t MCTIM0;
  574. __IO uint32_t MCTIM1;
  575. __IO uint32_t MCTIM2;
  576. __IO uint32_t MCPER0;
  577. __IO uint32_t MCPER1;
  578. __IO uint32_t MCPER2;
  579. __IO uint32_t MCPW0;
  580. __IO uint32_t MCPW1;
  581. __IO uint32_t MCPW2;
  582. __IO uint32_t MCDEADTIME;
  583. __IO uint32_t MCCCP;
  584. __IO uint32_t MCCR0;
  585. __IO uint32_t MCCR1;
  586. __IO uint32_t MCCR2;
  587. __I uint32_t MCINTEN;
  588. __O uint32_t MCINTEN_SET;
  589. __O uint32_t MCINTEN_CLR;
  590. __I uint32_t MCCNTCON;
  591. __O uint32_t MCCNTCON_SET;
  592. __O uint32_t MCCNTCON_CLR;
  593. __I uint32_t MCINTFLAG;
  594. __O uint32_t MCINTFLAG_SET;
  595. __O uint32_t MCINTFLAG_CLR;
  596. __O uint32_t MCCAP_CLR;
  597. } LPC_MCPWM_TypeDef;
  598. /*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
  599. typedef struct
  600. {
  601. __O uint32_t QEICON;
  602. __I uint32_t QEISTAT;
  603. __IO uint32_t QEICONF;
  604. __I uint32_t QEIPOS;
  605. __IO uint32_t QEIMAXPOS;
  606. __IO uint32_t CMPOS0;
  607. __IO uint32_t CMPOS1;
  608. __IO uint32_t CMPOS2;
  609. __I uint32_t INXCNT;
  610. __IO uint32_t INXCMP;
  611. __IO uint32_t QEILOAD;
  612. __I uint32_t QEITIME;
  613. __I uint32_t QEIVEL;
  614. __I uint32_t QEICAP;
  615. __IO uint32_t VELCOMP;
  616. __IO uint32_t FILTER;
  617. uint32_t RESERVED0[998];
  618. __O uint32_t QEIIEC;
  619. __O uint32_t QEIIES;
  620. __I uint32_t QEIINTSTAT;
  621. __I uint32_t QEIIE;
  622. __O uint32_t QEICLR;
  623. __O uint32_t QEISET;
  624. } LPC_QEI_TypeDef;
  625. /*------------- Controller Area Network (CAN) --------------------------------*/
  626. typedef struct
  627. {
  628. __IO uint32_t mask[512]; /* ID Masks */
  629. } LPC_CANAF_RAM_TypeDef;
  630. typedef struct /* Acceptance Filter Registers */
  631. {
  632. __IO uint32_t AFMR;
  633. __IO uint32_t SFF_sa;
  634. __IO uint32_t SFF_GRP_sa;
  635. __IO uint32_t EFF_sa;
  636. __IO uint32_t EFF_GRP_sa;
  637. __IO uint32_t ENDofTable;
  638. __I uint32_t LUTerrAd;
  639. __I uint32_t LUTerr;
  640. __IO uint32_t FCANIE;
  641. __IO uint32_t FCANIC0;
  642. __IO uint32_t FCANIC1;
  643. } LPC_CANAF_TypeDef;
  644. typedef struct /* Central Registers */
  645. {
  646. __I uint32_t CANTxSR;
  647. __I uint32_t CANRxSR;
  648. __I uint32_t CANMSR;
  649. } LPC_CANCR_TypeDef;
  650. typedef struct /* Controller Registers */
  651. {
  652. __IO uint32_t MOD;
  653. __O uint32_t CMR;
  654. __IO uint32_t GSR;
  655. __I uint32_t ICR;
  656. __IO uint32_t IER;
  657. __IO uint32_t BTR;
  658. __IO uint32_t EWL;
  659. __I uint32_t SR;
  660. __IO uint32_t RFS;
  661. __IO uint32_t RID;
  662. __IO uint32_t RDA;
  663. __IO uint32_t RDB;
  664. __IO uint32_t TFI1;
  665. __IO uint32_t TID1;
  666. __IO uint32_t TDA1;
  667. __IO uint32_t TDB1;
  668. __IO uint32_t TFI2;
  669. __IO uint32_t TID2;
  670. __IO uint32_t TDA2;
  671. __IO uint32_t TDB2;
  672. __IO uint32_t TFI3;
  673. __IO uint32_t TID3;
  674. __IO uint32_t TDA3;
  675. __IO uint32_t TDB3;
  676. } LPC_CAN_TypeDef;
  677. /*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
  678. typedef struct /* Common Registers */
  679. {
  680. __I uint32_t DMACIntStat;
  681. __I uint32_t DMACIntTCStat;
  682. __O uint32_t DMACIntTCClear;
  683. __I uint32_t DMACIntErrStat;
  684. __O uint32_t DMACIntErrClr;
  685. __I uint32_t DMACRawIntTCStat;
  686. __I uint32_t DMACRawIntErrStat;
  687. __I uint32_t DMACEnbldChns;
  688. __IO uint32_t DMACSoftBReq;
  689. __IO uint32_t DMACSoftSReq;
  690. __IO uint32_t DMACSoftLBReq;
  691. __IO uint32_t DMACSoftLSReq;
  692. __IO uint32_t DMACConfig;
  693. __IO uint32_t DMACSync;
  694. } LPC_GPDMA_TypeDef;
  695. typedef struct /* Channel Registers */
  696. {
  697. __IO uint32_t DMACCSrcAddr;
  698. __IO uint32_t DMACCDestAddr;
  699. __IO uint32_t DMACCLLI;
  700. __IO uint32_t DMACCControl;
  701. __IO uint32_t DMACCConfig;
  702. } LPC_GPDMACH_TypeDef;
  703. /*------------- Universal Serial Bus (USB) -----------------------------------*/
  704. typedef struct
  705. {
  706. __I uint32_t HcRevision; /* USB Host Registers */
  707. __IO uint32_t HcControl;
  708. __IO uint32_t HcCommandStatus;
  709. __IO uint32_t HcInterruptStatus;
  710. __IO uint32_t HcInterruptEnable;
  711. __IO uint32_t HcInterruptDisable;
  712. __IO uint32_t HcHCCA;
  713. __I uint32_t HcPeriodCurrentED;
  714. __IO uint32_t HcControlHeadED;
  715. __IO uint32_t HcControlCurrentED;
  716. __IO uint32_t HcBulkHeadED;
  717. __IO uint32_t HcBulkCurrentED;
  718. __I uint32_t HcDoneHead;
  719. __IO uint32_t HcFmInterval;
  720. __I uint32_t HcFmRemaining;
  721. __I uint32_t HcFmNumber;
  722. __IO uint32_t HcPeriodicStart;
  723. __IO uint32_t HcLSTreshold;
  724. __IO uint32_t HcRhDescriptorA;
  725. __IO uint32_t HcRhDescriptorB;
  726. __IO uint32_t HcRhStatus;
  727. __IO uint32_t HcRhPortStatus1;
  728. __IO uint32_t HcRhPortStatus2;
  729. uint32_t RESERVED0[40];
  730. __I uint32_t Module_ID;
  731. __I uint32_t OTGIntSt; /* USB On-The-Go Registers */
  732. __IO uint32_t OTGIntEn;
  733. __O uint32_t OTGIntSet;
  734. __O uint32_t OTGIntClr;
  735. __IO uint32_t OTGStCtrl;
  736. __IO uint32_t OTGTmr;
  737. uint32_t RESERVED1[58];
  738. __I uint32_t USBDevIntSt; /* USB Device Interrupt Registers */
  739. __IO uint32_t USBDevIntEn;
  740. __O uint32_t USBDevIntClr;
  741. __O uint32_t USBDevIntSet;
  742. __O uint32_t USBCmdCode; /* USB Device SIE Command Registers */
  743. __I uint32_t USBCmdData;
  744. __I uint32_t USBRxData; /* USB Device Transfer Registers */
  745. __O uint32_t USBTxData;
  746. __I uint32_t USBRxPLen;
  747. __O uint32_t USBTxPLen;
  748. __IO uint32_t USBCtrl;
  749. __O uint32_t USBDevIntPri;
  750. __I uint32_t USBEpIntSt; /* USB Device Endpoint Interrupt Regs */
  751. __IO uint32_t USBEpIntEn;
  752. __O uint32_t USBEpIntClr;
  753. __O uint32_t USBEpIntSet;
  754. __O uint32_t USBEpIntPri;
  755. __IO uint32_t USBReEp; /* USB Device Endpoint Realization Reg*/
  756. __O uint32_t USBEpInd;
  757. __IO uint32_t USBMaxPSize;
  758. __I uint32_t USBDMARSt; /* USB Device DMA Registers */
  759. __O uint32_t USBDMARClr;
  760. __O uint32_t USBDMARSet;
  761. uint32_t RESERVED2[9];
  762. __IO uint32_t USBUDCAH;
  763. __I uint32_t USBEpDMASt;
  764. __O uint32_t USBEpDMAEn;
  765. __O uint32_t USBEpDMADis;
  766. __I uint32_t USBDMAIntSt;
  767. __IO uint32_t USBDMAIntEn;
  768. uint32_t RESERVED3[2];
  769. __I uint32_t USBEoTIntSt;
  770. __O uint32_t USBEoTIntClr;
  771. __O uint32_t USBEoTIntSet;
  772. __I uint32_t USBNDDRIntSt;
  773. __O uint32_t USBNDDRIntClr;
  774. __O uint32_t USBNDDRIntSet;
  775. __I uint32_t USBSysErrIntSt;
  776. __O uint32_t USBSysErrIntClr;
  777. __O uint32_t USBSysErrIntSet;
  778. uint32_t RESERVED4[15];
  779. __I uint32_t I2C_RX; /* USB OTG I2C Registers */
  780. __O uint32_t I2C_WO;
  781. __I uint32_t I2C_STS;
  782. __IO uint32_t I2C_CTL;
  783. __IO uint32_t I2C_CLKHI;
  784. __O uint32_t I2C_CLKLO;
  785. uint32_t RESERVED5[823];
  786. union {
  787. __IO uint32_t USBClkCtrl; /* USB Clock Control Registers */
  788. __IO uint32_t OTGClkCtrl;
  789. };
  790. union {
  791. __I uint32_t USBClkSt;
  792. __I uint32_t OTGClkSt;
  793. };
  794. } LPC_USB_TypeDef;
  795. /*------------- Ethernet Media Access Controller (EMAC) ----------------------*/
  796. typedef struct
  797. {
  798. __IO uint32_t MAC1; /* MAC Registers */
  799. __IO uint32_t MAC2;
  800. __IO uint32_t IPGT;
  801. __IO uint32_t IPGR;
  802. __IO uint32_t CLRT;
  803. __IO uint32_t MAXF;
  804. __IO uint32_t SUPP;
  805. __IO uint32_t TEST;
  806. __IO uint32_t MCFG;
  807. __IO uint32_t MCMD;
  808. __IO uint32_t MADR;
  809. __O uint32_t MWTD;
  810. __I uint32_t MRDD;
  811. __I uint32_t MIND;
  812. uint32_t RESERVED0[2];
  813. __IO uint32_t SA0;
  814. __IO uint32_t SA1;
  815. __IO uint32_t SA2;
  816. uint32_t RESERVED1[45];
  817. __IO uint32_t Command; /* Control Registers */
  818. __I uint32_t Status;
  819. __IO uint32_t RxDescriptor;
  820. __IO uint32_t RxStatus;
  821. __IO uint32_t RxDescriptorNumber;
  822. __I uint32_t RxProduceIndex;
  823. __IO uint32_t RxConsumeIndex;
  824. __IO uint32_t TxDescriptor;
  825. __IO uint32_t TxStatus;
  826. __IO uint32_t TxDescriptorNumber;
  827. __IO uint32_t TxProduceIndex;
  828. __I uint32_t TxConsumeIndex;
  829. uint32_t RESERVED2[10];
  830. __I uint32_t TSV0;
  831. __I uint32_t TSV1;
  832. __I uint32_t RSV;
  833. uint32_t RESERVED3[3];
  834. __IO uint32_t FlowControlCounter;
  835. __I uint32_t FlowControlStatus;
  836. uint32_t RESERVED4[34];
  837. __IO uint32_t RxFilterCtrl; /* Rx Filter Registers */
  838. __IO uint32_t RxFilterWoLStatus;
  839. __IO uint32_t RxFilterWoLClear;
  840. uint32_t RESERVED5;
  841. __IO uint32_t HashFilterL;
  842. __IO uint32_t HashFilterH;
  843. uint32_t RESERVED6[882];
  844. __I uint32_t IntStatus; /* Module Control Registers */
  845. __IO uint32_t IntEnable;
  846. __O uint32_t IntClear;
  847. __O uint32_t IntSet;
  848. uint32_t RESERVED7;
  849. __IO uint32_t PowerDown;
  850. uint32_t RESERVED8;
  851. __IO uint32_t Module_ID;
  852. } LPC_EMAC_TypeDef;
  853. #if defined ( __CC_ARM )
  854. #pragma no_anon_unions
  855. #endif
  856. /******************************************************************************/
  857. /* Peripheral memory map */
  858. /******************************************************************************/
  859. /* Base addresses */
  860. #define LPC_FLASH_BASE (0x00000000UL)
  861. #define LPC_RAM_BASE (0x10000000UL)
  862. #define LPC_GPIO_BASE (0x2009C000UL)
  863. #define LPC_APB0_BASE (0x40000000UL)
  864. #define LPC_APB1_BASE (0x40080000UL)
  865. #define LPC_AHB_BASE (0x50000000UL)
  866. #define LPC_CM3_BASE (0xE0000000UL)
  867. /* APB0 peripherals */
  868. #define LPC_WDT_BASE (LPC_APB0_BASE + 0x00000)
  869. #define LPC_TIM0_BASE (LPC_APB0_BASE + 0x04000)
  870. #define LPC_TIM1_BASE (LPC_APB0_BASE + 0x08000)
  871. #define LPC_UART0_BASE (LPC_APB0_BASE + 0x0C000)
  872. #define LPC_UART1_BASE (LPC_APB0_BASE + 0x10000)
  873. #define LPC_PWM1_BASE (LPC_APB0_BASE + 0x18000)
  874. #define LPC_I2C0_BASE (LPC_APB0_BASE + 0x1C000)
  875. #define LPC_SPI_BASE (LPC_APB0_BASE + 0x20000)
  876. #define LPC_RTC_BASE (LPC_APB0_BASE + 0x24000)
  877. #define LPC_GPIOINT_BASE (LPC_APB0_BASE + 0x28080)
  878. #define LPC_PINCON_BASE (LPC_APB0_BASE + 0x2C000)
  879. #define LPC_SSP1_BASE (LPC_APB0_BASE + 0x30000)
  880. #define LPC_ADC_BASE (LPC_APB0_BASE + 0x34000)
  881. #define LPC_CANAF_RAM_BASE (LPC_APB0_BASE + 0x38000)
  882. #define LPC_CANAF_BASE (LPC_APB0_BASE + 0x3C000)
  883. #define LPC_CANCR_BASE (LPC_APB0_BASE + 0x40000)
  884. #define LPC_CAN1_BASE (LPC_APB0_BASE + 0x44000)
  885. #define LPC_CAN2_BASE (LPC_APB0_BASE + 0x48000)
  886. #define LPC_I2C1_BASE (LPC_APB0_BASE + 0x5C000)
  887. /* APB1 peripherals */
  888. #define LPC_SSP0_BASE (LPC_APB1_BASE + 0x08000)
  889. #define LPC_DAC_BASE (LPC_APB1_BASE + 0x0C000)
  890. #define LPC_TIM2_BASE (LPC_APB1_BASE + 0x10000)
  891. #define LPC_TIM3_BASE (LPC_APB1_BASE + 0x14000)
  892. #define LPC_UART2_BASE (LPC_APB1_BASE + 0x18000)
  893. #define LPC_UART3_BASE (LPC_APB1_BASE + 0x1C000)
  894. #define LPC_I2C2_BASE (LPC_APB1_BASE + 0x20000)
  895. #define LPC_I2S_BASE (LPC_APB1_BASE + 0x28000)
  896. #define LPC_RIT_BASE (LPC_APB1_BASE + 0x30000)
  897. #define LPC_MCPWM_BASE (LPC_APB1_BASE + 0x38000)
  898. #define LPC_QEI_BASE (LPC_APB1_BASE + 0x3C000)
  899. #define LPC_SC_BASE (LPC_APB1_BASE + 0x7C000)
  900. /* AHB peripherals */
  901. #define LPC_EMAC_BASE (LPC_AHB_BASE + 0x00000)
  902. #define LPC_GPDMA_BASE (LPC_AHB_BASE + 0x04000)
  903. #define LPC_GPDMACH0_BASE (LPC_AHB_BASE + 0x04100)
  904. #define LPC_GPDMACH1_BASE (LPC_AHB_BASE + 0x04120)
  905. #define LPC_GPDMACH2_BASE (LPC_AHB_BASE + 0x04140)
  906. #define LPC_GPDMACH3_BASE (LPC_AHB_BASE + 0x04160)
  907. #define LPC_GPDMACH4_BASE (LPC_AHB_BASE + 0x04180)
  908. #define LPC_GPDMACH5_BASE (LPC_AHB_BASE + 0x041A0)
  909. #define LPC_GPDMACH6_BASE (LPC_AHB_BASE + 0x041C0)
  910. #define LPC_GPDMACH7_BASE (LPC_AHB_BASE + 0x041E0)
  911. #define LPC_USB_BASE (LPC_AHB_BASE + 0x0C000)
  912. /* GPIOs */
  913. #define LPC_GPIO0_BASE (LPC_GPIO_BASE + 0x00000)
  914. #define LPC_GPIO1_BASE (LPC_GPIO_BASE + 0x00020)
  915. #define LPC_GPIO2_BASE (LPC_GPIO_BASE + 0x00040)
  916. #define LPC_GPIO3_BASE (LPC_GPIO_BASE + 0x00060)
  917. #define LPC_GPIO4_BASE (LPC_GPIO_BASE + 0x00080)
  918. /******************************************************************************/
  919. /* Peripheral declaration */
  920. /******************************************************************************/
  921. #define LPC_SC ((LPC_SC_TypeDef *) LPC_SC_BASE )
  922. #define LPC_GPIO0 ((LPC_GPIO_TypeDef *) LPC_GPIO0_BASE )
  923. #define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
  924. #define LPC_GPIO2 ((LPC_GPIO_TypeDef *) LPC_GPIO2_BASE )
  925. #define LPC_GPIO3 ((LPC_GPIO_TypeDef *) LPC_GPIO3_BASE )
  926. #define LPC_GPIO4 ((LPC_GPIO_TypeDef *) LPC_GPIO4_BASE )
  927. #define LPC_WDT ((LPC_WDT_TypeDef *) LPC_WDT_BASE )
  928. #define LPC_TIM0 ((LPC_TIM_TypeDef *) LPC_TIM0_BASE )
  929. #define LPC_TIM1 ((LPC_TIM_TypeDef *) LPC_TIM1_BASE )
  930. #define LPC_TIM2 ((LPC_TIM_TypeDef *) LPC_TIM2_BASE )
  931. #define LPC_TIM3 ((LPC_TIM_TypeDef *) LPC_TIM3_BASE )
  932. #define LPC_RIT ((LPC_RIT_TypeDef *) LPC_RIT_BASE )
  933. #define LPC_UART0 ((LPC_UART0_TypeDef *) LPC_UART0_BASE )
  934. #define LPC_UART1 ((LPC_UART1_TypeDef *) LPC_UART1_BASE )
  935. #define LPC_UART2 ((LPC_UART_TypeDef *) LPC_UART2_BASE )
  936. #define LPC_UART3 ((LPC_UART_TypeDef *) LPC_UART3_BASE )
  937. #define LPC_PWM1 ((LPC_PWM_TypeDef *) LPC_PWM1_BASE )
  938. #define LPC_I2C0 ((LPC_I2C_TypeDef *) LPC_I2C0_BASE )
  939. #define LPC_I2C1 ((LPC_I2C_TypeDef *) LPC_I2C1_BASE )
  940. #define LPC_I2C2 ((LPC_I2C_TypeDef *) LPC_I2C2_BASE )
  941. #define LPC_I2S ((LPC_I2S_TypeDef *) LPC_I2S_BASE )
  942. #define LPC_SPI ((LPC_SPI_TypeDef *) LPC_SPI_BASE )
  943. #define LPC_RTC ((LPC_RTC_TypeDef *) LPC_RTC_BASE )
  944. #define LPC_GPIOINT ((LPC_GPIOINT_TypeDef *) LPC_GPIOINT_BASE )
  945. #define LPC_PINCON ((LPC_PINCON_TypeDef *) LPC_PINCON_BASE )
  946. #define LPC_SSP0 ((LPC_SSP_TypeDef *) LPC_SSP0_BASE )
  947. #define LPC_SSP1 ((LPC_SSP_TypeDef *) LPC_SSP1_BASE )
  948. #define LPC_ADC ((LPC_ADC_TypeDef *) LPC_ADC_BASE )
  949. #define LPC_DAC ((LPC_DAC_TypeDef *) LPC_DAC_BASE )
  950. #define LPC_CANAF_RAM ((LPC_CANAF_RAM_TypeDef *) LPC_CANAF_RAM_BASE)
  951. #define LPC_CANAF ((LPC_CANAF_TypeDef *) LPC_CANAF_BASE )
  952. #define LPC_CANCR ((LPC_CANCR_TypeDef *) LPC_CANCR_BASE )
  953. #define LPC_CAN1 ((LPC_CAN_TypeDef *) LPC_CAN1_BASE )
  954. #define LPC_CAN2 ((LPC_CAN_TypeDef *) LPC_CAN2_BASE )
  955. #define LPC_MCPWM ((LPC_MCPWM_TypeDef *) LPC_MCPWM_BASE )
  956. #define LPC_QEI ((LPC_QEI_TypeDef *) LPC_QEI_BASE )
  957. #define LPC_EMAC ((LPC_EMAC_TypeDef *) LPC_EMAC_BASE )
  958. #define LPC_GPDMA ((LPC_GPDMA_TypeDef *) LPC_GPDMA_BASE )
  959. #define LPC_GPDMACH0 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH0_BASE )
  960. #define LPC_GPDMACH1 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH1_BASE )
  961. #define LPC_GPDMACH2 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH2_BASE )
  962. #define LPC_GPDMACH3 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH3_BASE )
  963. #define LPC_GPDMACH4 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH4_BASE )
  964. #define LPC_GPDMACH5 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH5_BASE )
  965. #define LPC_GPDMACH6 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH6_BASE )
  966. #define LPC_GPDMACH7 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH7_BASE )
  967. #define LPC_USB ((LPC_USB_TypeDef *) LPC_USB_BASE )
  968. #endif // __LPC17xx_H__