lpc1768.pp 39 KB

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