lpc407x_8x.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499
  1. /****************************************************************************************************//**
  2. * $Id: LPC407x_8x.h 57747 2012-10-09 18:24:45Z anderslu $ LPC407x_8x.h 2012-04-25
  3. *//**
  4. * @file LPC407x_8x.h
  5. *
  6. * @brief CMSIS Cortex-M4 Peripheral Access Layer Header File for
  7. * NXP LPC407x_8x.
  8. * @version V0.6
  9. * @date 30. May 2012
  10. * @author NXP MCU SW Application Team
  11. *
  12. * Copyright(C) 2012, NXP Semiconductor
  13. * All rights reserved.
  14. *
  15. ***********************************************************************
  16. * Software that is described herein is for illustrative purposes only
  17. * which provides customers with programming information regarding the
  18. * products. This software is supplied "AS IS" without any warranties.
  19. * NXP Semiconductors assumes no responsibility or liability for the
  20. * use of the software, conveys no license or title under any patent,
  21. * copyright, or mask work right to the product. NXP Semiconductors
  22. * reserves the right to make changes in the software without
  23. * notification. NXP Semiconductors also make no representation or
  24. * warranty that such application will be suitable for the specified
  25. * use without further testing or modification.
  26. * Permission to use, copy, modify, and distribute this software and its
  27. * documentation is hereby granted, under NXP Semiconductors'
  28. * relevant copyright in the software, without fee, provided that it
  29. * is used in conjunction with NXP Semiconductors microcontrollers. This
  30. * copyright, permission, and disclaimer notice must appear in all copies of
  31. * this code.
  32. **********************************************************************/
  33. #ifndef __LPC407x_8x_H__
  34. #define __LPC407x_8x_H__
  35. /* ------------------------- Interrupt Number Definition ------------------------ */
  36. typedef enum IRQn
  37. {
  38. /****** Cortex-M4 Processor Exceptions Numbers ***************************************************/
  39. Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset */
  40. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  41. HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault */
  42. MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
  43. BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
  44. UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
  45. SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
  46. DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
  47. PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
  48. SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
  49. /****** LPC407x_8x Specific Interrupt Numbers *******************************************************/
  50. WDT_IRQn = 0, /*!< Watchdog Timer Interrupt */
  51. TIMER0_IRQn = 1, /*!< Timer0 Interrupt */
  52. TIMER1_IRQn = 2, /*!< Timer1 Interrupt */
  53. TIMER2_IRQn = 3, /*!< Timer2 Interrupt */
  54. TIMER3_IRQn = 4, /*!< Timer3 Interrupt */
  55. UART0_IRQn = 5, /*!< UART0 Interrupt */
  56. UART1_IRQn = 6, /*!< UART1 Interrupt */
  57. UART2_IRQn = 7, /*!< UART2 Interrupt */
  58. UART3_IRQn = 8, /*!< UART3 Interrupt */
  59. PWM1_IRQn = 9, /*!< PWM1 Interrupt */
  60. I2C0_IRQn = 10, /*!< I2C0 Interrupt */
  61. I2C1_IRQn = 11, /*!< I2C1 Interrupt */
  62. I2C2_IRQn = 12, /*!< I2C2 Interrupt */
  63. Reserved0_IRQn = 13, /*!< Reserved */
  64. SSP0_IRQn = 14, /*!< SSP0 Interrupt */
  65. SSP1_IRQn = 15, /*!< SSP1 Interrupt */
  66. PLL0_IRQn = 16, /*!< PLL0 Lock (Main PLL) Interrupt */
  67. RTC_IRQn = 17, /*!< Real Time Clock Interrupt */
  68. EINT0_IRQn = 18, /*!< External Interrupt 0 Interrupt */
  69. EINT1_IRQn = 19, /*!< External Interrupt 1 Interrupt */
  70. EINT2_IRQn = 20, /*!< External Interrupt 2 Interrupt */
  71. EINT3_IRQn = 21, /*!< External Interrupt 3 Interrupt */
  72. ADC_IRQn = 22, /*!< A/D Converter Interrupt */
  73. BOD_IRQn = 23, /*!< Brown-Out Detect Interrupt */
  74. USB_IRQn = 24, /*!< USB Interrupt */
  75. CAN_IRQn = 25, /*!< CAN Interrupt */
  76. DMA_IRQn = 26, /*!< General Purpose DMA Interrupt */
  77. I2S_IRQn = 27, /*!< I2S Interrupt */
  78. ENET_IRQn = 28, /*!< Ethernet Interrupt */
  79. MCI_IRQn = 29, /*!< SD/MMC card I/F Interrupt */
  80. MCPWM_IRQn = 30, /*!< Motor Control PWM Interrupt */
  81. QEI_IRQn = 31, /*!< Quadrature Encoder Interface Interrupt */
  82. PLL1_IRQn = 32, /*!< PLL1 Lock (USB PLL) Interrupt */
  83. USBActivity_IRQn = 33, /*!< USB Activity interrupt */
  84. CANActivity_IRQn = 34, /*!< CAN Activity interrupt */
  85. UART4_IRQn = 35, /*!< UART4 Interrupt */
  86. SSP2_IRQn = 36, /*!< SSP2 Interrupt */
  87. LCD_IRQn = 37, /*!< LCD Interrupt */
  88. GPIO_IRQn = 38, /*!< GPIO Interrupt */
  89. PWM0_IRQn = 39, /*!< 39 PWM0 */
  90. EEPROM_IRQn = 40, /*!< 40 EEPROM */
  91. CMP0_IRQn = 41, /*!< 41 CMP0 */
  92. CMP1_IRQn = 42, /*!< 42 CMP1 */
  93. IRQn_MAX /*!< Total number of interrupts */
  94. } IRQn_Type;
  95. /* ================================================================================ */
  96. /* ================ Processor and Core Peripheral Section ================ */
  97. /* ================================================================================ */
  98. /* ----------------Configuration of the cm4 Processor and Core Peripherals---------------- */
  99. #define __CM4_REV 0x0000 /*!< Cortex-M4 Core Revision */
  100. #define __MPU_PRESENT 1 /*!< MPU present or not */
  101. #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */
  102. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  103. #define __FPU_PRESENT 1 /*!< FPU present or not */
  104. #include <arch/cm3/core_cm4.h> /* Cortex-M3 processor and core peripherals */
  105. #include "system_lpc407x_8x.h" /* System Header */
  106. /* ================================================================================ */
  107. /* ================ Device Specific Peripheral Section ================ */
  108. /* ================================================================================ */
  109. #if defined ( __CC_ARM )
  110. #pragma anon_unions
  111. #endif
  112. /*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
  113. typedef struct /* Common Registers */
  114. {
  115. __I uint32_t IntStat;
  116. __I uint32_t IntTCStat;
  117. __O uint32_t IntTCClear;
  118. __I uint32_t IntErrStat;
  119. __O uint32_t IntErrClr;
  120. __I uint32_t RawIntTCStat;
  121. __I uint32_t RawIntErrStat;
  122. __I uint32_t EnbldChns;
  123. __IO uint32_t SoftBReq;
  124. __IO uint32_t SoftSReq;
  125. __IO uint32_t SoftLBReq;
  126. __IO uint32_t SoftLSReq;
  127. __IO uint32_t Config;
  128. __IO uint32_t Sync;
  129. } LPC_GPDMA_TypeDef;
  130. typedef struct /* Channel Registers */
  131. {
  132. __IO uint32_t CSrcAddr;
  133. __IO uint32_t CDestAddr;
  134. __IO uint32_t CLLI;
  135. __IO uint32_t CControl;
  136. __IO uint32_t CConfig;
  137. } LPC_GPDMACH_TypeDef;
  138. /*------------- System Control (SC) ------------------------------------------*/
  139. typedef struct
  140. {
  141. __IO uint32_t FLASHCFG; /*!< Offset: 0x000 (R/W) Flash Accelerator Configuration Register */
  142. uint32_t RESERVED0[31];
  143. __IO uint32_t PLL0CON; /*!< Offset: 0x080 (R/W) PLL0 Control Register */
  144. __IO uint32_t PLL0CFG; /*!< Offset: 0x084 (R/W) PLL0 Configuration Register */
  145. __I uint32_t PLL0STAT; /*!< Offset: 0x088 (R/ ) PLL0 Status Register */
  146. __O uint32_t PLL0FEED; /*!< Offset: 0x08C ( /W) PLL0 Feed Register */
  147. uint32_t RESERVED1[4];
  148. __IO uint32_t PLL1CON; /*!< Offset: 0x0A0 (R/W) PLL1 Control Register */
  149. __IO uint32_t PLL1CFG; /*!< Offset: 0x0A4 (R/W) PLL1 Configuration Register */
  150. __I uint32_t PLL1STAT; /*!< Offset: 0x0A8 (R/ ) PLL1 Status Register */
  151. __O uint32_t PLL1FEED; /*!< Offset: 0x0AC ( /W) PLL1 Feed Register */
  152. uint32_t RESERVED2[4];
  153. __IO uint32_t PCON; /*!< Offset: 0x0C0 (R/W) Power Control Register */
  154. __IO uint32_t PCONP; /*!< Offset: 0x0C4 (R/W) Power Control for Peripherals Register */
  155. __IO uint32_t PCONP1; /*!< Offset: 0x0C8 (R/W) Power Control for Peripherals Register */
  156. uint32_t RESERVED3[13];
  157. __IO uint32_t EMCCLKSEL; /*!< Offset: 0x100 (R/W) External Memory Controller Clock Selection Register */
  158. __IO uint32_t CCLKSEL; /*!< Offset: 0x104 (R/W) CPU Clock Selection Register */
  159. __IO uint32_t USBCLKSEL; /*!< Offset: 0x108 (R/W) USB Clock Selection Register */
  160. __IO uint32_t CLKSRCSEL; /*!< Offset: 0x10C (R/W) Clock Source Select Register */
  161. __IO uint32_t CANSLEEPCLR; /*!< Offset: 0x110 (R/W) CAN Sleep Clear Register */
  162. __IO uint32_t CANWAKEFLAGS; /*!< Offset: 0x114 (R/W) CAN Wake-up Flags Register */
  163. uint32_t RESERVED4[10];
  164. __IO uint32_t EXTINT; /*!< Offset: 0x140 (R/W) External Interrupt Flag Register */
  165. uint32_t RESERVED5[1];
  166. __IO uint32_t EXTMODE; /*!< Offset: 0x148 (R/W) External Interrupt Mode Register */
  167. __IO uint32_t EXTPOLAR; /*!< Offset: 0x14C (R/W) External Interrupt Polarity Register */
  168. uint32_t RESERVED6[12];
  169. __IO uint32_t RSID; /*!< Offset: 0x180 (R/W) Reset Source Identification Register */
  170. uint32_t RESERVED7[7];
  171. __IO uint32_t SCS; /*!< Offset: 0x1A0 (R/W) System Controls and Status Register */
  172. __IO uint32_t IRCTRIM; /*!< Offset: 0x1A4 (R/W) Clock Dividers */
  173. __IO uint32_t PCLKSEL; /*!< Offset: 0x1A8 (R/W) Peripheral Clock Selection Register */
  174. uint32_t RESERVED8;
  175. __IO uint32_t PBOOST; /*!< Offset: 0x1B0 (R/W) Power Boost control register */
  176. __IO uint32_t SPIFICLKSEL;
  177. __IO uint32_t LCD_CFG; /*!< Offset: 0x1B8 (R/W) LCD Configuration and clocking control Register */
  178. uint32_t RESERVED10[1];
  179. __IO uint32_t USBIntSt; /*!< Offset: 0x1C0 (R/W) USB Interrupt Status Register */
  180. __IO uint32_t DMAREQSEL; /*!< Offset: 0x1C4 (R/W) DMA Request Select Register */
  181. __IO uint32_t CLKOUTCFG; /*!< Offset: 0x1C8 (R/W) Clock Output Configuration Register */
  182. __IO uint32_t RSTCON0; /*!< Offset: 0x1CC (R/W) RESET Control0 Register */
  183. __IO uint32_t RSTCON1; /*!< Offset: 0x1D0 (R/W) RESET Control1 Register */
  184. uint32_t RESERVED11[2];
  185. __IO uint32_t EMCDLYCTL; /*!< Offset: 0x1DC (R/W) SDRAM programmable delays */
  186. __IO uint32_t EMCCAL; /*!< Offset: 0x1E0 (R/W) Calibration of programmable delays */
  187. } LPC_SC_TypeDef;
  188. /*------------- Ethernet Media Access Controller (EMAC) ----------------------*/
  189. typedef struct
  190. {
  191. __IO uint32_t MAC1; /* MAC Registers */
  192. __IO uint32_t MAC2;
  193. __IO uint32_t IPGT;
  194. __IO uint32_t IPGR;
  195. __IO uint32_t CLRT;
  196. __IO uint32_t MAXF;
  197. __IO uint32_t SUPP;
  198. __IO uint32_t TEST;
  199. __IO uint32_t MCFG;
  200. __IO uint32_t MCMD;
  201. __IO uint32_t MADR;
  202. __O uint32_t MWTD;
  203. __I uint32_t MRDD;
  204. __I uint32_t MIND;
  205. uint32_t RESERVED0[2];
  206. __IO uint32_t SA0;
  207. __IO uint32_t SA1;
  208. __IO uint32_t SA2;
  209. uint32_t RESERVED1[45];
  210. __IO uint32_t Command; /* Control Registers */
  211. __I uint32_t Status;
  212. __IO uint32_t RxDescriptor;
  213. __IO uint32_t RxStatus;
  214. __IO uint32_t RxDescriptorNumber;
  215. __I uint32_t RxProduceIndex;
  216. __IO uint32_t RxConsumeIndex;
  217. __IO uint32_t TxDescriptor;
  218. __IO uint32_t TxStatus;
  219. __IO uint32_t TxDescriptorNumber;
  220. __IO uint32_t TxProduceIndex;
  221. __I uint32_t TxConsumeIndex;
  222. uint32_t RESERVED2[10];
  223. __I uint32_t TSV0;
  224. __I uint32_t TSV1;
  225. __I uint32_t RSV;
  226. uint32_t RESERVED3[3];
  227. __IO uint32_t FlowControlCounter;
  228. __I uint32_t FlowControlStatus;
  229. uint32_t RESERVED4[34];
  230. __IO uint32_t RxFilterCtrl; /* Rx Filter Registers */
  231. __I uint32_t RxFilterWoLStatus;
  232. __O uint32_t RxFilterWoLClear;
  233. uint32_t RESERVED5;
  234. __IO uint32_t HashFilterL;
  235. __IO uint32_t HashFilterH;
  236. uint32_t RESERVED6[882];
  237. __I uint32_t IntStatus; /* Module Control Registers */
  238. __IO uint32_t IntEnable;
  239. __O uint32_t IntClear;
  240. __O uint32_t IntSet;
  241. uint32_t RESERVED7;
  242. __IO uint32_t PowerDown;
  243. uint32_t RESERVED8;
  244. __IO uint32_t Module_ID;
  245. } LPC_EMAC_TypeDef;
  246. /*------------- LCD controller (LCD) -----------------------------------------*/
  247. typedef struct
  248. {
  249. __IO uint32_t TIMH; /* LCD Registers */
  250. __IO uint32_t TIMV;
  251. __IO uint32_t POL;
  252. __IO uint32_t LE;
  253. __IO uint32_t UPBASE;
  254. __IO uint32_t LPBASE;
  255. __IO uint32_t CTRL;
  256. __IO uint32_t INTMSK;
  257. __I uint32_t INTRAW;
  258. __I uint32_t INTSTAT;
  259. __O uint32_t INTCLR;
  260. __I uint32_t UPCURR;
  261. __I uint32_t LPCURR;
  262. uint32_t RESERVED0[115];
  263. __IO uint32_t PAL[128];
  264. uint32_t RESERVED1[256];
  265. __IO uint32_t CRSR_IMG[256];
  266. __IO uint32_t CRSR_CTRL;
  267. __IO uint32_t CRSR_CFG;
  268. __IO uint32_t CRSR_PAL0;
  269. __IO uint32_t CRSR_PAL1;
  270. __IO uint32_t CRSR_XY;
  271. __IO uint32_t CRSR_CLIP;
  272. uint32_t RESERVED2[2];
  273. __IO uint32_t CRSR_INTMSK;
  274. __O uint32_t CRSR_INTCLR;
  275. __I uint32_t CRSR_INTRAW;
  276. __I uint32_t CRSR_INTSTAT;
  277. } LPC_LCD_TypeDef;
  278. /*------------- Universal Serial Bus (USB) -----------------------------------*/
  279. typedef struct
  280. {
  281. __I uint32_t Revision; /* USB Host Registers */
  282. __IO uint32_t Control;
  283. __IO uint32_t CommandStatus;
  284. __IO uint32_t InterruptStatus;
  285. __IO uint32_t InterruptEnable;
  286. __IO uint32_t InterruptDisable;
  287. __IO uint32_t HCCA;
  288. __I uint32_t PeriodCurrentED;
  289. __IO uint32_t ControlHeadED;
  290. __IO uint32_t ControlCurrentED;
  291. __IO uint32_t BulkHeadED;
  292. __IO uint32_t BulkCurrentED;
  293. __I uint32_t DoneHead;
  294. __IO uint32_t FmInterval;
  295. __I uint32_t FmRemaining;
  296. __I uint32_t FmNumber;
  297. __IO uint32_t PeriodicStart;
  298. __IO uint32_t LSTreshold;
  299. __IO uint32_t RhDescriptorA;
  300. __IO uint32_t RhDescriptorB;
  301. __IO uint32_t RhStatus;
  302. __IO uint32_t RhPortStatus1;
  303. __IO uint32_t RhPortStatus2;
  304. uint32_t RESERVED0[40];
  305. __I uint32_t Module_ID;
  306. __I uint32_t IntSt; /* USB On-The-Go Registers */
  307. __IO uint32_t IntEn;
  308. __O uint32_t IntSet;
  309. __O uint32_t IntClr;
  310. __IO uint32_t StCtrl;
  311. __IO uint32_t Tmr;
  312. uint32_t RESERVED1[58];
  313. __I uint32_t DevIntSt; /* USB Device Interrupt Registers */
  314. __IO uint32_t DevIntEn;
  315. __O uint32_t DevIntClr;
  316. __O uint32_t DevIntSet;
  317. __O uint32_t CmdCode; /* USB Device SIE Command Registers */
  318. __I uint32_t CmdData;
  319. __I uint32_t RxData; /* USB Device Transfer Registers */
  320. __O uint32_t TxData;
  321. __I uint32_t RxPLen;
  322. __O uint32_t TxPLen;
  323. __IO uint32_t Ctrl;
  324. __O uint32_t DevIntPri;
  325. __I uint32_t EpIntSt; /* USB Device Endpoint Interrupt Regs */
  326. __IO uint32_t EpIntEn;
  327. __O uint32_t EpIntClr;
  328. __O uint32_t EpIntSet;
  329. __O uint32_t EpIntPri;
  330. __IO uint32_t ReEp; /* USB Device Endpoint Realization Reg*/
  331. __O uint32_t EpInd;
  332. __IO uint32_t MaxPSize;
  333. __I uint32_t DMARSt; /* USB Device DMA Registers */
  334. __O uint32_t DMARClr;
  335. __O uint32_t DMARSet;
  336. uint32_t RESERVED2[9];
  337. __IO uint32_t UDCAH;
  338. __I uint32_t EpDMASt;
  339. __O uint32_t EpDMAEn;
  340. __O uint32_t EpDMADis;
  341. __I uint32_t DMAIntSt;
  342. __IO uint32_t DMAIntEn;
  343. uint32_t RESERVED3[2];
  344. __I uint32_t EoTIntSt;
  345. __O uint32_t EoTIntClr;
  346. __O uint32_t EoTIntSet;
  347. __I uint32_t NDDRIntSt;
  348. __O uint32_t NDDRIntClr;
  349. __O uint32_t NDDRIntSet;
  350. __I uint32_t SysErrIntSt;
  351. __O uint32_t SysErrIntClr;
  352. __O uint32_t SysErrIntSet;
  353. uint32_t RESERVED4[15];
  354. union {
  355. __I uint32_t I2C_RX; /* USB OTG I2C Registers */
  356. __O uint32_t I2C_TX;
  357. };
  358. __IO uint32_t I2C_STS;
  359. __IO uint32_t I2C_CTL;
  360. __IO uint32_t I2C_CLKHI;
  361. __O uint32_t I2C_CLKLO;
  362. uint32_t RESERVED5[824];
  363. union {
  364. __IO uint32_t USBClkCtrl; /* USB Clock Control Registers */
  365. __IO uint32_t OTGClkCtrl;
  366. };
  367. union {
  368. __I uint32_t USBClkSt;
  369. __I uint32_t OTGClkSt;
  370. };
  371. } LPC_USB_TypeDef;
  372. /*------------- CRC Engine (CRC) -----------------------------------------*/
  373. typedef struct
  374. {
  375. __IO uint32_t MODE;
  376. __IO uint32_t SEED;
  377. union {
  378. __I uint32_t SUM;
  379. struct {
  380. __O uint32_t DATA;
  381. } WR_DATA_DWORD;
  382. struct {
  383. __O uint16_t DATA;
  384. uint16_t RESERVED;
  385. }WR_DATA_WORD;
  386. struct {
  387. __O uint8_t DATA;
  388. uint8_t RESERVED[3];
  389. }WR_DATA_BYTE;
  390. };
  391. } LPC_CRC_TypeDef;
  392. /*------------- General Purpose Input/Output (GPIO) --------------------------*/
  393. typedef struct
  394. {
  395. __IO uint32_t FIODIR;
  396. uint32_t RESERVED0[3];
  397. __IO uint32_t FIOMASK;
  398. __IO uint32_t FIOPIN;
  399. __IO uint32_t FIOSET;
  400. __O uint32_t FIOCLR;
  401. } LPC_GPIO_TypeDef;
  402. typedef struct
  403. {
  404. __I uint32_t IntStatus;
  405. __I uint32_t IO0IntStatR;
  406. __I uint32_t IO0IntStatF;
  407. __O uint32_t IO0IntClr;
  408. __IO uint32_t IO0IntEnR;
  409. __IO uint32_t IO0IntEnF;
  410. uint32_t RESERVED0[3];
  411. __I uint32_t IO2IntStatR;
  412. __I uint32_t IO2IntStatF;
  413. __O uint32_t IO2IntClr;
  414. __IO uint32_t IO2IntEnR;
  415. __IO uint32_t IO2IntEnF;
  416. } LPC_GPIOINT_TypeDef;
  417. /*------------- External Memory Controller (EMC) -----------------------------*/
  418. typedef struct
  419. {
  420. __IO uint32_t Control;
  421. __I uint32_t Status;
  422. __IO uint32_t Config;
  423. uint32_t RESERVED0[5];
  424. __IO uint32_t DynamicControl;
  425. __IO uint32_t DynamicRefresh;
  426. __IO uint32_t DynamicReadConfig;
  427. uint32_t RESERVED1[1];
  428. __IO uint32_t DynamicRP;
  429. __IO uint32_t DynamicRAS;
  430. __IO uint32_t DynamicSREX;
  431. __IO uint32_t DynamicAPR;
  432. __IO uint32_t DynamicDAL;
  433. __IO uint32_t DynamicWR;
  434. __IO uint32_t DynamicRC;
  435. __IO uint32_t DynamicRFC;
  436. __IO uint32_t DynamicXSR;
  437. __IO uint32_t DynamicRRD;
  438. __IO uint32_t DynamicMRD;
  439. uint32_t RESERVED2[9];
  440. __IO uint32_t StaticExtendedWait;
  441. uint32_t RESERVED3[31];
  442. __IO uint32_t DynamicConfig0;
  443. __IO uint32_t DynamicRasCas0;
  444. uint32_t RESERVED4[6];
  445. __IO uint32_t DynamicConfig1;
  446. __IO uint32_t DynamicRasCas1;
  447. uint32_t RESERVED5[6];
  448. __IO uint32_t DynamicConfig2;
  449. __IO uint32_t DynamicRasCas2;
  450. uint32_t RESERVED6[6];
  451. __IO uint32_t DynamicConfig3;
  452. __IO uint32_t DynamicRasCas3;
  453. uint32_t RESERVED7[38];
  454. __IO uint32_t StaticConfig0;
  455. __IO uint32_t StaticWaitWen0;
  456. __IO uint32_t StaticWaitOen0;
  457. __IO uint32_t StaticWaitRd0;
  458. __IO uint32_t StaticWaitPage0;
  459. __IO uint32_t StaticWaitWr0;
  460. __IO uint32_t StaticWaitTurn0;
  461. uint32_t RESERVED8[1];
  462. __IO uint32_t StaticConfig1;
  463. __IO uint32_t StaticWaitWen1;
  464. __IO uint32_t StaticWaitOen1;
  465. __IO uint32_t StaticWaitRd1;
  466. __IO uint32_t StaticWaitPage1;
  467. __IO uint32_t StaticWaitWr1;
  468. __IO uint32_t StaticWaitTurn1;
  469. uint32_t RESERVED9[1];
  470. __IO uint32_t StaticConfig2;
  471. __IO uint32_t StaticWaitWen2;
  472. __IO uint32_t StaticWaitOen2;
  473. __IO uint32_t StaticWaitRd2;
  474. __IO uint32_t StaticWaitPage2;
  475. __IO uint32_t StaticWaitWr2;
  476. __IO uint32_t StaticWaitTurn2;
  477. uint32_t RESERVED10[1];
  478. __IO uint32_t StaticConfig3;
  479. __IO uint32_t StaticWaitWen3;
  480. __IO uint32_t StaticWaitOen3;
  481. __IO uint32_t StaticWaitRd3;
  482. __IO uint32_t StaticWaitPage3;
  483. __IO uint32_t StaticWaitWr3;
  484. __IO uint32_t StaticWaitTurn3;
  485. } LPC_EMC_TypeDef;
  486. /*------------- Watchdog Timer (WDT) -----------------------------------------*/
  487. typedef struct
  488. {
  489. __IO uint8_t MOD;
  490. uint8_t RESERVED0[3];
  491. __IO uint32_t TC;
  492. __O uint8_t FEED;
  493. uint8_t RESERVED1[3];
  494. __I uint32_t TV;
  495. uint32_t RESERVED2;
  496. __IO uint32_t WARNINT;
  497. __IO uint32_t WINDOW;
  498. } LPC_WDT_TypeDef;
  499. /*------------- Timer (TIM) --------------------------------------------------*/
  500. typedef struct
  501. {
  502. __IO uint32_t IR; /*!< Offset: 0x000 Interrupt Register (R/W) */
  503. __IO uint32_t TCR; /*!< Offset: 0x004 Timer Control Register (R/W) */
  504. __IO uint32_t TC; /*!< Offset: 0x008 Timer Counter Register (R/W) */
  505. __IO uint32_t PR; /*!< Offset: 0x00C Prescale Register (R/W) */
  506. __IO uint32_t PC; /*!< Offset: 0x010 Prescale Counter Register (R/W) */
  507. __IO uint32_t MCR; /*!< Offset: 0x014 Match Control Register (R/W) */
  508. __IO uint32_t MR0; /*!< Offset: 0x018 Match Register 0 (R/W) */
  509. __IO uint32_t MR1; /*!< Offset: 0x01C Match Register 1 (R/W) */
  510. __IO uint32_t MR2; /*!< Offset: 0x020 Match Register 2 (R/W) */
  511. __IO uint32_t MR3; /*!< Offset: 0x024 Match Register 3 (R/W) */
  512. __IO uint32_t CCR; /*!< Offset: 0x028 Capture Control Register (R/W) */
  513. __I uint32_t CR0; /*!< Offset: 0x02C Capture Register 0 (R/ ) */
  514. __I uint32_t CR1; /*!< Offset: 0x030 Capture Register 1 (R/ ) */
  515. uint32_t RESERVED0[2];
  516. __IO uint32_t EMR; /*!< Offset: 0x03C External Match Register (R/W) */
  517. uint32_t RESERVED1[12];
  518. __IO uint32_t CTCR; /*!< Offset: 0x070 Count Control Register (R/W) */
  519. } LPC_TIM_TypeDef;
  520. /*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
  521. typedef struct
  522. {
  523. __IO uint32_t IR; /*!< Offset: 0x000 Interrupt Register (R/W) */
  524. __IO uint32_t TCR; /*!< Offset: 0x004 Timer Control Register (R/W) */
  525. __IO uint32_t TC; /*!< Offset: 0x008 Timer Counter Register (R/W) */
  526. __IO uint32_t PR; /*!< Offset: 0x00C Prescale Register (R/W) */
  527. __IO uint32_t PC; /*!< Offset: 0x010 Prescale Counter Register (R/W) */
  528. __IO uint32_t MCR; /*!< Offset: 0x014 Match Control Register (R/W) */
  529. __IO uint32_t MR0; /*!< Offset: 0x018 Match Register 0 (R/W) */
  530. __IO uint32_t MR1; /*!< Offset: 0x01C Match Register 1 (R/W) */
  531. __IO uint32_t MR2; /*!< Offset: 0x020 Match Register 2 (R/W) */
  532. __IO uint32_t MR3; /*!< Offset: 0x024 Match Register 3 (R/W) */
  533. __IO uint32_t CCR; /*!< Offset: 0x028 Capture Control Register (R/W) */
  534. __I uint32_t CR0; /*!< Offset: 0x02C Capture Register 0 (R/ ) */
  535. __I uint32_t CR1; /*!< Offset: 0x030 Capture Register 1 (R/ ) */
  536. __I uint32_t CR2; /*!< Offset: 0x034 Capture Register 2 (R/ ) */
  537. __I uint32_t CR3; /*!< Offset: 0x038 Capture Register 3 (R/ ) */
  538. uint32_t RESERVED0;
  539. __IO uint32_t MR4; /*!< Offset: 0x040 Match Register 4 (R/W) */
  540. __IO uint32_t MR5; /*!< Offset: 0x044 Match Register 5 (R/W) */
  541. __IO uint32_t MR6; /*!< Offset: 0x048 Match Register 6 (R/W) */
  542. __IO uint32_t PCR; /*!< Offset: 0x04C PWM Control Register (R/W) */
  543. __IO uint32_t LER; /*!< Offset: 0x050 Load Enable Register (R/W) */
  544. uint32_t RESERVED1[7];
  545. __IO uint32_t CTCR; /*!< Offset: 0x070 Counter Control Register (R/W) */
  546. } LPC_PWM_TypeDef;
  547. /*------------- Universal Asynchronous Receiver Transmitter (UARTx) -----------*/
  548. /* There are three types of UARTs on the chip:
  549. (1) UART0,UART2, and UART3 are the standard UART.
  550. (2) UART1 is the standard with modem capability.
  551. (3) USART(UART4) is the sync/async UART with smart card capability.
  552. More details can be found on the Users Manual. */
  553. #if 0
  554. typedef struct
  555. {
  556. union {
  557. __I uint8_t RBR;
  558. __O uint8_t THR;
  559. __IO uint8_t DLL;
  560. uint32_t RESERVED0;
  561. };
  562. union {
  563. __IO uint8_t DLM;
  564. __IO uint32_t IER;
  565. };
  566. union {
  567. __I uint32_t IIR;
  568. __O uint8_t FCR;
  569. };
  570. __IO uint8_t LCR;
  571. uint8_t RESERVED1[7];
  572. __I uint8_t LSR;
  573. uint8_t RESERVED2[7];
  574. __IO uint8_t SCR;
  575. uint8_t RESERVED3[3];
  576. __IO uint32_t ACR;
  577. __IO uint8_t ICR;
  578. uint8_t RESERVED4[3];
  579. __IO uint8_t FDR;
  580. uint8_t RESERVED5[7];
  581. __IO uint8_t TER;
  582. uint8_t RESERVED6[39];
  583. __I uint8_t FIFOLVL;
  584. } LPC_UART_TypeDef;
  585. #else
  586. typedef struct
  587. {
  588. union
  589. {
  590. __I uint8_t RBR;
  591. __O uint8_t THR;
  592. __IO uint8_t DLL;
  593. uint32_t RESERVED0;
  594. };
  595. union
  596. {
  597. __IO uint8_t DLM;
  598. __IO uint32_t IER;
  599. };
  600. union
  601. {
  602. __I uint32_t IIR;
  603. __O uint8_t FCR;
  604. };
  605. __IO uint8_t LCR;
  606. uint8_t RESERVED1[7];//Reserved
  607. __I uint8_t LSR;
  608. uint8_t RESERVED2[7];//Reserved
  609. __IO uint8_t SCR;
  610. uint8_t RESERVED3[3];//Reserved
  611. __IO uint32_t ACR;
  612. __IO uint8_t ICR;
  613. uint8_t RESERVED4[3];//Reserved
  614. __IO uint8_t FDR;
  615. uint8_t RESERVED5[7];//Reserved
  616. __IO uint8_t TER;
  617. uint8_t RESERVED8[27];//Reserved
  618. __IO uint8_t RS485CTRL;
  619. uint8_t RESERVED9[3];//Reserved
  620. __IO uint8_t ADRMATCH;
  621. uint8_t RESERVED10[3];//Reserved
  622. __IO uint8_t RS485DLY;
  623. uint8_t RESERVED11[3];//Reserved
  624. __I uint8_t FIFOLVL;
  625. }LPC_UART_TypeDef;
  626. #endif
  627. typedef struct
  628. {
  629. union {
  630. __I uint8_t RBR;
  631. __O uint8_t THR;
  632. __IO uint8_t DLL;
  633. uint32_t RESERVED0;
  634. };
  635. union {
  636. __IO uint8_t DLM;
  637. __IO uint32_t IER;
  638. };
  639. union {
  640. __I uint32_t IIR;
  641. __O uint8_t FCR;
  642. };
  643. __IO uint8_t LCR;
  644. uint8_t RESERVED1[3];
  645. __IO uint8_t MCR;
  646. uint8_t RESERVED2[3];
  647. __I uint8_t LSR;
  648. uint8_t RESERVED3[3];
  649. __I uint8_t MSR;
  650. uint8_t RESERVED4[3];
  651. __IO uint8_t SCR;
  652. uint8_t RESERVED5[3];
  653. __IO uint32_t ACR;
  654. uint32_t RESERVED6;
  655. __IO uint32_t FDR;
  656. uint32_t RESERVED7;
  657. __IO uint8_t TER;
  658. uint8_t RESERVED8[27];
  659. __IO uint8_t RS485CTRL;
  660. uint8_t RESERVED9[3];
  661. __IO uint8_t ADRMATCH;
  662. uint8_t RESERVED10[3];
  663. __IO uint8_t RS485DLY;
  664. uint8_t RESERVED11[3];
  665. __I uint8_t FIFOLVL;
  666. } LPC_UART1_TypeDef;
  667. typedef struct
  668. {
  669. union {
  670. __I uint32_t RBR; /*!< Offset: 0x000 Receiver Buffer Register (R/ ) */
  671. __O uint32_t THR; /*!< Offset: 0x000 Transmit Holding Register ( /W) */
  672. __IO uint32_t DLL; /*!< Offset: 0x000 Divisor Latch LSB (R/W) */
  673. };
  674. union {
  675. __IO uint32_t DLM; /*!< Offset: 0x004 Divisor Latch MSB (R/W) */
  676. __IO uint32_t IER; /*!< Offset: 0x000 Interrupt Enable Register (R/W) */
  677. };
  678. union {
  679. __I uint32_t IIR; /*!< Offset: 0x008 Interrupt ID Register (R/ ) */
  680. __O uint32_t FCR; /*!< Offset: 0x008 FIFO Control Register ( /W) */
  681. };
  682. __IO uint32_t LCR; /*!< Offset: 0x00C Line Control Register (R/W) */
  683. __IO uint32_t MCR; /*!< Offset: 0x010 Modem control Register (R/W) */
  684. __I uint32_t LSR; /*!< Offset: 0x014 Line Status Register (R/ ) */
  685. __I uint32_t MSR; /*!< Offset: 0x018 Modem status Register (R/ ) */
  686. __IO uint32_t SCR; /*!< Offset: 0x01C Scratch Pad Register (R/W) */
  687. __IO uint32_t ACR; /*!< Offset: 0x020 Auto-baud Control Register (R/W) */
  688. __IO uint32_t ICR; /*!< Offset: 0x024 irDA Control Register (R/W) */
  689. __IO uint32_t FDR; /*!< Offset: 0x028 Fractional Divider Register (R/W) */
  690. __IO uint32_t OSR; /*!< Offset: 0x02C Over sampling Register (R/W) */
  691. __O uint32_t POP; /*!< Offset: 0x030 NHP Pop Register (W) */
  692. __IO uint32_t MODE; /*!< Offset: 0x034 NHP Mode selection Register (W) */
  693. uint32_t RESERVED0[2];
  694. __IO uint32_t HDEN; /*!< Offset: 0x040 Half duplex Enable Register (R/W) */
  695. uint32_t RESERVED1;
  696. __IO uint32_t SCI_CTRL; /*!< Offset: 0x048 Smart card Interface Control Register (R/W) */
  697. __IO uint32_t RS485CTRL; /*!< Offset: 0x04C RS-485/EIA-485 Control Register (R/W) */
  698. __IO uint32_t ADRMATCH; /*!< Offset: 0x050 RS-485/EIA-485 address match Register (R/W) */
  699. __IO uint32_t RS485DLY; /*!< Offset: 0x054 RS-485/EIA-485 direction control delay Register (R/W) */
  700. __IO uint32_t SYNCCTRL; /*!< Offset: 0x058 Synchronous Mode Control Register (R/W ) */
  701. __IO uint32_t TER; /*!< Offset: 0x05C Transmit Enable Register (R/W) */
  702. uint32_t RESERVED2[989];
  703. __I uint32_t CFG; /*!< Offset: 0xFD4 Configuration Register (R) */
  704. __O uint32_t INTCE; /*!< Offset: 0xFD8 Interrupt Clear Enable Register (W) */
  705. __O uint32_t INTSE; /*!< Offset: 0xFDC Interrupt Set Enable Register (W) */
  706. __I uint32_t INTS; /*!< Offset: 0xFE0 Interrupt Status Register (R) */
  707. __I uint32_t INTE; /*!< Offset: 0xFE4 Interrupt Enable Register (R) */
  708. __O uint32_t INTCS; /*!< Offset: 0xFE8 Interrupt Clear Status Register (W) */
  709. __O uint32_t INTSS; /*!< Offset: 0xFEC Interrupt Set Status Register (W) */
  710. uint32_t RESERVED3[3];
  711. __I uint32_t MID; /*!< Offset: 0xFFC Module Identification Register (R) */
  712. } LPC_UART4_TypeDef;
  713. /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
  714. typedef struct
  715. {
  716. __IO uint32_t CONSET; /*!< Offset: 0x000 I2C Control Set Register (R/W) */
  717. __I uint32_t STAT; /*!< Offset: 0x004 I2C Status Register (R/ ) */
  718. __IO uint32_t DAT; /*!< Offset: 0x008 I2C Data Register (R/W) */
  719. __IO uint32_t ADR0; /*!< Offset: 0x00C I2C Slave Address Register 0 (R/W) */
  720. __IO uint32_t SCLH; /*!< Offset: 0x010 SCH Duty Cycle Register High Half Word (R/W) */
  721. __IO uint32_t SCLL; /*!< Offset: 0x014 SCL Duty Cycle Register Low Half Word (R/W) */
  722. __O uint32_t CONCLR; /*!< Offset: 0x018 I2C Control Clear Register ( /W) */
  723. __IO uint32_t MMCTRL; /*!< Offset: 0x01C Monitor mode control register (R/W) */
  724. __IO uint32_t ADR1; /*!< Offset: 0x020 I2C Slave Address Register 1 (R/W) */
  725. __IO uint32_t ADR2; /*!< Offset: 0x024 I2C Slave Address Register 2 (R/W) */
  726. __IO uint32_t ADR3; /*!< Offset: 0x028 I2C Slave Address Register 3 (R/W) */
  727. __I uint32_t DATA_BUFFER; /*!< Offset: 0x02C Data buffer register ( /W) */
  728. __IO uint32_t MASK0; /*!< Offset: 0x030 I2C Slave address mask register 0 (R/W) */
  729. __IO uint32_t MASK1; /*!< Offset: 0x034 I2C Slave address mask register 1 (R/W) */
  730. __IO uint32_t MASK2; /*!< Offset: 0x038 I2C Slave address mask register 2 (R/W) */
  731. __IO uint32_t MASK3; /*!< Offset: 0x03C I2C Slave address mask register 3 (R/W) */
  732. } LPC_I2C_TypeDef;
  733. /*------------- Real-Time Clock (RTC) ----------------------------------------*/
  734. typedef struct
  735. {
  736. __IO uint8_t ILR;
  737. uint8_t RESERVED0[7];
  738. __IO uint8_t CCR;
  739. uint8_t RESERVED1[3];
  740. __IO uint8_t CIIR;
  741. uint8_t RESERVED2[3];
  742. __IO uint8_t AMR;
  743. uint8_t RESERVED3[3];
  744. __I uint32_t CTIME0;
  745. __I uint32_t CTIME1;
  746. __I uint32_t CTIME2;
  747. __IO uint8_t SEC;
  748. uint8_t RESERVED4[3];
  749. __IO uint8_t MIN;
  750. uint8_t RESERVED5[3];
  751. __IO uint8_t HOUR;
  752. uint8_t RESERVED6[3];
  753. __IO uint8_t DOM;
  754. uint8_t RESERVED7[3];
  755. __IO uint8_t DOW;
  756. uint8_t RESERVED8[3];
  757. __IO uint16_t DOY;
  758. uint16_t RESERVED9;
  759. __IO uint8_t MONTH;
  760. uint8_t RESERVED10[3];
  761. __IO uint16_t YEAR;
  762. uint16_t RESERVED11;
  763. __IO uint32_t CALIBRATION;
  764. __IO uint32_t GPREG0;
  765. __IO uint32_t GPREG1;
  766. __IO uint32_t GPREG2;
  767. __IO uint32_t GPREG3;
  768. __IO uint32_t GPREG4;
  769. __IO uint8_t RTC_AUXEN;
  770. uint8_t RESERVED12[3];
  771. __IO uint8_t RTC_AUX;
  772. uint8_t RESERVED13[3];
  773. __IO uint8_t ALSEC;
  774. uint8_t RESERVED14[3];
  775. __IO uint8_t ALMIN;
  776. uint8_t RESERVED15[3];
  777. __IO uint8_t ALHOUR;
  778. uint8_t RESERVED16[3];
  779. __IO uint8_t ALDOM;
  780. uint8_t RESERVED17[3];
  781. __IO uint8_t ALDOW;
  782. uint8_t RESERVED18[3];
  783. __IO uint16_t ALDOY;
  784. uint16_t RESERVED19;
  785. __IO uint8_t ALMON;
  786. uint8_t RESERVED20[3];
  787. __IO uint16_t ALYEAR;
  788. uint16_t RESERVED21;
  789. __IO uint32_t ERSTATUS;
  790. __IO uint32_t ERCONTROL;
  791. __IO uint32_t ERCOUNTERS;
  792. uint32_t RESERVED22;
  793. __IO uint32_t ERFIRSTSTAMP0;
  794. __IO uint32_t ERFIRSTSTAMP1;
  795. __IO uint32_t ERFIRSTSTAMP2;
  796. uint32_t RESERVED23;
  797. __IO uint32_t ERLASTSTAMP0;
  798. __IO uint32_t ERLASTSTAMP1;
  799. __IO uint32_t ERLASTSTAMP2;
  800. } LPC_RTC_TypeDef;
  801. /*------------- Pin Connect Block (PINCON) -----------------------------------*/
  802. typedef struct
  803. {
  804. __IO uint32_t P0_0; /* 0x000 */
  805. __IO uint32_t P0_1;
  806. __IO uint32_t P0_2;
  807. __IO uint32_t P0_3;
  808. __IO uint32_t P0_4;
  809. __IO uint32_t P0_5;
  810. __IO uint32_t P0_6;
  811. __IO uint32_t P0_7;
  812. __IO uint32_t P0_8; /* 0x020 */
  813. __IO uint32_t P0_9;
  814. __IO uint32_t P0_10;
  815. __IO uint32_t P0_11;
  816. __IO uint32_t P0_12;
  817. __IO uint32_t P0_13;
  818. __IO uint32_t P0_14;
  819. __IO uint32_t P0_15;
  820. __IO uint32_t P0_16; /* 0x040 */
  821. __IO uint32_t P0_17;
  822. __IO uint32_t P0_18;
  823. __IO uint32_t P0_19;
  824. __IO uint32_t P0_20;
  825. __IO uint32_t P0_21;
  826. __IO uint32_t P0_22;
  827. __IO uint32_t P0_23;
  828. __IO uint32_t P0_24; /* 0x060 */
  829. __IO uint32_t P0_25;
  830. __IO uint32_t P0_26;
  831. __IO uint32_t P0_27;
  832. __IO uint32_t P0_28;
  833. __IO uint32_t P0_29;
  834. __IO uint32_t P0_30;
  835. __IO uint32_t P0_31;
  836. __IO uint32_t P1_0; /* 0x080 */
  837. __IO uint32_t P1_1;
  838. __IO uint32_t P1_2;
  839. __IO uint32_t P1_3;
  840. __IO uint32_t P1_4;
  841. __IO uint32_t P1_5;
  842. __IO uint32_t P1_6;
  843. __IO uint32_t P1_7;
  844. __IO uint32_t P1_8; /* 0x0A0 */
  845. __IO uint32_t P1_9;
  846. __IO uint32_t P1_10;
  847. __IO uint32_t P1_11;
  848. __IO uint32_t P1_12;
  849. __IO uint32_t P1_13;
  850. __IO uint32_t P1_14;
  851. __IO uint32_t P1_15;
  852. __IO uint32_t P1_16; /* 0x0C0 */
  853. __IO uint32_t P1_17;
  854. __IO uint32_t P1_18;
  855. __IO uint32_t P1_19;
  856. __IO uint32_t P1_20;
  857. __IO uint32_t P1_21;
  858. __IO uint32_t P1_22;
  859. __IO uint32_t P1_23;
  860. __IO uint32_t P1_24; /* 0x0E0 */
  861. __IO uint32_t P1_25;
  862. __IO uint32_t P1_26;
  863. __IO uint32_t P1_27;
  864. __IO uint32_t P1_28;
  865. __IO uint32_t P1_29;
  866. __IO uint32_t P1_30;
  867. __IO uint32_t P1_31;
  868. __IO uint32_t P2_0; /* 0x100 */
  869. __IO uint32_t P2_1;
  870. __IO uint32_t P2_2;
  871. __IO uint32_t P2_3;
  872. __IO uint32_t P2_4;
  873. __IO uint32_t P2_5;
  874. __IO uint32_t P2_6;
  875. __IO uint32_t P2_7;
  876. __IO uint32_t P2_8; /* 0x120 */
  877. __IO uint32_t P2_9;
  878. __IO uint32_t P2_10;
  879. __IO uint32_t P2_11;
  880. __IO uint32_t P2_12;
  881. __IO uint32_t P2_13;
  882. __IO uint32_t P2_14;
  883. __IO uint32_t P2_15;
  884. __IO uint32_t P2_16; /* 0x140 */
  885. __IO uint32_t P2_17;
  886. __IO uint32_t P2_18;
  887. __IO uint32_t P2_19;
  888. __IO uint32_t P2_20;
  889. __IO uint32_t P2_21;
  890. __IO uint32_t P2_22;
  891. __IO uint32_t P2_23;
  892. __IO uint32_t P2_24; /* 0x160 */
  893. __IO uint32_t P2_25;
  894. __IO uint32_t P2_26;
  895. __IO uint32_t P2_27;
  896. __IO uint32_t P2_28;
  897. __IO uint32_t P2_29;
  898. __IO uint32_t P2_30;
  899. __IO uint32_t P2_31;
  900. __IO uint32_t P3_0; /* 0x180 */
  901. __IO uint32_t P3_1;
  902. __IO uint32_t P3_2;
  903. __IO uint32_t P3_3;
  904. __IO uint32_t P3_4;
  905. __IO uint32_t P3_5;
  906. __IO uint32_t P3_6;
  907. __IO uint32_t P3_7;
  908. __IO uint32_t P3_8; /* 0x1A0 */
  909. __IO uint32_t P3_9;
  910. __IO uint32_t P3_10;
  911. __IO uint32_t P3_11;
  912. __IO uint32_t P3_12;
  913. __IO uint32_t P3_13;
  914. __IO uint32_t P3_14;
  915. __IO uint32_t P3_15;
  916. __IO uint32_t P3_16; /* 0x1C0 */
  917. __IO uint32_t P3_17;
  918. __IO uint32_t P3_18;
  919. __IO uint32_t P3_19;
  920. __IO uint32_t P3_20;
  921. __IO uint32_t P3_21;
  922. __IO uint32_t P3_22;
  923. __IO uint32_t P3_23;
  924. __IO uint32_t P3_24; /* 0x1E0 */
  925. __IO uint32_t P3_25;
  926. __IO uint32_t P3_26;
  927. __IO uint32_t P3_27;
  928. __IO uint32_t P3_28;
  929. __IO uint32_t P3_29;
  930. __IO uint32_t P3_30;
  931. __IO uint32_t P3_31;
  932. __IO uint32_t P4_0; /* 0x200 */
  933. __IO uint32_t P4_1;
  934. __IO uint32_t P4_2;
  935. __IO uint32_t P4_3;
  936. __IO uint32_t P4_4;
  937. __IO uint32_t P4_5;
  938. __IO uint32_t P4_6;
  939. __IO uint32_t P4_7;
  940. __IO uint32_t P4_8; /* 0x220 */
  941. __IO uint32_t P4_9;
  942. __IO uint32_t P4_10;
  943. __IO uint32_t P4_11;
  944. __IO uint32_t P4_12;
  945. __IO uint32_t P4_13;
  946. __IO uint32_t P4_14;
  947. __IO uint32_t P4_15;
  948. __IO uint32_t P4_16; /* 0x240 */
  949. __IO uint32_t P4_17;
  950. __IO uint32_t P4_18;
  951. __IO uint32_t P4_19;
  952. __IO uint32_t P4_20;
  953. __IO uint32_t P4_21;
  954. __IO uint32_t P4_22;
  955. __IO uint32_t P4_23;
  956. __IO uint32_t P4_24; /* 0x260 */
  957. __IO uint32_t P4_25;
  958. __IO uint32_t P4_26;
  959. __IO uint32_t P4_27;
  960. __IO uint32_t P4_28;
  961. __IO uint32_t P4_29;
  962. __IO uint32_t P4_30;
  963. __IO uint32_t P4_31;
  964. __IO uint32_t P5_0; /* 0x280 */
  965. __IO uint32_t P5_1;
  966. __IO uint32_t P5_2;
  967. __IO uint32_t P5_3;
  968. __IO uint32_t P5_4; /* 0x290 */
  969. } LPC_IOCON_TypeDef;
  970. /*------------- Synchronous Serial Communication (SSP) -----------------------*/
  971. typedef struct
  972. {
  973. __IO uint32_t CR0; /*!< Offset: 0x000 Control Register 0 (R/W) */
  974. __IO uint32_t CR1; /*!< Offset: 0x004 Control Register 1 (R/W) */
  975. __IO uint32_t DR; /*!< Offset: 0x008 Data Register (R/W) */
  976. __I uint32_t SR; /*!< Offset: 0x00C Status Registe (R/ ) */
  977. __IO uint32_t CPSR; /*!< Offset: 0x010 Clock Prescale Register (R/W) */
  978. __IO uint32_t IMSC; /*!< Offset: 0x014 Interrupt Mask Set and Clear Register (R/W) */
  979. __IO uint32_t RIS; /*!< Offset: 0x018 Raw Interrupt Status Register (R/W) */
  980. __IO uint32_t MIS; /*!< Offset: 0x01C Masked Interrupt Status Register (R/W) */
  981. __IO uint32_t ICR; /*!< Offset: 0x020 SSPICR Interrupt Clear Register (R/W) */
  982. __IO uint32_t DMACR;
  983. } LPC_SSP_TypeDef;
  984. /*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
  985. typedef struct
  986. {
  987. __IO uint32_t CR; /*!< Offset: 0x000 A/D Control Register (R/W) */
  988. __IO uint32_t GDR; /*!< Offset: 0x004 A/D Global Data Register (R/W) */
  989. uint32_t RESERVED0;
  990. __IO uint32_t INTEN; /*!< Offset: 0x00C A/D Interrupt Enable Register (R/W) */
  991. __IO uint32_t DR[8]; /*!< Offset: 0x010-0x02C A/D Channel 0..7 Data Register (R/W) */
  992. __I uint32_t STAT; /*!< Offset: 0x030 A/D Status Register (R/ ) */
  993. __IO uint32_t ADTRM;
  994. } LPC_ADC_TypeDef;
  995. /*------------- Controller Area Network (CAN) --------------------------------*/
  996. typedef struct
  997. {
  998. __IO uint32_t mask[512]; /* ID Masks */
  999. } LPC_CANAF_RAM_TypeDef;
  1000. typedef struct /* Acceptance Filter Registers */
  1001. {
  1002. ///Offset: 0x00000000 - Acceptance Filter Register
  1003. __IO uint32_t AFMR;
  1004. ///Offset: 0x00000004 - Standard Frame Individual Start Address Register
  1005. __IO uint32_t SFF_sa;
  1006. ///Offset: 0x00000008 - Standard Frame Group Start Address Register
  1007. __IO uint32_t SFF_GRP_sa;
  1008. ///Offset: 0x0000000C - Extended Frame Start Address Register
  1009. __IO uint32_t EFF_sa;
  1010. ///Offset: 0x00000010 - Extended Frame Group Start Address Register
  1011. __IO uint32_t EFF_GRP_sa;
  1012. ///Offset: 0x00000014 - End of AF Tables register
  1013. __IO uint32_t ENDofTable;
  1014. ///Offset: 0x00000018 - LUT Error Address register
  1015. __I uint32_t LUTerrAd;
  1016. ///Offset: 0x0000001C - LUT Error Register
  1017. __I uint32_t LUTerr;
  1018. ///Offset: 0x00000020 - CAN Central Transmit Status Register
  1019. __IO uint32_t FCANIE;
  1020. ///Offset: 0x00000024 - FullCAN Interrupt and Capture registers 0
  1021. __IO uint32_t FCANIC0;
  1022. ///Offset: 0x00000028 - FullCAN Interrupt and Capture registers 1
  1023. __IO uint32_t FCANIC1;
  1024. } LPC_CANAF_TypeDef;
  1025. typedef struct /* Central Registers */
  1026. {
  1027. __I uint32_t TxSR;
  1028. __I uint32_t RxSR;
  1029. __I uint32_t MSR;
  1030. } LPC_CANCR_TypeDef;
  1031. typedef struct /* Controller Registers */
  1032. {
  1033. ///Offset: 0x00000000 - Controls the operating mode of the CAN Controller
  1034. __IO uint32_t MOD;
  1035. ///Offset: 0x00000004 - Command bits that affect the state
  1036. __O uint32_t CMR;
  1037. ///Offset: 0x00000008 - Global Controller Status and Error Counters
  1038. __IO uint32_t GSR;
  1039. ///Offset: 0x0000000C - Interrupt status, Arbitration Lost Capture, Error Code Capture
  1040. __I uint32_t ICR;
  1041. ///Offset: 0x00000010 - Interrupt Enable Register
  1042. __IO uint32_t IER;
  1043. ///Offset: 0x00000014 - Bus Timing Register
  1044. __IO uint32_t BTR;
  1045. ///Offset: 0x00000018 - Error Warning Limit
  1046. __IO uint32_t EWL;
  1047. ///Offset: 0x0000001C - Status Register
  1048. __I uint32_t SR;
  1049. ///Offset: 0x00000020 - Receive frame status
  1050. __IO uint32_t RFS;
  1051. ///Offset: 0x00000024 - Received Identifier
  1052. __IO uint32_t RID;
  1053. ///Offset: 0x00000028 - Received data bytes 1-4
  1054. __IO uint32_t RDA;
  1055. ///Offset: 0x0000002C - Received data bytes 5-8
  1056. __IO uint32_t RDB;
  1057. ///Offset: 0x00000030 - Transmit frame info (Tx Buffer 1)
  1058. __IO uint32_t TFI1;
  1059. ///Offset: 0x00000034 - Transmit Identifier (Tx Buffer 1)
  1060. __IO uint32_t TID1;
  1061. ///Offset: 0x00000038 - Transmit data bytes 1-4 (Tx Buffer 1)
  1062. __IO uint32_t TDA1;
  1063. ///Offset: 0x0000003C - Transmit data bytes 5-8 (Tx Buffer 1)
  1064. __IO uint32_t TDB1;
  1065. ///Offset: 0x00000040 - Transmit frame info (Tx Buffer 2)
  1066. __IO uint32_t TFI2;
  1067. ///Offset: 0x00000044 - Transmit Identifier (Tx Buffer 2)
  1068. __IO uint32_t TID2;
  1069. ///Offset: 0x00000048 - Transmit data bytes 1-4 (Tx Buffer 2)
  1070. __IO uint32_t TDA2;
  1071. ///Offset: 0x0000004C - Transmit data bytes 5-8 (Tx Buffer 2)
  1072. __IO uint32_t TDB2;
  1073. ///Offset: 0x00000050 - Transmit frame info (Tx Buffer 3)
  1074. __IO uint32_t TFI3;
  1075. ///Offset: 0x00000054 - Transmit Identifier (Tx Buffer 3)
  1076. __IO uint32_t TID3;
  1077. ///Offset: 0x00000058 - Transmit data bytes 1-4 (Tx Buffer 3)
  1078. __IO uint32_t TDA3;
  1079. ///Offset: 0x0000005C - Transmit data bytes 5-8 (Tx Buffer 3)
  1080. __IO uint32_t TDB3;
  1081. } LPC_CAN_TypeDef;
  1082. /*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
  1083. typedef struct
  1084. {
  1085. __IO uint32_t CR;
  1086. __IO uint32_t CTRL;
  1087. __IO uint32_t CNTVAL;
  1088. } LPC_DAC_TypeDef;
  1089. /*------------- Inter IC Sound (I2S) -----------------------------------------*/
  1090. typedef struct
  1091. {
  1092. __IO uint32_t DAO;
  1093. __IO uint32_t DAI;
  1094. __O uint32_t TXFIFO;
  1095. __I uint32_t RXFIFO;
  1096. __I uint32_t STATE;
  1097. __IO uint32_t DMA1;
  1098. __IO uint32_t DMA2;
  1099. __IO uint32_t IRQ;
  1100. __IO uint32_t TXRATE;
  1101. __IO uint32_t RXRATE;
  1102. __IO uint32_t TXBITRATE;
  1103. __IO uint32_t RXBITRATE;
  1104. __IO uint32_t TXMODE;
  1105. __IO uint32_t RXMODE;
  1106. } LPC_I2S_TypeDef;
  1107. /*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
  1108. typedef struct
  1109. {
  1110. __I uint32_t CON;
  1111. __O uint32_t CON_SET;
  1112. __O uint32_t CON_CLR;
  1113. __I uint32_t CAPCON;
  1114. __O uint32_t CAPCON_SET;
  1115. __O uint32_t CAPCON_CLR;
  1116. __IO uint32_t TC0;
  1117. __IO uint32_t TC1;
  1118. __IO uint32_t TC2;
  1119. __IO uint32_t LIM0;
  1120. __IO uint32_t LIM1;
  1121. __IO uint32_t LIM2;
  1122. __IO uint32_t MAT0;
  1123. __IO uint32_t MAT1;
  1124. __IO uint32_t MAT2;
  1125. __IO uint32_t DT;
  1126. __IO uint32_t CP;
  1127. __IO uint32_t CAP0;
  1128. __IO uint32_t CAP1;
  1129. __IO uint32_t CAP2;
  1130. __I uint32_t INTEN;
  1131. __O uint32_t INTEN_SET;
  1132. __O uint32_t INTEN_CLR;
  1133. __I uint32_t CNTCON;
  1134. __O uint32_t CNTCON_SET;
  1135. __O uint32_t CNTCON_CLR;
  1136. __I uint32_t INTF;
  1137. __O uint32_t INTF_SET;
  1138. __O uint32_t INTF_CLR;
  1139. __O uint32_t CAP_CLR;
  1140. } LPC_MCPWM_TypeDef;
  1141. /*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
  1142. typedef struct
  1143. {
  1144. __O uint32_t CON;
  1145. __I uint32_t STAT;
  1146. __IO uint32_t CONF;
  1147. __I uint32_t POS;
  1148. __IO uint32_t MAXPOS;
  1149. __IO uint32_t CMPOS0;
  1150. __IO uint32_t CMPOS1;
  1151. __IO uint32_t CMPOS2;
  1152. __I uint32_t INXCNT;
  1153. __IO uint32_t INXCMP0;
  1154. __IO uint32_t LOAD;
  1155. __I uint32_t TIME;
  1156. __I uint32_t VEL;
  1157. __I uint32_t CAP;
  1158. __IO uint32_t VELCOMP;
  1159. __IO uint32_t FILTERPHA;
  1160. __IO uint32_t FILTERPHB;
  1161. __IO uint32_t FILTERINX;
  1162. __IO uint32_t WINDOW;
  1163. __IO uint32_t INXCMP1;
  1164. __IO uint32_t INXCMP2;
  1165. uint32_t RESERVED0[993];
  1166. __O uint32_t IEC;
  1167. __O uint32_t IES;
  1168. __I uint32_t INTSTAT;
  1169. __I uint32_t IE;
  1170. __O uint32_t CLR;
  1171. __O uint32_t SET;
  1172. } LPC_QEI_TypeDef;
  1173. /*------------- SD/MMC card Interface (MCI)-----------------------------------*/
  1174. typedef struct
  1175. {
  1176. __IO uint32_t POWER;
  1177. __IO uint32_t CLOCK;
  1178. __IO uint32_t ARGUMENT;
  1179. __IO uint32_t COMMAND;
  1180. __I uint32_t RESP_CMD;
  1181. __I uint32_t RESP0;
  1182. __I uint32_t RESP1;
  1183. __I uint32_t RESP2;
  1184. __I uint32_t RESP3;
  1185. __IO uint32_t DATATMR;
  1186. __IO uint32_t DATALEN;
  1187. __IO uint32_t DATACTRL;
  1188. __I uint32_t DATACNT;
  1189. __I uint32_t STATUS;
  1190. __O uint32_t CLEAR;
  1191. __IO uint32_t MASK0;
  1192. uint32_t RESERVED0[2];
  1193. __I uint32_t FIFOCNT;
  1194. uint32_t RESERVED1[13];
  1195. __IO uint32_t FIFO[16];
  1196. } LPC_MCI_TypeDef;
  1197. /*------------- EEPROM Controller (EEPROM) -----------------------------------*/
  1198. typedef struct
  1199. {
  1200. __IO uint32_t CMD; /* 0x0080 */
  1201. __IO uint32_t ADDR;
  1202. __IO uint32_t WDATA;
  1203. __IO uint32_t RDATA;
  1204. __IO uint32_t WSTATE; /* 0x0090 */
  1205. __IO uint32_t CLKDIV;
  1206. __IO uint32_t PWRDWN; /* 0x0098 */
  1207. uint32_t RESERVED0[975];
  1208. __IO uint32_t INT_CLR_ENABLE; /* 0x0FD8 */
  1209. __IO uint32_t INT_SET_ENABLE;
  1210. __IO uint32_t INT_STATUS; /* 0x0FE0 */
  1211. __IO uint32_t INT_ENABLE;
  1212. __IO uint32_t INT_CLR_STATUS;
  1213. __IO uint32_t INT_SET_STATUS;
  1214. } LPC_EEPROM_TypeDef;
  1215. /*------------- COMPARATOR ----------------------------------------------------*/
  1216. typedef struct { /*!< (@ 0x40020000) COMPARATOR Structure */
  1217. __IO uint32_t CTRL; /*!< (@ 0x40020000) Comparator block control register */
  1218. __IO uint32_t CTRL0; /*!< (@ 0x40020004) Comparator 0 control register */
  1219. __IO uint32_t CTRL1; /*!< (@ 0x40020008) Comparator 1 control register */
  1220. } LPC_COMPARATOR_Type;
  1221. #if defined ( __CC_ARM )
  1222. #pragma no_anon_unions
  1223. #endif
  1224. /******************************************************************************/
  1225. /* Peripheral memory map */
  1226. /******************************************************************************/
  1227. /* Base addresses */
  1228. #define LPC_FLASH_BASE (0x00000000UL)
  1229. #define LPC_RAM_BASE (0x10000000UL)
  1230. #define LPC_PERI_RAM_BASE (0x20000000UL)
  1231. #define LPC_APB0_BASE (0x40000000UL)
  1232. #define LPC_APB1_BASE (0x40080000UL)
  1233. #define LPC_AHBRAM1_BASE (0x20004000UL)
  1234. #define LPC_AHB_BASE (0x20080000UL)
  1235. #define LPC_CM3_BASE (0xE0000000UL)
  1236. /* APB0 peripherals */
  1237. #define LPC_WDT_BASE (LPC_APB0_BASE + 0x00000)
  1238. #define LPC_TIM0_BASE (LPC_APB0_BASE + 0x04000)
  1239. #define LPC_TIM1_BASE (LPC_APB0_BASE + 0x08000)
  1240. #define LPC_UART0_BASE (LPC_APB0_BASE + 0x0C000)
  1241. #define LPC_UART1_BASE (LPC_APB0_BASE + 0x10000)
  1242. #define LPC_PWM0_BASE (LPC_APB0_BASE + 0x14000)
  1243. #define LPC_PWM1_BASE (LPC_APB0_BASE + 0x18000)
  1244. #define LPC_I2C0_BASE (LPC_APB0_BASE + 0x1C000)
  1245. #define LPC_COMPARATOR_BASE (LPC_APB0_BASE + 0x20000)
  1246. #define LPC_RTC_BASE (LPC_APB0_BASE + 0x24000)
  1247. #define LPC_GPIOINT_BASE (LPC_APB0_BASE + 0x28080)
  1248. #define LPC_IOCON_BASE (LPC_APB0_BASE + 0x2C000)
  1249. #define LPC_SSP1_BASE (LPC_APB0_BASE + 0x30000)
  1250. #define LPC_ADC_BASE (LPC_APB0_BASE + 0x34000)
  1251. #define LPC_CANAF_RAM_BASE (LPC_APB0_BASE + 0x38000)
  1252. #define LPC_CANAF_BASE (LPC_APB0_BASE + 0x3C000)
  1253. #define LPC_CANCR_BASE (LPC_APB0_BASE + 0x40000)
  1254. #define LPC_CAN1_BASE (LPC_APB0_BASE + 0x44000)
  1255. #define LPC_CAN2_BASE (LPC_APB0_BASE + 0x48000)
  1256. #define LPC_I2C1_BASE (LPC_APB0_BASE + 0x5C000)
  1257. /* APB1 peripherals */
  1258. #define LPC_SSP0_BASE (LPC_APB1_BASE + 0x08000)
  1259. #define LPC_DAC_BASE (LPC_APB1_BASE + 0x0C000)
  1260. #define LPC_TIM2_BASE (LPC_APB1_BASE + 0x10000)
  1261. #define LPC_TIM3_BASE (LPC_APB1_BASE + 0x14000)
  1262. #define LPC_UART2_BASE (LPC_APB1_BASE + 0x18000)
  1263. #define LPC_UART3_BASE (LPC_APB1_BASE + 0x1C000)
  1264. #define LPC_I2C2_BASE (LPC_APB1_BASE + 0x20000)
  1265. #define LPC_UART4_BASE (LPC_APB1_BASE + 0x24000)
  1266. #define LPC_I2S_BASE (LPC_APB1_BASE + 0x28000)
  1267. #define LPC_SSP2_BASE (LPC_APB1_BASE + 0x2C000)
  1268. #define LPC_MCPWM_BASE (LPC_APB1_BASE + 0x38000)
  1269. #define LPC_QEI_BASE (LPC_APB1_BASE + 0x3C000)
  1270. #define LPC_MCI_BASE (LPC_APB1_BASE + 0x40000)
  1271. #define LPC_SC_BASE (LPC_APB1_BASE + 0x7C000)
  1272. /* AHB peripherals */
  1273. #define LPC_GPDMA_BASE (LPC_AHB_BASE + 0x00000)
  1274. #define LPC_GPDMACH0_BASE (LPC_AHB_BASE + 0x00100)
  1275. #define LPC_GPDMACH1_BASE (LPC_AHB_BASE + 0x00120)
  1276. #define LPC_GPDMACH2_BASE (LPC_AHB_BASE + 0x00140)
  1277. #define LPC_GPDMACH3_BASE (LPC_AHB_BASE + 0x00160)
  1278. #define LPC_GPDMACH4_BASE (LPC_AHB_BASE + 0x00180)
  1279. #define LPC_GPDMACH5_BASE (LPC_AHB_BASE + 0x001A0)
  1280. #define LPC_GPDMACH6_BASE (LPC_AHB_BASE + 0x001C0)
  1281. #define LPC_GPDMACH7_BASE (LPC_AHB_BASE + 0x001E0)
  1282. #define LPC_EMAC_BASE (LPC_AHB_BASE + 0x04000)
  1283. #define LPC_LCD_BASE (LPC_AHB_BASE + 0x08000)
  1284. #define LPC_USB_BASE (LPC_AHB_BASE + 0x0C000)
  1285. #define LPC_CRC_BASE (LPC_AHB_BASE + 0x10000)
  1286. #define LPC_GPIO0_BASE (LPC_AHB_BASE + 0x18000)
  1287. #define LPC_GPIO1_BASE (LPC_AHB_BASE + 0x18020)
  1288. #define LPC_GPIO2_BASE (LPC_AHB_BASE + 0x18040)
  1289. #define LPC_GPIO3_BASE (LPC_AHB_BASE + 0x18060)
  1290. #define LPC_GPIO4_BASE (LPC_AHB_BASE + 0x18080)
  1291. #define LPC_GPIO5_BASE (LPC_AHB_BASE + 0x180A0)
  1292. #define LPC_EMC_BASE (LPC_AHB_BASE + 0x1C000)
  1293. #define LPC_EEPROM_BASE (LPC_FLASH_BASE+ 0x200080)
  1294. /******************************************************************************/
  1295. /* Peripheral declaration */
  1296. /******************************************************************************/
  1297. #define LPC_SC ((LPC_SC_TypeDef *) LPC_SC_BASE )
  1298. #define LPC_WDT ((LPC_WDT_TypeDef *) LPC_WDT_BASE )
  1299. #define LPC_TIM0 ((LPC_TIM_TypeDef *) LPC_TIM0_BASE )
  1300. #define LPC_TIM1 ((LPC_TIM_TypeDef *) LPC_TIM1_BASE )
  1301. #define LPC_TIM2 ((LPC_TIM_TypeDef *) LPC_TIM2_BASE )
  1302. #define LPC_TIM3 ((LPC_TIM_TypeDef *) LPC_TIM3_BASE )
  1303. #define LPC_UART0 ((LPC_UART_TypeDef *) LPC_UART0_BASE )
  1304. #define LPC_UART1 ((LPC_UART1_TypeDef *) LPC_UART1_BASE )
  1305. #define LPC_UART2 ((LPC_UART_TypeDef *) LPC_UART2_BASE )
  1306. #define LPC_UART3 ((LPC_UART_TypeDef *) LPC_UART3_BASE )
  1307. #define LPC_UART4 ((LPC_UART4_TypeDef *) LPC_UART4_BASE )
  1308. #define LPC_PWM0 ((LPC_PWM_TypeDef *) LPC_PWM0_BASE )
  1309. #define LPC_PWM1 ((LPC_PWM_TypeDef *) LPC_PWM1_BASE )
  1310. #define LPC_I2C0 ((LPC_I2C_TypeDef *) LPC_I2C0_BASE )
  1311. #define LPC_I2C1 ((LPC_I2C_TypeDef *) LPC_I2C1_BASE )
  1312. #define LPC_I2C2 ((LPC_I2C_TypeDef *) LPC_I2C2_BASE )
  1313. #define LPC_I2S ((LPC_I2S_TypeDef *) LPC_I2S_BASE )
  1314. #define LPC_COMPARATOR ((LPC_COMPARATOR_Type *) LPC_COMPARATOR_BASE)
  1315. #define LPC_RTC ((LPC_RTC_TypeDef *) LPC_RTC_BASE )
  1316. #define LPC_GPIOINT ((LPC_GPIOINT_TypeDef *) LPC_GPIOINT_BASE )
  1317. #define LPC_IOCON ((LPC_IOCON_TypeDef *) LPC_IOCON_BASE )
  1318. #define LPC_SSP0 ((LPC_SSP_TypeDef *) LPC_SSP0_BASE )
  1319. #define LPC_SSP1 ((LPC_SSP_TypeDef *) LPC_SSP1_BASE )
  1320. #define LPC_SSP2 ((LPC_SSP_TypeDef *) LPC_SSP2_BASE )
  1321. #define LPC_ADC ((LPC_ADC_TypeDef *) LPC_ADC_BASE )
  1322. #define LPC_DAC ((LPC_DAC_TypeDef *) LPC_DAC_BASE )
  1323. #define LPC_CANAF_RAM ((LPC_CANAF_RAM_TypeDef *) LPC_CANAF_RAM_BASE)
  1324. #define LPC_CANAF ((LPC_CANAF_TypeDef *) LPC_CANAF_BASE )
  1325. #define LPC_CANCR ((LPC_CANCR_TypeDef *) LPC_CANCR_BASE )
  1326. #define LPC_CAN1 ((LPC_CAN_TypeDef *) LPC_CAN1_BASE )
  1327. #define LPC_CAN2 ((LPC_CAN_TypeDef *) LPC_CAN2_BASE )
  1328. #define LPC_MCPWM ((LPC_MCPWM_TypeDef *) LPC_MCPWM_BASE )
  1329. #define LPC_QEI ((LPC_QEI_TypeDef *) LPC_QEI_BASE )
  1330. #define LPC_MCI ((LPC_MCI_TypeDef *) LPC_MCI_BASE )
  1331. #define LPC_GPDMA ((LPC_GPDMA_TypeDef *) LPC_GPDMA_BASE )
  1332. #define LPC_GPDMACH0 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH0_BASE )
  1333. #define LPC_GPDMACH1 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH1_BASE )
  1334. #define LPC_GPDMACH2 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH2_BASE )
  1335. #define LPC_GPDMACH3 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH3_BASE )
  1336. #define LPC_GPDMACH4 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH4_BASE )
  1337. #define LPC_GPDMACH5 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH5_BASE )
  1338. #define LPC_GPDMACH6 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH6_BASE )
  1339. #define LPC_GPDMACH7 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH7_BASE )
  1340. #define LPC_EMAC ((LPC_EMAC_TypeDef *) LPC_EMAC_BASE )
  1341. #define LPC_LCD ((LPC_LCD_TypeDef *) LPC_LCD_BASE )
  1342. #define LPC_USB ((LPC_USB_TypeDef *) LPC_USB_BASE )
  1343. #define LPC_GPIO0 ((LPC_GPIO_TypeDef *) LPC_GPIO0_BASE )
  1344. #define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
  1345. #define LPC_GPIO2 ((LPC_GPIO_TypeDef *) LPC_GPIO2_BASE )
  1346. #define LPC_GPIO3 ((LPC_GPIO_TypeDef *) LPC_GPIO3_BASE )
  1347. #define LPC_GPIO4 ((LPC_GPIO_TypeDef *) LPC_GPIO4_BASE )
  1348. #define LPC_GPIO5 ((LPC_GPIO_TypeDef *) LPC_GPIO5_BASE )
  1349. #define LPC_EMC ((LPC_EMC_TypeDef *) LPC_EMC_BASE )
  1350. #define LPC_CRC ((LPC_CRC_TypeDef *) LPC_CRC_BASE )
  1351. #define LPC_EEPROM ((LPC_EEPROM_TypeDef *) LPC_EEPROM_BASE )
  1352. #endif // __LPC407x_8x_H__