mk64f12.pp 101 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit mk64f12;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. interface
  5. {$PACKRECORDS 2}
  6. {$GOTO ON}
  7. {$MODESWITCH ADVANCEDRECORDS}
  8. // ** ###################################################################
  9. // ** Processors: MK64FN1M0VDC12
  10. // ** MK64FN1M0VLL12
  11. // ** MK64FN1M0VLQ12
  12. // ** MK64FN1M0VMD12
  13. // **
  14. // ** Compilers: Keil ARM C/C++ Compiler
  15. // ** Freescale C/C++ for Embedded ARM
  16. // ** GNU C Compiler
  17. // ** GNU C Compiler - CodeSourcery Sourcery G++
  18. // ** IAR ANSI C/C++ Compiler for ARM
  19. // **
  20. // ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
  21. // ** Version: rev. 2.8, 2015-02-19
  22. // ** Build: b150225
  23. // **
  24. // ** Abstract:
  25. // ** CMSIS Peripheral Access Layer for MK64F12
  26. // **
  27. // ** Copyright (c) 1997 - 2015 Freescale Semiconductor, Inc.
  28. // ** All rights reserved.
  29. // **
  30. // ** Redistribution and use in source and binary forms, with or without modification,
  31. // ** are permitted provided that the following conditions are met:
  32. // **
  33. // ** o Redistributions of source code must retain the above copyright notice, this list
  34. // ** of conditions and the following disclaimer.
  35. // **
  36. // ** o Redistributions in binary form must reproduce the above copyright notice, this
  37. // ** list of conditions and the following disclaimer in the documentation and/or
  38. // ** other materials provided with the distribution.
  39. // **
  40. // ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
  41. // ** contributors may be used to endorse or promote products derived from this
  42. // ** software without specific prior written permission.
  43. // **
  44. // ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  45. // ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  46. // ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  47. // ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  48. // ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  49. // ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  50. // ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  51. // ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. // ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  53. // ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. // **
  55. // ** http: www.freescale.com
  56. // ** mail: [email protected]
  57. // **
  58. // ** Revisions:
  59. // ** - rev. 1.0 (2013-08-12)
  60. // ** Initial version.
  61. // ** - rev. 2.0 (2013-10-29)
  62. // ** Register accessor macros added to the memory map.
  63. // ** Symbols for Processor Expert memory map compatibility added to the memory map.
  64. // ** Startup file for gcc has been updated according to CMSIS 3.2.
  65. // ** System initialization updated.
  66. // ** MCG - registers updated.
  67. // ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
  68. // ** - rev. 2.1 (2013-10-30)
  69. // ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
  70. // ** - rev. 2.2 (2013-12-09)
  71. // ** DMA - EARS register removed.
  72. // ** AIPS0, AIPS1 - MPRA register updated.
  73. // ** - rev. 2.3 (2014-01-24)
  74. // ** Update according to reference manual rev. 2
  75. // ** ENET, MCG, MCM, SIM, USB - registers updated
  76. // ** - rev. 2.4 (2014-02-10)
  77. // ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
  78. // ** Update of SystemInit() and SystemCoreClockUpdate() functions.
  79. // ** - rev. 2.5 (2014-02-10)
  80. // ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
  81. // ** Update of SystemInit() and SystemCoreClockUpdate() functions.
  82. // ** Module access macro module_BASES replaced by module_BASE_PTRS.
  83. // ** - rev. 2.6 (2014-08-28)
  84. // ** Update of system files - default clock configuration changed.
  85. // ** Update of startup files - possibility to override DefaultISR added.
  86. // ** - rev. 2.7 (2014-10-14)
  87. // ** Interrupt INT_LPTimer renamed to INT_LPTMR0, interrupt INT_Watchdog renamed to INT_WDOG_EWM.
  88. // ** - rev. 2.8 (2015-02-19)
  89. // ** Renamed interrupt vector LLW to LLWU.
  90. // **
  91. // ** ###################################################################
  92. // !
  93. // * @file MK64F12.h
  94. // * @version 2.8
  95. // * @date 2015-02-19
  96. // CMSIS Peripheral Access Layer for MK64F12
  97. // *
  98. // * CMSIS Peripheral Access Layer for MK64F12
  99. // ----------------------------------------------------------------------------
  100. // -- MCU activation
  101. // ----------------------------------------------------------------------------
  102. // Prevention from multiple including the same memory map
  103. // Check if another memory map has not been also included
  104. // * Memory map major version (memory maps with equal major version number are
  105. // * compatible)
  106. // * Memory map minor version
  107. // Macro to calculate address of an aliased word in the peripheral
  108. // * bitband area for a peripheral register and bit (bit band region 0x40000000 to
  109. // * 0x400FFFFF).
  110. // * @param Reg Register to access.
  111. // * @param Bit Bit number to access.
  112. // * @return Address of the aliased word in the peripheral bitband area.
  113. // Macro to access a single bit of a peripheral register (bit band region
  114. // * 0x40000000 to 0x400FFFFF) using the bit-band alias region access. Can
  115. // * be used for peripherals with 32bit access allowed.
  116. // * @param Reg Register to access.
  117. // * @param Bit Bit number to access.
  118. // * @return Value of the targeted bit in the bit band region.
  119. // Macro to access a single bit of a peripheral register (bit band region
  120. // * 0x40000000 to 0x400FFFFF) using the bit-band alias region access. Can
  121. // * be used for peripherals with 16bit access allowed.
  122. // * @param Reg Register to access.
  123. // * @param Bit Bit number to access.
  124. // * @return Value of the targeted bit in the bit band region.
  125. // Macro to access a single bit of a peripheral register (bit band region
  126. // * 0x40000000 to 0x400FFFFF) using the bit-band alias region access. Can
  127. // * be used for peripherals with 8bit access allowed.
  128. // * @param Reg Register to access.
  129. // * @param Bit Bit number to access.
  130. // * @return Value of the targeted bit in the bit band region.
  131. // ----------------------------------------------------------------------------
  132. // -- Interrupt vector numbers
  133. // ----------------------------------------------------------------------------
  134. // !
  135. // * Interrupt Number Definitions
  136. type
  137. TIRQn_Enum = (
  138. NonMaskableInt_IRQn = -14, // *< Non Maskable Interrupt
  139. HardFault_IRQn = -13, // *< Cortex-M4 SV Hard Fault Interrupt
  140. MemoryManagement_IRQn = -12, // *< Cortex-M4 Memory Management Interrupt
  141. BusFault_IRQn = -11, // *< Cortex-M4 Bus Fault Interrupt
  142. UsageFault_IRQn = -10, // *< Cortex-M4 Usage Fault Interrupt
  143. SVCall_IRQn = -5, // *< Cortex-M4 SV Call Interrupt
  144. DebugMonitor_IRQn = -4, // *< Cortex-M4 Debug Monitor Interrupt
  145. PendSV_IRQn = -2, // *< Cortex-M4 Pend SV Interrupt
  146. SysTick_IRQn = -1, // *< Cortex-M4 System Tick Interrupt
  147. DMA0_IRQn = 0, // *< DMA Channel 0 Transfer Complete
  148. DMA1_IRQn = 1, // *< DMA Channel 1 Transfer Complete
  149. DMA2_IRQn = 2, // *< DMA Channel 2 Transfer Complete
  150. DMA3_IRQn = 3, // *< DMA Channel 3 Transfer Complete
  151. DMA4_IRQn = 4, // *< DMA Channel 4 Transfer Complete
  152. DMA5_IRQn = 5, // *< DMA Channel 5 Transfer Complete
  153. DMA6_IRQn = 6, // *< DMA Channel 6 Transfer Complete
  154. DMA7_IRQn = 7, // *< DMA Channel 7 Transfer Complete
  155. DMA8_IRQn = 8, // *< DMA Channel 8 Transfer Complete
  156. DMA9_IRQn = 9, // *< DMA Channel 9 Transfer Complete
  157. DMA10_IRQn = 10, // *< DMA Channel 10 Transfer Complete
  158. DMA11_IRQn = 11, // *< DMA Channel 11 Transfer Complete
  159. DMA12_IRQn = 12, // *< DMA Channel 12 Transfer Complete
  160. DMA13_IRQn = 13, // *< DMA Channel 13 Transfer Complete
  161. DMA14_IRQn = 14, // *< DMA Channel 14 Transfer Complete
  162. DMA15_IRQn = 15, // *< DMA Channel 15 Transfer Complete
  163. DMA_Error_IRQn = 16, // *< DMA Error Interrupt
  164. MCM_IRQn = 17, // *< Normal Interrupt
  165. FTFE_IRQn = 18, // *< FTFE Command complete interrupt
  166. Read_Collision_IRQn = 19, // *< Read Collision Interrupt
  167. LVD_LVW_IRQn = 20, // *< Low Voltage Detect, Low Voltage Warning
  168. LLWU_IRQn = 21, // *< Low Leakage Wakeup Unit
  169. WDOG_EWM_IRQn = 22, // *< WDOG Interrupt
  170. RNG_IRQn = 23, // *< RNG Interrupt
  171. I2C0_IRQn = 24, // *< I2C0 interrupt
  172. I2C1_IRQn = 25, // *< I2C1 interrupt
  173. SPI0_IRQn = 26, // *< SPI0 Interrupt
  174. SPI1_IRQn = 27, // *< SPI1 Interrupt
  175. I2S0_Tx_IRQn = 28, // *< I2S0 transmit interrupt
  176. I2S0_Rx_IRQn = 29, // *< I2S0 receive interrupt
  177. UART0_LON_IRQn = 30, // *< UART0 LON interrupt
  178. UART0_RX_TX_IRQn = 31, // *< UART0 Receive/Transmit interrupt
  179. UART0_ERR_IRQn = 32, // *< UART0 Error interrupt
  180. UART1_RX_TX_IRQn = 33, // *< UART1 Receive/Transmit interrupt
  181. UART1_ERR_IRQn = 34, // *< UART1 Error interrupt
  182. UART2_RX_TX_IRQn = 35, // *< UART2 Receive/Transmit interrupt
  183. UART2_ERR_IRQn = 36, // *< UART2 Error interrupt
  184. UART3_RX_TX_IRQn = 37, // *< UART3 Receive/Transmit interrupt
  185. UART3_ERR_IRQn = 38, // *< UART3 Error interrupt
  186. ADC0_IRQn = 39, // *< ADC0 interrupt
  187. CMP0_IRQn = 40, // *< CMP0 interrupt
  188. CMP1_IRQn = 41, // *< CMP1 interrupt
  189. FTM0_IRQn = 42, // *< FTM0 fault, overflow and channels interrupt
  190. FTM1_IRQn = 43, // *< FTM1 fault, overflow and channels interrupt
  191. FTM2_IRQn = 44, // *< FTM2 fault, overflow and channels interrupt
  192. CMT_IRQn = 45, // *< CMT interrupt
  193. RTC_IRQn = 46, // *< RTC interrupt
  194. RTC_Seconds_IRQn = 47, // *< RTC seconds interrupt
  195. PIT0_IRQn = 48, // *< PIT timer channel 0 interrupt
  196. PIT1_IRQn = 49, // *< PIT timer channel 1 interrupt
  197. PIT2_IRQn = 50, // *< PIT timer channel 2 interrupt
  198. PIT3_IRQn = 51, // *< PIT timer channel 3 interrupt
  199. PDB0_IRQn = 52, // *< PDB0 Interrupt
  200. USB0_IRQn = 53, // *< USB0 interrupt
  201. USBDCD_IRQn = 54, // *< USBDCD Interrupt
  202. RESERVED71_IRQn = 55, // *< Reserved interrupt 71
  203. DAC0_IRQn = 56, // *< DAC0 interrupt
  204. MCG_IRQn = 57, // *< MCG Interrupt
  205. LPTMR0_IRQn = 58, // *< LPTimer interrupt
  206. PORTA_IRQn = 59, // *< Port A interrupt
  207. PORTB_IRQn = 60, // *< Port B interrupt
  208. PORTC_IRQn = 61, // *< Port C interrupt
  209. PORTD_IRQn = 62, // *< Port D interrupt
  210. PORTE_IRQn = 63, // *< Port E interrupt
  211. SWI_IRQn = 64, // *< Software interrupt
  212. SPI2_IRQn = 65, // *< SPI2 Interrupt
  213. UART4_RX_TX_IRQn = 66, // *< UART4 Receive/Transmit interrupt
  214. UART4_ERR_IRQn = 67, // *< UART4 Error interrupt
  215. UART5_RX_TX_IRQn = 68, // *< UART5 Receive/Transmit interrupt
  216. UART5_ERR_IRQn = 69, // *< UART5 Error interrupt
  217. CMP2_IRQn = 70, // *< CMP2 interrupt
  218. FTM3_IRQn = 71, // *< FTM3 fault, overflow and channels interrupt
  219. DAC1_IRQn = 72, // *< DAC1 interrupt
  220. ADC1_IRQn = 73, // *< ADC1 interrupt
  221. I2C2_IRQn = 74, // *< I2C2 interrupt
  222. CAN0_ORed_Message_buffer_IRQn = 75, // *< CAN0 OR'd message buffers interrupt
  223. CAN0_Bus_Off_IRQn = 76, // *< CAN0 bus off interrupt
  224. CAN0_Error_IRQn = 77, // *< CAN0 error interrupt
  225. CAN0_Tx_Warning_IRQn = 78, // *< CAN0 Tx warning interrupt
  226. CAN0_Rx_Warning_IRQn = 79, // *< CAN0 Rx warning interrupt
  227. CAN0_Wake_Up_IRQn = 80, // *< CAN0 wake up interrupt
  228. SDHC_IRQn = 81, // *< SDHC interrupt
  229. ENET_1588_Timer_IRQn = 82, // *< Ethernet MAC IEEE 1588 Timer Interrupt
  230. ENET_Transmit_IRQn = 83, // *< Ethernet MAC Transmit Interrupt
  231. ENET_Receive_IRQn = 84, // *< Ethernet MAC Receive Interrupt
  232. ENET_Error_IRQn = 85 // *< Ethernet MAC Error and miscelaneous Interrupt
  233. );
  234. TADC_Registers = record
  235. SC1 : array[0..1] of longword; // *< ADC Status and Control Registers 1, array offset: 0x0, array step: 0x4
  236. CFG1 : longword; // *< ADC Configuration Register 1, offset: 0x8
  237. CFG2 : longword; // *< ADC Configuration Register 2, offset: 0xC
  238. R : array[0..1] of longword; // *< ADC Data Result Register, array offset: 0x10, array step: 0x4
  239. CV1 : longword; // *< Compare Value Registers, offset: 0x18
  240. CV2 : longword; // *< Compare Value Registers, offset: 0x1C
  241. SC2 : longword; // *< Status and Control Register 2, offset: 0x20
  242. SC3 : longword; // *< Status and Control Register 3, offset: 0x24
  243. OFS : longword; // *< ADC Offset Correction Register, offset: 0x28
  244. PG : longword; // *< ADC Plus-Side Gain Register, offset: 0x2C
  245. MG : longword; // *< ADC Minus-Side Gain Register, offset: 0x30
  246. CLPD : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x34
  247. CLPS : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x38
  248. CLP4 : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x3C
  249. CLP3 : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x40
  250. CLP2 : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x44
  251. CLP1 : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x48
  252. CLP0 : longword; // *< ADC Plus-Side General Calibration Value Register, offset: 0x4C
  253. RESERVED_0 : array[0..3] of byte;
  254. CLMD : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x54
  255. CLMS : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x58
  256. CLM4 : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x5C
  257. CLM3 : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x60
  258. CLM2 : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x64
  259. CLM1 : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x68
  260. CLM0 : longword; // *< ADC Minus-Side General Calibration Value Register, offset: 0x6C
  261. end;
  262. const
  263. ADC0_BASE = $4003B000;
  264. var
  265. ADC0 : TADC_Registers absolute ADC0_BASE;
  266. const
  267. ADC1_BASE = $400BB000;
  268. var
  269. ADC1 : TADC_Registers absolute ADC1_BASE;
  270. type
  271. TAIPS_Registers = record
  272. MPRA : longword; // *< Master Privilege Register A, offset: 0x0
  273. RESERVED_0 : array[0..27] of byte;
  274. PACRA : longword; // *< Peripheral Access Control Register, offset: 0x20
  275. PACRB : longword; // *< Peripheral Access Control Register, offset: 0x24
  276. PACRC : longword; // *< Peripheral Access Control Register, offset: 0x28
  277. PACRD : longword; // *< Peripheral Access Control Register, offset: 0x2C
  278. RESERVED_1 : array[0..15] of byte;
  279. PACRE : longword; // *< Peripheral Access Control Register, offset: 0x40
  280. PACRF : longword; // *< Peripheral Access Control Register, offset: 0x44
  281. PACRG : longword; // *< Peripheral Access Control Register, offset: 0x48
  282. PACRH : longword; // *< Peripheral Access Control Register, offset: 0x4C
  283. PACRI : longword; // *< Peripheral Access Control Register, offset: 0x50
  284. PACRJ : longword; // *< Peripheral Access Control Register, offset: 0x54
  285. PACRK : longword; // *< Peripheral Access Control Register, offset: 0x58
  286. PACRL : longword; // *< Peripheral Access Control Register, offset: 0x5C
  287. PACRM : longword; // *< Peripheral Access Control Register, offset: 0x60
  288. PACRN : longword; // *< Peripheral Access Control Register, offset: 0x64
  289. PACRO : longword; // *< Peripheral Access Control Register, offset: 0x68
  290. PACRP : longword; // *< Peripheral Access Control Register, offset: 0x6C
  291. RESERVED_2 : array[0..15] of byte;
  292. PACRU : longword; // *< Peripheral Access Control Register, offset: 0x80
  293. end;
  294. const
  295. AIPS0_BASE = $40000000;
  296. var
  297. AIPS0 : TAIPS_Registers absolute AIPS0_BASE;
  298. const
  299. AIPS1_BASE = $40080000;
  300. var
  301. AIPS1 : TAIPS_Registers absolute AIPS1_BASE;
  302. type
  303. TAXBS_SLAVE = record
  304. PRS : longword; // *< Priority Registers Slave, array offset: 0x0, array step: 0x100
  305. RESERVED_0 : array[0..11] of byte;
  306. CRS : longword; // *< Control Register, array offset: 0x10, array step: 0x100
  307. RESERVED_1 : array[0..235] of byte;
  308. end;
  309. TAXBS_Registers = record
  310. SLAVE : array[0..4] of TAXBS_SLAVE;
  311. RESERVED_0 : array[0..767] of byte;
  312. MGPCR0 : longword; // *< Master General Purpose Control Register, offset: 0x800
  313. RESERVED_1 : array[0..251] of byte;
  314. MGPCR1 : longword; // *< Master General Purpose Control Register, offset: 0x900
  315. RESERVED_2 : array[0..251] of byte;
  316. MGPCR2 : longword; // *< Master General Purpose Control Register, offset: 0xA00
  317. RESERVED_3 : array[0..251] of byte;
  318. MGPCR3 : longword; // *< Master General Purpose Control Register, offset: 0xB00
  319. RESERVED_4 : array[0..251] of byte;
  320. MGPCR4 : longword; // *< Master General Purpose Control Register, offset: 0xC00
  321. RESERVED_5 : array[0..251] of byte;
  322. MGPCR5 : longword; // *< Master General Purpose Control Register, offset: 0xD00
  323. end;
  324. const
  325. AXBS_BASE = $40004000;
  326. var
  327. AXBS : TAXBS_Registers absolute AXBS_BASE;
  328. type
  329. TCAN_MB = record
  330. CS : longword; // *< Message Buffer 0 CS Register..Message Buffer 15 CS Register, array offset: 0x80, array step: 0x10
  331. ID : longword; // *< Message Buffer 0 ID Register..Message Buffer 15 ID Register, array offset: 0x84, array step: 0x10
  332. WORD0 : longword; // *< Message Buffer 0 WORD0 Register..Message Buffer 15 WORD0 Register, array offset: 0x88, array step: 0x10
  333. WORD1 : longword; // *< Message Buffer 0 WORD1 Register..Message Buffer 15 WORD1 Register, array offset: 0x8C, array step: 0x10
  334. end;
  335. TCAN_Registers = record
  336. MCR : longword; // *< Module Configuration Register, offset: 0x0
  337. CTRL1 : longword; // *< Control 1 register, offset: 0x4
  338. TIMER : longword; // *< Free Running Timer, offset: 0x8
  339. RESERVED_0 : array[0..3] of byte;
  340. RXMGMASK : longword; // *< Rx Mailboxes Global Mask Register, offset: 0x10
  341. RX14MASK : longword; // *< Rx 14 Mask register, offset: 0x14
  342. RX15MASK : longword; // *< Rx 15 Mask register, offset: 0x18
  343. ECR : longword; // *< Error Counter, offset: 0x1C
  344. ESR1 : longword; // *< Error and Status 1 register, offset: 0x20
  345. RESERVED_1 : array[0..3] of byte;
  346. IMASK1 : longword; // *< Interrupt Masks 1 register, offset: 0x28
  347. RESERVED_2 : array[0..3] of byte;
  348. IFLAG1 : longword; // *< Interrupt Flags 1 register, offset: 0x30
  349. CTRL2 : longword; // *< Control 2 register, offset: 0x34
  350. ESR2 : longword; // *< Error and Status 2 register, offset: 0x38
  351. RESERVED_3 : array[0..7] of byte;
  352. CRCR : longword; // *< CRC Register, offset: 0x44
  353. RXFGMASK : longword; // *< Rx FIFO Global Mask register, offset: 0x48
  354. RXFIR : longword; // *< Rx FIFO Information Register, offset: 0x4C
  355. RESERVED_4 : array[0..47] of byte;
  356. MB : array[0..15] of TCAN_MB;
  357. RESERVED_5 : array[0..1791] of byte;
  358. RXIMR : array[0..15] of longword; // *< Rx Individual Mask Registers, array offset: 0x880, array step: 0x4
  359. end;
  360. const
  361. CAN0_BASE = $40024000;
  362. var
  363. CAN0 : TCAN_Registers absolute CAN0_BASE;
  364. type
  365. TCAU_Registers = record
  366. DIRECT : array[0..15] of longword; // *< Direct access register 0..Direct access register 15, array offset: 0x0, array step: 0x4
  367. RESERVED_0 : array[0..2047] of byte;
  368. LDR_CASR : longword; // *< Status register - Load Register command, offset: 0x840
  369. LDR_CAA : longword; // *< Accumulator register - Load Register command, offset: 0x844
  370. LDR_CA : array[0..8] of longword; // *< General Purpose Register 0 - Load Register command..General Purpose Register 8 - Load Register command, array offset: 0x848, array step: 0x4
  371. RESERVED_1 : array[0..19] of byte;
  372. STR_CASR : longword; // *< Status register - Store Register command, offset: 0x880
  373. STR_CAA : longword; // *< Accumulator register - Store Register command, offset: 0x884
  374. STR_CA : array[0..8] of longword; // *< General Purpose Register 0 - Store Register command..General Purpose Register 8 - Store Register command, array offset: 0x888, array step: 0x4
  375. RESERVED_2 : array[0..19] of byte;
  376. ADR_CASR : longword; // *< Status register - Add Register command, offset: 0x8C0
  377. ADR_CAA : longword; // *< Accumulator register - Add to register command, offset: 0x8C4
  378. ADR_CA : array[0..8] of longword; // *< General Purpose Register 0 - Add to register command..General Purpose Register 8 - Add to register command, array offset: 0x8C8, array step: 0x4
  379. RESERVED_3 : array[0..19] of byte;
  380. RADR_CASR : longword; // *< Status register - Reverse and Add to Register command, offset: 0x900
  381. RADR_CAA : longword; // *< Accumulator register - Reverse and Add to Register command, offset: 0x904
  382. RADR_CA : array[0..8] of longword; // *< General Purpose Register 0 - Reverse and Add to Register command..General Purpose Register 8 - Reverse and Add to Register command, array offset: 0x908, array step: 0x4
  383. RESERVED_4 : array[0..83] of byte;
  384. XOR_CASR : longword; // *< Status register - Exclusive Or command, offset: 0x980
  385. XOR_CAA : longword; // *< Accumulator register - Exclusive Or command, offset: 0x984
  386. XOR_CA : array[0..8] of longword; // *< General Purpose Register 0 - Exclusive Or command..General Purpose Register 8 - Exclusive Or command, array offset: 0x988, array step: 0x4
  387. RESERVED_5 : array[0..19] of byte;
  388. ROTL_CASR : longword; // *< Status register - Rotate Left command, offset: 0x9C0
  389. ROTL_CAA : longword; // *< Accumulator register - Rotate Left command, offset: 0x9C4
  390. ROTL_CA : array[0..8] of longword; // *< General Purpose Register 0 - Rotate Left command..General Purpose Register 8 - Rotate Left command, array offset: 0x9C8, array step: 0x4
  391. RESERVED_6 : array[0..275] of byte;
  392. AESC_CASR : longword; // *< Status register - AES Column Operation command, offset: 0xB00
  393. AESC_CAA : longword; // *< Accumulator register - AES Column Operation command, offset: 0xB04
  394. AESC_CA : array[0..8] of longword; // *< General Purpose Register 0 - AES Column Operation command..General Purpose Register 8 - AES Column Operation command, array offset: 0xB08, array step: 0x4
  395. RESERVED_7 : array[0..19] of byte;
  396. AESIC_CASR : longword; // *< Status register - AES Inverse Column Operation command, offset: 0xB40
  397. AESIC_CAA : longword; // *< Accumulator register - AES Inverse Column Operation command, offset: 0xB44
  398. AESIC_CA : array[0..8] of longword; // *< General Purpose Register 0 - AES Inverse Column Operation command..General Purpose Register 8 - AES Inverse Column Operation command, array offset: 0xB48, array step: 0x4
  399. end;
  400. const
  401. CAU_BASE = $E0081000;
  402. var
  403. CAU : TCAU_Registers absolute CAU_BASE;
  404. type
  405. TCMP_Registers = record
  406. CR0 : byte; // *< CMP Control Register 0, offset: 0x0
  407. CR1 : byte; // *< CMP Control Register 1, offset: 0x1
  408. FPR : byte; // *< CMP Filter Period Register, offset: 0x2
  409. SCR : byte; // *< CMP Status and Control Register, offset: 0x3
  410. DACCR : byte; // *< DAC Control Register, offset: 0x4
  411. MUXCR : byte; // *< MUX Control Register, offset: 0x5
  412. end;
  413. const
  414. CMP0_BASE = $40073000;
  415. var
  416. CMP0 : TCMP_Registers absolute CMP0_BASE;
  417. const
  418. CMP1_BASE = $40073008;
  419. var
  420. CMP1 : TCMP_Registers absolute CMP1_BASE;
  421. const
  422. CMP2_BASE = $40073010;
  423. var
  424. CMP2 : TCMP_Registers absolute CMP2_BASE;
  425. type
  426. TCMT_Registers = record
  427. CGH1 : byte; // *< CMT Carrier Generator High Data Register 1, offset: 0x0
  428. CGL1 : byte; // *< CMT Carrier Generator Low Data Register 1, offset: 0x1
  429. CGH2 : byte; // *< CMT Carrier Generator High Data Register 2, offset: 0x2
  430. CGL2 : byte; // *< CMT Carrier Generator Low Data Register 2, offset: 0x3
  431. OC : byte; // *< CMT Output Control Register, offset: 0x4
  432. MSC : byte; // *< CMT Modulator Status and Control Register, offset: 0x5
  433. CMD1 : byte; // *< CMT Modulator Data Register Mark High, offset: 0x6
  434. CMD2 : byte; // *< CMT Modulator Data Register Mark Low, offset: 0x7
  435. CMD3 : byte; // *< CMT Modulator Data Register Space High, offset: 0x8
  436. CMD4 : byte; // *< CMT Modulator Data Register Space Low, offset: 0x9
  437. PPS : byte; // *< CMT Primary Prescaler Register, offset: 0xA
  438. DMA : byte; // *< CMT Direct Memory Access Register, offset: 0xB
  439. end;
  440. const
  441. CMT_BASE = $40062000;
  442. var
  443. CMT : TCMT_Registers absolute CMT_BASE;
  444. type
  445. TCRC_Registers = record
  446. DATA : longword; // *< CRC Data register, offset: 0x0
  447. GPOLY : longword; // *< CRC Polynomial register, offset: 0x4
  448. CTRL : longword; // *< CRC Control register, offset: 0x8
  449. end;
  450. const
  451. CRC_BASE = $40032000;
  452. var
  453. CRC0 : TCRC_Registers absolute CRC_BASE;
  454. type
  455. TDAC_DAT = record
  456. DATL : byte; // *< DAC Data Low Register, array offset: 0x0, array step: 0x2
  457. DATH : byte; // *< DAC Data High Register, array offset: 0x1, array step: 0x2
  458. end;
  459. TDAC_Registers = record
  460. DAT : array[0..15] of TDAC_DAT;
  461. SR : byte; // *< DAC Status Register, offset: 0x20
  462. C0 : byte; // *< DAC Control Register, offset: 0x21
  463. C1 : byte; // *< DAC Control Register 1, offset: 0x22
  464. C2 : byte; // *< DAC Control Register 2, offset: 0x23
  465. end;
  466. const
  467. DAC0_BASE = $400CC000;
  468. var
  469. DAC0 : TDAC_Registers absolute DAC0_BASE;
  470. const
  471. DAC1_BASE = $400CD000;
  472. var
  473. DAC1 : TDAC_Registers absolute DAC1_BASE;
  474. type
  475. TDMA_TCD = record
  476. SADDR : longword; // *< TCD Source Address, array offset: 0x1000, array step: 0x20
  477. SOFF : word; // *< TCD Signed Source Address Offset, array offset: 0x1004, array step: 0x20
  478. ATTR : word; // *< TCD Transfer Attributes, array offset: 0x1006, array step: 0x20
  479. NBYTES_MLNO : longword; // *< TCD Minor Byte Count (Minor Loop Disabled), array offset: 0x1008, array step: 0x20
  480. SLAST : longword; // *< TCD Last Source Address Adjustment, array offset: 0x100C, array step: 0x20
  481. DADDR : longword; // *< TCD Destination Address, array offset: 0x1010, array step: 0x20
  482. DOFF : word; // *< TCD Signed Destination Address Offset, array offset: 0x1014, array step: 0x20
  483. CITER_ELINKNO : word; // *< TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled), array offset: 0x1016, array step: 0x20
  484. DLAST_SGA : longword; // *< TCD Last Destination Address Adjustment/Scatter Gather Address, array offset: 0x1018, array step: 0x20
  485. CSR : word; // *< TCD Control and Status, array offset: 0x101C, array step: 0x20
  486. BITER_ELINKNO : word; // *< TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled), array offset: 0x101E, array step: 0x20
  487. end;
  488. TDMA_Registers = record
  489. CR : longword; // *< Control Register, offset: 0x0
  490. ES : longword; // *< Error Status Register, offset: 0x4
  491. RESERVED_0 : array[0..3] of byte;
  492. ERQ : longword; // *< Enable Request Register, offset: 0xC
  493. RESERVED_1 : array[0..3] of byte;
  494. EEI : longword; // *< Enable Error Interrupt Register, offset: 0x14
  495. CEEI : byte; // *< Clear Enable Error Interrupt Register, offset: 0x18
  496. SEEI : byte; // *< Set Enable Error Interrupt Register, offset: 0x19
  497. CERQ : byte; // *< Clear Enable Request Register, offset: 0x1A
  498. SERQ : byte; // *< Set Enable Request Register, offset: 0x1B
  499. CDNE : byte; // *< Clear DONE Status Bit Register, offset: 0x1C
  500. SSRT : byte; // *< Set START Bit Register, offset: 0x1D
  501. CERR : byte; // *< Clear Error Register, offset: 0x1E
  502. CINT : byte; // *< Clear Interrupt Request Register, offset: 0x1F
  503. RESERVED_2 : array[0..3] of byte;
  504. INT : longword; // *< Interrupt Request Register, offset: 0x24
  505. RESERVED_3 : array[0..3] of byte;
  506. ERR : longword; // *< Error Register, offset: 0x2C
  507. RESERVED_4 : array[0..3] of byte;
  508. HRS : longword; // *< Hardware Request Status Register, offset: 0x34
  509. RESERVED_5 : array[0..199] of byte;
  510. DCHPRI3 : byte; // *< Channel n Priority Register, offset: 0x100
  511. DCHPRI2 : byte; // *< Channel n Priority Register, offset: 0x101
  512. DCHPRI1 : byte; // *< Channel n Priority Register, offset: 0x102
  513. DCHPRI0 : byte; // *< Channel n Priority Register, offset: 0x103
  514. DCHPRI7 : byte; // *< Channel n Priority Register, offset: 0x104
  515. DCHPRI6 : byte; // *< Channel n Priority Register, offset: 0x105
  516. DCHPRI5 : byte; // *< Channel n Priority Register, offset: 0x106
  517. DCHPRI4 : byte; // *< Channel n Priority Register, offset: 0x107
  518. DCHPRI11 : byte; // *< Channel n Priority Register, offset: 0x108
  519. DCHPRI10 : byte; // *< Channel n Priority Register, offset: 0x109
  520. DCHPRI9 : byte; // *< Channel n Priority Register, offset: 0x10A
  521. DCHPRI8 : byte; // *< Channel n Priority Register, offset: 0x10B
  522. DCHPRI15 : byte; // *< Channel n Priority Register, offset: 0x10C
  523. DCHPRI14 : byte; // *< Channel n Priority Register, offset: 0x10D
  524. DCHPRI13 : byte; // *< Channel n Priority Register, offset: 0x10E
  525. DCHPRI12 : byte; // *< Channel n Priority Register, offset: 0x10F
  526. RESERVED_6 : array[0..3823] of byte;
  527. TCD : array[0..15] of TDMA_TCD;
  528. end;
  529. const
  530. DMA_BASE = $40008000;
  531. var
  532. DMA0 : TDMA_Registers absolute DMA_BASE;
  533. type
  534. TDMAMUX_Registers = record
  535. CHCFG : array[0..15] of byte; // *< Channel Configuration register, array offset: 0x0, array step: 0x1
  536. end;
  537. const
  538. DMAMUX_BASE = $40021000;
  539. var
  540. DMAMUX : TDMAMUX_Registers absolute DMAMUX_BASE;
  541. type
  542. TENET_CHANNEL= record
  543. TCSR : longword; // *< Timer Control Status Register, array offset: 0x608, array step: 0x8
  544. TCCR : longword; // *< Timer Compare Capture Register, array offset: 0x60C, array step: 0x8
  545. end;
  546. TENET_Registers = record
  547. RESERVED_0 : array[0..3] of byte;
  548. EIR : longword; // *< Interrupt Event Register, offset: 0x4
  549. EIMR : longword; // *< Interrupt Mask Register, offset: 0x8
  550. RESERVED_1 : array[0..3] of byte;
  551. RDAR : longword; // *< Receive Descriptor Active Register, offset: 0x10
  552. TDAR : longword; // *< Transmit Descriptor Active Register, offset: 0x14
  553. RESERVED_2 : array[0..11] of byte;
  554. ECR : longword; // *< Ethernet Control Register, offset: 0x24
  555. RESERVED_3 : array[0..23] of byte;
  556. MMFR : longword; // *< MII Management Frame Register, offset: 0x40
  557. MSCR : longword; // *< MII Speed Control Register, offset: 0x44
  558. RESERVED_4 : array[0..27] of byte;
  559. MIBC : longword; // *< MIB Control Register, offset: 0x64
  560. RESERVED_5 : array[0..27] of byte;
  561. RCR : longword; // *< Receive Control Register, offset: 0x84
  562. RESERVED_6 : array[0..59] of byte;
  563. TCR : longword; // *< Transmit Control Register, offset: 0xC4
  564. RESERVED_7 : array[0..27] of byte;
  565. PALR : longword; // *< Physical Address Lower Register, offset: 0xE4
  566. PAUR : longword; // *< Physical Address Upper Register, offset: 0xE8
  567. OPD : longword; // *< Opcode/Pause Duration Register, offset: 0xEC
  568. RESERVED_8 : array[0..39] of byte;
  569. IAUR : longword; // *< Descriptor Individual Upper Address Register, offset: 0x118
  570. IALR : longword; // *< Descriptor Individual Lower Address Register, offset: 0x11C
  571. GAUR : longword; // *< Descriptor Group Upper Address Register, offset: 0x120
  572. GALR : longword; // *< Descriptor Group Lower Address Register, offset: 0x124
  573. RESERVED_9 : array[0..27] of byte;
  574. TFWR : longword; // *< Transmit FIFO Watermark Register, offset: 0x144
  575. RESERVED_10 : array[0..55] of byte;
  576. RDSR : longword; // *< Receive Descriptor Ring Start Register, offset: 0x180
  577. TDSR : longword; // *< Transmit Buffer Descriptor Ring Start Register, offset: 0x184
  578. MRBR : longword; // *< Maximum Receive Buffer Size Register, offset: 0x188
  579. RESERVED_11 : array[0..3] of byte;
  580. RSFL : longword; // *< Receive FIFO Section Full Threshold, offset: 0x190
  581. RSEM : longword; // *< Receive FIFO Section Empty Threshold, offset: 0x194
  582. RAEM : longword; // *< Receive FIFO Almost Empty Threshold, offset: 0x198
  583. RAFL : longword; // *< Receive FIFO Almost Full Threshold, offset: 0x19C
  584. TSEM : longword; // *< Transmit FIFO Section Empty Threshold, offset: 0x1A0
  585. TAEM : longword; // *< Transmit FIFO Almost Empty Threshold, offset: 0x1A4
  586. TAFL : longword; // *< Transmit FIFO Almost Full Threshold, offset: 0x1A8
  587. TIPG : longword; // *< Transmit Inter-Packet Gap, offset: 0x1AC
  588. FTRL : longword; // *< Frame Truncation Length, offset: 0x1B0
  589. RESERVED_12 : array[0..11] of byte;
  590. TACC : longword; // *< Transmit Accelerator Function Configuration, offset: 0x1C0
  591. RACC : longword; // *< Receive Accelerator Function Configuration, offset: 0x1C4
  592. RESERVED_13 : array[0..59] of byte;
  593. RMON_T_PACKETS : longword; // *< Tx Packet Count Statistic Register, offset: 0x204
  594. RMON_T_BC_PKT : longword; // *< Tx Broadcast Packets Statistic Register, offset: 0x208
  595. RMON_T_MC_PKT : longword; // *< Tx Multicast Packets Statistic Register, offset: 0x20C
  596. RMON_T_CRC_ALIGN : longword; // *< Tx Packets with CRC/Align Error Statistic Register, offset: 0x210
  597. RMON_T_UNDERSIZE : longword; // *< Tx Packets Less Than Bytes and Good CRC Statistic Register, offset: 0x214
  598. RMON_T_OVERSIZE : longword; // *< Tx Packets GT MAX_FL bytes and Good CRC Statistic Register, offset: 0x218
  599. RMON_T_FRAG : longword; // *< Tx Packets Less Than 64 Bytes and Bad CRC Statistic Register, offset: 0x21C
  600. RMON_T_JAB : longword; // *< Tx Packets Greater Than MAX_FL bytes and Bad CRC Statistic Register, offset: 0x220
  601. RMON_T_COL : longword; // *< Tx Collision Count Statistic Register, offset: 0x224
  602. RMON_T_P64 : longword; // *< Tx 64-Byte Packets Statistic Register, offset: 0x228
  603. RMON_T_P65TO127 : longword; // *< Tx 65- to 127-byte Packets Statistic Register, offset: 0x22C
  604. RMON_T_P128TO255 : longword; // *< Tx 128- to 255-byte Packets Statistic Register, offset: 0x230
  605. RMON_T_P256TO511 : longword; // *< Tx 256- to 511-byte Packets Statistic Register, offset: 0x234
  606. RMON_T_P512TO1023 : longword; // *< Tx 512- to 1023-byte Packets Statistic Register, offset: 0x238
  607. RMON_T_P1024TO2047 : longword; // *< Tx 1024- to 2047-byte Packets Statistic Register, offset: 0x23C
  608. RMON_T_P_GTE2048 : longword; // *< Tx Packets Greater Than 2048 Bytes Statistic Register, offset: 0x240
  609. RMON_T_OCTETS : longword; // *< Tx Octets Statistic Register, offset: 0x244
  610. RESERVED_14 : array[0..3] of byte;
  611. IEEE_T_FRAME_OK : longword; // *< Frames Transmitted OK Statistic Register, offset: 0x24C
  612. IEEE_T_1COL : longword; // *< Frames Transmitted with Single Collision Statistic Register, offset: 0x250
  613. IEEE_T_MCOL : longword; // *< Frames Transmitted with Multiple Collisions Statistic Register, offset: 0x254
  614. IEEE_T_DEF : longword; // *< Frames Transmitted after Deferral Delay Statistic Register, offset: 0x258
  615. IEEE_T_LCOL : longword; // *< Frames Transmitted with Late Collision Statistic Register, offset: 0x25C
  616. IEEE_T_EXCOL : longword; // *< Frames Transmitted with Excessive Collisions Statistic Register, offset: 0x260
  617. IEEE_T_MACERR : longword; // *< Frames Transmitted with Tx FIFO Underrun Statistic Register, offset: 0x264
  618. IEEE_T_CSERR : longword; // *< Frames Transmitted with Carrier Sense Error Statistic Register, offset: 0x268
  619. RESERVED_15 : array[0..3] of byte;
  620. IEEE_T_FDXFC : longword; // *< Flow Control Pause Frames Transmitted Statistic Register, offset: 0x270
  621. IEEE_T_OCTETS_OK : longword; // *< Octet Count for Frames Transmitted w/o Error Statistic Register, offset: 0x274
  622. RESERVED_16 : array[0..11] of byte;
  623. RMON_R_PACKETS : longword; // *< Rx Packet Count Statistic Register, offset: 0x284
  624. RMON_R_BC_PKT : longword; // *< Rx Broadcast Packets Statistic Register, offset: 0x288
  625. RMON_R_MC_PKT : longword; // *< Rx Multicast Packets Statistic Register, offset: 0x28C
  626. RMON_R_CRC_ALIGN : longword; // *< Rx Packets with CRC/Align Error Statistic Register, offset: 0x290
  627. RMON_R_UNDERSIZE : longword; // *< Rx Packets with Less Than 64 Bytes and Good CRC Statistic Register, offset: 0x294
  628. RMON_R_OVERSIZE : longword; // *< Rx Packets Greater Than MAX_FL and Good CRC Statistic Register, offset: 0x298
  629. RMON_R_FRAG : longword; // *< Rx Packets Less Than 64 Bytes and Bad CRC Statistic Register, offset: 0x29C
  630. RMON_R_JAB : longword; // *< Rx Packets Greater Than MAX_FL Bytes and Bad CRC Statistic Register, offset: 0x2A0
  631. RESERVED_17 : array[0..3] of byte;
  632. RMON_R_P64 : longword; // *< Rx 64-Byte Packets Statistic Register, offset: 0x2A8
  633. RMON_R_P65TO127 : longword; // *< Rx 65- to 127-Byte Packets Statistic Register, offset: 0x2AC
  634. RMON_R_P128TO255 : longword; // *< Rx 128- to 255-Byte Packets Statistic Register, offset: 0x2B0
  635. RMON_R_P256TO511 : longword; // *< Rx 256- to 511-Byte Packets Statistic Register, offset: 0x2B4
  636. RMON_R_P512TO1023 : longword; // *< Rx 512- to 1023-Byte Packets Statistic Register, offset: 0x2B8
  637. RMON_R_P1024TO2047 : longword; // *< Rx 1024- to 2047-Byte Packets Statistic Register, offset: 0x2BC
  638. RMON_R_P_GTE2048 : longword; // *< Rx Packets Greater than 2048 Bytes Statistic Register, offset: 0x2C0
  639. RMON_R_OCTETS : longword; // *< Rx Octets Statistic Register, offset: 0x2C4
  640. IEEE_R_DROP : longword; // *< Frames not Counted Correctly Statistic Register, offset: 0x2C8
  641. IEEE_R_FRAME_OK : longword; // *< Frames Received OK Statistic Register, offset: 0x2CC
  642. IEEE_R_CRC : longword; // *< Frames Received with CRC Error Statistic Register, offset: 0x2D0
  643. IEEE_R_ALIGN : longword; // *< Frames Received with Alignment Error Statistic Register, offset: 0x2D4
  644. IEEE_R_MACERR : longword; // *< Receive FIFO Overflow Count Statistic Register, offset: 0x2D8
  645. IEEE_R_FDXFC : longword; // *< Flow Control Pause Frames Received Statistic Register, offset: 0x2DC
  646. IEEE_R_OCTETS_OK : longword; // *< Octet Count for Frames Received without Error Statistic Register, offset: 0x2E0
  647. RESERVED_18 : array[0..283] of byte;
  648. ATCR : longword; // *< Adjustable Timer Control Register, offset: 0x400
  649. ATVR : longword; // *< Timer Value Register, offset: 0x404
  650. ATOFF : longword; // *< Timer Offset Register, offset: 0x408
  651. ATPER : longword; // *< Timer Period Register, offset: 0x40C
  652. ATCOR : longword; // *< Timer Correction Register, offset: 0x410
  653. ATINC : longword; // *< Time-Stamping Clock Period Register, offset: 0x414
  654. ATSTMP : longword; // *< Timestamp of Last Transmitted Frame, offset: 0x418
  655. RESERVED_19 : array[0..487] of byte;
  656. TGSR : longword; // *< Timer Global Status Register, offset: 0x604
  657. CHANNEL : array[0..3] of TENET_CHANNEL;
  658. end;
  659. const
  660. ENET_BASE = $400C0000;
  661. var
  662. ENET : TENET_Registers absolute ENET_BASE;
  663. type
  664. TEWM_Registers = record
  665. CTRL : byte; // *< Control Register, offset: 0x0
  666. SERV : byte; // *< Service Register, offset: 0x1
  667. CMPL : byte; // *< Compare Low Register, offset: 0x2
  668. CMPH : byte; // *< Compare High Register, offset: 0x3
  669. end;
  670. const
  671. EWM_BASE = $40061000;
  672. var
  673. EWM : TEWM_Registers absolute EWM_BASE;
  674. type
  675. TFB_CS = record
  676. CSAR : longword; // *< Chip Select Address Register, array offset: 0x0, array step: 0xC
  677. CSMR : longword; // *< Chip Select Mask Register, array offset: 0x4, array step: 0xC
  678. CSCR : longword; // *< Chip Select Control Register, array offset: 0x8, array step: 0xC
  679. end;
  680. TFB_Registers = record
  681. CS : array[0..5] of TFB_CS;
  682. RESERVED_0 : array[0..23] of byte;
  683. CSPMCR : longword; // *< Chip Select port Multiplexing Control Register, offset: 0x60
  684. end;
  685. const
  686. FB_BASE = $4000C000;
  687. var
  688. FB : TFB_Registers absolute FB_BASE;
  689. type
  690. TFMC_SET = record
  691. DATA_U : longword; // *< Cache Data Storage (upper word), array offset: 0x200, array step: index*0x20, index2*0x8
  692. DATA_L : longword; // *< Cache Data Storage (lower word), array offset: 0x204, array step: index*0x20, index2*0x8
  693. end;
  694. TFMC_Registers = record
  695. PFAPR : longword; // *< Flash Access Protection Register, offset: 0x0
  696. PFB0CR : longword; // *< Flash Bank 0 Control Register, offset: 0x4
  697. PFB1CR : longword; // *< Flash Bank 1 Control Register, offset: 0x8
  698. RESERVED_0 : array[0..243] of byte;
  699. TAGVDW0S : array[0..3] of longword; // *< Cache Tag Storage, array offset: 0x100, array step: 0x4
  700. TAGVDW1S : array[0..3] of longword; // *< Cache Tag Storage, array offset: 0x110, array step: 0x4
  701. TAGVDW2S : array[0..3] of longword; // *< Cache Tag Storage, array offset: 0x120, array step: 0x4
  702. TAGVDW3S : array[0..3] of longword; // *< Cache Tag Storage, array offset: 0x130, array step: 0x4
  703. RESERVED_1 : array[0..191] of byte;
  704. &SET : array[0..3] of TFMC_SET;
  705. end;
  706. const
  707. FMC_BASE = $4001F000;
  708. var
  709. FMC : TFMC_Registers absolute FMC_BASE;
  710. type
  711. TFTFE_Registers = record
  712. FSTAT : byte; // *< Flash Status Register, offset: 0x0
  713. FCNFG : byte; // *< Flash Configuration Register, offset: 0x1
  714. FSEC : byte; // *< Flash Security Register, offset: 0x2
  715. FOPT : byte; // *< Flash Option Register, offset: 0x3
  716. FCCOB3 : byte; // *< Flash Common Command Object Registers, offset: 0x4
  717. FCCOB2 : byte; // *< Flash Common Command Object Registers, offset: 0x5
  718. FCCOB1 : byte; // *< Flash Common Command Object Registers, offset: 0x6
  719. FCCOB0 : byte; // *< Flash Common Command Object Registers, offset: 0x7
  720. FCCOB7 : byte; // *< Flash Common Command Object Registers, offset: 0x8
  721. FCCOB6 : byte; // *< Flash Common Command Object Registers, offset: 0x9
  722. FCCOB5 : byte; // *< Flash Common Command Object Registers, offset: 0xA
  723. FCCOB4 : byte; // *< Flash Common Command Object Registers, offset: 0xB
  724. FCCOBB : byte; // *< Flash Common Command Object Registers, offset: 0xC
  725. FCCOBA : byte; // *< Flash Common Command Object Registers, offset: 0xD
  726. FCCOB9 : byte; // *< Flash Common Command Object Registers, offset: 0xE
  727. FCCOB8 : byte; // *< Flash Common Command Object Registers, offset: 0xF
  728. FPROT3 : byte; // *< Program Flash Protection Registers, offset: 0x10
  729. FPROT2 : byte; // *< Program Flash Protection Registers, offset: 0x11
  730. FPROT1 : byte; // *< Program Flash Protection Registers, offset: 0x12
  731. FPROT0 : byte; // *< Program Flash Protection Registers, offset: 0x13
  732. RESERVED_0 : array[0..1] of byte;
  733. FEPROT : byte; // *< EEPROM Protection Register, offset: 0x16
  734. FDPROT : byte; // *< Data Flash Protection Register, offset: 0x17
  735. end;
  736. const
  737. FTFE_BASE = $40020000;
  738. var
  739. FTFE : TFTFE_Registers absolute FTFE_BASE;
  740. type
  741. TFTM_CONTROLS= record
  742. CnSC : longword; // *< Channel (n) Status And Control, array offset: 0xC, array step: 0x8
  743. CnV : longword; // *< Channel (n) Value, array offset: 0x10, array step: 0x8
  744. end;
  745. TFTM_Registers = record
  746. SC : longword; // *< Status And Control, offset: 0x0
  747. CNT : longword; // *< Counter, offset: 0x4
  748. &MOD : longword; // *< Modulo, offset: 0x8
  749. CONTROLS : array[0..7] of TFTM_CONTROLS;
  750. CNTIN : longword; // *< Counter Initial Value, offset: 0x4C
  751. STATUS : longword; // *< Capture And Compare Status, offset: 0x50
  752. MODE : longword; // *< Features Mode Selection, offset: 0x54
  753. SYNC : longword; // *< Synchronization, offset: 0x58
  754. OUTINIT : longword; // *< Initial State For Channels Output, offset: 0x5C
  755. OUTMASK : longword; // *< Output Mask, offset: 0x60
  756. COMBINE : longword; // *< Function For Linked Channels, offset: 0x64
  757. DEADTIME : longword; // *< Deadtime Insertion Control, offset: 0x68
  758. EXTTRIG : longword; // *< FTM External Trigger, offset: 0x6C
  759. POL : longword; // *< Channels Polarity, offset: 0x70
  760. FMS : longword; // *< Fault Mode Status, offset: 0x74
  761. FILTER : longword; // *< Input Capture Filter Control, offset: 0x78
  762. FLTCTRL : longword; // *< Fault Control, offset: 0x7C
  763. QDCTRL : longword; // *< Quadrature Decoder Control And Status, offset: 0x80
  764. CONF : longword; // *< Configuration, offset: 0x84
  765. FLTPOL : longword; // *< FTM Fault Input Polarity, offset: 0x88
  766. SYNCONF : longword; // *< Synchronization Configuration, offset: 0x8C
  767. INVCTRL : longword; // *< FTM Inverting Control, offset: 0x90
  768. SWOCTRL : longword; // *< FTM Software Output Control, offset: 0x94
  769. PWMLOAD : longword; // *< FTM PWM Load, offset: 0x98
  770. end;
  771. const
  772. FTM0_BASE = $40038000;
  773. var
  774. FTM0 : TFTM_Registers absolute FTM0_BASE;
  775. const
  776. FTM1_BASE = $40039000;
  777. var
  778. FTM1 : TFTM_Registers absolute FTM1_BASE;
  779. const
  780. FTM2_BASE = $4003A000;
  781. var
  782. FTM2 : TFTM_Registers absolute FTM2_BASE;
  783. const
  784. FTM3_BASE = $400B9000;
  785. var
  786. FTM3 : TFTM_Registers absolute FTM3_BASE;
  787. type
  788. TGPIO_Registers = record
  789. PDOR : longword; // *< Port Data Output Register, offset: 0x0
  790. PSOR : longword; // *< Port Set Output Register, offset: 0x4
  791. PCOR : longword; // *< Port Clear Output Register, offset: 0x8
  792. PTOR : longword; // *< Port Toggle Output Register, offset: 0xC
  793. PDIR : longword; // *< Port Data Input Register, offset: 0x10
  794. PDDR : longword; // *< Port Data Direction Register, offset: 0x14
  795. end;
  796. const
  797. PTA_BASE = $400FF000;
  798. var
  799. PTA : TGPIO_Registers absolute PTA_BASE;
  800. const
  801. PTB_BASE = $400FF040;
  802. var
  803. PTB : TGPIO_Registers absolute PTB_BASE;
  804. const
  805. PTC_BASE = $400FF080;
  806. var
  807. PTC : TGPIO_Registers absolute PTC_BASE;
  808. const
  809. PTD_BASE = $400FF0C0;
  810. var
  811. PTD : TGPIO_Registers absolute PTD_BASE;
  812. const
  813. PTE_BASE = $400FF100;
  814. var
  815. PTE : TGPIO_Registers absolute PTE_BASE;
  816. type
  817. TI2C_Registers = record
  818. A1 : byte; // *< I2C Address Register 1, offset: 0x0
  819. F : byte; // *< I2C Frequency Divider register, offset: 0x1
  820. C1 : byte; // *< I2C Control Register 1, offset: 0x2
  821. S : byte; // *< I2C Status register, offset: 0x3
  822. D : byte; // *< I2C Data I/O register, offset: 0x4
  823. C2 : byte; // *< I2C Control Register 2, offset: 0x5
  824. FLT : byte; // *< I2C Programmable Input Glitch Filter register, offset: 0x6
  825. RA : byte; // *< I2C Range Address register, offset: 0x7
  826. SMB : byte; // *< I2C SMBus Control and Status register, offset: 0x8
  827. A2 : byte; // *< I2C Address Register 2, offset: 0x9
  828. SLTH : byte; // *< I2C SCL Low Timeout Register High, offset: 0xA
  829. SLTL : byte; // *< I2C SCL Low Timeout Register Low, offset: 0xB
  830. end;
  831. const
  832. I2C0_BASE = $40066000;
  833. var
  834. I2C0 : TI2C_Registers absolute I2C0_BASE;
  835. const
  836. I2C1_BASE = $40067000;
  837. var
  838. I2C1 : TI2C_Registers absolute I2C1_BASE;
  839. const
  840. I2C2_BASE = $400E6000;
  841. var
  842. I2C2 : TI2C_Registers absolute I2C2_BASE;
  843. type
  844. TI2S_Registers = record
  845. TCSR : longword; // *< SAI Transmit Control Register, offset: 0x0
  846. TCR1 : longword; // *< SAI Transmit Configuration 1 Register, offset: 0x4
  847. TCR2 : longword; // *< SAI Transmit Configuration 2 Register, offset: 0x8
  848. TCR3 : longword; // *< SAI Transmit Configuration 3 Register, offset: 0xC
  849. TCR4 : longword; // *< SAI Transmit Configuration 4 Register, offset: 0x10
  850. TCR5 : longword; // *< SAI Transmit Configuration 5 Register, offset: 0x14
  851. RESERVED_0 : array[0..7] of byte;
  852. TDR : array[0..1] of longword; // *< SAI Transmit Data Register, array offset: 0x20, array step: 0x4
  853. RESERVED_1 : array[0..23] of byte;
  854. TFR : array[0..1] of longword; // *< SAI Transmit FIFO Register, array offset: 0x40, array step: 0x4
  855. RESERVED_2 : array[0..23] of byte;
  856. TMR : longword; // *< SAI Transmit Mask Register, offset: 0x60
  857. RESERVED_3 : array[0..27] of byte;
  858. RCSR : longword; // *< SAI Receive Control Register, offset: 0x80
  859. RCR1 : longword; // *< SAI Receive Configuration 1 Register, offset: 0x84
  860. RCR2 : longword; // *< SAI Receive Configuration 2 Register, offset: 0x88
  861. RCR3 : longword; // *< SAI Receive Configuration 3 Register, offset: 0x8C
  862. RCR4 : longword; // *< SAI Receive Configuration 4 Register, offset: 0x90
  863. RCR5 : longword; // *< SAI Receive Configuration 5 Register, offset: 0x94
  864. RESERVED_4 : array[0..7] of byte;
  865. RDR : array[0..1] of longword; // *< SAI Receive Data Register, array offset: 0xA0, array step: 0x4
  866. RESERVED_5 : array[0..23] of byte;
  867. RFR : array[0..1] of longword; // *< SAI Receive FIFO Register, array offset: 0xC0, array step: 0x4
  868. RESERVED_6 : array[0..23] of byte;
  869. RMR : longword; // *< SAI Receive Mask Register, offset: 0xE0
  870. RESERVED_7 : array[0..27] of byte;
  871. MCR : longword; // *< SAI MCLK Control Register, offset: 0x100
  872. MDR : longword; // *< SAI MCLK Divide Register, offset: 0x104
  873. end;
  874. const
  875. I2S0_BASE = $4002F000;
  876. var
  877. I2S0 : TI2S_Registers absolute I2S0_BASE;
  878. type
  879. TLLWU_Registers = record
  880. PE1 : byte; // *< LLWU Pin Enable 1 register, offset: 0x0
  881. PE2 : byte; // *< LLWU Pin Enable 2 register, offset: 0x1
  882. PE3 : byte; // *< LLWU Pin Enable 3 register, offset: 0x2
  883. PE4 : byte; // *< LLWU Pin Enable 4 register, offset: 0x3
  884. ME : byte; // *< LLWU Module Enable register, offset: 0x4
  885. F1 : byte; // *< LLWU Flag 1 register, offset: 0x5
  886. F2 : byte; // *< LLWU Flag 2 register, offset: 0x6
  887. F3 : byte; // *< LLWU Flag 3 register, offset: 0x7
  888. FILT1 : byte; // *< LLWU Pin Filter 1 register, offset: 0x8
  889. FILT2 : byte; // *< LLWU Pin Filter 2 register, offset: 0x9
  890. RST : byte; // *< LLWU Reset Enable register, offset: 0xA
  891. end;
  892. const
  893. LLWU_BASE = $4007C000;
  894. var
  895. LLWU : TLLWU_Registers absolute LLWU_BASE;
  896. type
  897. TLPTMR_Registers = record
  898. CSR : longword; // *< Low Power Timer Control Status Register, offset: 0x0
  899. PSR : longword; // *< Low Power Timer Prescale Register, offset: 0x4
  900. CMR : longword; // *< Low Power Timer Compare Register, offset: 0x8
  901. CNR : longword; // *< Low Power Timer Counter Register, offset: 0xC
  902. end;
  903. const
  904. LPTMR0_BASE = $40040000;
  905. var
  906. LPTMR0 : TLPTMR_Registers absolute LPTMR0_BASE;
  907. type
  908. TMCG_Registers = record
  909. C1 : byte; // *< MCG Control 1 Register, offset: 0x0
  910. C2 : byte; // *< MCG Control 2 Register, offset: 0x1
  911. C3 : byte; // *< MCG Control 3 Register, offset: 0x2
  912. C4 : byte; // *< MCG Control 4 Register, offset: 0x3
  913. C5 : byte; // *< MCG Control 5 Register, offset: 0x4
  914. C6 : byte; // *< MCG Control 6 Register, offset: 0x5
  915. S : byte; // *< MCG Status Register, offset: 0x6
  916. RESERVED_0 : array[0..0] of byte;
  917. SC : byte; // *< MCG Status and Control Register, offset: 0x8
  918. RESERVED_1 : array[0..0] of byte;
  919. ATCVH : byte; // *< MCG Auto Trim Compare Value High Register, offset: 0xA
  920. ATCVL : byte; // *< MCG Auto Trim Compare Value Low Register, offset: 0xB
  921. C7 : byte; // *< MCG Control 7 Register, offset: 0xC
  922. C8 : byte; // *< MCG Control 8 Register, offset: 0xD
  923. end;
  924. const
  925. MCG_BASE = $40064000;
  926. var
  927. MCG : TMCG_Registers absolute MCG_BASE;
  928. type
  929. TMCM_Registers = record
  930. RESERVED_0 : array[0..7] of byte;
  931. PLASC : word; // *< Crossbar Switch (AXBS) Slave Configuration, offset: 0x8
  932. PLAMC : word; // *< Crossbar Switch (AXBS) Master Configuration, offset: 0xA
  933. CR : longword; // *< Control Register, offset: 0xC
  934. ISCR : longword; // *< Interrupt Status Register, offset: 0x10
  935. ETBCC : longword; // *< ETB Counter Control register, offset: 0x14
  936. ETBRL : longword; // *< ETB Reload register, offset: 0x18
  937. ETBCNT : longword; // *< ETB Counter Value register, offset: 0x1C
  938. RESERVED_1 : array[0..15] of byte;
  939. PID : longword; // *< Process ID register, offset: 0x30
  940. end;
  941. const
  942. MCM_BASE = $E0080000;
  943. var
  944. MCM : TMCM_Registers absolute MCM_BASE;
  945. type
  946. TMPU_SP = record
  947. EAR : longword; // *< Error Address Register, slave port n, array offset: 0x10, array step: 0x8
  948. EDR : longword; // *< Error Detail Register, slave port n, array offset: 0x14, array step: 0x8
  949. end;
  950. TMPU_Registers = record
  951. CESR : longword; // *< Control/Error Status Register, offset: 0x0
  952. RESERVED_0 : array[0..11] of byte;
  953. SP : array[0..4] of TMPU_SP;
  954. RESERVED_1 : array[0..967] of byte;
  955. WORD : array[0..11] of longword; // *< Region Descriptor n, Word 0..Region Descriptor n, Word 3, array offset: 0x400, array step: index*0x10, index2*0x4
  956. RESERVED_2 : array[0..831] of byte;
  957. RGDAAC : array[0..11] of longword; // *< Region Descriptor Alternate Access Control n, array offset: 0x800, array step: 0x4
  958. end;
  959. const
  960. MPU_BASE = $4000D000;
  961. var
  962. MPU : TMPU_Registers absolute MPU_BASE;
  963. type
  964. TNV_Registers = record
  965. BACKKEY3 : byte; // *< Backdoor Comparison Key 3., offset: 0x0
  966. BACKKEY2 : byte; // *< Backdoor Comparison Key 2., offset: 0x1
  967. BACKKEY1 : byte; // *< Backdoor Comparison Key 1., offset: 0x2
  968. BACKKEY0 : byte; // *< Backdoor Comparison Key 0., offset: 0x3
  969. BACKKEY7 : byte; // *< Backdoor Comparison Key 7., offset: 0x4
  970. BACKKEY6 : byte; // *< Backdoor Comparison Key 6., offset: 0x5
  971. BACKKEY5 : byte; // *< Backdoor Comparison Key 5., offset: 0x6
  972. BACKKEY4 : byte; // *< Backdoor Comparison Key 4., offset: 0x7
  973. FPROT3 : byte; // *< Non-volatile P-Flash Protection 1 - Low Register, offset: 0x8
  974. FPROT2 : byte; // *< Non-volatile P-Flash Protection 1 - High Register, offset: 0x9
  975. FPROT1 : byte; // *< Non-volatile P-Flash Protection 0 - Low Register, offset: 0xA
  976. FPROT0 : byte; // *< Non-volatile P-Flash Protection 0 - High Register, offset: 0xB
  977. FSEC : byte; // *< Non-volatile Flash Security Register, offset: 0xC
  978. FOPT : byte; // *< Non-volatile Flash Option Register, offset: 0xD
  979. FEPROT : byte; // *< Non-volatile EERAM Protection Register, offset: 0xE
  980. FDPROT : byte; // *< Non-volatile D-Flash Protection Register, offset: 0xF
  981. end;
  982. const
  983. FTFE_FlashConfig_BASE = $400;
  984. var
  985. FTFE_FlashConfig : TNV_Registers absolute FTFE_FlashConfig_BASE;
  986. type
  987. TOSC_Registers = record
  988. CR : byte; // *< OSC Control Register, offset: 0x0
  989. end;
  990. const
  991. OSC_BASE = $40065000;
  992. var
  993. OSC : TOSC_Registers absolute OSC_BASE;
  994. type
  995. TPDB_CH = record
  996. C1 : longword; // *< Channel n Control register 1, array offset: 0x10, array step: 0x28
  997. S : longword; // *< Channel n Status register, array offset: 0x14, array step: 0x28
  998. DLY : array[0..1] of longword; // *< Channel n Delay 0 register..Channel n Delay 1 register, array offset: 0x18, array step: index*0x28, index2*0x4
  999. RESERVED_0 : array[0..23] of byte;
  1000. end;
  1001. TPDB_DAC = record
  1002. INTC : longword; // *< DAC Interval Trigger n Control register, array offset: 0x150, array step: 0x8
  1003. INT : longword; // *< DAC Interval n register, array offset: 0x154, array step: 0x8
  1004. end;
  1005. TPDB_Registers = record
  1006. SC : longword; // *< Status and Control register, offset: 0x0
  1007. &MOD : longword; // *< Modulus register, offset: 0x4
  1008. CNT : longword; // *< Counter register, offset: 0x8
  1009. IDLY : longword; // *< Interrupt Delay register, offset: 0xC
  1010. CH : array[0..1] of TPDB_CH;
  1011. RESERVED_0 : array[0..239] of byte;
  1012. DAC : array[0..1] of TPDB_DAC;
  1013. RESERVED_1 : array[0..47] of byte;
  1014. POEN : longword; // *< Pulse-Out n Enable register, offset: 0x190
  1015. PODLY : array[0..2] of longword; // *< Pulse-Out n Delay register, array offset: 0x194, array step: 0x4
  1016. end;
  1017. const
  1018. PDB0_BASE = $40036000;
  1019. var
  1020. PDB0 : TPDB_Registers absolute PDB0_BASE;
  1021. type
  1022. TPIT_CHANNEL = record
  1023. LDVAL : longword; // *< Timer Load Value Register, array offset: 0x100, array step: 0x10
  1024. CVAL : longword; // *< Current Timer Value Register, array offset: 0x104, array step: 0x10
  1025. TCTRL : longword; // *< Timer Control Register, array offset: 0x108, array step: 0x10
  1026. TFLG : longword; // *< Timer Flag Register, array offset: 0x10C, array step: 0x10
  1027. end;
  1028. TPIT_Registers = record
  1029. MCR : longword; // *< PIT Module Control Register, offset: 0x0
  1030. RESERVED_0 : array[0..251] of byte;
  1031. CHANNEL : array[0..3] of TPIT_CHANNEL;
  1032. end;
  1033. const
  1034. PIT_BASE = $40037000;
  1035. var
  1036. PIT : TPIT_Registers absolute PIT_BASE;
  1037. type
  1038. TPMC_Registers = record
  1039. LVDSC1 : byte; // *< Low Voltage Detect Status And Control 1 register, offset: 0x0
  1040. LVDSC2 : byte; // *< Low Voltage Detect Status And Control 2 register, offset: 0x1
  1041. REGSC : byte; // *< Regulator Status And Control register, offset: 0x2
  1042. end;
  1043. const
  1044. PMC_BASE = $4007D000;
  1045. var
  1046. PMC : TPMC_Registers absolute PMC_BASE;
  1047. type
  1048. TPORT_Registers = record
  1049. PCR : array[0..31] of longword; // *< Pin Control Register n, array offset: 0x0, array step: 0x4
  1050. GPCLR : longword; // *< Global Pin Control Low Register, offset: 0x80
  1051. GPCHR : longword; // *< Global Pin Control High Register, offset: 0x84
  1052. RESERVED_0 : array[0..23] of byte;
  1053. ISFR : longword; // *< Interrupt Status Flag Register, offset: 0xA0
  1054. RESERVED_1 : array[0..27] of byte;
  1055. DFER : longword; // *< Digital Filter Enable Register, offset: 0xC0
  1056. DFCR : longword; // *< Digital Filter Clock Register, offset: 0xC4
  1057. DFWR : longword; // *< Digital Filter Width Register, offset: 0xC8
  1058. end;
  1059. const
  1060. PORTA_BASE = $40049000;
  1061. var
  1062. PORTA : TPORT_Registers absolute PORTA_BASE;
  1063. const
  1064. PORTB_BASE = $4004A000;
  1065. var
  1066. PORTB : TPORT_Registers absolute PORTB_BASE;
  1067. const
  1068. PORTC_BASE = $4004B000;
  1069. var
  1070. PORTC : TPORT_Registers absolute PORTC_BASE;
  1071. const
  1072. PORTD_BASE = $4004C000;
  1073. var
  1074. PORTD : TPORT_Registers absolute PORTD_BASE;
  1075. const
  1076. PORTE_BASE = $4004D000;
  1077. var
  1078. PORTE : TPORT_Registers absolute PORTE_BASE;
  1079. type
  1080. TRCM_Registers = record
  1081. SRS0 : byte; // *< System Reset Status Register 0, offset: 0x0
  1082. SRS1 : byte; // *< System Reset Status Register 1, offset: 0x1
  1083. RESERVED_0 : array[0..1] of byte;
  1084. RPFC : byte; // *< Reset Pin Filter Control register, offset: 0x4
  1085. RPFW : byte; // *< Reset Pin Filter Width register, offset: 0x5
  1086. RESERVED_1 : array[0..0] of byte;
  1087. MR : byte; // *< Mode Register, offset: 0x7
  1088. end;
  1089. const
  1090. RCM_BASE = $4007F000;
  1091. var
  1092. RCM : TRCM_Registers absolute RCM_BASE;
  1093. type
  1094. TRFSYS_Registers = record
  1095. REG : array[0..7] of longword; // *< Register file register, array offset: 0x0, array step: 0x4
  1096. end;
  1097. const
  1098. RFSYS_BASE = $40041000;
  1099. var
  1100. RFSYS : TRFSYS_Registers absolute RFSYS_BASE;
  1101. type
  1102. TRFVBAT_Registers = record
  1103. REG : array[0..7] of longword; // *< VBAT register file register, array offset: 0x0, array step: 0x4
  1104. end;
  1105. const
  1106. RFVBAT_BASE = $4003E000;
  1107. var
  1108. RFVBAT : TRFVBAT_Registers absolute RFVBAT_BASE;
  1109. type
  1110. TRNG_Registers = record
  1111. CR : longword; // *< RNGA Control Register, offset: 0x0
  1112. SR : longword; // *< RNGA Status Register, offset: 0x4
  1113. ER : longword; // *< RNGA Entropy Register, offset: 0x8
  1114. &OR : longword; // *< RNGA Output Register, offset: 0xC
  1115. end;
  1116. const
  1117. RNG_BASE = $40029000;
  1118. var
  1119. RNG : TRNG_Registers absolute RNG_BASE;
  1120. type
  1121. TRTC_Registers = record
  1122. TSR : longword; // *< RTC Time Seconds Register, offset: 0x0
  1123. TPR : longword; // *< RTC Time Prescaler Register, offset: 0x4
  1124. TAR : longword; // *< RTC Time Alarm Register, offset: 0x8
  1125. TCR : longword; // *< RTC Time Compensation Register, offset: 0xC
  1126. CR : longword; // *< RTC Control Register, offset: 0x10
  1127. SR : longword; // *< RTC Status Register, offset: 0x14
  1128. LR : longword; // *< RTC Lock Register, offset: 0x18
  1129. IER : longword; // *< RTC Interrupt Enable Register, offset: 0x1C
  1130. RESERVED_0 : array[0..2015] of byte;
  1131. WAR : longword; // *< RTC Write Access Register, offset: 0x800
  1132. RAR : longword; // *< RTC Read Access Register, offset: 0x804
  1133. end;
  1134. const
  1135. RTC_BASE = $4003D000;
  1136. var
  1137. RTC : TRTC_Registers absolute RTC_BASE;
  1138. type
  1139. TSDHC_Registers = record
  1140. DSADDR : longword; // *< DMA System Address register, offset: 0x0
  1141. BLKATTR : longword; // *< Block Attributes register, offset: 0x4
  1142. CMDARG : longword; // *< Command Argument register, offset: 0x8
  1143. XFERTYP : longword; // *< Transfer Type register, offset: 0xC
  1144. CMDRSP : array[0..3] of longword; // *< Command Response 0..Command Response 3, array offset: 0x10, array step: 0x4
  1145. DATPORT : longword; // *< Buffer Data Port register, offset: 0x20
  1146. PRSSTAT : longword; // *< Present State register, offset: 0x24
  1147. PROCTL : longword; // *< Protocol Control register, offset: 0x28
  1148. SYSCTL : longword; // *< System Control register, offset: 0x2C
  1149. IRQSTAT : longword; // *< Interrupt Status register, offset: 0x30
  1150. IRQSTATEN : longword; // *< Interrupt Status Enable register, offset: 0x34
  1151. IRQSIGEN : longword; // *< Interrupt Signal Enable register, offset: 0x38
  1152. AC12ERR : longword; // *< Auto CMD12 Error Status Register, offset: 0x3C
  1153. HTCAPBLT : longword; // *< Host Controller Capabilities, offset: 0x40
  1154. WML : longword; // *< Watermark Level Register, offset: 0x44
  1155. RESERVED_0 : array[0..7] of byte;
  1156. FEVT : longword; // *< Force Event register, offset: 0x50
  1157. ADMAES : longword; // *< ADMA Error Status register, offset: 0x54
  1158. ADSADDR : longword; // *< ADMA System Addressregister, offset: 0x58
  1159. RESERVED_1 : array[0..99] of byte;
  1160. VENDOR : longword; // *< Vendor Specific register, offset: 0xC0
  1161. MMCBOOT : longword; // *< MMC Boot register, offset: 0xC4
  1162. RESERVED_2 : array[0..51] of byte;
  1163. HOSTVER : longword; // *< Host Controller Version, offset: 0xFC
  1164. end;
  1165. const
  1166. SDHC_BASE = $400B1000;
  1167. var
  1168. SDHC : TSDHC_Registers absolute SDHC_BASE;
  1169. type
  1170. TSIM_Registers = record
  1171. SOPT1 : longword; // *< System Options Register 1, offset: 0x0
  1172. SOPT1CFG : longword; // *< SOPT1 Configuration Register, offset: 0x4
  1173. RESERVED_0 : array[0..4091] of byte;
  1174. SOPT2 : longword; // *< System Options Register 2, offset: 0x1004
  1175. RESERVED_1 : array[0..3] of byte;
  1176. SOPT4 : longword; // *< System Options Register 4, offset: 0x100C
  1177. SOPT5 : longword; // *< System Options Register 5, offset: 0x1010
  1178. RESERVED_2 : array[0..3] of byte;
  1179. SOPT7 : longword; // *< System Options Register 7, offset: 0x1018
  1180. RESERVED_3 : array[0..7] of byte;
  1181. SDID : longword; // *< System Device Identification Register, offset: 0x1024
  1182. SCGC1 : longword; // *< System Clock Gating Control Register 1, offset: 0x1028
  1183. SCGC2 : longword; // *< System Clock Gating Control Register 2, offset: 0x102C
  1184. SCGC3 : longword; // *< System Clock Gating Control Register 3, offset: 0x1030
  1185. SCGC4 : longword; // *< System Clock Gating Control Register 4, offset: 0x1034
  1186. SCGC5 : longword; // *< System Clock Gating Control Register 5, offset: 0x1038
  1187. SCGC6 : longword; // *< System Clock Gating Control Register 6, offset: 0x103C
  1188. SCGC7 : longword; // *< System Clock Gating Control Register 7, offset: 0x1040
  1189. CLKDIV1 : longword; // *< System Clock Divider Register 1, offset: 0x1044
  1190. CLKDIV2 : longword; // *< System Clock Divider Register 2, offset: 0x1048
  1191. FCFG1 : longword; // *< Flash Configuration Register 1, offset: 0x104C
  1192. FCFG2 : longword; // *< Flash Configuration Register 2, offset: 0x1050
  1193. UIDH : longword; // *< Unique Identification Register High, offset: 0x1054
  1194. UIDMH : longword; // *< Unique Identification Register Mid-High, offset: 0x1058
  1195. UIDML : longword; // *< Unique Identification Register Mid Low, offset: 0x105C
  1196. UIDL : longword; // *< Unique Identification Register Low, offset: 0x1060
  1197. end;
  1198. const
  1199. SIM_BASE = $40047000;
  1200. var
  1201. SIM : TSIM_Registers absolute SIM_BASE;
  1202. type
  1203. TSMC_Registers = record
  1204. PMPROT : byte; // *< Power Mode Protection register, offset: 0x0
  1205. PMCTRL : byte; // *< Power Mode Control register, offset: 0x1
  1206. VLLSCTRL : byte; // *< VLLS Control register, offset: 0x2
  1207. PMSTAT : byte; // *< Power Mode Status register, offset: 0x3
  1208. end;
  1209. const
  1210. SMC_BASE = $4007E000;
  1211. var
  1212. SMC : TSMC_Registers absolute SMC_BASE;
  1213. type
  1214. TSPI_Registers = record
  1215. MCR : longword; // *< Module Configuration Register, offset: 0x0
  1216. RESERVED_0 : array[0..3] of byte;
  1217. TCR : longword; // *< Transfer Count Register, offset: 0x8
  1218. CTAR : array[0..1] of longword; // *< Clock and Transfer Attributes Register (In Master Mode), array offset: 0xC, array step: 0x4
  1219. RESERVED_1 : array[0..23] of byte;
  1220. SR : longword; // *< Status Register, offset: 0x2C
  1221. RSER : longword; // *< DMA/Interrupt Request Select and Enable Register, offset: 0x30
  1222. PUSHR : longword; // *< PUSH TX FIFO Register In Master Mode, offset: 0x34
  1223. POPR : longword; // *< POP RX FIFO Register, offset: 0x38
  1224. TXFR0 : longword; // *< Transmit FIFO Registers, offset: 0x3C
  1225. TXFR1 : longword; // *< Transmit FIFO Registers, offset: 0x40
  1226. TXFR2 : longword; // *< Transmit FIFO Registers, offset: 0x44
  1227. TXFR3 : longword; // *< Transmit FIFO Registers, offset: 0x48
  1228. RESERVED_2 : array[0..47] of byte;
  1229. RXFR0 : longword; // *< Receive FIFO Registers, offset: 0x7C
  1230. RXFR1 : longword; // *< Receive FIFO Registers, offset: 0x80
  1231. RXFR2 : longword; // *< Receive FIFO Registers, offset: 0x84
  1232. RXFR3 : longword; // *< Receive FIFO Registers, offset: 0x88
  1233. end;
  1234. const
  1235. SPI0_BASE = $4002C000;
  1236. var
  1237. SPI0 : TSPI_Registers absolute SPI0_BASE;
  1238. const
  1239. SPI1_BASE = $4002D000;
  1240. var
  1241. SPI1 : TSPI_Registers absolute SPI1_BASE;
  1242. const
  1243. SPI2_BASE = $400AC000;
  1244. var
  1245. SPI2 : TSPI_Registers absolute SPI2_BASE;
  1246. type
  1247. TUART_Registers = record
  1248. BDH : byte; // *< UART Baud Rate Registers: High, offset: 0x0
  1249. BDL : byte; // *< UART Baud Rate Registers: Low, offset: 0x1
  1250. C1 : byte; // *< UART Control Register 1, offset: 0x2
  1251. C2 : byte; // *< UART Control Register 2, offset: 0x3
  1252. S1 : byte; // *< UART Status Register 1, offset: 0x4
  1253. S2 : byte; // *< UART Status Register 2, offset: 0x5
  1254. C3 : byte; // *< UART Control Register 3, offset: 0x6
  1255. D : byte; // *< UART Data Register, offset: 0x7
  1256. MA1 : byte; // *< UART Match Address Registers 1, offset: 0x8
  1257. MA2 : byte; // *< UART Match Address Registers 2, offset: 0x9
  1258. C4 : byte; // *< UART Control Register 4, offset: 0xA
  1259. C5 : byte; // *< UART Control Register 5, offset: 0xB
  1260. ED : byte; // *< UART Extended Data Register, offset: 0xC
  1261. MODEM : byte; // *< UART Modem Register, offset: 0xD
  1262. IR : byte; // *< UART Infrared Register, offset: 0xE
  1263. RESERVED_0 : array[0..0] of byte;
  1264. PFIFO : byte; // *< UART FIFO Parameters, offset: 0x10
  1265. CFIFO : byte; // *< UART FIFO Control Register, offset: 0x11
  1266. SFIFO : byte; // *< UART FIFO Status Register, offset: 0x12
  1267. TWFIFO : byte; // *< UART FIFO Transmit Watermark, offset: 0x13
  1268. TCFIFO : byte; // *< UART FIFO Transmit Count, offset: 0x14
  1269. RWFIFO : byte; // *< UART FIFO Receive Watermark, offset: 0x15
  1270. RCFIFO : byte; // *< UART FIFO Receive Count, offset: 0x16
  1271. RESERVED_1 : array[0..0] of byte;
  1272. C7816 : byte; // *< UART 7816 Control Register, offset: 0x18
  1273. IE7816 : byte; // *< UART 7816 Interrupt Enable Register, offset: 0x19
  1274. IS7816 : byte; // *< UART 7816 Interrupt Status Register, offset: 0x1A
  1275. WP7816T0 : byte; // *< UART 7816 Wait Parameter Register, offset: 0x1B
  1276. WN7816 : byte; // *< UART 7816 Wait N Register, offset: 0x1C
  1277. WF7816 : byte; // *< UART 7816 Wait FD Register, offset: 0x1D
  1278. ET7816 : byte; // *< UART 7816 Error Threshold Register, offset: 0x1E
  1279. TL7816 : byte; // *< UART 7816 Transmit Length Register, offset: 0x1F
  1280. end;
  1281. const
  1282. UART0_BASE = $4006A000;
  1283. var
  1284. UART0 : TUART_Registers absolute UART0_BASE;
  1285. const
  1286. UART1_BASE = $4006B000;
  1287. var
  1288. UART1 : TUART_Registers absolute UART1_BASE;
  1289. const
  1290. UART2_BASE = $4006C000;
  1291. var
  1292. UART2 : TUART_Registers absolute UART2_BASE;
  1293. const
  1294. UART3_BASE = $4006D000;
  1295. var
  1296. UART3 : TUART_Registers absolute UART3_BASE;
  1297. const
  1298. UART4_BASE = $400EA000;
  1299. var
  1300. UART4 : TUART_Registers absolute UART4_BASE;
  1301. const
  1302. UART5_BASE = $400EB000;
  1303. var
  1304. UART5 : TUART_Registers absolute UART5_BASE;
  1305. type
  1306. TUSB_ENDPOINT= record
  1307. ENDPT : byte; // *< Endpoint Control register, array offset: 0xC0, array step: 0x4
  1308. RESERVED_0 : array[0..2] of byte;
  1309. end;
  1310. TUSB_Registers = record
  1311. PERID : byte; // *< Peripheral ID register, offset: 0x0
  1312. RESERVED_0 : array[0..2] of byte;
  1313. IDCOMP : byte; // *< Peripheral ID Complement register, offset: 0x4
  1314. RESERVED_1 : array[0..2] of byte;
  1315. REV : byte; // *< Peripheral Revision register, offset: 0x8
  1316. RESERVED_2 : array[0..2] of byte;
  1317. ADDINFO : byte; // *< Peripheral Additional Info register, offset: 0xC
  1318. RESERVED_3 : array[0..2] of byte;
  1319. OTGISTAT : byte; // *< OTG Interrupt Status register, offset: 0x10
  1320. RESERVED_4 : array[0..2] of byte;
  1321. OTGICR : byte; // *< OTG Interrupt Control register, offset: 0x14
  1322. RESERVED_5 : array[0..2] of byte;
  1323. OTGSTAT : byte; // *< OTG Status register, offset: 0x18
  1324. RESERVED_6 : array[0..2] of byte;
  1325. OTGCTL : byte; // *< OTG Control register, offset: 0x1C
  1326. RESERVED_7 : array[0..98] of byte;
  1327. ISTAT : byte; // *< Interrupt Status register, offset: 0x80
  1328. RESERVED_8 : array[0..2] of byte;
  1329. INTEN : byte; // *< Interrupt Enable register, offset: 0x84
  1330. RESERVED_9 : array[0..2] of byte;
  1331. ERRSTAT : byte; // *< Error Interrupt Status register, offset: 0x88
  1332. RESERVED_10 : array[0..2] of byte;
  1333. ERREN : byte; // *< Error Interrupt Enable register, offset: 0x8C
  1334. RESERVED_11 : array[0..2] of byte;
  1335. STAT : byte; // *< Status register, offset: 0x90
  1336. RESERVED_12 : array[0..2] of byte;
  1337. CTL : byte; // *< Control register, offset: 0x94
  1338. RESERVED_13 : array[0..2] of byte;
  1339. ADDR : byte; // *< Address register, offset: 0x98
  1340. RESERVED_14 : array[0..2] of byte;
  1341. BDTPAGE1 : byte; // *< BDT Page register 1, offset: 0x9C
  1342. RESERVED_15 : array[0..2] of byte;
  1343. FRMNUML : byte; // *< Frame Number register Low, offset: 0xA0
  1344. RESERVED_16 : array[0..2] of byte;
  1345. FRMNUMH : byte; // *< Frame Number register High, offset: 0xA4
  1346. RESERVED_17 : array[0..2] of byte;
  1347. TOKEN : byte; // *< Token register, offset: 0xA8
  1348. RESERVED_18 : array[0..2] of byte;
  1349. SOFTHLD : byte; // *< SOF Threshold register, offset: 0xAC
  1350. RESERVED_19 : array[0..2] of byte;
  1351. BDTPAGE2 : byte; // *< BDT Page Register 2, offset: 0xB0
  1352. RESERVED_20 : array[0..2] of byte;
  1353. BDTPAGE3 : byte; // *< BDT Page Register 3, offset: 0xB4
  1354. RESERVED_21 : array[0..10] of byte;
  1355. ENDPOINT : array[0..15] of TUSB_ENDPOINT;
  1356. USBCTRL : byte; // *< USB Control register, offset: 0x100
  1357. RESERVED_22 : array[0..2] of byte;
  1358. OBSERVE : byte; // *< USB OTG Observe register, offset: 0x104
  1359. RESERVED_23 : array[0..2] of byte;
  1360. CONTROL : byte; // *< USB OTG Control register, offset: 0x108
  1361. RESERVED_24 : array[0..2] of byte;
  1362. USBTRC0 : byte; // *< USB Transceiver Control register 0, offset: 0x10C
  1363. RESERVED_25 : array[0..6] of byte;
  1364. USBFRMADJUST : byte; // *< Frame Adjust Register, offset: 0x114
  1365. RESERVED_26 : array[0..42] of byte;
  1366. CLK_RECOVER_CTRL : byte; // *< USB Clock recovery control, offset: 0x140
  1367. RESERVED_27 : array[0..2] of byte;
  1368. CLK_RECOVER_IRC_EN : byte; // *< IRC48M oscillator enable register, offset: 0x144
  1369. RESERVED_28 : array[0..22] of byte;
  1370. CLK_RECOVER_INT_STATUS : byte; // *< Clock recovery separated interrupt status, offset: 0x15C
  1371. end;
  1372. const
  1373. USB0_BASE = $40072000;
  1374. var
  1375. USB0 : TUSB_Registers absolute USB0_BASE;
  1376. type
  1377. TUSBDCD_Registers = record
  1378. CONTROL : longword; // *< Control register, offset: 0x0
  1379. CLOCK : longword; // *< Clock register, offset: 0x4
  1380. STATUS : longword; // *< Status register, offset: 0x8
  1381. RESERVED_0 : array[0..3] of byte;
  1382. TIMER0 : longword; // *< TIMER0 register, offset: 0x10
  1383. TIMER1 : longword; // *< TIMER1 register, offset: 0x14
  1384. TIMER2_BC11: longword; // *< TIMER2_BC11 register, offset: 0x18
  1385. end;
  1386. const
  1387. USBDCD_BASE = $40035000;
  1388. var
  1389. USBDCD : TUSBDCD_Registers absolute USBDCD_BASE;
  1390. type
  1391. TVREF_Registers = record
  1392. TRM : byte; // *< VREF Trim Register, offset: 0x0
  1393. SC : byte; // *< VREF Status and Control Register, offset: 0x1
  1394. end;
  1395. const
  1396. VREF_BASE = $40074000;
  1397. var
  1398. VREF : TVREF_Registers absolute VREF_BASE;
  1399. type
  1400. TWDOG_Registers = record
  1401. STCTRLH : word; // *< Watchdog Status and Control Register High, offset: 0x0
  1402. STCTRLL : word; // *< Watchdog Status and Control Register Low, offset: 0x2
  1403. TOVALH : word; // *< Watchdog Time-out Value Register High, offset: 0x4
  1404. TOVALL : word; // *< Watchdog Time-out Value Register Low, offset: 0x6
  1405. WINH : word; // *< Watchdog Window Register High, offset: 0x8
  1406. WINL : word; // *< Watchdog Window Register Low, offset: 0xA
  1407. REFRESH : word; // *< Watchdog Refresh register, offset: 0xC
  1408. UNLOCK : word; // *< Watchdog Unlock register, offset: 0xE
  1409. TMROUTH : word; // *< Watchdog Timer Output Register High, offset: 0x10
  1410. TMROUTL : word; // *< Watchdog Timer Output Register Low, offset: 0x12
  1411. RSTCNT : word; // *< Watchdog Reset Count register, offset: 0x14
  1412. PRESC : word; // *< Watchdog Prescaler register, offset: 0x16
  1413. end;
  1414. const
  1415. WDOG_BASE = $40052000;
  1416. var
  1417. WDOG : TWDOG_Registers absolute WDOG_BASE;
  1418. implementation
  1419. procedure NonMaskableInt_interrupt; external name 'NonMaskableInt_interrupt';
  1420. procedure HardFault_interrupt; external name 'HardFault_interrupt';
  1421. procedure MemoryManagement_interrupt; external name 'MemoryManagement_interrupt';
  1422. procedure BusFault_interrupt; external name 'BusFault_interrupt';
  1423. procedure UsageFault_interrupt; external name 'UsageFault_interrupt';
  1424. procedure SVCall_interrupt; external name 'SVCall_interrupt';
  1425. procedure DebugMonitor_interrupt; external name 'DebugMonitor_interrupt';
  1426. procedure PendSV_interrupt; external name 'PendSV_interrupt';
  1427. procedure SysTick_interrupt; external name 'SysTick_interrupt';
  1428. procedure DMA0_interrupt; external name 'DMA0_interrupt';
  1429. procedure DMA1_interrupt; external name 'DMA1_interrupt';
  1430. procedure DMA2_interrupt; external name 'DMA2_interrupt';
  1431. procedure DMA3_interrupt; external name 'DMA3_interrupt';
  1432. procedure DMA4_interrupt; external name 'DMA4_interrupt';
  1433. procedure DMA5_interrupt; external name 'DMA5_interrupt';
  1434. procedure DMA6_interrupt; external name 'DMA6_interrupt';
  1435. procedure DMA7_interrupt; external name 'DMA7_interrupt';
  1436. procedure DMA8_interrupt; external name 'DMA8_interrupt';
  1437. procedure DMA9_interrupt; external name 'DMA9_interrupt';
  1438. procedure DMA10_interrupt; external name 'DMA10_interrupt';
  1439. procedure DMA11_interrupt; external name 'DMA11_interrupt';
  1440. procedure DMA12_interrupt; external name 'DMA12_interrupt';
  1441. procedure DMA13_interrupt; external name 'DMA13_interrupt';
  1442. procedure DMA14_interrupt; external name 'DMA14_interrupt';
  1443. procedure DMA15_interrupt; external name 'DMA15_interrupt';
  1444. procedure DMA_Error_interrupt; external name 'DMA_Error_interrupt';
  1445. procedure MCM_interrupt; external name 'MCM_interrupt';
  1446. procedure FTFE_interrupt; external name 'FTFE_interrupt';
  1447. procedure Read_Collision_interrupt; external name 'Read_Collision_interrupt';
  1448. procedure LVD_LVW_interrupt; external name 'LVD_LVW_interrupt';
  1449. procedure LLWU_interrupt; external name 'LLWU_interrupt';
  1450. procedure WDOG_EWM_interrupt; external name 'WDOG_EWM_interrupt';
  1451. procedure RNG_interrupt; external name 'RNG_interrupt';
  1452. procedure I2C0_interrupt; external name 'I2C0_interrupt';
  1453. procedure I2C1_interrupt; external name 'I2C1_interrupt';
  1454. procedure SPI0_interrupt; external name 'SPI0_interrupt';
  1455. procedure SPI1_interrupt; external name 'SPI1_interrupt';
  1456. procedure I2S0_Tx_interrupt; external name 'I2S0_Tx_interrupt';
  1457. procedure I2S0_Rx_interrupt; external name 'I2S0_Rx_interrupt';
  1458. procedure UART0_LON_interrupt; external name 'UART0_LON_interrupt';
  1459. procedure UART0_RX_TX_interrupt; external name 'UART0_RX_TX_interrupt';
  1460. procedure UART0_ERR_interrupt; external name 'UART0_ERR_interrupt';
  1461. procedure UART1_RX_TX_interrupt; external name 'UART1_RX_TX_interrupt';
  1462. procedure UART1_ERR_interrupt; external name 'UART1_ERR_interrupt';
  1463. procedure UART2_RX_TX_interrupt; external name 'UART2_RX_TX_interrupt';
  1464. procedure UART2_ERR_interrupt; external name 'UART2_ERR_interrupt';
  1465. procedure UART3_RX_TX_interrupt; external name 'UART3_RX_TX_interrupt';
  1466. procedure UART3_ERR_interrupt; external name 'UART3_ERR_interrupt';
  1467. procedure ADC0_interrupt; external name 'ADC0_interrupt';
  1468. procedure CMP0_interrupt; external name 'CMP0_interrupt';
  1469. procedure CMP1_interrupt; external name 'CMP1_interrupt';
  1470. procedure FTM0_interrupt; external name 'FTM0_interrupt';
  1471. procedure FTM1_interrupt; external name 'FTM1_interrupt';
  1472. procedure FTM2_interrupt; external name 'FTM2_interrupt';
  1473. procedure CMT_interrupt; external name 'CMT_interrupt';
  1474. procedure RTC_interrupt; external name 'RTC_interrupt';
  1475. procedure RTC_Seconds_interrupt; external name 'RTC_Seconds_interrupt';
  1476. procedure PIT0_interrupt; external name 'PIT0_interrupt';
  1477. procedure PIT1_interrupt; external name 'PIT1_interrupt';
  1478. procedure PIT2_interrupt; external name 'PIT2_interrupt';
  1479. procedure PIT3_interrupt; external name 'PIT3_interrupt';
  1480. procedure PDB0_interrupt; external name 'PDB0_interrupt';
  1481. procedure USB0_interrupt; external name 'USB0_interrupt';
  1482. procedure USBDCD_interrupt; external name 'USBDCD_interrupt';
  1483. procedure RESERVED71_interrupt; external name 'RESERVED71_interrupt';
  1484. procedure DAC0_interrupt; external name 'DAC0_interrupt';
  1485. procedure MCG_interrupt; external name 'MCG_interrupt';
  1486. procedure LPTMR0_interrupt; external name 'LPTMR0_interrupt';
  1487. procedure PORTA_interrupt; external name 'PORTA_interrupt';
  1488. procedure PORTB_interrupt; external name 'PORTB_interrupt';
  1489. procedure PORTC_interrupt; external name 'PORTC_interrupt';
  1490. procedure PORTD_interrupt; external name 'PORTD_interrupt';
  1491. procedure PORTE_interrupt; external name 'PORTE_interrupt';
  1492. procedure SWI_interrupt; external name 'SWI_interrupt';
  1493. procedure SPI2_interrupt; external name 'SPI2_interrupt';
  1494. procedure UART4_RX_TX_interrupt; external name 'UART4_RX_TX_interrupt';
  1495. procedure UART4_ERR_interrupt; external name 'UART4_ERR_interrupt';
  1496. procedure UART5_RX_TX_interrupt; external name 'UART5_RX_TX_interrupt';
  1497. procedure UART5_ERR_interrupt; external name 'UART5_ERR_interrupt';
  1498. procedure CMP2_interrupt; external name 'CMP2_interrupt';
  1499. procedure FTM3_interrupt; external name 'FTM3_interrupt';
  1500. procedure DAC1_interrupt; external name 'DAC1_interrupt';
  1501. procedure ADC1_interrupt; external name 'ADC1_interrupt';
  1502. procedure I2C2_interrupt; external name 'I2C2_interrupt';
  1503. procedure CAN0_ORed_Message_buffer_interrupt; external name 'CAN0_ORed_Message_buffer_interrupt';
  1504. procedure CAN0_Bus_Off_interrupt; external name 'CAN0_Bus_Off_interrupt';
  1505. procedure CAN0_Error_interrupt; external name 'CAN0_Error_interrupt';
  1506. procedure CAN0_Tx_Warning_interrupt; external name 'CAN0_Tx_Warning_interrupt';
  1507. procedure CAN0_Rx_Warning_interrupt; external name 'CAN0_Rx_Warning_interrupt';
  1508. procedure CAN0_Wake_Up_interrupt; external name 'CAN0_Wake_Up_interrupt';
  1509. procedure SDHC_interrupt; external name 'SDHC_interrupt';
  1510. procedure ENET_1588_Timer_interrupt; external name 'ENET_1588_Timer_interrupt';
  1511. procedure ENET_Transmit_interrupt; external name 'ENET_Transmit_interrupt';
  1512. procedure ENET_Receive_interrupt; external name 'ENET_Receive_interrupt';
  1513. procedure ENET_Error_interrupt; external name 'ENET_Error_interrupt';
  1514. {$i cortexm4f_start.inc}
  1515. procedure FlashConfiguration; assembler; nostackframe;
  1516. label flash_conf;
  1517. asm
  1518. .section ".flash_config.flash_conf"
  1519. flash_conf:
  1520. .byte 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF
  1521. .text
  1522. end;
  1523. procedure LowLevelStartup; assembler; nostackframe; [public, alias: '_LOWLEVELSTART'];
  1524. asm
  1525. // Unlock watchdog
  1526. ldr r0, .LWDOG_BASE
  1527. movw r1, #50464
  1528. strh r1, [r0, #0xE]
  1529. movw r1, #55592
  1530. strh r1, [r0, #0xE]
  1531. nop
  1532. nop
  1533. // Disable watchdog for now
  1534. movs r1, #0
  1535. strh r1, [r0, #0]
  1536. b Startup
  1537. .LWDOG_BASE:
  1538. .long 0x40052000
  1539. end;
  1540. procedure Vectors; assembler; nostackframe;
  1541. label interrupt_vectors;
  1542. asm
  1543. .section ".init.interrupt_vectors"
  1544. interrupt_vectors:
  1545. .long _stack_top
  1546. .long LowLevelStartup // int -15
  1547. .long NonMaskableInt_interrupt // int -14
  1548. .long HardFault_interrupt // int -13
  1549. .long MemoryManagement_interrupt // int -12
  1550. .long BusFault_interrupt // int -11
  1551. .long UsageFault_interrupt // int -10
  1552. .long 0 // int -9
  1553. .long 0 // int -8
  1554. .long 0 // int -7
  1555. .long 0 // int -6
  1556. .long SVCall_interrupt // int -5
  1557. .long DebugMonitor_interrupt // int -4
  1558. .long 0 // int -3
  1559. .long PendSV_interrupt // int -2
  1560. .long SysTick_interrupt // int -1
  1561. .long DMA0_interrupt // int 0
  1562. .long DMA1_interrupt // int 1
  1563. .long DMA2_interrupt // int 2
  1564. .long DMA3_interrupt // int 3
  1565. .long DMA4_interrupt // int 4
  1566. .long DMA5_interrupt // int 5
  1567. .long DMA6_interrupt // int 6
  1568. .long DMA7_interrupt // int 7
  1569. .long DMA8_interrupt // int 8
  1570. .long DMA9_interrupt // int 9
  1571. .long DMA10_interrupt // int 10
  1572. .long DMA11_interrupt // int 11
  1573. .long DMA12_interrupt // int 12
  1574. .long DMA13_interrupt // int 13
  1575. .long DMA14_interrupt // int 14
  1576. .long DMA15_interrupt // int 15
  1577. .long DMA_Error_interrupt // int 16
  1578. .long MCM_interrupt // int 17
  1579. .long FTFE_interrupt // int 18
  1580. .long Read_Collision_interrupt // int 19
  1581. .long LVD_LVW_interrupt // int 20
  1582. .long LLWU_interrupt // int 21
  1583. .long WDOG_EWM_interrupt // int 22
  1584. .long RNG_interrupt // int 23
  1585. .long I2C0_interrupt // int 24
  1586. .long I2C1_interrupt // int 25
  1587. .long SPI0_interrupt // int 26
  1588. .long SPI1_interrupt // int 27
  1589. .long I2S0_Tx_interrupt // int 28
  1590. .long I2S0_Rx_interrupt // int 29
  1591. .long UART0_LON_interrupt // int 30
  1592. .long UART0_RX_TX_interrupt // int 31
  1593. .long UART0_ERR_interrupt // int 32
  1594. .long UART1_RX_TX_interrupt // int 33
  1595. .long UART1_ERR_interrupt // int 34
  1596. .long UART2_RX_TX_interrupt // int 35
  1597. .long UART2_ERR_interrupt // int 36
  1598. .long UART3_RX_TX_interrupt // int 37
  1599. .long UART3_ERR_interrupt // int 38
  1600. .long ADC0_interrupt // int 39
  1601. .long CMP0_interrupt // int 40
  1602. .long CMP1_interrupt // int 41
  1603. .long FTM0_interrupt // int 42
  1604. .long FTM1_interrupt // int 43
  1605. .long FTM2_interrupt // int 44
  1606. .long CMT_interrupt // int 45
  1607. .long RTC_interrupt // int 46
  1608. .long RTC_Seconds_interrupt // int 47
  1609. .long PIT0_interrupt // int 48
  1610. .long PIT1_interrupt // int 49
  1611. .long PIT2_interrupt // int 50
  1612. .long PIT3_interrupt // int 51
  1613. .long PDB0_interrupt // int 52
  1614. .long USB0_interrupt // int 53
  1615. .long USBDCD_interrupt // int 54
  1616. .long RESERVED71_interrupt // int 55
  1617. .long DAC0_interrupt // int 56
  1618. .long MCG_interrupt // int 57
  1619. .long LPTMR0_interrupt // int 58
  1620. .long PORTA_interrupt // int 59
  1621. .long PORTB_interrupt // int 60
  1622. .long PORTC_interrupt // int 61
  1623. .long PORTD_interrupt // int 62
  1624. .long PORTE_interrupt // int 63
  1625. .long SWI_interrupt // int 64
  1626. .long SPI2_interrupt // int 65
  1627. .long UART4_RX_TX_interrupt // int 66
  1628. .long UART4_ERR_interrupt // int 67
  1629. .long UART5_RX_TX_interrupt // int 68
  1630. .long UART5_ERR_interrupt // int 69
  1631. .long CMP2_interrupt // int 70
  1632. .long FTM3_interrupt // int 71
  1633. .long DAC1_interrupt // int 72
  1634. .long ADC1_interrupt // int 73
  1635. .long I2C2_interrupt // int 74
  1636. .long CAN0_ORed_Message_buffer_interrupt // int 75
  1637. .long CAN0_Bus_Off_interrupt // int 76
  1638. .long CAN0_Error_interrupt // int 77
  1639. .long CAN0_Tx_Warning_interrupt // int 78
  1640. .long CAN0_Rx_Warning_interrupt // int 79
  1641. .long CAN0_Wake_Up_interrupt // int 80
  1642. .long SDHC_interrupt // int 81
  1643. .long ENET_1588_Timer_interrupt // int 82
  1644. .long ENET_Transmit_interrupt // int 83
  1645. .long ENET_Receive_interrupt // int 84
  1646. .long ENET_Error_interrupt // int 85
  1647. .weak NonMaskableInt_interrupt
  1648. .weak HardFault_interrupt
  1649. .weak MemoryManagement_interrupt
  1650. .weak BusFault_interrupt
  1651. .weak UsageFault_interrupt
  1652. .weak SVCall_interrupt
  1653. .weak DebugMonitor_interrupt
  1654. .weak PendSV_interrupt
  1655. .weak SysTick_interrupt
  1656. .weak DMA0_interrupt
  1657. .weak DMA1_interrupt
  1658. .weak DMA2_interrupt
  1659. .weak DMA3_interrupt
  1660. .weak DMA4_interrupt
  1661. .weak DMA5_interrupt
  1662. .weak DMA6_interrupt
  1663. .weak DMA7_interrupt
  1664. .weak DMA8_interrupt
  1665. .weak DMA9_interrupt
  1666. .weak DMA10_interrupt
  1667. .weak DMA11_interrupt
  1668. .weak DMA12_interrupt
  1669. .weak DMA13_interrupt
  1670. .weak DMA14_interrupt
  1671. .weak DMA15_interrupt
  1672. .weak DMA_Error_interrupt
  1673. .weak MCM_interrupt
  1674. .weak FTFE_interrupt
  1675. .weak Read_Collision_interrupt
  1676. .weak LVD_LVW_interrupt
  1677. .weak LLWU_interrupt
  1678. .weak WDOG_EWM_interrupt
  1679. .weak RNG_interrupt
  1680. .weak I2C0_interrupt
  1681. .weak I2C1_interrupt
  1682. .weak SPI0_interrupt
  1683. .weak SPI1_interrupt
  1684. .weak I2S0_Tx_interrupt
  1685. .weak I2S0_Rx_interrupt
  1686. .weak UART0_LON_interrupt
  1687. .weak UART0_RX_TX_interrupt
  1688. .weak UART0_ERR_interrupt
  1689. .weak UART1_RX_TX_interrupt
  1690. .weak UART1_ERR_interrupt
  1691. .weak UART2_RX_TX_interrupt
  1692. .weak UART2_ERR_interrupt
  1693. .weak UART3_RX_TX_interrupt
  1694. .weak UART3_ERR_interrupt
  1695. .weak ADC0_interrupt
  1696. .weak CMP0_interrupt
  1697. .weak CMP1_interrupt
  1698. .weak FTM0_interrupt
  1699. .weak FTM1_interrupt
  1700. .weak FTM2_interrupt
  1701. .weak CMT_interrupt
  1702. .weak RTC_interrupt
  1703. .weak RTC_Seconds_interrupt
  1704. .weak PIT0_interrupt
  1705. .weak PIT1_interrupt
  1706. .weak PIT2_interrupt
  1707. .weak PIT3_interrupt
  1708. .weak PDB0_interrupt
  1709. .weak USB0_interrupt
  1710. .weak USBDCD_interrupt
  1711. .weak RESERVED71_interrupt
  1712. .weak DAC0_interrupt
  1713. .weak MCG_interrupt
  1714. .weak LPTMR0_interrupt
  1715. .weak PORTA_interrupt
  1716. .weak PORTB_interrupt
  1717. .weak PORTC_interrupt
  1718. .weak PORTD_interrupt
  1719. .weak PORTE_interrupt
  1720. .weak SWI_interrupt
  1721. .weak SPI2_interrupt
  1722. .weak UART4_RX_TX_interrupt
  1723. .weak UART4_ERR_interrupt
  1724. .weak UART5_RX_TX_interrupt
  1725. .weak UART5_ERR_interrupt
  1726. .weak CMP2_interrupt
  1727. .weak FTM3_interrupt
  1728. .weak DAC1_interrupt
  1729. .weak ADC1_interrupt
  1730. .weak I2C2_interrupt
  1731. .weak CAN0_ORed_Message_buffer_interrupt
  1732. .weak CAN0_Bus_Off_interrupt
  1733. .weak CAN0_Error_interrupt
  1734. .weak CAN0_Tx_Warning_interrupt
  1735. .weak CAN0_Rx_Warning_interrupt
  1736. .weak CAN0_Wake_Up_interrupt
  1737. .weak SDHC_interrupt
  1738. .weak ENET_1588_Timer_interrupt
  1739. .weak ENET_Transmit_interrupt
  1740. .weak ENET_Receive_interrupt
  1741. .weak ENET_Error_interrupt
  1742. .set NonMaskableInt_interrupt, HaltProc
  1743. .set HardFault_interrupt, HaltProc
  1744. .set MemoryManagement_interrupt, HaltProc
  1745. .set BusFault_interrupt, HaltProc
  1746. .set UsageFault_interrupt, HaltProc
  1747. .set SVCall_interrupt, HaltProc
  1748. .set DebugMonitor_interrupt, HaltProc
  1749. .set PendSV_interrupt, HaltProc
  1750. .set SysTick_interrupt, HaltProc
  1751. .set DMA0_interrupt, HaltProc
  1752. .set DMA1_interrupt, HaltProc
  1753. .set DMA2_interrupt, HaltProc
  1754. .set DMA3_interrupt, HaltProc
  1755. .set DMA4_interrupt, HaltProc
  1756. .set DMA5_interrupt, HaltProc
  1757. .set DMA6_interrupt, HaltProc
  1758. .set DMA7_interrupt, HaltProc
  1759. .set DMA8_interrupt, HaltProc
  1760. .set DMA9_interrupt, HaltProc
  1761. .set DMA10_interrupt, HaltProc
  1762. .set DMA11_interrupt, HaltProc
  1763. .set DMA12_interrupt, HaltProc
  1764. .set DMA13_interrupt, HaltProc
  1765. .set DMA14_interrupt, HaltProc
  1766. .set DMA15_interrupt, HaltProc
  1767. .set DMA_Error_interrupt, HaltProc
  1768. .set MCM_interrupt, HaltProc
  1769. .set FTFE_interrupt, HaltProc
  1770. .set Read_Collision_interrupt, HaltProc
  1771. .set LVD_LVW_interrupt, HaltProc
  1772. .set LLWU_interrupt, HaltProc
  1773. .set WDOG_EWM_interrupt, HaltProc
  1774. .set RNG_interrupt, HaltProc
  1775. .set I2C0_interrupt, HaltProc
  1776. .set I2C1_interrupt, HaltProc
  1777. .set SPI0_interrupt, HaltProc
  1778. .set SPI1_interrupt, HaltProc
  1779. .set I2S0_Tx_interrupt, HaltProc
  1780. .set I2S0_Rx_interrupt, HaltProc
  1781. .set UART0_LON_interrupt, HaltProc
  1782. .set UART0_RX_TX_interrupt, HaltProc
  1783. .set UART0_ERR_interrupt, HaltProc
  1784. .set UART1_RX_TX_interrupt, HaltProc
  1785. .set UART1_ERR_interrupt, HaltProc
  1786. .set UART2_RX_TX_interrupt, HaltProc
  1787. .set UART2_ERR_interrupt, HaltProc
  1788. .set UART3_RX_TX_interrupt, HaltProc
  1789. .set UART3_ERR_interrupt, HaltProc
  1790. .set ADC0_interrupt, HaltProc
  1791. .set CMP0_interrupt, HaltProc
  1792. .set CMP1_interrupt, HaltProc
  1793. .set FTM0_interrupt, HaltProc
  1794. .set FTM1_interrupt, HaltProc
  1795. .set FTM2_interrupt, HaltProc
  1796. .set CMT_interrupt, HaltProc
  1797. .set RTC_interrupt, HaltProc
  1798. .set RTC_Seconds_interrupt, HaltProc
  1799. .set PIT0_interrupt, HaltProc
  1800. .set PIT1_interrupt, HaltProc
  1801. .set PIT2_interrupt, HaltProc
  1802. .set PIT3_interrupt, HaltProc
  1803. .set PDB0_interrupt, HaltProc
  1804. .set USB0_interrupt, HaltProc
  1805. .set USBDCD_interrupt, HaltProc
  1806. .set RESERVED71_interrupt, HaltProc
  1807. .set DAC0_interrupt, HaltProc
  1808. .set MCG_interrupt, HaltProc
  1809. .set LPTMR0_interrupt, HaltProc
  1810. .set PORTA_interrupt, HaltProc
  1811. .set PORTB_interrupt, HaltProc
  1812. .set PORTC_interrupt, HaltProc
  1813. .set PORTD_interrupt, HaltProc
  1814. .set PORTE_interrupt, HaltProc
  1815. .set SWI_interrupt, HaltProc
  1816. .set SPI2_interrupt, HaltProc
  1817. .set UART4_RX_TX_interrupt, HaltProc
  1818. .set UART4_ERR_interrupt, HaltProc
  1819. .set UART5_RX_TX_interrupt, HaltProc
  1820. .set UART5_ERR_interrupt, HaltProc
  1821. .set CMP2_interrupt, HaltProc
  1822. .set FTM3_interrupt, HaltProc
  1823. .set DAC1_interrupt, HaltProc
  1824. .set ADC1_interrupt, HaltProc
  1825. .set I2C2_interrupt, HaltProc
  1826. .set CAN0_ORed_Message_buffer_interrupt, HaltProc
  1827. .set CAN0_Bus_Off_interrupt, HaltProc
  1828. .set CAN0_Error_interrupt, HaltProc
  1829. .set CAN0_Tx_Warning_interrupt, HaltProc
  1830. .set CAN0_Rx_Warning_interrupt, HaltProc
  1831. .set CAN0_Wake_Up_interrupt, HaltProc
  1832. .set SDHC_interrupt, HaltProc
  1833. .set ENET_1588_Timer_interrupt, HaltProc
  1834. .set ENET_Transmit_interrupt, HaltProc
  1835. .set ENET_Receive_interrupt, HaltProc
  1836. .set ENET_Error_interrupt, HaltProc
  1837. .text
  1838. end;
  1839. end.