lpc176x.h 34 KB

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