lpc1768.pp 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit lpc1768;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. {$goto on}
  5. {$define lpc1768}
  6. interface
  7. {$PACKRECORDS 2}
  8. //
  9. // STCTRL : DWord absolute $E000E010;
  10. // STRELOAD : DWord absolute $E000E014;
  11. // STCURR : DWord absolute $E000E018;
  12. //
  13. // FIO1DIR2 : Byte absolute $2009C022;
  14. // FIO1SET2 : Byte absolute $2009C03A;
  15. // FIO1CLR2 : Byte absolute $2009C03E;
  16. //
  17. // SCS : DWord absolute $400FC1A0;
  18. // CLKSRCSEL: DWord absolute $400FC10C;
  19. // PLL0FEED : DWord absolute $400FC08C;
  20. // PLL0CON : DWord absolute $400FC080;
  21. // PLL0CFG : DWord absolute $400FC084;
  22. // PLL0STAT : DWord absolute $400FC088;
  23. // CCLKCFG : DWord absolute $400FC104;
  24. //
  25. Const
  26. NonMaskableInt_IRQn = -14; // 2 Non Maskable // interrupt
  27. HardFault_IRQn = -13; // 4 Cortex-M3 Memory Management // interrupt
  28. MemoryManagement_IRQn = -12; // 4 Cortex-M3 Memory Management // interrupt
  29. BusFault_IRQn = -11; // 5 Cortex-M3 Bus Fault // interrupt
  30. UsageFault_IRQn = -10; // 6 Cortex-M3 Usage Fault // interrupt
  31. SVCall_IRQn = -5; // 11 Cortex-M3 SV Call // interrupt
  32. DebugMonitor_IRQn = -4; // 12 Cortex-M3 Debug Monitor // interrupt
  33. PendSV_IRQn = -2; // 14 Cortex-M3 Pend SV // interrupt
  34. SysTick_IRQn = -1; // 15 Cortex-M3 System Tick // interrupt
  35. WWDG_IRQn = 0; // Window WatchDog // interrupt
  36. PVD_IRQn = 1; // PVD through EXTI Line detection // interrupt
  37. TAMPER_IRQn = 2; // Tamper // interrupt
  38. RTC_IRQn = 3; // RTC global // interrupt
  39. FLASH_IRQn = 4; // FLASH global // interrupt
  40. RCC_IRQn = 5; // RCC global // interrupt
  41. EXTI0_IRQn = 6; // EXTI Line0 // interrupt
  42. EXTI1_IRQn = 7; // EXTI Line1 // interrupt
  43. EXTI2_IRQn = 8; // EXTI Line2 // interrupt
  44. EXTI3_IRQn = 9; // EXTI Line3 // interrupt
  45. EXTI4_IRQn = 10; // EXTI Line4 // interrupt
  46. DMA1_Channel1_IRQn = 11; // DMA1 Channel 1 global // interrupt
  47. DMA1_Channel2_IRQn = 12; // DMA1 Channel 2 global // interrupt
  48. DMA1_Channel3_IRQn = 13; // DMA1 Channel 3 global // interrupt
  49. DMA1_Channel4_IRQn = 14; // DMA1 Channel 4 global // interrupt
  50. DMA1_Channel5_IRQn = 15; // DMA1 Channel 5 global // interrupt
  51. DMA1_Channel6_IRQn = 16; // DMA1 Channel 6 global // interrupt
  52. DMA1_Channel7_IRQn = 17; // DMA1 Channel 7 global // interrupt
  53. ADC1_2_IRQn = 18; // ADC1 et ADC2 global // interrupt
  54. USB_HP_CAN1_TX_IRQn = 19; // USB High Priority or CAN1 TX Interrupts
  55. USB_LP_CAN1_RX0_IRQn = 20; // USB Low Priority or CAN1 RX0 Interrupts
  56. CAN1_RX1_IRQn = 21; // CAN1 RX1 // interrupt
  57. CAN1_SCE_IRQn = 22; // CAN1 SCE // interrupt
  58. EXTI9_5_IRQn = 23; // External Line[9:5] Interrupts
  59. TIM1_BRK_IRQn = 24; // TIM1 Break // interrupt
  60. TIM1_UP_IRQn = 25; // TIM1 Update // interrupt
  61. TIM1_TRG_COM_IRQn = 26; // TIM1 Trigger and Commutation // interrupt
  62. TIM1_CC_IRQn = 27; // TIM1 Capture Compare // interrupt
  63. TIM2_IRQn = 28; // TIM2 global // interrupt
  64. TIM3_IRQn = 29; // TIM3 global // interrupt
  65. TIM4_IRQn = 30; // TIM4 global // interrupt
  66. I2C1_EV_IRQn = 31; // I2C1 Event // interrupt
  67. I2C1_ER_IRQn = 32; // I2C1 Error // interrupt
  68. I2C2_EV_IRQn = 33; // I2C2 Event // interrupt
  69. I2C2_ER_IRQn = 34; // I2C2 Error // interrupt
  70. SPI1_IRQn = 35; // SPI1 global // interrupt
  71. SPI2_IRQn = 36; // SPI2 global // interrupt
  72. USART1_IRQn = 37; // USART1 global // interrupt
  73. USART2_IRQn = 38; // USART2 global // interrupt
  74. USART3_IRQn = 39; // USART3 global // interrupt
  75. EXTI15_10_IRQn = 40; // External Line[15:10] Interrupts
  76. RTCAlarm_IRQn = 41; // RTC Alarm through EXTI Line // interrupt
  77. USBWakeUp_IRQn = 42; // USB WakeUp from suspend through EXTI Line // interrupt
  78. TIM8_BRK_IRQn = 43; // TIM8 Break // interrupt
  79. TIM8_UP_IRQn = 44; // TIM8 Update // interrupt
  80. TIM8_TRG_COM_IRQn = 45; // TIM8 Trigger and Commutation // interrupt
  81. TIM8_CC_IRQn = 46; // TIM8 Capture Compare // interrupt
  82. ADC3_IRQn = 47; // ADC3 global // interrupt
  83. FSMC_IRQn = 48; // FSMC global // interrupt
  84. SDIO_IRQn = 49; // SDIO global // interrupt
  85. TIM5_IRQn = 50; // TIM5 global // interrupt
  86. SPI3_IRQn = 51; // SPI3 global // interrupt
  87. UART4_IRQn = 52; // UART4 global // interrupt
  88. UART5_IRQn = 53; // UART5 global // interrupt
  89. TIM6_IRQn = 54; // TIM6 global // interrupt
  90. TIM7_IRQn = 55; // TIM7 global // interrupt
  91. DMA2_Channel1_IRQn = 56; // DMA2 Channel 1 global // interrupt
  92. DMA2_Channel2_IRQn = 57; // DMA2 Channel 2 global // interrupt
  93. DMA2_Channel3_IRQn = 58; // DMA2 Channel 3 global // interrupt
  94. DMA2_Channel4_5_IRQn = 59; // DMA2 Channel 4 and Channel 5 global // interrupt
  95. Type
  96. //*------------- System Control (SC) ------------------------------------------*/
  97. TSCRegisters = Record
  98. FLASHCFG : DWord; // Flash Accelerator Module */
  99. RESERVED0 : Array [1..31] Of DWord;
  100. PLL0CON : DWord; // Clocking and Power Control */
  101. PLL0CFG : DWord;
  102. PLL0STAT : DWord;
  103. PLL0FEED : DWord;
  104. RESERVED1 : Array [1..4] Of DWord;
  105. PLL1CON : DWord;
  106. PLL1CFG : DWord;
  107. PLL1STAT : DWord;
  108. PLL1FEED : DWord;
  109. RESERVED2 : Array [1..4] Of DWord;
  110. PCON : DWord;
  111. PCONP : DWord;
  112. RESERVED3 : Array [1..15] Of DWord;
  113. CCLKCFG : DWord;
  114. USBCLKCFG : DWord;
  115. CLKSRCSEL : DWord;
  116. RESERVED4 : Array [1..12] Of DWord;
  117. EXTINT : DWord; // External Interrupts */
  118. RESERVED5 : DWord;
  119. EXTMODE : DWord;
  120. EXTPOLAR : DWord;
  121. RESERVED : Array [1..12] Of DWord;
  122. RSID : DWord; // Reset */
  123. RESERVED7 : Array [1..7] Of DWord;
  124. SCS : DWord; // Syscon Miscellaneous Registers */
  125. IRCTRIM : DWord; // Clock Dividers */
  126. PCLKSEL0 : DWord;
  127. PCLKSEL1 : DWord;
  128. RESERVED8 : Array [1..4] Of DWord;
  129. USBIntSt : DWord; // USB Device/OTG Interrupt Register */
  130. DMAREQSEL : DWord;
  131. CLKOUTCFG : DWord; // Clock Output Configuration */
  132. End;
  133. //*------------- Pin Connect Block (PINCON) -----------------------------------*/
  134. TPINCONRegisters = Record
  135. PINSEL0 : DWord;
  136. PINSEL1 : DWord;
  137. PINSEL2 : DWord;
  138. PINSEL3 : DWord;
  139. PINSEL4 : DWord;
  140. PINSEL5 : DWord;
  141. PINSEL6 : DWord;
  142. PINSEL7 : DWord;
  143. PINSEL8 : DWord;
  144. PINSEL9 : DWord;
  145. PINSEL10 : DWord;
  146. RESERVED0 : Array [1..5] Of DWord;
  147. PINMODE0 : DWord;
  148. PINMODE1 : DWord;
  149. PINMODE2 : DWord;
  150. PINMODE3 : DWord;
  151. PINMODE4 : DWord;
  152. PINMODE5 : DWord;
  153. PINMODE6 : DWord;
  154. PINMODE7 : DWord;
  155. PINMODE8 : DWord;
  156. PINMODE9 : DWord;
  157. PINMODE_OD0 : DWord;
  158. PINMODE_OD1 : DWord;
  159. PINMODE_OD2 : DWord;
  160. PINMODE_OD3 : DWord;
  161. PINMODE_OD4 : DWord;
  162. I2CPADCFG : DWord;
  163. End;
  164. //------------- General Purpose Input/Output (GPIO) --------------------------*/
  165. {
  166. TGPIORegisters = Record
  167. Case Byte Of
  168. 0: (FIODIR: DWord);
  169. 1: (FIORIRL, FIODIRH: Word);
  170. 2: (FIODIR0, FIODIR1, FIODIR2, FIODIR3: Byte);
  171. End;
  172. RESERVED0: Array [1..3] Of DWord;;
  173. Case Byte Of
  174. 0: (FIOMASK: DWord);
  175. 1: (FIOMASKL, FIOMASKH: Word);
  176. 2: (FIOMASK0, FIOMASK1, FIOMASK2, FIOMASK3: Byte);
  177. End;
  178. Case Byte Of
  179. 0: (FIOPIN: DWord);
  180. 1: (FIOPINL, FIOPINH: Word);
  181. 2: (FIOPIN0, FIOPIN1, FIOPIN2, FIOPIN3: Byte);
  182. End;
  183. Case Byte Of
  184. 0: (FIOSET: DWord);
  185. 1: (FIOSETL, FIOSETH: Word);
  186. 2: (FIOSET0, FIOSET1, FIOSET2, FIOSET3: Byte);
  187. End;
  188. Case Byte Of
  189. 0: (FIOCLR: DWord);
  190. 1: (FIOCLRL, FIOSETH: Word);
  191. 2: (FIOCLR0, FIOCLR1, FIOCLR2, FIOCLR3: Byte);
  192. End;
  193. End;
  194. }
  195. TGPIORegisters = Record
  196. FIODIR: DWord;
  197. RESERVED0: Array [1..3] Of DWord;
  198. FIOMASK: DWord;
  199. FIOPIN: DWord;
  200. FIOSET: DWord;
  201. FIOCLR: DWord;
  202. End;
  203. TGPIOINTRegisters = Record
  204. IntStatus: DWord;
  205. IO0IntStatR: DWord;
  206. IO0IntStatF: DWord;
  207. IO0IntClr: DWord;
  208. IO0IntEnR: DWord;
  209. IO0IntEnF: DWord;
  210. RESERVED0: Array [1..2] Of DWord;
  211. IO2IntStatR: DWord;
  212. IO2IntStatF: DWord;
  213. IO2IntClr: DWord;
  214. IO2IntEnR: DWord;
  215. IO2IntEnF: DWord;
  216. End;
  217. //*------------- Timer (TIM) --------------------------------------------------*/
  218. TTIMRegisters = Record
  219. IR: DWord;
  220. TCR: DWord;
  221. TC: DWord;
  222. PR: DWord;
  223. PC: DWord;
  224. MCR: DWord;
  225. MR0: DWord;
  226. MR1: DWord;
  227. MR2: DWord;
  228. MR3: DWord;
  229. CCR: DWord;
  230. CR0: DWord;
  231. CR1: DWord;
  232. RESERVED0: Array [1..2] Of DWord;
  233. EMR: DWord;
  234. RESERVED1: Array [1..12] Of DWord;
  235. CTCR: DWord;
  236. End;
  237. //*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
  238. TPWMRegisters = Record
  239. IR: DWord;
  240. TCR: DWord;
  241. TC: DWord;
  242. PR: DWord;
  243. PC: DWord;
  244. MCR: DWord;
  245. MR0: DWord;
  246. MR1: DWord;
  247. MR2: DWord;
  248. MR3: DWord;
  249. CCR: DWord;
  250. CR0: DWord;
  251. CR1: DWord;
  252. CR2: DWord;
  253. CR3: DWord;
  254. RESERVED0: DWord;
  255. MR4: DWord;
  256. MR5: DWord;
  257. MR6: DWord;
  258. PCR: DWord;
  259. LER: DWord;
  260. RESERVED1: Array [1..7] Of DWord;
  261. CTCR: DWord;
  262. End;
  263. //*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
  264. {
  265. TUARTRegisters = Record
  266. Case Byte Of
  267. 0: (RBR: Byte);
  268. 1: (THR: Byte);
  269. 2: (DLL: Byte);
  270. 3: (RESERVED: DWord);
  271. End;
  272. Case Byte Of
  273. 0: (DLM: Byte);
  274. 1: (IER: DWord);
  275. End;
  276. Case Byte Of
  277. 0: (IIR: DWord);
  278. 1: (FCR: Byte);
  279. End;
  280. LCR: Byte;
  281. RESERVED1: Array [1..7] Of Byte;
  282. LSR: Byte;
  283. RESERVED2: Array [1..7] Of Byte;
  284. SCR: Byte;
  285. RESERVED3: Array [1..3] Of Byte;
  286. ACR: DWord;
  287. ICR: Byte;
  288. RESERVED4: Array [1..3] Of Byte;
  289. FDR: Byte;
  290. RESERVED5: Array [1..7] Of Byte;
  291. TER: Byte;
  292. RESERVED6: Array [1..39] Of Byte;
  293. FIFOLVL: Byte;
  294. End;
  295. TUART0Registers = Record
  296. Case Byte Of
  297. 0: (RBR: Byte);
  298. 1: (THR: Byte);
  299. 2: (DLL: Byte);
  300. 3: (RESERVED: DWord);
  301. End;
  302. Case Byte Of
  303. 0: (DLM: Byte);
  304. 1: (IER: DWord);
  305. End;
  306. Case Byte Of
  307. 0: (IIR: DWord);
  308. 1: (FCR: Byte);
  309. End;
  310. LCR: Byte;
  311. RESERVED1: Array [1..7] Of Byte;
  312. LSR: Byte;
  313. RESERVED2: Array [1..7] Of Byte;
  314. SCR: Byte;
  315. RESERVED3: Array [1..3] Of Byte;
  316. ACR: DWord;
  317. ICR: Byte;
  318. RESERVED4: Array [1..3] Of Byte;
  319. FDR: Byte;
  320. RESERVED5: Array [1..7] Of Byte;
  321. TER: Byte;
  322. RESERVED6: Array [1..39] Of Byte;
  323. FIFOLVL: Byte;
  324. End;
  325. TUART1Registers = Record
  326. Case Byte Of
  327. 0: (RBR: Byte);
  328. 1: (THR: Byte);
  329. 2: (DLL: Byte);
  330. 3: (RESERVED: DWord);
  331. End;
  332. Case Byte Of
  333. 0: (DLM: Byte);
  334. 1: (IER: DWord);
  335. End;
  336. Case Byte Of
  337. 0: (IIR: DWord);
  338. 1: (FCR: Byte);
  339. End;
  340. LCR: Byte;
  341. RESERVED1: Array [1..3] Of Byte;
  342. MCR: Byte;
  343. RESERVED2: Array [1..3] Of Byte;
  344. LSR: Byte;
  345. RESERVED3: Array [1..3] Of Byte;
  346. MSR: Byte;
  347. RESERVED4: Array [1..3] Of Byte;
  348. SCR: Byte;
  349. RESERVED5: Array [1..3] Of Byte;
  350. ACR: DWord;
  351. RESERVED6: DWord;
  352. FDR: DWord;
  353. RESERVED7: DWord;
  354. TER: Byte;
  355. RESERVED8: Array [1..27] Of Byte;
  356. RS485CTRL: Byte;
  357. RESERVED9: Array [1..3] Of Byte;
  358. ADRMATCH: Byte;
  359. RESERVED10: Array [1..3] Of Byte;
  360. RS485DLY: Byte;
  361. RESERVED11: Array [1..3] Of Byte;
  362. FIFOLVL: Byte
  363. End;
  364. }
  365. //*------------- Serial Peripheral Interface (SPI) ----------------------------*/
  366. TSPIRegisters = Record
  367. SPCR : DWord;
  368. SPSR : DWord;
  369. SPDR : DWord;
  370. RESERVED0 : Array [1..3] Of DWord;
  371. SPINT : DWord;
  372. End;
  373. //*------------- Synchronous Serial Communication (SSP) -----------------------*/
  374. TSSPRegisters = Record
  375. CR0,
  376. CR1,
  377. DR,
  378. SR,
  379. CPSR,
  380. IMSC,
  381. RIS,
  382. MIS,
  383. ICR,
  384. DMACR : DWord;
  385. End;
  386. //*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
  387. TI2CRegisters = Record
  388. I2CONSET : DWord;
  389. I2STAT : DWord;
  390. I2DAT : DWord;
  391. I2ADR0 : DWord;
  392. I2SCLH : DWord;
  393. I2SCLL : DWord;
  394. I2CONCLR : DWord;
  395. MMCTRL : DWord;
  396. I2ADR1 : DWord;
  397. I2ADR2 : DWord;
  398. I2ADR3 : DWord;
  399. I2DATA_BUFFER : DWord;
  400. I2MASK0 : DWord;
  401. I2MASK1 : DWord;
  402. I2MASK2 : DWord;
  403. I2MASK3 : DWord;
  404. End;
  405. //*------------- Inter IC Sound (I2S) -----------------------------------------*/
  406. TI2SRegisters = Record
  407. I2SDAO : DWord;
  408. I2SDAI : DWord;
  409. I2STXFIFO : DWord;
  410. I2SRXFIFO : DWord;
  411. I2SSTATE : DWord;
  412. I2SDMA1 : DWord;
  413. I2SDMA2 : DWord;
  414. I2SIRQ : DWord;
  415. I2STXRATE : DWord;
  416. I2SRXRATE : DWord;
  417. I2STXBITRATE : DWord;
  418. I2SRXBITRATE : DWord;
  419. I2STXMODE : DWord;
  420. I2SRXMODE : DWord;
  421. End;
  422. //*------------- Repetitive Interrupt Timer (RIT) -----------------------------*/
  423. TRITRegisters = Record
  424. RICOMPVAL : DWord;
  425. RIMASK : DWord;
  426. RICTRL : Byte;
  427. RESERVED0 : Array [1..3] Of Byte;
  428. RICOUNTER : DWord;
  429. End;
  430. //*------------- Real-Time Clock (RTC) ----------------------------------------*/
  431. TRTCRegisters = Record
  432. ILR : Byte;
  433. RESERVED0 : Array [1..7] Of Byte;
  434. CCR : Byte;
  435. RESERVED1 : Array [1..3] Of Byte;
  436. CIIR : Byte;
  437. RESERVED2 : Array [1..3] Of Byte;
  438. AMR : Byte;
  439. RESERVED3 : Array [1..3] Of Byte;
  440. CTIME0 : DWord;
  441. CTIME1 : DWord;
  442. CTIME2 : DWord;
  443. SEC : Byte;
  444. RESERVED4 : Array [1..3] Of Byte;
  445. MIN : Byte;
  446. RESERVED5 : Array [1..3] Of Byte;
  447. HOUR : Byte;
  448. RESERVED6 : Array [1..3] Of Byte;
  449. DOM : Byte;
  450. RESERVED7 : Array [1..3] Of Byte;
  451. DOW : Byte;
  452. RESERVED8 : Array [1..3] Of Byte;
  453. DOY : Word;
  454. RESERVED9 : Word;
  455. MONTH : Byte;
  456. RESERVED10 : Array [1..3] Of Byte;
  457. YEAR : Word;
  458. RESERVED11 : Word;
  459. CALIBRATION : DWord;
  460. GPREG0 : DWord;
  461. GPREG1 : DWord;
  462. GPREG2 : DWord;
  463. GPREG3 : DWord;
  464. GPREG4 : DWord;
  465. RTC_AUXEN : Byte;
  466. RESERVED12 : Array [1..3] Of Byte;
  467. RTC_AUX : Byte;
  468. RESERVED13 : Array [1..3] Of Byte;
  469. ALSEC : Byte;
  470. RESERVED14 : Array [1..3] Of Byte;
  471. ALMIN : Byte;
  472. RESERVED15 : Array [1..3] Of Byte;
  473. ALHOUR : Byte;
  474. RESERVED16 : Array [1..3] Of Byte;
  475. ALDOM : Byte;
  476. RESERVED17 : Array [1..3] Of Byte;
  477. ALDOW : Byte;
  478. RESERVED18 : Array [1..3] Of Byte;
  479. ALDOY : Word;
  480. RESERVED19 : Word;
  481. ALMON : Byte;
  482. RESERVED20 : Array [1..3] Of Byte;
  483. ALYEAR : Word;
  484. RESERVED21 : Word;
  485. End;
  486. //*------------- Watchdog Timer (WDT) -----------------------------------------*/
  487. TWDTRegisters = Record
  488. WDMOD : Byte;
  489. RESERVED0 : Array [1..3] Of Byte;
  490. WDTC : DWord;
  491. WDFEED : Byte;
  492. RESERVED1 : Array [1..3] Of Byte;
  493. WDTV : DWord;
  494. WDCLKSEL : DWord;
  495. End;
  496. //*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
  497. TADCRegisters = Record
  498. ADCR : DWord;
  499. ADGDR : DWord;
  500. RESERVED0 : DWord;
  501. ADINTEN : DWord;
  502. ADDR0 : DWord;
  503. ADDR1 : DWord;
  504. ADDR2 : DWord;
  505. ADDR3 : DWord;
  506. ADDR4 : DWord;
  507. ADDR5 : DWord;
  508. ADDR6 : DWord;
  509. ADDR7 : DWord;
  510. ADSTAT : DWord;
  511. ADTRM : DWord;
  512. End;
  513. //*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
  514. TDACRegisters = Record
  515. DACR : DWord;
  516. DACCTRL : DWord;
  517. DACCNTVAL : Word;
  518. End;
  519. //*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
  520. TMCPWMRegisters = Record
  521. MCCON : DWord;
  522. MCCON_SET : DWord;
  523. MCCON_CLR : DWord;
  524. MCCAPCON : DWord;
  525. MCCAPCON_SET : DWord;
  526. MCCAPCON_CLR : DWord;
  527. MCTIM0 : DWord;
  528. MCTIM1 : DWord;
  529. MCTIM2 : DWord;
  530. MCPER0 : DWord;
  531. MCPER1 : DWord;
  532. MCPER2 : DWord;
  533. MCPW0 : DWord;
  534. MCPW1 : DWord;
  535. MCPW2 : DWord;
  536. MCDEADTIME : DWord;
  537. MCCCP : DWord;
  538. MCCR0 : DWord;
  539. MCCR1 : DWord;
  540. MCCR2 : DWord;
  541. MCINTEN : DWord;
  542. MCINTEN_SET : DWord;
  543. MCINTEN_CLR : DWord;
  544. MCCNTCON : DWord;
  545. MCCNTCON_SET : DWord;
  546. MCCNTCON_CLR : DWord;
  547. MCINTFLAG : DWord;
  548. MCINTFLAG_SET: DWord;
  549. MCINTFLAG_CLR: DWord;
  550. MCCAP_CLR : DWord;
  551. End;
  552. //*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
  553. TQEIRegisters = Record
  554. QEICON: DWord;
  555. QEISTAT: DWord;
  556. QEICONF: DWord;
  557. QEIPOS: DWord;
  558. QEIMAXPOS: DWord;
  559. CMPOS0: DWord;
  560. CMPOS1: DWord;
  561. CMPOS2: DWord;
  562. INXCNT: DWord;
  563. INXCMP: DWord;
  564. QEILOAD: DWord;
  565. QEITIME: DWord;
  566. QEIVEL: DWord;
  567. QEICAP: DWord;
  568. VELCOMP: DWord;
  569. FILTER: DWord;
  570. RESERVED0: Array [1..998] Of DWord;
  571. QEIIEC: DWord;
  572. QEIIES: DWord;
  573. QEIINTSTAT: DWord;
  574. QEIIE: DWord;
  575. QEICLR: DWord;
  576. QEISET: DWord;
  577. End;
  578. //*------------- Controller Area Network (CAN) --------------------------------*/
  579. TCANAF_RAMRegisters = Record
  580. MASK: Array [1..512] Of DWord; //* ID Masks */
  581. End;
  582. TCANAF = Record //* Acceptance Filter Registers */
  583. AFMR: DWord;
  584. SFF_sa: DWord;
  585. SFF_GRP_sa: DWord;
  586. EFF_sa: DWord;
  587. EFF_GRP_sa: DWord;
  588. ENDofTable: DWord;
  589. LUTerrAd: DWord;
  590. LUTerr: DWord;
  591. FCANIE: DWord;
  592. FCANIC0: DWord;
  593. FCANIC1: DWord;
  594. End;
  595. TCANCRRegisters = Record //* Central Registers */
  596. CANTxSR: DWord;
  597. CANRxSR: DWord;
  598. CANMSR: DWord;
  599. End;
  600. TCANRegisters = Record //* Controller Registers */
  601. _MOD: DWord;
  602. CMR: DWord;
  603. GSR: DWord;
  604. ICR: DWord;
  605. IER: DWord;
  606. BTR: DWord;
  607. EWL: DWord;
  608. SR: DWord;
  609. RFS: DWord;
  610. RID: DWord;
  611. RDA: DWord;
  612. RDB: DWord;
  613. TFI1: DWord;
  614. TID1: DWord;
  615. TDA1: DWord;
  616. TDB1: DWord;
  617. TFI2: DWord;
  618. TID2: DWord;
  619. TDA2: DWord;
  620. TDB2: DWord;
  621. TFI3: DWord;
  622. TID3: DWord;
  623. TDA3: DWord;
  624. TDB3: DWord;
  625. End;
  626. //*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
  627. TGPDMARegisters = Record //* Common Registers */
  628. DMACIntStat: DWord;
  629. DMACIntTCStat: DWord;
  630. DMACIntTCClear: DWord;
  631. DMACIntErrStat: DWord;
  632. DMACIntErrClr: DWord;
  633. DMACRawIntTCStat: DWord;
  634. DMACRawIntErrStat: DWord;
  635. DMACEnbldChns: DWord;
  636. DMACSoftBReq: DWord;
  637. DMACSoftSReq: DWord;
  638. DMACSoftLBReq: DWord;
  639. DMACSoftLSReq: DWord;
  640. DMACConfig: DWord;
  641. DMACSync: DWord;
  642. End;
  643. TGPDMACHRegisters = Record //* Channel Registers */
  644. DMACCSrcAddr : DWord;
  645. DMACCDestAddr : DWord;
  646. DMACCLLI : DWord;
  647. DMACCControl : DWord;
  648. DMACCConfig : DWord;
  649. End;
  650. //*------------- Universal Serial Bus (USB) -----------------------------------*/
  651. TUSBRegisters = Record
  652. HcRevision: DWord; //* USB Host Registers */
  653. HcControl: DWord;
  654. HcCommandStatus: DWord;
  655. HcInterruptStatus: DWord;
  656. HcInterruptEnable: DWord;
  657. HcInterruptDisable: DWord;
  658. HcHCCA: DWord;
  659. HcPeriodCurrentED: DWord;
  660. HcControlHeadED: DWord;
  661. HcControlCurrentED: DWord;
  662. HcBulkHeadED: DWord;
  663. HcBulkCurrentED: DWord;
  664. HcDoneHead: DWord;
  665. HcFmInterval: DWord;
  666. HcFmRemaining: DWord;
  667. HcFmNumber: DWord;
  668. HcPeriodicStart: DWord;
  669. HcLSTreshold: DWord;
  670. HcRhDescriptorA: DWord;
  671. HcRhDescriptorB: DWord;
  672. HcRhStatus: DWord;
  673. HcRhPortStatus1: DWord;
  674. HcRhPortStatus2: DWord;
  675. RESERVED0: Array [1..40] Of DWord;
  676. Module_ID: DWord;
  677. OTGIntSt: DWord; //* USB On-The-Go Registers */
  678. OTGIntEn: DWord;
  679. OTGIntSet: DWord;
  680. OTGIntClr: DWord;
  681. OTGStCtrl: DWord;
  682. OTGTmr: DWord;
  683. RESERVED1: Array [1..58] Of DWord;
  684. USBDevIntSt: DWord; // USB Device Interrupt Registers */
  685. USBDevIntEn: DWord;
  686. USBDevIntClr: DWord;
  687. USBDevIntSet: DWord;
  688. USBCmdCode: DWord; // USB Device SIE Command Registers */
  689. USBCmdData: DWord;
  690. USBRxData: DWord; // USB Device Transfer Registers */
  691. USBTxData: DWord;
  692. USBRxPLen: DWord;
  693. USBTxPLen: DWord;
  694. USBCtrl: DWord;
  695. USBDevIntPri: DWord;
  696. USBEpIntSt: DWord; // USB Device Endpoint Interrupt Regs */
  697. USBEpIntEn: DWord;
  698. USBEpIntClr: DWord;
  699. USBEpIntSet: DWord;
  700. USBEpIntPri: DWord;
  701. USBReEp: DWord; // USB Device Endpoint Realization Reg*/
  702. USBEpInd: DWord;
  703. USBMaxPSize: DWord;
  704. USBDMARSt: DWord; // USB Device DMA Registers */
  705. USBDMARClr: DWord;
  706. USBDMARSet: DWord;
  707. RESERVED2:Array [1..9] Of DWord;
  708. USBUDCAH: DWord;
  709. USBEpDMASt: DWord;
  710. USBEpDMAEn: DWord;
  711. USBEpDMADis: DWord;
  712. USBDMAIntSt: DWord;
  713. USBDMAIntEn: DWord;
  714. RESERVED3:Array [1..2] Of DWord;
  715. USBEoTIntSt: DWord;
  716. USBEoTIntClr: DWord;
  717. USBEoTIntSet: DWord;
  718. USBNDDRIntSt: DWord;
  719. USBNDDRIntClr: DWord;
  720. USBNDDRIntSet: DWord;
  721. USBSysErrIntSt: DWord;
  722. USBSysErrIntClr: DWord;
  723. USBSysErrIntSet: DWord;
  724. RESERVED4: Array [1..15] Of DWord;
  725. I2C_RX: DWord; // USB OTG I2C Registers */
  726. I2C_WO: DWord;
  727. I2C_STS: DWord;
  728. I2C_CTL: DWord;
  729. I2C_CLKHI: DWord;
  730. I2C_CLKLO: DWord;
  731. RESERVED5:Array [1..823] Of DWord;
  732. USBClkCtrl: Byte; // USB Clock Control Registers */
  733. End;
  734. ///------------- Ethernet Media Access Controller (EMAC) ----------------------*/
  735. TEMACRegisters = Record
  736. MAC1: DWord; // MAC Registers */
  737. MAC2: DWord;
  738. IPGT: DWord;
  739. IPGR: DWord;
  740. CLRT: DWord;
  741. MAXF: DWord;
  742. SUPP: DWord;
  743. TEST: DWord;
  744. MCFG: DWord;
  745. MCMD: DWord;
  746. MADR: DWord;
  747. MWTD: DWord;
  748. MRDD: DWord;
  749. MIND: DWord;
  750. RESERVED0:Array [1..2] Of DWord;
  751. SA0: DWord;
  752. SA1: DWord;
  753. SA2: DWord;
  754. RESERVED1:Array [1..45] Of DWord;
  755. Command: DWord; // Control Registers */
  756. Status: DWord;
  757. RxDescriptor: DWord;
  758. RxStatus: DWord;
  759. RxDescriptorNumber: DWord;
  760. RxProduceIndex: DWord;
  761. RxConsumeIndex: DWord;
  762. TxDescriptor: DWord;
  763. TxStatus: DWord;
  764. TxDescriptorNumber: DWord;
  765. TxProduceIndex: DWord;
  766. TxConsumeIndex: DWord;
  767. RESERVED2:Array [1..10] Of DWord;
  768. TSV0: DWord;
  769. TSV1: DWord;
  770. RSV: DWord;
  771. RESERVED3: Array [1..3] Of DWord;
  772. FlowControlCounter: DWord;
  773. FlowControlStatus: DWord;
  774. RESERVED4: Array [1..34] Of DWord;
  775. RxFilterCtrl: DWord; // Rx Filter Registers */
  776. RxFilterWoLStatus: DWord;
  777. RxFilterWoLClear: DWord;
  778. RESERVED5: DWord;
  779. HashFilterL: DWord;
  780. HashFilterH: DWord;
  781. RESERVED6:Array [1..882] Of DWord;
  782. IntStatus: DWord; // Module Control Registers */
  783. IntEnable: DWord;
  784. IntClear: DWord;
  785. IntSet: DWord;
  786. RESERVED7: DWord;
  787. PowerDown: DWord;
  788. RESERVED8: DWord;
  789. Module_ID: DWord;
  790. End;
  791. TNVICRegisters = packed record
  792. ISER: array[0..7] of longword;
  793. reserved0: array[0..23] of longword;
  794. ICER: array[0..7] of longword;
  795. reserved1: array[0..23] of longword;
  796. ISPR: array[0..7] of longword;
  797. reserved2: array[0..23] of longword;
  798. ICPR: array[0..7] of longword;
  799. reserved3: array[0..23] of longword;
  800. IABR: array[0..7] of longword;
  801. reserved4: array[0..55] of longword;
  802. IP: array[0..239] of longword;
  803. reserved5: array[0..643] of longword;
  804. STIR: longword;
  805. End;
  806. TSCBRegisters = packed record
  807. CPUID, {!< CPU ID Base Register }
  808. ICSR, {!< Interrupt Control State Register }
  809. VTOR, {!< Vector Table Offset Register }
  810. AIRCR, {!< Application Interrupt / Reset Control Register }
  811. SCR, {!< System Control Register }
  812. CCR: longword; {!< Configuration Control Register }
  813. SHP: array[0..11] of byte; {!< System Handlers Priority Registers (4-7, 8-11, 12-15) }
  814. SHCSR, {!< System Handler Control and State Register }
  815. CFSR, {!< Configurable Fault Status Register }
  816. HFSR, {!< Hard Fault Status Register }
  817. DFSR, {!< Debug Fault Status Register }
  818. MMFAR, {!< Mem Manage Address Register }
  819. BFAR, {!< Bus Fault Address Register }
  820. AFSR: longword; {!< Auxiliary Fault Status Register }
  821. PFR: array[0..1] of longword; {!< Processor Feature Register }
  822. DFR, {!< Debug Feature Register }
  823. ADR: longword; {!< Auxiliary Feature Register }
  824. MMFR: array[0..3] of longword; {!< Memory Model Feature Register }
  825. ISAR: array[0..4] of longword; {!< ISA Feature Register }
  826. end;
  827. TSysTickRegisters = Packed Record
  828. CTRL,
  829. RELOAD,
  830. VAL,
  831. CALIB: LongWord;
  832. End;
  833. // Based on CORE_CM3.H
  834. ///*****************************************************************************/
  835. /// Peripheral memory map */
  836. ///*****************************************************************************/
  837. Const
  838. LPC_SCS_BASE = $E000E000;
  839. LPC_SCB_BASE = (LPC_SCS_BASE + $0D00); // System Control Block Base Address
  840. /// Base addresses */
  841. LPC_FLASH_BASE = ($00000000);
  842. LPC_RAM_BASE = ($10000000);
  843. LPC_GPIO_BASE = ($2009C000);
  844. LPC_APB0_BASE = ($40000000);
  845. LPC_APB1_BASE = ($40080000);
  846. LPC_AHB_BASE = ($50000000);
  847. LPC_CM3_BASE = ($E0000000);
  848. /// APB0 peripherals */
  849. LPC_WDT_BASE = (LPC_APB0_BASE + $00000);
  850. LPC_TIM0_BASE = (LPC_APB0_BASE + $04000);
  851. LPC_TIM1_BASE = (LPC_APB0_BASE + $08000);
  852. LPC_UART0_BASE = (LPC_APB0_BASE + $0C000);
  853. LPC_UART1_BASE = (LPC_APB0_BASE + $10000);
  854. LPC_PWM1_BASE = (LPC_APB0_BASE + $18000);
  855. LPC_I2C0_BASE = (LPC_APB0_BASE + $1C000);
  856. LPC_SPI_BASE = (LPC_APB0_BASE + $20000);
  857. LPC_RTC_BASE = (LPC_APB0_BASE + $24000);
  858. LPC_GPIOINT_BASE = (LPC_APB0_BASE + $28080);
  859. LPC_PINCON_BASE = (LPC_APB0_BASE + $2C000);
  860. LPC_SSP1_BASE = (LPC_APB0_BASE + $30000);
  861. LPC_ADC_BASE = (LPC_APB0_BASE + $34000);
  862. LPC_CANAF_RAM_BASE = (LPC_APB0_BASE + $38000);
  863. LPC_CANAF_BASE = (LPC_APB0_BASE + $3C000);
  864. LPC_CANCR_BASE = (LPC_APB0_BASE + $40000);
  865. LPC_CAN1_BASE = (LPC_APB0_BASE + $44000);
  866. LPC_CAN2_BASE = (LPC_APB0_BASE + $48000);
  867. LPC_I2C1_BASE = (LPC_APB0_BASE + $5C000);
  868. /// APB1 peripherals */
  869. LPC_SSP0_BASE = (LPC_APB1_BASE + $08000);
  870. LPC_DAC_BASE = (LPC_APB1_BASE + $0C000);
  871. LPC_TIM2_BASE = (LPC_APB1_BASE + $10000);
  872. LPC_TIM3_BASE = (LPC_APB1_BASE + $14000);
  873. LPC_UART2_BASE = (LPC_APB1_BASE + $18000);
  874. LPC_UART3_BASE = (LPC_APB1_BASE + $1C000);
  875. LPC_I2C2_BASE = (LPC_APB1_BASE + $20000);
  876. LPC_I2S_BASE = (LPC_APB1_BASE + $28000);
  877. LPC_RIT_BASE = (LPC_APB1_BASE + $30000);
  878. LPC_MCPWM_BASE = (LPC_APB1_BASE + $38000);
  879. LPC_QEI_BASE = (LPC_APB1_BASE + $3C000);
  880. LPC_SC_BASE = (LPC_APB1_BASE + $7C000);
  881. /// AHB peripherals */
  882. LPC_EMAC_BASE = (LPC_AHB_BASE + $00000);
  883. LPC_GPDMA_BASE = (LPC_AHB_BASE + $04000);
  884. LPC_GPDMACH0_BASE = (LPC_AHB_BASE + $04100);
  885. LPC_GPDMACH1_BASE = (LPC_AHB_BASE + $04120);
  886. LPC_GPDMACH2_BASE = (LPC_AHB_BASE + $04140);
  887. LPC_GPDMACH3_BASE = (LPC_AHB_BASE + $04160);
  888. LPC_GPDMACH4_BASE = (LPC_AHB_BASE + $04180);
  889. LPC_GPDMACH5_BASE = (LPC_AHB_BASE + $041A0);
  890. LPC_GPDMACH6_BASE = (LPC_AHB_BASE + $041C0);
  891. LPC_GPDMACH7_BASE = (LPC_AHB_BASE + $041E0);
  892. LPC_USB_BASE = (LPC_AHB_BASE + $0C000);
  893. /// GPIOs */
  894. LPC_GPIO0_BASE = (LPC_GPIO_BASE + $00000);
  895. LPC_GPIO1_BASE = (LPC_GPIO_BASE + $00020);
  896. LPC_GPIO2_BASE = (LPC_GPIO_BASE + $00040);
  897. LPC_GPIO3_BASE = (LPC_GPIO_BASE + $00060);
  898. LPC_GPIO4_BASE = (LPC_GPIO_BASE + $00080);
  899. ///*****************************************************************************/
  900. /// Peripheral declaration */
  901. ///*****************************************************************************/
  902. {$ALIGN 2}
  903. Var
  904. LPC_SC : TSCRegisters Absolute (LPC_SC_BASE);
  905. LPC_SCB : TSCBRegisters Absolute (LPC_SCB_BASE);
  906. LPC_GPIO0 : TGPIORegisters Absolute (LPC_GPIO0_BASE);
  907. LPC_GPIO1 : TGPIORegisters Absolute (LPC_GPIO1_BASE);
  908. LPC_GPIO2 : TGPIORegisters Absolute (LPC_GPIO2_BASE);
  909. LPC_GPIO3 : TGPIORegisters Absolute (LPC_GPIO3_BASE);
  910. LPC_GPIO4 : TGPIORegisters Absolute (LPC_GPIO4_BASE);
  911. LPC_WDT : TWDTRegisters Absolute (LPC_WDT_BASE);
  912. LPC_TIM0 : TTIMRegisters Absolute (LPC_TIM0_BASE);
  913. LPC_TIM1 : TTIMRegisters Absolute (LPC_TIM1_BASE);
  914. LPC_TIM2 : TTIMRegisters Absolute (LPC_TIM2_BASE);
  915. LPC_TIM3 : TTIMRegisters Absolute (LPC_TIM3_BASE);
  916. LPC_RIT : TRITRegisters Absolute (LPC_RIT_BASE);
  917. {
  918. LPC_UART0 : TUART0Registers Absolute (LPC_UART0_BASE);
  919. LPC_UART1 : TUART1Registers Absolute (LPC_UART1_BASE);
  920. LPC_UART2 : TUARTRegisters Absolute (LPC_UART2_BASE);
  921. LPC_UART3 : TUARTRegisters Absolute (LPC_UART3_BASE);
  922. }
  923. LPC_SYSTICK : TSysTickRegisters Absolute (LPC_SCS_BASE+$0010);
  924. LPC_NVIC: TNVICRegisters Absolute (LPC_SCS_BASE+$0100);
  925. LPC_PWM1 : TPWMRegisters Absolute (LPC_PWM1_BASE);
  926. LPC_I2C0 : TI2CRegisters Absolute (LPC_I2C0_BASE);
  927. LPC_I2C1 : TI2CRegisters Absolute (LPC_I2C1_BASE);
  928. LPC_I2C2 : TI2CRegisters Absolute (LPC_I2C2_BASE);
  929. LPC_I2S : TI2SRegisters Absolute (LPC_I2S_BASE);
  930. LPC_SPI : TSPIRegisters Absolute (LPC_SPI_BASE);
  931. LPC_RTC : TRTCRegisters Absolute (LPC_RTC_BASE);
  932. LPC_GPIOINT : TGPIOINTRegisters Absolute (LPC_GPIOINT_BASE);
  933. LPC_PINCON : TPINCONRegisters Absolute (LPC_PINCON_BASE);
  934. LPC_SSP0 : TSSPRegisters Absolute (LPC_SSP0_BASE);
  935. LPC_SSP1 : TSSPRegisters Absolute (LPC_SSP1_BASE);
  936. LPC_ADC : TADCRegisters Absolute (LPC_ADC_BASE);
  937. LPC_DAC : TDACRegisters Absolute (LPC_DAC_BASE);
  938. {
  939. LPC_CANAF_RAM : TCANAF_RAMRegisters Absolute (LPC_CANAF_RAM_BASE);
  940. LPC_CANAF : TCANAFRegisters Absolute (LPC_CANAF_BASE);
  941. LPC_CANCR : TCANCR_RAMRegisters Absolute (LPC_CANCR_BASE);
  942. }
  943. LPC_CAN1 : TCANRegisters Absolute (LPC_CAN1_BASE);
  944. LPC_CAN2 : TCANRegisters Absolute (LPC_CAN2_BASE);
  945. LPC_MCPWM : TMCPWMRegisters Absolute (LPC_MCPWM_BASE);
  946. LPC_QEI : TQEIRegisters Absolute (LPC_QEI_BASE);
  947. LPC_EMAC : TEMACRegisters Absolute (LPC_EMAC_BASE);
  948. LPC_GPDMA : TGPDMARegisters Absolute (LPC_GPDMA_BASE);
  949. LPC_GPDMACH0 : TGPDMACHRegisters Absolute (LPC_GPDMACH0_BASE);
  950. LPC_GPDMACH1 : TGPDMACHRegisters Absolute (LPC_GPDMACH1_BASE);
  951. LPC_GPDMACH2 : TGPDMACHRegisters Absolute (LPC_GPDMACH2_BASE);
  952. LPC_GPDMACH3 : TGPDMACHRegisters Absolute (LPC_GPDMACH3_BASE);
  953. LPC_GPDMACH4 : TGPDMACHRegisters Absolute (LPC_GPDMACH4_BASE);
  954. LPC_GPDMACH5 : TGPDMACHRegisters Absolute (LPC_GPDMACH5_BASE);
  955. LPC_GPDMACH6 : TGPDMACHRegisters Absolute (LPC_GPDMACH6_BASE);
  956. LPC_GPDMACH7 : TGPDMACHRegisters Absolute (LPC_GPDMACH7_BASE);
  957. LPC_USB : TUSBRegisters Absolute (LPC_USB_BASE);
  958. implementation
  959. procedure NMI_interrupt; external name 'NMI_interrupt';
  960. procedure Hardfault_interrupt; external name 'Hardfault_interrupt';
  961. procedure MemManage_interrupt; external name 'MemManage_interrupt';
  962. procedure BusFault_interrupt; external name 'BusFault_interrupt';
  963. procedure UsageFault_interrupt; external name 'UsageFault_interrupt';
  964. procedure SWI_interrupt; external name 'SWI_interrupt';
  965. procedure DebugMonitor_interrupt; external name 'DebugMonitor_interrupt';
  966. procedure PendingSV_interrupt; external name 'PendingSV_interrupt';
  967. procedure SysTick_interrupt; external name 'SysTick_interrupt';
  968. procedure Watchdog_Interrupt; external name 'Watchdog_Interrupt';
  969. procedure Timer0_Interrupt; external name 'Timer0_Interrupt';
  970. procedure Timer1_Interrupt; external name 'Timer1_Interrupt';
  971. procedure Timer2_Interrupt; external name 'Timer2_Interrupt';
  972. procedure Timer3_Interrupt; external name 'Timer3_Interrupt';
  973. procedure UART0_Interrupt; external name 'UART0_Interrupt';
  974. procedure UART1_Interrupt; external name 'UART1_Interrupt';
  975. procedure UART2_Interrupt; external name 'UART2_Interrupt';
  976. procedure UART3_Interrupt; external name 'UART3_Interrupt';
  977. procedure PWM1_Interrupt; external name 'PWM1_Interrupt';
  978. procedure I2C0_Interrupt; external name 'I2C0_Interrupt';
  979. procedure I2C1_Interrupt; external name 'I2C1_Interrupt';
  980. procedure I2C2_Interrupt; external name 'I2C2_Interrupt';
  981. procedure SPI_Interrupt; external name 'SPI_Interrupt';
  982. procedure SSP0_Interrupt; external name 'SSP0_Interrupt';
  983. procedure SSP1_Interrupt; external name 'SSP1_Interrupt';
  984. procedure PLL0_Interrupt; external name 'PLL0_Interrupt';
  985. procedure RTC_Interrupt; external name 'RTC_Interrupt';
  986. procedure EINT0_Interrupt; external name 'EINT0_Interrupt';
  987. procedure EINT1_Interrupt; external name 'EINT1_Interrupt';
  988. procedure EINT2_Interrupt; external name 'EINT2_Interrupt';
  989. procedure EINT3_Interrupt; external name 'EINT3_Interrupt';
  990. procedure ADC_Interrupt; external name 'ADC_Interrupt';
  991. procedure BOD_Interrupt; external name 'BOD_Interrupt';
  992. procedure USB_Interrupt; external name 'USB_Interrupt';
  993. procedure CAN_Interrupt; external name 'CAN_Interrupt';
  994. procedure HPDMA_Interrupt; external name 'HPDMA_Interrupt';
  995. procedure I2C_Interrupt; external name 'I2C_Interrupt';
  996. procedure Ethernet_Interrupt; external name 'Ethernet_Interrupt';
  997. procedure RITINT_Interrupt; external name 'RITINT_Interrupt';
  998. procedure MotorControlPWM_Interrupt; external name 'MotorControlPWM_Interrupt';
  999. procedure QuadratureEncoder_Interrupt; external name 'QuadratureEncoder_Interrupt';
  1000. procedure PLL1_Interrupt; external name 'PLL1_Interrupt';
  1001. procedure USBActivity_Interrupt; external name 'USBActivity_Interrupt';
  1002. procedure CanActivity_Interrupt; external name 'CanActivity_Interrupt';
  1003. {$i cortexm3_start.inc}
  1004. procedure Vectors; assembler; nostackframe;
  1005. label interrupt_vectors;
  1006. asm
  1007. .section ".init.interrupt_vectors"
  1008. interrupt_vectors:
  1009. .long _stack_top // stack top address
  1010. .long Startup
  1011. .long NMI_interrupt
  1012. .long Hardfault_interrupt
  1013. .long MemManage_interrupt
  1014. .long BusFault_interrupt
  1015. .long UsageFault_interrupt
  1016. .long 0
  1017. .long 0
  1018. .long 0
  1019. .long 0
  1020. .long SWI_interrupt
  1021. .long DebugMonitor_interrupt
  1022. .long 0
  1023. .long PendingSV_interrupt
  1024. .long SysTick_interrupt
  1025. .long Watchdog_Interrupt
  1026. .long Timer0_Interrupt
  1027. .long Timer1_Interrupt
  1028. .long Timer2_Interrupt
  1029. .long Timer3_Interrupt
  1030. .long UART0_Interrupt
  1031. .long UART1_Interrupt
  1032. .long UART2_Interrupt
  1033. .long UART3_Interrupt
  1034. .long PWM1_Interrupt
  1035. .long I2C0_Interrupt
  1036. .long I2C1_Interrupt
  1037. .long I2C2_Interrupt
  1038. .long SPI_Interrupt
  1039. .long SSP0_Interrupt
  1040. .long SSP1_Interrupt
  1041. .long PLL0_Interrupt
  1042. .long RTC_Interrupt
  1043. .long EINT0_Interrupt
  1044. .long EINT1_Interrupt
  1045. .long EINT2_Interrupt
  1046. .long EINT3_Interrupt
  1047. .long ADC_Interrupt
  1048. .long BOD_Interrupt
  1049. .long USB_Interrupt
  1050. .long CAN_Interrupt
  1051. .long HPDMA_Interrupt
  1052. .long I2C_Interrupt
  1053. .long Ethernet_Interrupt
  1054. .long RITINT_Interrupt
  1055. .long MotorControlPWM_Interrupt
  1056. .long QuadratureEncoder_Interrupt
  1057. .long PLL1_Interrupt
  1058. .long USBActivity_Interrupt
  1059. .long CanActivity_Interrupt
  1060. .weak NMI_interrupt
  1061. .weak Hardfault_interrupt
  1062. .weak MemManage_interrupt
  1063. .weak BusFault_interrupt
  1064. .weak UsageFault_interrupt
  1065. .weak SWI_interrupt
  1066. .weak DebugMonitor_interrupt
  1067. .weak PendingSV_interrupt
  1068. .weak SysTick_interrupt
  1069. .weak Watchdog_Interrupt
  1070. .weak Timer0_Interrupt
  1071. .weak Timer1_Interrupt
  1072. .weak Timer2_Interrupt
  1073. .weak Timer3_Interrupt
  1074. .weak UART0_Interrupt
  1075. .weak UART1_Interrupt
  1076. .weak UART2_Interrupt
  1077. .weak UART3_Interrupt
  1078. .weak PWM1_Interrupt
  1079. .weak I2C0_Interrupt
  1080. .weak I2C1_Interrupt
  1081. .weak I2C2_Interrupt
  1082. .weak SPI_Interrupt
  1083. .weak SSP0_Interrupt
  1084. .weak SSP1_Interrupt
  1085. .weak PLL0_Interrupt
  1086. .weak RTC_Interrupt
  1087. .weak EINT0_Interrupt
  1088. .weak EINT1_Interrupt
  1089. .weak EINT2_Interrupt
  1090. .weak EINT3_Interrupt
  1091. .weak ADC_Interrupt
  1092. .weak BOD_Interrupt
  1093. .weak USB_Interrupt
  1094. .weak CAN_Interrupt
  1095. .weak HPDMA_Interrupt
  1096. .weak I2C_Interrupt
  1097. .weak Ethernet_Interrupt
  1098. .weak RITINT_Interrupt
  1099. .weak MotorControlPWM_Interrupt
  1100. .weak QuadratureEncoder_Interrupt
  1101. .weak PLL1_Interrupt
  1102. .weak USBActivity_Interrupt
  1103. .weak CanActivity_Interrupt
  1104. .set NMI_interrupt, Startup
  1105. .set Hardfault_interrupt, Startup
  1106. .set MemManage_interrupt, Startup
  1107. .set BusFault_interrupt, Startup
  1108. .set UsageFault_interrupt, Startup
  1109. .set SWI_interrupt, Startup
  1110. .set DebugMonitor_interrupt, Startup
  1111. .set PendingSV_interrupt, Startup
  1112. .set SysTick_interrupt, Startup
  1113. .set Watchdog_Interrupt, Startup
  1114. .set Timer0_Interrupt, Startup
  1115. .set Timer1_Interrupt, Startup
  1116. .set Timer2_Interrupt, Startup
  1117. .set Timer3_Interrupt, Startup
  1118. .set UART0_Interrupt, Startup
  1119. .set UART1_Interrupt, Startup
  1120. .set UART2_Interrupt, Startup
  1121. .set UART3_Interrupt, Startup
  1122. .set PWM1_Interrupt, Startup
  1123. .set I2C0_Interrupt, Startup
  1124. .set I2C1_Interrupt, Startup
  1125. .set I2C2_Interrupt, Startup
  1126. .set SPI_Interrupt, Startup
  1127. .set SSP0_Interrupt, Startup
  1128. .set SSP1_Interrupt, Startup
  1129. .set PLL0_Interrupt, Startup
  1130. .set RTC_Interrupt, Startup
  1131. .set EINT0_Interrupt, Startup
  1132. .set EINT1_Interrupt, Startup
  1133. .set EINT2_Interrupt, Startup
  1134. .set EINT3_Interrupt, Startup
  1135. .set ADC_Interrupt, Startup
  1136. .set BOD_Interrupt, Startup
  1137. .set USB_Interrupt, Startup
  1138. .set CAN_Interrupt, Startup
  1139. .set HPDMA_Interrupt, Startup
  1140. .set I2C_Interrupt, Startup
  1141. .set Ethernet_Interrupt, Startup
  1142. .set RITINT_Interrupt, Startup
  1143. .set MotorControlPWM_Interrupt, Startup
  1144. .set QuadratureEncoder_Interrupt, Startup
  1145. .set PLL1_Interrupt, Startup
  1146. .set USBActivity_Interrupt, Startup
  1147. .set CanActivity_Interrupt, Startup
  1148. .text
  1149. end;
  1150. end.