board.c 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2009-01-05 Bernard first implementation
  9. * 2022-08-15 xjy198903 add sdram pin config
  10. * 2022-08-17 xjy198903 add rgmii pins
  11. * 2022-09-01 xjy198903 add can pins
  12. * 2022-09-07 xjy198903 add sdio pins
  13. * 2022-09-14 xjy198903 add flexspi pins
  14. */
  15. #include <rthw.h>
  16. #include <rtthread.h>
  17. #include "board.h"
  18. #include "pin_mux.h"
  19. #include "fsl_iomuxc.h"
  20. #include "fsl_gpio.h"
  21. #ifdef BSP_USING_DMA
  22. #include "fsl_dmamux.h"
  23. #include "fsl_edma.h"
  24. #endif
  25. #define NVIC_PRIORITYGROUP_0 0x00000007U /*!< 0 bits for pre-emption priority
  26. 4 bits for subpriority */
  27. #define NVIC_PRIORITYGROUP_1 0x00000006U /*!< 1 bits for pre-emption priority
  28. 3 bits for subpriority */
  29. #define NVIC_PRIORITYGROUP_2 0x00000005U /*!< 2 bits for pre-emption priority
  30. 2 bits for subpriority */
  31. #define NVIC_PRIORITYGROUP_3 0x00000004U /*!< 3 bits for pre-emption priority
  32. 1 bits for subpriority */
  33. #define NVIC_PRIORITYGROUP_4 0x00000003U /*!< 4 bits for pre-emption priority
  34. 0 bits for subpriority */
  35. /* MPU configuration. */
  36. static void BOARD_ConfigMPU(void)
  37. {
  38. #if defined(__CC_ARM) || defined(__ARMCC_VERSION)
  39. extern uint32_t Image$$RW_m_ncache$$Base[];
  40. /* RW_m_ncache_unused is a auxiliary region which is used to get the whole size of noncache section */
  41. extern uint32_t Image$$RW_m_ncache_unused$$Base[];
  42. extern uint32_t Image$$RW_m_ncache_unused$$ZI$$Limit[];
  43. uint32_t nonCacheStart = (uint32_t)Image$$RW_m_ncache$$Base;
  44. uint32_t size = ((uint32_t)Image$$RW_m_ncache_unused$$Base == nonCacheStart) ?
  45. 0 :
  46. ((uint32_t)Image$$RW_m_ncache_unused$$ZI$$Limit - nonCacheStart);
  47. #elif defined(__MCUXPRESSO)
  48. #if defined(__USE_SHMEM)
  49. extern uint32_t __base_rpmsg_sh_mem;
  50. extern uint32_t __top_rpmsg_sh_mem;
  51. uint32_t nonCacheStart = (uint32_t)(&__base_rpmsg_sh_mem);
  52. uint32_t size = (uint32_t)(&__top_rpmsg_sh_mem) - nonCacheStart;
  53. #else
  54. extern uint32_t __base_NCACHE_REGION;
  55. extern uint32_t __top_NCACHE_REGION;
  56. uint32_t nonCacheStart = (uint32_t)(&__base_NCACHE_REGION);
  57. uint32_t size = (uint32_t)(&__top_NCACHE_REGION) - nonCacheStart;
  58. #endif
  59. #elif defined(__ICCARM__) || defined(__GNUC__)
  60. extern uint32_t __NCACHE_REGION_START[];
  61. extern uint32_t __NCACHE_REGION_SIZE[];
  62. uint32_t nonCacheStart = (uint32_t)__NCACHE_REGION_START;
  63. uint32_t size = (uint32_t)__NCACHE_REGION_SIZE;
  64. #endif
  65. volatile uint32_t i = 0;
  66. #if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT
  67. /* Disable I cache and D cache */
  68. if (SCB_CCR_IC_Msk == (SCB_CCR_IC_Msk & SCB->CCR))
  69. {
  70. SCB_DisableICache();
  71. }
  72. #endif
  73. #if defined(__DCACHE_PRESENT) && __DCACHE_PRESENT
  74. if (SCB_CCR_DC_Msk == (SCB_CCR_DC_Msk & SCB->CCR))
  75. {
  76. SCB_DisableDCache();
  77. }
  78. #endif
  79. /* Disable MPU */
  80. ARM_MPU_Disable();
  81. /* MPU configure:
  82. * Use ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable,
  83. * SubRegionDisable, Size)
  84. * API in mpu_armv7.h.
  85. * param DisableExec Instruction access (XN) disable bit,0=instruction fetches enabled, 1=instruction fetches
  86. * disabled.
  87. * param AccessPermission Data access permissions, allows you to configure read/write access for User and
  88. * Privileged mode.
  89. * Use MACROS defined in mpu_armv7.h:
  90. * ARM_MPU_AP_NONE/ARM_MPU_AP_PRIV/ARM_MPU_AP_URO/ARM_MPU_AP_FULL/ARM_MPU_AP_PRO/ARM_MPU_AP_RO
  91. * Combine TypeExtField/IsShareable/IsCacheable/IsBufferable to configure MPU memory access attributes.
  92. * TypeExtField IsShareable IsCacheable IsBufferable Memory Attribtue Shareability Cache
  93. * 0 x 0 0 Strongly Ordered shareable
  94. * 0 x 0 1 Device shareable
  95. * 0 0 1 0 Normal not shareable Outer and inner write
  96. * through no write allocate
  97. * 0 0 1 1 Normal not shareable Outer and inner write
  98. * back no write allocate
  99. * 0 1 1 0 Normal shareable Outer and inner write
  100. * through no write allocate
  101. * 0 1 1 1 Normal shareable Outer and inner write
  102. * back no write allocate
  103. * 1 0 0 0 Normal not shareable outer and inner
  104. * noncache
  105. * 1 1 0 0 Normal shareable outer and inner
  106. * noncache
  107. * 1 0 1 1 Normal not shareable outer and inner write
  108. * back write/read acllocate
  109. * 1 1 1 1 Normal shareable outer and inner write
  110. * back write/read acllocate
  111. * 2 x 0 0 Device not shareable
  112. * Above are normal use settings, if your want to see more details or want to config different inner/outter cache
  113. * policy.
  114. * please refer to Table 4-55 /4-56 in arm cortex-M7 generic user guide <dui0646b_cortex_m7_dgug.pdf>
  115. * param SubRegionDisable Sub-region disable field. 0=sub-region is enabled, 1=sub-region is disabled.
  116. * param Size Region size of the region to be configured. use ARM_MPU_REGION_SIZE_xxx MACRO in
  117. * mpu_armv7.h.
  118. */
  119. /* Region 0 setting: Instruction access disabled, No data access permission. */
  120. MPU->RBAR = ARM_MPU_RBAR(0, 0x00000000U);
  121. MPU->RASR = ARM_MPU_RASR(1, ARM_MPU_AP_NONE, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4GB);
  122. /* Region 1 setting: Memory with Device type, not shareable, non-cacheable. */
  123. MPU->RBAR = ARM_MPU_RBAR(1, 0x80000000U);
  124. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);
  125. /* Region 2 setting: Memory with Device type, not shareable, non-cacheable. */
  126. MPU->RBAR = ARM_MPU_RBAR(2, 0x60000000U);
  127. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);
  128. /* Region 3 setting: Memory with Device type, not shareable, non-cacheable. */
  129. MPU->RBAR = ARM_MPU_RBAR(3, 0x00000000U);
  130. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1GB);
  131. /* Region 4 setting: Memory with Normal type, not shareable, outer/inner write back */
  132. MPU->RBAR = ARM_MPU_RBAR(4, 0x00000000U);
  133. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_256KB);
  134. /* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */
  135. MPU->RBAR = ARM_MPU_RBAR(5, 0x20000000U);
  136. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_256KB);
  137. #if defined(CACHE_MODE_WRITE_THROUGH) && CACHE_MODE_WRITE_THROUGH
  138. /* Region 6 setting: Memory with Normal type, not shareable, write through */
  139. MPU->RBAR = ARM_MPU_RBAR(6, 0x20200000U);
  140. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 0, 0, ARM_MPU_REGION_SIZE_1MB);
  141. /* Region 7 setting: Memory with Normal type, not shareable, write trough */
  142. MPU->RBAR = ARM_MPU_RBAR(7, 0x20300000U);
  143. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 0, 0, ARM_MPU_REGION_SIZE_512KB);
  144. #else
  145. /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
  146. MPU->RBAR = ARM_MPU_RBAR(6, 0x20200000U);
  147. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_1MB);
  148. /* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */
  149. MPU->RBAR = ARM_MPU_RBAR(7, 0x20300000U);
  150. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_512KB);
  151. #endif
  152. #if defined(XIP_EXTERNAL_FLASH) && (XIP_EXTERNAL_FLASH == 1)
  153. /* Region 8 setting: Memory with Normal type, not shareable, outer/inner write back. */
  154. MPU->RBAR = ARM_MPU_RBAR(8, 0x30000000U);
  155. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_RO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_16MB);
  156. #endif
  157. #ifdef USE_SDRAM
  158. #if defined(CACHE_MODE_WRITE_THROUGH) && CACHE_MODE_WRITE_THROUGH
  159. /* Region 9 setting: Memory with Normal type, not shareable, write trough */
  160. MPU->RBAR = ARM_MPU_RBAR(9, 0x80000000U);
  161. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 0, 0, ARM_MPU_REGION_SIZE_64MB);
  162. #else
  163. /* Region 9 setting: Memory with Normal type, not shareable, outer/inner write back */
  164. MPU->RBAR = ARM_MPU_RBAR(9, 0x80000000U);
  165. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64MB);
  166. #endif
  167. #endif
  168. while ((size >> i) > 0x1U)
  169. {
  170. i++;
  171. }
  172. if (i != 0)
  173. {
  174. /* The MPU region size should be 2^N, 5<=N<=32, region base should be multiples of size. */
  175. assert(!(nonCacheStart % size));
  176. assert(size == (uint32_t)(1 << i));
  177. assert(i >= 5);
  178. /* Region 10 setting: Memory with Normal type, not shareable, non-cacheable */
  179. MPU->RBAR = ARM_MPU_RBAR(10, nonCacheStart);
  180. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, i - 1);
  181. }
  182. /* Region 11 setting: Memory with Device type, not shareable, non-cacheable */
  183. MPU->RBAR = ARM_MPU_RBAR(11, 0x40000000);
  184. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_16MB);
  185. /* Region 12 setting: Memory with Device type, not shareable, non-cacheable */
  186. MPU->RBAR = ARM_MPU_RBAR(12, 0x41000000);
  187. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_2MB);
  188. /* Region 13 setting: Memory with Device type, not shareable, non-cacheable */
  189. MPU->RBAR = ARM_MPU_RBAR(13, 0x41400000);
  190. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB);
  191. /* Region 14 setting: Memory with Device type, not shareable, non-cacheable */
  192. MPU->RBAR = ARM_MPU_RBAR(14, 0x41800000);
  193. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_2MB);
  194. /* Region 15 setting: Memory with Device type, not shareable, non-cacheable */
  195. MPU->RBAR = ARM_MPU_RBAR(15, 0x42000000);
  196. MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB);
  197. /* Enable MPU */
  198. ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk);
  199. /* Enable I cache and D cache */
  200. #if defined(__DCACHE_PRESENT) && __DCACHE_PRESENT
  201. SCB_EnableDCache();
  202. #endif
  203. #if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT
  204. SCB_EnableICache();
  205. #endif
  206. }
  207. /* This is the timer interrupt service routine. */
  208. void SysTick_Handler(void)
  209. {
  210. /* enter interrupt */
  211. rt_interrupt_enter();
  212. rt_tick_increase();
  213. /* leave interrupt */
  214. rt_interrupt_leave();
  215. }
  216. #ifdef BSP_USING_LPUART
  217. void imxrt_uart_pins_init(void)
  218. {
  219. #ifdef BSP_USING_LPUART1
  220. IOMUXC_SetPinMux(
  221. IOMUXC_GPIO_AD_24_LPUART1_TXD, /* GPIO_AD_B0_12 is configured as LPUART1_TX */
  222. 0U); /* Software Input On Field: Input Path is determined by functionality */
  223. IOMUXC_SetPinMux(
  224. IOMUXC_GPIO_AD_25_LPUART1_RXD, /* GPIO_AD_B0_13 is configured as LPUART1_RX */
  225. 0U); /* Software Input On Field: Input Path is determined by functionality */
  226. #endif
  227. #ifdef BSP_USING_LPUART2
  228. IOMUXC_SetPinMux(
  229. IOMUXC_GPIO_AD_B1_02_LPUART2_TX,
  230. 0U);
  231. IOMUXC_SetPinMux(
  232. IOMUXC_GPIO_AD_B1_03_LPUART2_RX,
  233. 0U);
  234. IOMUXC_SetPinConfig(
  235. IOMUXC_GPIO_AD_B1_02_LPUART2_TX,
  236. 0x10B0u);
  237. IOMUXC_SetPinConfig(
  238. IOMUXC_GPIO_AD_B1_03_LPUART2_RX,
  239. 0x10B0u);
  240. #endif
  241. #ifdef BSP_USING_LPUART3
  242. IOMUXC_SetPinMux(
  243. IOMUXC_GPIO_AD_B1_06_LPUART3_TX,
  244. 0U);
  245. IOMUXC_SetPinMux(
  246. IOMUXC_GPIO_AD_B1_07_LPUART3_RX,
  247. 0U);
  248. IOMUXC_SetPinConfig(
  249. IOMUXC_GPIO_AD_B1_06_LPUART3_TX,
  250. 0x10B0u);
  251. IOMUXC_SetPinConfig(
  252. IOMUXC_GPIO_AD_B1_07_LPUART3_RX,
  253. 0x10B0u);
  254. #endif
  255. #ifdef BSP_USING_LPUART4
  256. IOMUXC_SetPinMux(
  257. IOMUXC_GPIO_B1_00_LPUART4_TX,
  258. 0U);
  259. IOMUXC_SetPinMux(
  260. IOMUXC_GPIO_B1_01_LPUART4_RX,
  261. 0U);
  262. IOMUXC_SetPinConfig(
  263. IOMUXC_GPIO_B1_00_LPUART4_TX,
  264. 0x10B0u);
  265. IOMUXC_SetPinConfig(
  266. IOMUXC_GPIO_B1_01_LPUART4_RX,
  267. 0x10B0u);
  268. #endif
  269. #ifdef BSP_USING_LPUART5
  270. IOMUXC_SetPinMux(
  271. IOMUXC_GPIO_B1_12_LPUART5_TX,
  272. 0U);
  273. IOMUXC_SetPinMux(
  274. IOMUXC_GPIO_B1_13_LPUART5_RX,
  275. 0U);
  276. IOMUXC_SetPinConfig(
  277. IOMUXC_GPIO_B1_12_LPUART5_TX,
  278. 0x10B0u);
  279. IOMUXC_SetPinConfig(
  280. IOMUXC_GPIO_B1_13_LPUART5_RX,
  281. 0x10B0u);
  282. #endif
  283. #ifdef BSP_USING_LPUART6
  284. IOMUXC_SetPinMux(
  285. IOMUXC_GPIO_AD_B0_02_LPUART6_TX,
  286. 0U);
  287. IOMUXC_SetPinMux(
  288. IOMUXC_GPIO_AD_B0_03_LPUART6_RX,
  289. 0U);
  290. IOMUXC_SetPinConfig(
  291. IOMUXC_GPIO_AD_B0_02_LPUART6_TX,
  292. 0x10B0u);
  293. IOMUXC_SetPinConfig(
  294. IOMUXC_GPIO_AD_B0_03_LPUART6_RX,
  295. 0x10B0u);
  296. #endif
  297. #ifdef BSP_USING_LPUART7
  298. IOMUXC_SetPinMux(
  299. IOMUXC_GPIO_EMC_31_LPUART7_TX,
  300. 0U);
  301. IOMUXC_SetPinMux(
  302. IOMUXC_GPIO_EMC_32_LPUART7_RX,
  303. 0U);
  304. IOMUXC_SetPinConfig(
  305. IOMUXC_GPIO_EMC_31_LPUART7_TX,
  306. 0x10B0u);
  307. IOMUXC_SetPinConfig(
  308. IOMUXC_GPIO_EMC_32_LPUART7_RX,
  309. 0x10B0u);
  310. #endif
  311. #ifdef BSP_USING_LPUART8
  312. IOMUXC_SetPinMux(
  313. IOMUXC_GPIO_AD_B1_10_LPUART8_TX,
  314. 0U);
  315. IOMUXC_SetPinMux(
  316. IOMUXC_GPIO_AD_B1_11_LPUART8_RX,
  317. 0U);
  318. IOMUXC_SetPinConfig(
  319. IOMUXC_GPIO_AD_B1_10_LPUART8_TX,
  320. 0x10B0u);
  321. IOMUXC_SetPinConfig(
  322. IOMUXC_GPIO_AD_B1_11_LPUART8_RX,
  323. 0x10B0u);
  324. #endif
  325. }
  326. #endif /* BSP_USING_LPUART */
  327. #ifdef BSP_USING_SDIO
  328. void imxrt_SDcard_pins_init(void)
  329. {
  330. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  331. IOMUXC_SetPinMux(
  332. IOMUXC_GPIO_AD_34_USDHC1_VSELECT, /* GPIO_AD_34 is configured as USDHC1_VSELECT */
  333. 0U); /* Software Input On Field: Input Path is determined by functionality */
  334. IOMUXC_SetPinMux(
  335. IOMUXC_GPIO_AD_35_GPIO10_IO02, /* GPIO_AD_35 is configured as GPIO10_IO02 */
  336. 0U); /* Software Input On Field: Input Path is determined by functionality */
  337. IOMUXC_SetPinMux(
  338. IOMUXC_GPIO_SD_B1_00_USDHC1_CMD, /* GPIO_SD_B1_00 is configured as USDHC1_CMD */
  339. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_00 */
  340. IOMUXC_SetPinMux(
  341. IOMUXC_GPIO_SD_B1_01_USDHC1_CLK, /* GPIO_SD_B1_01 is configured as USDHC1_CLK */
  342. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_01 */
  343. IOMUXC_SetPinMux(
  344. IOMUXC_GPIO_SD_B1_02_USDHC1_DATA0, /* GPIO_SD_B1_02 is configured as USDHC1_DATA0 */
  345. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_02 */
  346. IOMUXC_SetPinMux(
  347. IOMUXC_GPIO_SD_B1_03_USDHC1_DATA1, /* GPIO_SD_B1_03 is configured as USDHC1_DATA1 */
  348. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_03 */
  349. IOMUXC_SetPinMux(
  350. IOMUXC_GPIO_SD_B1_04_USDHC1_DATA2, /* GPIO_SD_B1_04 is configured as USDHC1_DATA2 */
  351. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_04 */
  352. IOMUXC_SetPinMux(
  353. IOMUXC_GPIO_SD_B1_05_USDHC1_DATA3, /* GPIO_SD_B1_05 is configured as USDHC1_DATA3 */
  354. 1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_05 */
  355. IOMUXC_GPR->GPR43 = ((IOMUXC_GPR->GPR43 &
  356. (~(IOMUXC_GPR_GPR43_GPIO_MUX3_GPIO_SEL_HIGH_MASK))) /* Mask bits to zero which are setting */
  357. | IOMUXC_GPR_GPR43_GPIO_MUX3_GPIO_SEL_HIGH(0x8000U) /* GPIO3 and CM7_GPIO3 share same IO MUX function, GPIO_MUX3 selects one GPIO function: 0x8000U */
  358. );
  359. IOMUXC_SetPinConfig(
  360. IOMUXC_GPIO_SD_B1_00_USDHC1_CMD, /* GPIO_SD_B1_00 PAD functional properties : */
  361. 0x04U); /* PDRV Field: high drive strength
  362. Pull Down Pull Up Field: Internal pullup resistor enabled
  363. Open Drain Field: Disabled
  364. Domain write protection: Both cores are allowed
  365. Domain write protection lock: Neither of DWP bits is locked */
  366. IOMUXC_SetPinConfig(
  367. IOMUXC_GPIO_SD_B1_01_USDHC1_CLK, /* GPIO_SD_B1_01 PAD functional properties : */
  368. 0x0CU); /* PDRV Field: high drive strength
  369. Pull Down Pull Up Field: No Pull
  370. Open Drain Field: Disabled
  371. Domain write protection: Both cores are allowed
  372. Domain write protection lock: Neither of DWP bits is locked */
  373. IOMUXC_SetPinConfig(
  374. IOMUXC_GPIO_SD_B1_02_USDHC1_DATA0, /* GPIO_SD_B1_02 PAD functional properties : */
  375. 0x04U); /* PDRV Field: high drive strength
  376. Pull Down Pull Up Field: Internal pullup resistor enabled
  377. Open Drain Field: Disabled
  378. Domain write protection: Both cores are allowed
  379. Domain write protection lock: Neither of DWP bits is locked */
  380. IOMUXC_SetPinConfig(
  381. IOMUXC_GPIO_SD_B1_03_USDHC1_DATA1, /* GPIO_SD_B1_03 PAD functional properties : */
  382. 0x04U); /* PDRV Field: high drive strength
  383. Pull Down Pull Up Field: Internal pullup resistor enabled
  384. Open Drain Field: Disabled
  385. Domain write protection: Both cores are allowed
  386. Domain write protection lock: Neither of DWP bits is locked */
  387. IOMUXC_SetPinConfig(
  388. IOMUXC_GPIO_SD_B1_04_USDHC1_DATA2, /* GPIO_SD_B1_04 PAD functional properties : */
  389. 0x04U); /* PDRV Field: high drive strength
  390. Pull Down Pull Up Field: Internal pullup resistor enabled
  391. Open Drain Field: Disabled
  392. Domain write protection: Both cores are allowed
  393. Domain write protection lock: Neither of DWP bits is locked */
  394. IOMUXC_SetPinConfig(
  395. IOMUXC_GPIO_SD_B1_05_USDHC1_DATA3, /* GPIO_SD_B1_05 PAD functional properties : */
  396. 0x04U); /* PDRV Field: high drive strength
  397. Pull Down Pull Up Field: Internal pullup resistor enabled
  398. Open Drain Field: Disabled
  399. Domain write protection: Both cores are allowed
  400. Domain write protection lock: Neither of DWP bits is locked */
  401. }
  402. #endif
  403. #ifdef BSP_USING_ETH
  404. void imxrt_eth_pins_init(void) {
  405. #ifdef PHY_USING_RTL8211F
  406. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  407. IOMUXC_SetPinMux(
  408. IOMUXC_GPIO_DISP_B1_00_ENET_1G_RX_EN, /* GPIO_DISP_B1_00 is configured as ENET_1G_RX_EN */
  409. 0U); /* Software Input On Field: Input Path is determined by functionality */
  410. IOMUXC_SetPinMux(
  411. IOMUXC_GPIO_DISP_B1_01_ENET_1G_RX_CLK, /* GPIO_DISP_B1_01 is configured as ENET_1G_RX_CLK */
  412. 0U); /* Software Input On Field: Input Path is determined by functionality */
  413. IOMUXC_SetPinMux(
  414. IOMUXC_GPIO_DISP_B1_02_ENET_1G_RX_DATA00, /* GPIO_DISP_B1_02 is configured as ENET_1G_RX_DATA00 */
  415. 0U); /* Software Input On Field: Input Path is determined by functionality */
  416. IOMUXC_SetPinMux(
  417. IOMUXC_GPIO_DISP_B1_03_ENET_1G_RX_DATA01, /* GPIO_DISP_B1_03 is configured as ENET_1G_RX_DATA01 */
  418. 0U); /* Software Input On Field: Input Path is determined by functionality */
  419. IOMUXC_SetPinMux(
  420. IOMUXC_GPIO_DISP_B1_04_ENET_1G_RX_DATA02, /* GPIO_DISP_B1_04 is configured as ENET_1G_RX_DATA02 */
  421. 0U); /* Software Input On Field: Input Path is determined by functionality */
  422. IOMUXC_SetPinMux(
  423. IOMUXC_GPIO_DISP_B1_05_ENET_1G_RX_DATA03, /* GPIO_DISP_B1_05 is configured as ENET_1G_RX_DATA03 */
  424. 0U); /* Software Input On Field: Input Path is determined by functionality */
  425. IOMUXC_SetPinMux(
  426. IOMUXC_GPIO_DISP_B1_06_ENET_1G_TX_DATA03, /* GPIO_DISP_B1_06 is configured as ENET_1G_TX_DATA03 */
  427. 0U); /* Software Input On Field: Input Path is determined by functionality */
  428. IOMUXC_SetPinMux(
  429. IOMUXC_GPIO_DISP_B1_07_ENET_1G_TX_DATA02, /* GPIO_DISP_B1_07 is configured as ENET_1G_TX_DATA02 */
  430. 0U); /* Software Input On Field: Input Path is determined by functionality */
  431. IOMUXC_SetPinMux(
  432. IOMUXC_GPIO_DISP_B1_08_ENET_1G_TX_DATA01, /* GPIO_DISP_B1_08 is configured as ENET_1G_TX_DATA01 */
  433. 0U); /* Software Input On Field: Input Path is determined by functionality */
  434. IOMUXC_SetPinMux(
  435. IOMUXC_GPIO_DISP_B1_09_ENET_1G_TX_DATA00, /* GPIO_DISP_B1_09 is configured as ENET_1G_TX_DATA00 */
  436. 0U); /* Software Input On Field: Input Path is determined by functionality */
  437. IOMUXC_SetPinMux(
  438. IOMUXC_GPIO_DISP_B1_10_ENET_1G_TX_EN, /* GPIO_DISP_B1_10 is configured as ENET_1G_TX_EN */
  439. 0U); /* Software Input On Field: Input Path is determined by functionality */
  440. IOMUXC_SetPinMux(
  441. IOMUXC_GPIO_DISP_B1_11_ENET_1G_TX_CLK_IO, /* GPIO_DISP_B1_11 is configured as ENET_1G_TX_CLK_IO */
  442. 0U); /* Software Input On Field: Input Path is determined by functionality */
  443. IOMUXC_SetPinMux(
  444. IOMUXC_GPIO_DISP_B2_12_GPIO_MUX5_IO13, /* GPIO_DISP_B2_12 is configured as GPIO_MUX5_IO13 */
  445. 0U); /* Software Input On Field: Input Path is determined by functionality */
  446. IOMUXC_SetPinMux(
  447. IOMUXC_GPIO_DISP_B2_13_GPIO_MUX5_IO14, /* GPIO_DISP_B2_13 is configured as GPIO_MUX5_IO14 */
  448. 0U); /* Software Input On Field: Input Path is determined by functionality */
  449. IOMUXC_SetPinMux(
  450. IOMUXC_GPIO_EMC_B2_19_ENET_1G_MDC, /* GPIO_EMC_B2_19 is configured as ENET_1G_MDC */
  451. 0U); /* Software Input On Field: Input Path is determined by functionality */
  452. IOMUXC_SetPinMux(
  453. IOMUXC_GPIO_EMC_B2_20_ENET_1G_MDIO, /* GPIO_EMC_B2_20 is configured as ENET_1G_MDIO */
  454. 0U); /* Software Input On Field: Input Path is determined by functionality */
  455. #else
  456. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  457. CLOCK_EnableClock(kCLOCK_Iomuxc_Lpsr); /* LPCG on: LPCG is ON. */
  458. IOMUXC_SetPinMux(
  459. IOMUXC_GPIO_AD_12_GPIO9_IO11, /* GPIO_AD_12 is configured as GPIO9_IO11 */
  460. 0U); /* Software Input On Field: Input Path is determined by functionality */
  461. IOMUXC_SetPinMux(
  462. IOMUXC_GPIO_AD_32_ENET_MDC, /* GPIO_AD_32 is configured as ENET_MDC */
  463. 0U); /* Software Input On Field: Input Path is determined by functionality */
  464. IOMUXC_SetPinMux(
  465. IOMUXC_GPIO_AD_33_ENET_MDIO, /* GPIO_AD_33 is configured as ENET_MDIO */
  466. 0U); /* Software Input On Field: Input Path is determined by functionality */
  467. IOMUXC_SetPinMux(
  468. IOMUXC_GPIO_DISP_B2_02_ENET_TX_DATA00, /* GPIO_DISP_B2_02 is configured as ENET_TX_DATA00 */
  469. 0U); /* Software Input On Field: Input Path is determined by functionality */
  470. IOMUXC_SetPinMux(
  471. IOMUXC_GPIO_DISP_B2_03_ENET_TX_DATA01, /* GPIO_DISP_B2_03 is configured as ENET_TX_DATA01 */
  472. 0U); /* Software Input On Field: Input Path is determined by functionality */
  473. IOMUXC_SetPinMux(
  474. IOMUXC_GPIO_DISP_B2_04_ENET_TX_EN, /* GPIO_DISP_B2_04 is configured as ENET_TX_EN */
  475. 0U); /* Software Input On Field: Input Path is determined by functionality */
  476. IOMUXC_SetPinMux(
  477. IOMUXC_GPIO_DISP_B2_05_ENET_REF_CLK, /* GPIO_DISP_B2_05 is configured as ENET_REF_CLK */
  478. 1U); /* Software Input On Field: Force input path of pad GPIO_DISP_B2_05 */
  479. IOMUXC_SetPinMux(
  480. IOMUXC_GPIO_DISP_B2_06_ENET_RX_DATA00, /* GPIO_DISP_B2_06 is configured as ENET_RX_DATA00 */
  481. 1U); /* Software Input On Field: Force input path of pad GPIO_DISP_B2_06 */
  482. IOMUXC_SetPinMux(
  483. IOMUXC_GPIO_DISP_B2_07_ENET_RX_DATA01, /* GPIO_DISP_B2_07 is configured as ENET_RX_DATA01 */
  484. 1U); /* Software Input On Field: Force input path of pad GPIO_DISP_B2_07 */
  485. IOMUXC_SetPinMux(
  486. IOMUXC_GPIO_DISP_B2_08_ENET_RX_EN, /* GPIO_DISP_B2_08 is configured as ENET_RX_EN */
  487. 0U); /* Software Input On Field: Input Path is determined by functionality */
  488. IOMUXC_SetPinMux(
  489. IOMUXC_GPIO_DISP_B2_09_ENET_RX_ER, /* GPIO_DISP_B2_09 is configured as ENET_RX_ER */
  490. 0U); /* Software Input On Field: Input Path is determined by functionality */
  491. IOMUXC_GPR->GPR4 = ((IOMUXC_GPR->GPR4 &
  492. (~(IOMUXC_GPR_GPR4_ENET_REF_CLK_DIR_MASK))) /* Mask bits to zero which are setting */
  493. | IOMUXC_GPR_GPR4_ENET_REF_CLK_DIR(0x01U) /* ENET_REF_CLK direction control: 0x01U */
  494. );
  495. IOMUXC_SetPinMux(
  496. IOMUXC_GPIO_LPSR_12_GPIO_MUX6_IO12, /* GPIO_LPSR_12 is configured as GPIO12_IO12 */
  497. 0U); /* Software Input On Field: Input Path is determined by functionality */
  498. IOMUXC_SetPinConfig(
  499. IOMUXC_GPIO_AD_12_GPIO9_IO11, /* GPIO_AD_12 PAD functional properties : */
  500. 0x06U); /* Slew Rate Field: Slow Slew Rate
  501. Drive Strength Field: high drive strength
  502. Pull / Keep Select Field: Pull Enable
  503. Pull Up / Down Config. Field: Weak pull down
  504. Open Drain Field: Disabled
  505. Domain write protection: Both cores are allowed
  506. Domain write protection lock: Neither of DWP bits is locked */
  507. IOMUXC_SetPinConfig(
  508. IOMUXC_GPIO_DISP_B2_02_ENET_TX_DATA00, /* GPIO_DISP_B2_02 PAD functional properties : */
  509. 0x02U); /* Slew Rate Field: Slow Slew Rate
  510. Drive Strength Field: high drive strength
  511. Pull / Keep Select Field: Pull Disable, Highz
  512. Pull Up / Down Config. Field: Weak pull down
  513. Open Drain Field: Disabled
  514. Domain write protection: Both cores are allowed
  515. Domain write protection lock: Neither of DWP bits is locked */
  516. IOMUXC_SetPinConfig(
  517. IOMUXC_GPIO_DISP_B2_03_ENET_TX_DATA01, /* GPIO_DISP_B2_03 PAD functional properties : */
  518. 0x02U); /* Slew Rate Field: Slow Slew Rate
  519. Drive Strength Field: high drive strength
  520. Pull / Keep Select Field: Pull Disable, Highz
  521. Pull Up / Down Config. Field: Weak pull down
  522. Open Drain Field: Disabled
  523. Domain write protection: Both cores are allowed
  524. Domain write protection lock: Neither of DWP bits is locked */
  525. IOMUXC_SetPinConfig(
  526. IOMUXC_GPIO_DISP_B2_04_ENET_TX_EN, /* GPIO_DISP_B2_04 PAD functional properties : */
  527. 0x02U); /* Slew Rate Field: Slow Slew Rate
  528. Drive Strength Field: high drive strength
  529. Pull / Keep Select Field: Pull Disable, Highz
  530. Pull Up / Down Config. Field: Weak pull down
  531. Open Drain Field: Disabled
  532. Domain write protection: Both cores are allowed
  533. Domain write protection lock: Neither of DWP bits is locked */
  534. IOMUXC_SetPinConfig(
  535. IOMUXC_GPIO_DISP_B2_05_ENET_REF_CLK, /* GPIO_DISP_B2_05 PAD functional properties : */
  536. 0x03U); /* Slew Rate Field: Fast Slew Rate
  537. Drive Strength Field: high drive strength
  538. Pull / Keep Select Field: Pull Disable, Highz
  539. Pull Up / Down Config. Field: Weak pull down
  540. Open Drain Field: Disabled
  541. Domain write protection: Both cores are allowed
  542. Domain write protection lock: Neither of DWP bits is locked */
  543. IOMUXC_SetPinConfig(
  544. IOMUXC_GPIO_DISP_B2_06_ENET_RX_DATA00, /* GPIO_DISP_B2_06 PAD functional properties : */
  545. 0x06U); /* Slew Rate Field: Slow Slew Rate
  546. Drive Strength Field: high drive strength
  547. Pull / Keep Select Field: Pull Enable
  548. Pull Up / Down Config. Field: Weak pull down
  549. Open Drain Field: Disabled
  550. Domain write protection: Both cores are allowed
  551. Domain write protection lock: Neither of DWP bits is locked */
  552. IOMUXC_SetPinConfig(
  553. IOMUXC_GPIO_DISP_B2_07_ENET_RX_DATA01, /* GPIO_DISP_B2_07 PAD functional properties : */
  554. 0x06U); /* Slew Rate Field: Slow Slew Rate
  555. Drive Strength Field: high drive strength
  556. Pull / Keep Select Field: Pull Enable
  557. Pull Up / Down Config. Field: Weak pull down
  558. Open Drain Field: Disabled
  559. Domain write protection: Both cores are allowed
  560. Domain write protection lock: Neither of DWP bits is locked */
  561. IOMUXC_SetPinConfig(
  562. IOMUXC_GPIO_DISP_B2_08_ENET_RX_EN, /* GPIO_DISP_B2_08 PAD functional properties : */
  563. 0x06U); /* Slew Rate Field: Slow Slew Rate
  564. Drive Strength Field: high drive strength
  565. Pull / Keep Select Field: Pull Enable
  566. Pull Up / Down Config. Field: Weak pull down
  567. Open Drain Field: Disabled
  568. Domain write protection: Both cores are allowed
  569. Domain write protection lock: Neither of DWP bits is locked */
  570. IOMUXC_SetPinConfig(
  571. IOMUXC_GPIO_DISP_B2_09_ENET_RX_ER, /* GPIO_DISP_B2_09 PAD functional properties : */
  572. 0x06U); /* Slew Rate Field: Slow Slew Rate
  573. Drive Strength Field: high drive strength
  574. Pull / Keep Select Field: Pull Enable
  575. Pull Up / Down Config. Field: Weak pull down
  576. Open Drain Field: Disabled
  577. Domain write protection: Both cores are allowed
  578. Domain write protection lock: Neither of DWP bits is locked */
  579. IOMUXC_SetPinConfig(
  580. IOMUXC_GPIO_LPSR_12_GPIO_MUX6_IO12, /* GPIO_LPSR_12 PAD functional properties : */
  581. 0x0EU); /* Slew Rate Field: Slow Slew Rate
  582. Drive Strength Field: high driver
  583. Pull / Keep Select Field: Pull Enable
  584. Pull Up / Down Config. Field: Weak pull up
  585. Open Drain LPSR Field: Disabled
  586. Domain write protection: Both cores are allowed
  587. Domain write protection lock: Neither of DWP bits is locked */
  588. #endif
  589. }
  590. #endif
  591. #ifdef BSP_USING_SDRAM
  592. void imxrt_sdram_pins_init(void)
  593. {
  594. // SEMC
  595. IOMUXC_SetPinMux(
  596. IOMUXC_GPIO_EMC_B1_00_SEMC_DATA00, /* GPIO_EMC_B1_00 is configured as SEMC_DATA00 */
  597. 0U); /* Software Input On Field: Input Path is determined by functionality */
  598. IOMUXC_SetPinMux(
  599. IOMUXC_GPIO_EMC_B1_01_SEMC_DATA01, /* GPIO_EMC_B1_01 is configured as SEMC_DATA01 */
  600. 0U); /* Software Input On Field: Input Path is determined by functionality */
  601. IOMUXC_SetPinMux(
  602. IOMUXC_GPIO_EMC_B1_02_SEMC_DATA02, /* GPIO_EMC_B1_02 is configured as SEMC_DATA02 */
  603. 0U); /* Software Input On Field: Input Path is determined by functionality */
  604. IOMUXC_SetPinMux(
  605. IOMUXC_GPIO_EMC_B1_03_SEMC_DATA03, /* GPIO_EMC_B1_03 is configured as SEMC_DATA03 */
  606. 0U); /* Software Input On Field: Input Path is determined by functionality */
  607. IOMUXC_SetPinMux(
  608. IOMUXC_GPIO_EMC_B1_04_SEMC_DATA04, /* GPIO_EMC_B1_04 is configured as SEMC_DATA04 */
  609. 0U); /* Software Input On Field: Input Path is determined by functionality */
  610. IOMUXC_SetPinMux(
  611. IOMUXC_GPIO_EMC_B1_05_SEMC_DATA05, /* GPIO_EMC_B1_05 is configured as SEMC_DATA05 */
  612. 0U); /* Software Input On Field: Input Path is determined by functionality */
  613. IOMUXC_SetPinMux(
  614. IOMUXC_GPIO_EMC_B1_06_SEMC_DATA06, /* GPIO_EMC_B1_06 is configured as SEMC_DATA06 */
  615. 0U); /* Software Input On Field: Input Path is determined by functionality */
  616. IOMUXC_SetPinMux(
  617. IOMUXC_GPIO_EMC_B1_07_SEMC_DATA07, /* GPIO_EMC_B1_07 is configured as SEMC_DATA07 */
  618. 0U); /* Software Input On Field: Input Path is determined by functionality */
  619. IOMUXC_SetPinMux(
  620. IOMUXC_GPIO_EMC_B1_08_SEMC_DM00, /* GPIO_EMC_B1_08 is configured as SEMC_DM00 */
  621. 0U); /* Software Input On Field: Input Path is determined by functionality */
  622. IOMUXC_SetPinMux(
  623. IOMUXC_GPIO_EMC_B1_09_SEMC_ADDR00, /* GPIO_EMC_B1_09 is configured as SEMC_ADDR00 */
  624. 0U); /* Software Input On Field: Input Path is determined by functionality */
  625. IOMUXC_SetPinMux(
  626. IOMUXC_GPIO_EMC_B1_10_SEMC_ADDR01, /* GPIO_EMC_B1_10 is configured as SEMC_ADDR01 */
  627. 0U); /* Software Input On Field: Input Path is determined by functionality */
  628. IOMUXC_SetPinMux(
  629. IOMUXC_GPIO_EMC_B1_11_SEMC_ADDR02, /* GPIO_EMC_B1_11 is configured as SEMC_ADDR02 */
  630. 0U); /* Software Input On Field: Input Path is determined by functionality */
  631. IOMUXC_SetPinMux(
  632. IOMUXC_GPIO_EMC_B1_12_SEMC_ADDR03, /* GPIO_EMC_B1_12 is configured as SEMC_ADDR03 */
  633. 0U); /* Software Input On Field: Input Path is determined by functionality */
  634. IOMUXC_SetPinMux(
  635. IOMUXC_GPIO_EMC_B1_13_SEMC_ADDR04, /* GPIO_EMC_B1_13 is configured as SEMC_ADDR04 */
  636. 0U); /* Software Input On Field: Input Path is determined by functionality */
  637. IOMUXC_SetPinMux(
  638. IOMUXC_GPIO_EMC_B1_14_SEMC_ADDR05, /* GPIO_EMC_B1_14 is configured as SEMC_ADDR05 */
  639. 0U); /* Software Input On Field: Input Path is determined by functionality */
  640. IOMUXC_SetPinMux(
  641. IOMUXC_GPIO_EMC_B1_15_SEMC_ADDR06, /* GPIO_EMC_B1_15 is configured as SEMC_ADDR06 */
  642. 0U); /* Software Input On Field: Input Path is determined by functionality */
  643. IOMUXC_SetPinMux(
  644. IOMUXC_GPIO_EMC_B1_16_SEMC_ADDR07, /* GPIO_EMC_B1_16 is configured as SEMC_ADDR07 */
  645. 0U); /* Software Input On Field: Input Path is determined by functionality */
  646. IOMUXC_SetPinMux(
  647. IOMUXC_GPIO_EMC_B1_17_SEMC_ADDR08, /* GPIO_EMC_B1_17 is configured as SEMC_ADDR08 */
  648. 0U); /* Software Input On Field: Input Path is determined by functionality */
  649. IOMUXC_SetPinMux(
  650. IOMUXC_GPIO_EMC_B1_18_SEMC_ADDR09, /* GPIO_EMC_B1_18 is configured as SEMC_ADDR09 */
  651. 0U); /* Software Input On Field: Input Path is determined by functionality */
  652. IOMUXC_SetPinMux(
  653. IOMUXC_GPIO_EMC_B1_19_SEMC_ADDR11, /* GPIO_EMC_B1_19 is configured as SEMC_ADDR11 */
  654. 0U); /* Software Input On Field: Input Path is determined by functionality */
  655. IOMUXC_SetPinMux(
  656. IOMUXC_GPIO_EMC_B1_20_SEMC_ADDR12, /* GPIO_EMC_B1_20 is configured as SEMC_ADDR12 */
  657. 0U); /* Software Input On Field: Input Path is determined by functionality */
  658. IOMUXC_SetPinMux(
  659. IOMUXC_GPIO_EMC_B1_21_SEMC_BA0, /* GPIO_EMC_B1_21 is configured as SEMC_BA0 */
  660. 0U); /* Software Input On Field: Input Path is determined by functionality */
  661. IOMUXC_SetPinMux(
  662. IOMUXC_GPIO_EMC_B1_22_SEMC_BA1, /* GPIO_EMC_B1_22 is configured as SEMC_BA1 */
  663. 0U); /* Software Input On Field: Input Path is determined by functionality */
  664. IOMUXC_SetPinMux(
  665. IOMUXC_GPIO_EMC_B1_23_SEMC_ADDR10, /* GPIO_EMC_B1_23 is configured as SEMC_ADDR10 */
  666. 0U); /* Software Input On Field: Input Path is determined by functionality */
  667. IOMUXC_SetPinMux(
  668. IOMUXC_GPIO_EMC_B1_24_SEMC_CAS, /* GPIO_EMC_B1_24 is configured as SEMC_CAS */
  669. 0U); /* Software Input On Field: Input Path is determined by functionality */
  670. IOMUXC_SetPinMux(
  671. IOMUXC_GPIO_EMC_B1_25_SEMC_RAS, /* GPIO_EMC_B1_25 is configured as SEMC_RAS */
  672. 0U); /* Software Input On Field: Input Path is determined by functionality */
  673. IOMUXC_SetPinMux(
  674. IOMUXC_GPIO_EMC_B1_26_SEMC_CLK, /* GPIO_EMC_B1_26 is configured as SEMC_CLK */
  675. 0U); /* Software Input On Field: Input Path is determined by functionality */
  676. IOMUXC_SetPinMux(
  677. IOMUXC_GPIO_EMC_B1_27_SEMC_CKE, /* GPIO_EMC_B1_27 is configured as SEMC_CKE */
  678. 0U); /* Software Input On Field: Input Path is determined by functionality */
  679. IOMUXC_SetPinMux(
  680. IOMUXC_GPIO_EMC_B1_28_SEMC_WE, /* GPIO_EMC_B1_28 is configured as SEMC_WE */
  681. 0U); /* Software Input On Field: Input Path is determined by functionality */
  682. IOMUXC_SetPinMux(
  683. IOMUXC_GPIO_EMC_B1_29_SEMC_CS0, /* GPIO_EMC_B1_29 is configured as SEMC_CS0 */
  684. 0U); /* Software Input On Field: Input Path is determined by functionality */
  685. IOMUXC_SetPinMux(
  686. IOMUXC_GPIO_EMC_B1_30_SEMC_DATA08, /* GPIO_EMC_B1_30 is configured as SEMC_DATA08 */
  687. 0U); /* Software Input On Field: Input Path is determined by functionality */
  688. IOMUXC_SetPinMux(
  689. IOMUXC_GPIO_EMC_B1_31_SEMC_DATA09, /* GPIO_EMC_B1_31 is configured as SEMC_DATA09 */
  690. 0U); /* Software Input On Field: Input Path is determined by functionality */
  691. IOMUXC_SetPinMux(
  692. IOMUXC_GPIO_EMC_B1_32_SEMC_DATA10, /* GPIO_EMC_B1_32 is configured as SEMC_DATA10 */
  693. 0U); /* Software Input On Field: Input Path is determined by functionality */
  694. IOMUXC_SetPinMux(
  695. IOMUXC_GPIO_EMC_B1_33_SEMC_DATA11, /* GPIO_EMC_B1_33 is configured as SEMC_DATA11 */
  696. 0U); /* Software Input On Field: Input Path is determined by functionality */
  697. IOMUXC_SetPinMux(
  698. IOMUXC_GPIO_EMC_B1_34_SEMC_DATA12, /* GPIO_EMC_B1_34 is configured as SEMC_DATA12 */
  699. 0U); /* Software Input On Field: Input Path is determined by functionality */
  700. IOMUXC_SetPinMux(
  701. IOMUXC_GPIO_EMC_B1_35_SEMC_DATA13, /* GPIO_EMC_B1_35 is configured as SEMC_DATA13 */
  702. 0U); /* Software Input On Field: Input Path is determined by functionality */
  703. IOMUXC_SetPinMux(
  704. IOMUXC_GPIO_EMC_B1_36_SEMC_DATA14, /* GPIO_EMC_B1_36 is configured as SEMC_DATA14 */
  705. 0U); /* Software Input On Field: Input Path is determined by functionality */
  706. IOMUXC_SetPinMux(
  707. IOMUXC_GPIO_EMC_B1_37_SEMC_DATA15, /* GPIO_EMC_B1_37 is configured as SEMC_DATA15 */
  708. 0U); /* Software Input On Field: Input Path is determined by functionality */
  709. IOMUXC_SetPinMux(
  710. IOMUXC_GPIO_EMC_B1_38_SEMC_DM01, /* GPIO_EMC_B1_38 is configured as SEMC_DM01 */
  711. 0U); /* Software Input On Field: Input Path is determined by functionality */
  712. IOMUXC_SetPinMux(
  713. IOMUXC_GPIO_EMC_B1_39_SEMC_DQS, /* GPIO_EMC_B1_39 is configured as SEMC_DQS */
  714. 1U); /* Software Input On Field: Force input path of pad GPIO_EMC_B1_39 */
  715. IOMUXC_SetPinMux(
  716. IOMUXC_GPIO_EMC_B1_40_SEMC_RDY, /* GPIO_EMC_B1_40 is configured as SEMC_RDY */
  717. 0U); /* Software Input On Field: Input Path is determined by functionality */
  718. IOMUXC_SetPinMux(
  719. IOMUXC_GPIO_EMC_B1_41_SEMC_CSX00, /* GPIO_EMC_B1_41 is configured as SEMC_CSX00 */
  720. 0U); /* Software Input On Field: Input Path is determined by functionality */
  721. IOMUXC_SetPinMux(
  722. IOMUXC_GPIO_EMC_B2_00_SEMC_DATA16, /* GPIO_EMC_B2_00 is configured as SEMC_DATA16 */
  723. 0U); /* Software Input On Field: Input Path is determined by functionality */
  724. IOMUXC_SetPinMux(
  725. IOMUXC_GPIO_EMC_B2_01_SEMC_DATA17, /* GPIO_EMC_B2_01 is configured as SEMC_DATA17 */
  726. 0U); /* Software Input On Field: Input Path is determined by functionality */
  727. IOMUXC_SetPinMux(
  728. IOMUXC_GPIO_EMC_B2_02_SEMC_DATA18, /* GPIO_EMC_B2_02 is configured as SEMC_DATA18 */
  729. 0U); /* Software Input On Field: Input Path is determined by functionality */
  730. IOMUXC_SetPinMux(
  731. IOMUXC_GPIO_EMC_B2_03_SEMC_DATA19, /* GPIO_EMC_B2_03 is configured as SEMC_DATA19 */
  732. 0U); /* Software Input On Field: Input Path is determined by functionality */
  733. IOMUXC_SetPinMux(
  734. IOMUXC_GPIO_EMC_B2_04_SEMC_DATA20, /* GPIO_EMC_B2_04 is configured as SEMC_DATA20 */
  735. 0U); /* Software Input On Field: Input Path is determined by functionality */
  736. IOMUXC_SetPinMux(
  737. IOMUXC_GPIO_EMC_B2_05_SEMC_DATA21, /* GPIO_EMC_B2_05 is configured as SEMC_DATA21 */
  738. 0U); /* Software Input On Field: Input Path is determined by functionality */
  739. IOMUXC_SetPinMux(
  740. IOMUXC_GPIO_EMC_B2_06_SEMC_DATA22, /* GPIO_EMC_B2_06 is configured as SEMC_DATA22 */
  741. 0U); /* Software Input On Field: Input Path is determined by functionality */
  742. IOMUXC_SetPinMux(
  743. IOMUXC_GPIO_EMC_B2_07_SEMC_DATA23, /* GPIO_EMC_B2_07 is configured as SEMC_DATA23 */
  744. 0U); /* Software Input On Field: Input Path is determined by functionality */
  745. IOMUXC_SetPinMux(
  746. IOMUXC_GPIO_EMC_B2_08_SEMC_DM02, /* GPIO_EMC_B2_08 is configured as SEMC_DM02 */
  747. 0U); /* Software Input On Field: Input Path is determined by functionality */
  748. IOMUXC_SetPinMux(
  749. IOMUXC_GPIO_EMC_B2_09_SEMC_DATA24, /* GPIO_EMC_B2_09 is configured as SEMC_DATA24 */
  750. 0U); /* Software Input On Field: Input Path is determined by functionality */
  751. IOMUXC_SetPinMux(
  752. IOMUXC_GPIO_EMC_B2_10_SEMC_DATA25, /* GPIO_EMC_B2_10 is configured as SEMC_DATA25 */
  753. 0U); /* Software Input On Field: Input Path is determined by functionality */
  754. IOMUXC_SetPinMux(
  755. IOMUXC_GPIO_EMC_B2_11_SEMC_DATA26, /* GPIO_EMC_B2_11 is configured as SEMC_DATA26 */
  756. 0U); /* Software Input On Field: Input Path is determined by functionality */
  757. IOMUXC_SetPinMux(
  758. IOMUXC_GPIO_EMC_B2_12_SEMC_DATA27, /* GPIO_EMC_B2_12 is configured as SEMC_DATA27 */
  759. 0U); /* Software Input On Field: Input Path is determined by functionality */
  760. IOMUXC_SetPinMux(
  761. IOMUXC_GPIO_EMC_B2_13_SEMC_DATA28, /* GPIO_EMC_B2_13 is configured as SEMC_DATA28 */
  762. 0U); /* Software Input On Field: Input Path is determined by functionality */
  763. IOMUXC_SetPinMux(
  764. IOMUXC_GPIO_EMC_B2_14_SEMC_DATA29, /* GPIO_EMC_B2_14 is configured as SEMC_DATA29 */
  765. 0U); /* Software Input On Field: Input Path is determined by functionality */
  766. IOMUXC_SetPinMux(
  767. IOMUXC_GPIO_EMC_B2_15_SEMC_DATA30, /* GPIO_EMC_B2_15 is configured as SEMC_DATA30 */
  768. 0U); /* Software Input On Field: Input Path is determined by functionality */
  769. IOMUXC_SetPinMux(
  770. IOMUXC_GPIO_EMC_B2_16_SEMC_DATA31, /* GPIO_EMC_B2_16 is configured as SEMC_DATA31 */
  771. 0U); /* Software Input On Field: Input Path is determined by functionality */
  772. IOMUXC_SetPinMux(
  773. IOMUXC_GPIO_EMC_B2_17_SEMC_DM03, /* GPIO_EMC_B2_17 is configured as SEMC_DM03 */
  774. 0U); /* Software Input On Field: Input Path is determined by functionality */
  775. IOMUXC_SetPinMux(
  776. IOMUXC_GPIO_EMC_B2_18_SEMC_DQS4, /* GPIO_EMC_B2_18 is configured as SEMC_DQS4 */
  777. 0U); /* Software Input On Field: Input Path is determined by functionality */
  778. IOMUXC_SetPinConfig(
  779. IOMUXC_GPIO_EMC_B1_00_SEMC_DATA00, /* GPIO_EMC_B1_00 PAD functional properties : */
  780. 0x08U); /* PDRV Field: high drive strength
  781. Pull Down Pull Up Field: Internal pulldown resistor enabled
  782. Open Drain Field: Disabled
  783. Domain write protection: Both cores are allowed
  784. Domain write protection lock: Neither of DWP bits is locked */
  785. IOMUXC_SetPinConfig(
  786. IOMUXC_GPIO_EMC_B1_01_SEMC_DATA01, /* GPIO_EMC_B1_01 PAD functional properties : */
  787. 0x08U); /* PDRV Field: high drive strength
  788. Pull Down Pull Up Field: Internal pulldown resistor enabled
  789. Open Drain Field: Disabled
  790. Domain write protection: Both cores are allowed
  791. Domain write protection lock: Neither of DWP bits is locked */
  792. IOMUXC_SetPinConfig(
  793. IOMUXC_GPIO_EMC_B1_02_SEMC_DATA02, /* GPIO_EMC_B1_02 PAD functional properties : */
  794. 0x08U); /* PDRV Field: high drive strength
  795. Pull Down Pull Up Field: Internal pulldown resistor enabled
  796. Open Drain Field: Disabled
  797. Domain write protection: Both cores are allowed
  798. Domain write protection lock: Neither of DWP bits is locked */
  799. IOMUXC_SetPinConfig(
  800. IOMUXC_GPIO_EMC_B1_03_SEMC_DATA03, /* GPIO_EMC_B1_03 PAD functional properties : */
  801. 0x08U); /* PDRV Field: high drive strength
  802. Pull Down Pull Up Field: Internal pulldown resistor enabled
  803. Open Drain Field: Disabled
  804. Domain write protection: Both cores are allowed
  805. Domain write protection lock: Neither of DWP bits is locked */
  806. IOMUXC_SetPinConfig(
  807. IOMUXC_GPIO_EMC_B1_04_SEMC_DATA04, /* GPIO_EMC_B1_04 PAD functional properties : */
  808. 0x08U); /* PDRV Field: high drive strength
  809. Pull Down Pull Up Field: Internal pulldown resistor enabled
  810. Open Drain Field: Disabled
  811. Domain write protection: Both cores are allowed
  812. Domain write protection lock: Neither of DWP bits is locked */
  813. IOMUXC_SetPinConfig(
  814. IOMUXC_GPIO_EMC_B1_05_SEMC_DATA05, /* GPIO_EMC_B1_05 PAD functional properties : */
  815. 0x08U); /* PDRV Field: high drive strength
  816. Pull Down Pull Up Field: Internal pulldown resistor enabled
  817. Open Drain Field: Disabled
  818. Domain write protection: Both cores are allowed
  819. Domain write protection lock: Neither of DWP bits is locked */
  820. IOMUXC_SetPinConfig(
  821. IOMUXC_GPIO_EMC_B1_06_SEMC_DATA06, /* GPIO_EMC_B1_06 PAD functional properties : */
  822. 0x08U); /* PDRV Field: high drive strength
  823. Pull Down Pull Up Field: Internal pulldown resistor enabled
  824. Open Drain Field: Disabled
  825. Domain write protection: Both cores are allowed
  826. Domain write protection lock: Neither of DWP bits is locked */
  827. IOMUXC_SetPinConfig(
  828. IOMUXC_GPIO_EMC_B1_07_SEMC_DATA07, /* GPIO_EMC_B1_07 PAD functional properties : */
  829. 0x08U); /* PDRV Field: high drive strength
  830. Pull Down Pull Up Field: Internal pulldown resistor enabled
  831. Open Drain Field: Disabled
  832. Domain write protection: Both cores are allowed
  833. Domain write protection lock: Neither of DWP bits is locked */
  834. IOMUXC_SetPinConfig(
  835. IOMUXC_GPIO_EMC_B1_08_SEMC_DM00, /* GPIO_EMC_B1_08 PAD functional properties : */
  836. 0x08U); /* PDRV Field: high drive strength
  837. Pull Down Pull Up Field: Internal pulldown resistor enabled
  838. Open Drain Field: Disabled
  839. Domain write protection: Both cores are allowed
  840. Domain write protection lock: Neither of DWP bits is locked */
  841. IOMUXC_SetPinConfig(
  842. IOMUXC_GPIO_EMC_B1_09_SEMC_ADDR00, /* GPIO_EMC_B1_09 PAD functional properties : */
  843. 0x08U); /* PDRV Field: high drive strength
  844. Pull Down Pull Up Field: Internal pulldown resistor enabled
  845. Open Drain Field: Disabled
  846. Domain write protection: Both cores are allowed
  847. Domain write protection lock: Neither of DWP bits is locked */
  848. IOMUXC_SetPinConfig(
  849. IOMUXC_GPIO_EMC_B1_10_SEMC_ADDR01, /* GPIO_EMC_B1_10 PAD functional properties : */
  850. 0x08U); /* PDRV Field: high drive strength
  851. Pull Down Pull Up Field: Internal pulldown resistor enabled
  852. Open Drain Field: Disabled
  853. Domain write protection: Both cores are allowed
  854. Domain write protection lock: Neither of DWP bits is locked */
  855. IOMUXC_SetPinConfig(
  856. IOMUXC_GPIO_EMC_B1_11_SEMC_ADDR02, /* GPIO_EMC_B1_11 PAD functional properties : */
  857. 0x08U); /* PDRV Field: high drive strength
  858. Pull Down Pull Up Field: Internal pulldown resistor enabled
  859. Open Drain Field: Disabled
  860. Domain write protection: Both cores are allowed
  861. Domain write protection lock: Neither of DWP bits is locked */
  862. IOMUXC_SetPinConfig(
  863. IOMUXC_GPIO_EMC_B1_12_SEMC_ADDR03, /* GPIO_EMC_B1_12 PAD functional properties : */
  864. 0x08U); /* PDRV Field: high drive strength
  865. Pull Down Pull Up Field: Internal pulldown resistor enabled
  866. Open Drain Field: Disabled
  867. Domain write protection: Both cores are allowed
  868. Domain write protection lock: Neither of DWP bits is locked */
  869. IOMUXC_SetPinConfig(
  870. IOMUXC_GPIO_EMC_B1_13_SEMC_ADDR04, /* GPIO_EMC_B1_13 PAD functional properties : */
  871. 0x08U); /* PDRV Field: high drive strength
  872. Pull Down Pull Up Field: Internal pulldown resistor enabled
  873. Open Drain Field: Disabled
  874. Domain write protection: Both cores are allowed
  875. Domain write protection lock: Neither of DWP bits is locked */
  876. IOMUXC_SetPinConfig(
  877. IOMUXC_GPIO_EMC_B1_14_SEMC_ADDR05, /* GPIO_EMC_B1_14 PAD functional properties : */
  878. 0x08U); /* PDRV Field: high drive strength
  879. Pull Down Pull Up Field: Internal pulldown resistor enabled
  880. Open Drain Field: Disabled
  881. Domain write protection: Both cores are allowed
  882. Domain write protection lock: Neither of DWP bits is locked */
  883. IOMUXC_SetPinConfig(
  884. IOMUXC_GPIO_EMC_B1_15_SEMC_ADDR06, /* GPIO_EMC_B1_15 PAD functional properties : */
  885. 0x08U); /* PDRV Field: high drive strength
  886. Pull Down Pull Up Field: Internal pulldown resistor enabled
  887. Open Drain Field: Disabled
  888. Domain write protection: Both cores are allowed
  889. Domain write protection lock: Neither of DWP bits is locked */
  890. IOMUXC_SetPinConfig(
  891. IOMUXC_GPIO_EMC_B1_16_SEMC_ADDR07, /* GPIO_EMC_B1_16 PAD functional properties : */
  892. 0x08U); /* PDRV Field: high drive strength
  893. Pull Down Pull Up Field: Internal pulldown resistor enabled
  894. Open Drain Field: Disabled
  895. Domain write protection: Both cores are allowed
  896. Domain write protection lock: Neither of DWP bits is locked */
  897. IOMUXC_SetPinConfig(
  898. IOMUXC_GPIO_EMC_B1_17_SEMC_ADDR08, /* GPIO_EMC_B1_17 PAD functional properties : */
  899. 0x08U); /* PDRV Field: high drive strength
  900. Pull Down Pull Up Field: Internal pulldown resistor enabled
  901. Open Drain Field: Disabled
  902. Domain write protection: Both cores are allowed
  903. Domain write protection lock: Neither of DWP bits is locked */
  904. IOMUXC_SetPinConfig(
  905. IOMUXC_GPIO_EMC_B1_18_SEMC_ADDR09, /* GPIO_EMC_B1_18 PAD functional properties : */
  906. 0x08U); /* PDRV Field: high drive strength
  907. Pull Down Pull Up Field: Internal pulldown resistor enabled
  908. Open Drain Field: Disabled
  909. Domain write protection: Both cores are allowed
  910. Domain write protection lock: Neither of DWP bits is locked */
  911. IOMUXC_SetPinConfig(
  912. IOMUXC_GPIO_EMC_B1_19_SEMC_ADDR11, /* GPIO_EMC_B1_19 PAD functional properties : */
  913. 0x08U); /* PDRV Field: high drive strength
  914. Pull Down Pull Up Field: Internal pulldown resistor enabled
  915. Open Drain Field: Disabled
  916. Domain write protection: Both cores are allowed
  917. Domain write protection lock: Neither of DWP bits is locked */
  918. IOMUXC_SetPinConfig(
  919. IOMUXC_GPIO_EMC_B1_20_SEMC_ADDR12, /* GPIO_EMC_B1_20 PAD functional properties : */
  920. 0x08U); /* PDRV Field: high drive strength
  921. Pull Down Pull Up Field: Internal pulldown resistor enabled
  922. Open Drain Field: Disabled
  923. Domain write protection: Both cores are allowed
  924. Domain write protection lock: Neither of DWP bits is locked */
  925. IOMUXC_SetPinConfig(
  926. IOMUXC_GPIO_EMC_B1_21_SEMC_BA0, /* GPIO_EMC_B1_21 PAD functional properties : */
  927. 0x08U); /* PDRV Field: high drive strength
  928. Pull Down Pull Up Field: Internal pulldown resistor enabled
  929. Open Drain Field: Disabled
  930. Domain write protection: Both cores are allowed
  931. Domain write protection lock: Neither of DWP bits is locked */
  932. IOMUXC_SetPinConfig(
  933. IOMUXC_GPIO_EMC_B1_22_SEMC_BA1, /* GPIO_EMC_B1_22 PAD functional properties : */
  934. 0x08U); /* PDRV Field: high drive strength
  935. Pull Down Pull Up Field: Internal pulldown resistor enabled
  936. Open Drain Field: Disabled
  937. Domain write protection: Both cores are allowed
  938. Domain write protection lock: Neither of DWP bits is locked */
  939. IOMUXC_SetPinConfig(
  940. IOMUXC_GPIO_EMC_B1_23_SEMC_ADDR10, /* GPIO_EMC_B1_23 PAD functional properties : */
  941. 0x08U); /* PDRV Field: high drive strength
  942. Pull Down Pull Up Field: Internal pulldown resistor enabled
  943. Open Drain Field: Disabled
  944. Domain write protection: Both cores are allowed
  945. Domain write protection lock: Neither of DWP bits is locked */
  946. IOMUXC_SetPinConfig(
  947. IOMUXC_GPIO_EMC_B1_24_SEMC_CAS, /* GPIO_EMC_B1_24 PAD functional properties : */
  948. 0x08U); /* PDRV Field: high drive strength
  949. Pull Down Pull Up Field: Internal pulldown resistor enabled
  950. Open Drain Field: Disabled
  951. Domain write protection: Both cores are allowed
  952. Domain write protection lock: Neither of DWP bits is locked */
  953. IOMUXC_SetPinConfig(
  954. IOMUXC_GPIO_EMC_B1_25_SEMC_RAS, /* GPIO_EMC_B1_25 PAD functional properties : */
  955. 0x08U); /* PDRV Field: high drive strength
  956. Pull Down Pull Up Field: Internal pulldown resistor enabled
  957. Open Drain Field: Disabled
  958. Domain write protection: Both cores are allowed
  959. Domain write protection lock: Neither of DWP bits is locked */
  960. IOMUXC_SetPinConfig(
  961. IOMUXC_GPIO_EMC_B1_26_SEMC_CLK, /* GPIO_EMC_B1_26 PAD functional properties : */
  962. 0x08U); /* PDRV Field: high drive strength
  963. Pull Down Pull Up Field: Internal pulldown resistor enabled
  964. Open Drain Field: Disabled
  965. Domain write protection: Both cores are allowed
  966. Domain write protection lock: Neither of DWP bits is locked */
  967. IOMUXC_SetPinConfig(
  968. IOMUXC_GPIO_EMC_B1_27_SEMC_CKE, /* GPIO_EMC_B1_27 PAD functional properties : */
  969. 0x08U); /* PDRV Field: high drive strength
  970. Pull Down Pull Up Field: Internal pulldown resistor enabled
  971. Open Drain Field: Disabled
  972. Domain write protection: Both cores are allowed
  973. Domain write protection lock: Neither of DWP bits is locked */
  974. IOMUXC_SetPinConfig(
  975. IOMUXC_GPIO_EMC_B1_28_SEMC_WE, /* GPIO_EMC_B1_28 PAD functional properties : */
  976. 0x08U); /* PDRV Field: high drive strength
  977. Pull Down Pull Up Field: Internal pulldown resistor enabled
  978. Open Drain Field: Disabled
  979. Domain write protection: Both cores are allowed
  980. Domain write protection lock: Neither of DWP bits is locked */
  981. IOMUXC_SetPinConfig(
  982. IOMUXC_GPIO_EMC_B1_29_SEMC_CS0, /* GPIO_EMC_B1_29 PAD functional properties : */
  983. 0x08U); /* PDRV Field: high drive strength
  984. Pull Down Pull Up Field: Internal pulldown resistor enabled
  985. Open Drain Field: Disabled
  986. Domain write protection: Both cores are allowed
  987. Domain write protection lock: Neither of DWP bits is locked */
  988. IOMUXC_SetPinConfig(
  989. IOMUXC_GPIO_EMC_B1_30_SEMC_DATA08, /* GPIO_EMC_B1_30 PAD functional properties : */
  990. 0x08U); /* PDRV Field: high drive strength
  991. Pull Down Pull Up Field: Internal pulldown resistor enabled
  992. Open Drain Field: Disabled
  993. Domain write protection: Both cores are allowed
  994. Domain write protection lock: Neither of DWP bits is locked */
  995. IOMUXC_SetPinConfig(
  996. IOMUXC_GPIO_EMC_B1_31_SEMC_DATA09, /* GPIO_EMC_B1_31 PAD functional properties : */
  997. 0x08U); /* PDRV Field: high drive strength
  998. Pull Down Pull Up Field: Internal pulldown resistor enabled
  999. Open Drain Field: Disabled
  1000. Domain write protection: Both cores are allowed
  1001. Domain write protection lock: Neither of DWP bits is locked */
  1002. IOMUXC_SetPinConfig(
  1003. IOMUXC_GPIO_EMC_B1_32_SEMC_DATA10, /* GPIO_EMC_B1_32 PAD functional properties : */
  1004. 0x08U); /* PDRV Field: high drive strength
  1005. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1006. Open Drain Field: Disabled
  1007. Domain write protection: Both cores are allowed
  1008. Domain write protection lock: Neither of DWP bits is locked */
  1009. IOMUXC_SetPinConfig(
  1010. IOMUXC_GPIO_EMC_B1_33_SEMC_DATA11, /* GPIO_EMC_B1_33 PAD functional properties : */
  1011. 0x08U); /* PDRV Field: high drive strength
  1012. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1013. Open Drain Field: Disabled
  1014. Domain write protection: Both cores are allowed
  1015. Domain write protection lock: Neither of DWP bits is locked */
  1016. IOMUXC_SetPinConfig(
  1017. IOMUXC_GPIO_EMC_B1_34_SEMC_DATA12, /* GPIO_EMC_B1_34 PAD functional properties : */
  1018. 0x08U); /* PDRV Field: high drive strength
  1019. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1020. Open Drain Field: Disabled
  1021. Domain write protection: Both cores are allowed
  1022. Domain write protection lock: Neither of DWP bits is locked */
  1023. IOMUXC_SetPinConfig(
  1024. IOMUXC_GPIO_EMC_B1_35_SEMC_DATA13, /* GPIO_EMC_B1_35 PAD functional properties : */
  1025. 0x08U); /* PDRV Field: high drive strength
  1026. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1027. Open Drain Field: Disabled
  1028. Domain write protection: Both cores are allowed
  1029. Domain write protection lock: Neither of DWP bits is locked */
  1030. IOMUXC_SetPinConfig(
  1031. IOMUXC_GPIO_EMC_B1_36_SEMC_DATA14, /* GPIO_EMC_B1_36 PAD functional properties : */
  1032. 0x08U); /* PDRV Field: high drive strength
  1033. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1034. Open Drain Field: Disabled
  1035. Domain write protection: Both cores are allowed
  1036. Domain write protection lock: Neither of DWP bits is locked */
  1037. IOMUXC_SetPinConfig(
  1038. IOMUXC_GPIO_EMC_B1_37_SEMC_DATA15, /* GPIO_EMC_B1_37 PAD functional properties : */
  1039. 0x08U); /* PDRV Field: high drive strength
  1040. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1041. Open Drain Field: Disabled
  1042. Domain write protection: Both cores are allowed
  1043. Domain write protection lock: Neither of DWP bits is locked */
  1044. IOMUXC_SetPinConfig(
  1045. IOMUXC_GPIO_EMC_B1_38_SEMC_DM01, /* GPIO_EMC_B1_38 PAD functional properties : */
  1046. 0x08U); /* PDRV Field: high drive strength
  1047. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1048. Open Drain Field: Disabled
  1049. Domain write protection: Both cores are allowed
  1050. Domain write protection lock: Neither of DWP bits is locked */
  1051. IOMUXC_SetPinConfig(
  1052. IOMUXC_GPIO_EMC_B1_39_SEMC_DQS, /* GPIO_EMC_B1_39 PAD functional properties : */
  1053. 0x08U); /* PDRV Field: high drive strength
  1054. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1055. Open Drain Field: Disabled
  1056. Domain write protection: Both cores are allowed
  1057. Domain write protection lock: Neither of DWP bits is locked */
  1058. IOMUXC_SetPinConfig(
  1059. IOMUXC_GPIO_EMC_B1_40_SEMC_RDY, /* GPIO_EMC_B1_40 PAD functional properties : */
  1060. 0x08U); /* PDRV Field: high drive strength
  1061. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1062. Open Drain Field: Disabled
  1063. Domain write protection: Both cores are allowed
  1064. Domain write protection lock: Neither of DWP bits is locked */
  1065. IOMUXC_SetPinConfig(
  1066. IOMUXC_GPIO_EMC_B1_41_SEMC_CSX00, /* GPIO_EMC_B1_41 PAD functional properties : */
  1067. 0x08U); /* PDRV Field: high drive strength
  1068. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1069. Open Drain Field: Disabled
  1070. Domain write protection: Both cores are allowed
  1071. Domain write protection lock: Neither of DWP bits is locked */
  1072. IOMUXC_SetPinConfig(
  1073. IOMUXC_GPIO_EMC_B2_00_SEMC_DATA16, /* GPIO_EMC_B2_00 PAD functional properties : */
  1074. 0x08U); /* PDRV Field: high drive strength
  1075. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1076. Open Drain Field: Disabled
  1077. Domain write protection: Both cores are allowed
  1078. Domain write protection lock: Neither of DWP bits is locked */
  1079. IOMUXC_SetPinConfig(
  1080. IOMUXC_GPIO_EMC_B2_01_SEMC_DATA17, /* GPIO_EMC_B2_01 PAD functional properties : */
  1081. 0x08U); /* PDRV Field: high drive strength
  1082. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1083. Open Drain Field: Disabled
  1084. Domain write protection: Both cores are allowed
  1085. Domain write protection lock: Neither of DWP bits is locked */
  1086. IOMUXC_SetPinConfig(
  1087. IOMUXC_GPIO_EMC_B2_02_SEMC_DATA18, /* GPIO_EMC_B2_02 PAD functional properties : */
  1088. 0x08U); /* PDRV Field: high drive strength
  1089. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1090. Open Drain Field: Disabled
  1091. Domain write protection: Both cores are allowed
  1092. Domain write protection lock: Neither of DWP bits is locked */
  1093. IOMUXC_SetPinConfig(
  1094. IOMUXC_GPIO_EMC_B2_03_SEMC_DATA19, /* GPIO_EMC_B2_03 PAD functional properties : */
  1095. 0x08U); /* PDRV Field: high drive strength
  1096. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1097. Open Drain Field: Disabled
  1098. Domain write protection: Both cores are allowed
  1099. Domain write protection lock: Neither of DWP bits is locked */
  1100. IOMUXC_SetPinConfig(
  1101. IOMUXC_GPIO_EMC_B2_04_SEMC_DATA20, /* GPIO_EMC_B2_04 PAD functional properties : */
  1102. 0x08U); /* PDRV Field: high drive strength
  1103. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1104. Open Drain Field: Disabled
  1105. Domain write protection: Both cores are allowed
  1106. Domain write protection lock: Neither of DWP bits is locked */
  1107. IOMUXC_SetPinConfig(
  1108. IOMUXC_GPIO_EMC_B2_05_SEMC_DATA21, /* GPIO_EMC_B2_05 PAD functional properties : */
  1109. 0x08U); /* PDRV Field: high drive strength
  1110. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1111. Open Drain Field: Disabled
  1112. Domain write protection: Both cores are allowed
  1113. Domain write protection lock: Neither of DWP bits is locked */
  1114. IOMUXC_SetPinConfig(
  1115. IOMUXC_GPIO_EMC_B2_06_SEMC_DATA22, /* GPIO_EMC_B2_06 PAD functional properties : */
  1116. 0x08U); /* PDRV Field: high drive strength
  1117. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1118. Open Drain Field: Disabled
  1119. Domain write protection: Both cores are allowed
  1120. Domain write protection lock: Neither of DWP bits is locked */
  1121. IOMUXC_SetPinConfig(
  1122. IOMUXC_GPIO_EMC_B2_07_SEMC_DATA23, /* GPIO_EMC_B2_07 PAD functional properties : */
  1123. 0x08U); /* PDRV Field: high drive strength
  1124. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1125. Open Drain Field: Disabled
  1126. Domain write protection: Both cores are allowed
  1127. Domain write protection lock: Neither of DWP bits is locked */
  1128. IOMUXC_SetPinConfig(
  1129. IOMUXC_GPIO_EMC_B2_08_SEMC_DM02, /* GPIO_EMC_B2_08 PAD functional properties : */
  1130. 0x04U); /* PDRV Field: high drive strength
  1131. Pull Down Pull Up Field: Internal pullup resistor enabled
  1132. Open Drain Field: Disabled
  1133. Domain write protection: Both cores are allowed
  1134. Domain write protection lock: Neither of DWP bits is locked */
  1135. IOMUXC_SetPinConfig(
  1136. IOMUXC_GPIO_EMC_B2_09_SEMC_DATA24, /* GPIO_EMC_B2_09 PAD functional properties : */
  1137. 0x08U); /* PDRV Field: high drive strength
  1138. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1139. Open Drain Field: Disabled
  1140. Domain write protection: Both cores are allowed
  1141. Domain write protection lock: Neither of DWP bits is locked */
  1142. IOMUXC_SetPinConfig(
  1143. IOMUXC_GPIO_EMC_B2_10_SEMC_DATA25, /* GPIO_EMC_B2_10 PAD functional properties : */
  1144. 0x08U); /* PDRV Field: high drive strength
  1145. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1146. Open Drain Field: Disabled
  1147. Domain write protection: Both cores are allowed
  1148. Domain write protection lock: Neither of DWP bits is locked */
  1149. IOMUXC_SetPinConfig(
  1150. IOMUXC_GPIO_EMC_B2_11_SEMC_DATA26, /* GPIO_EMC_B2_11 PAD functional properties : */
  1151. 0x04U); /* PDRV Field: high drive strength
  1152. Pull Down Pull Up Field: Internal pullup resistor enabled
  1153. Open Drain Field: Disabled
  1154. Domain write protection: Both cores are allowed
  1155. Domain write protection lock: Neither of DWP bits is locked */
  1156. IOMUXC_SetPinConfig(
  1157. IOMUXC_GPIO_EMC_B2_12_SEMC_DATA27, /* GPIO_EMC_B2_12 PAD functional properties : */
  1158. 0x08U); /* PDRV Field: high drive strength
  1159. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1160. Open Drain Field: Disabled
  1161. Domain write protection: Both cores are allowed
  1162. Domain write protection lock: Neither of DWP bits is locked */
  1163. IOMUXC_SetPinConfig(
  1164. IOMUXC_GPIO_EMC_B2_13_SEMC_DATA28, /* GPIO_EMC_B2_13 PAD functional properties : */
  1165. 0x08U); /* PDRV Field: high drive strength
  1166. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1167. Open Drain Field: Disabled
  1168. Domain write protection: Both cores are allowed
  1169. Domain write protection lock: Neither of DWP bits is locked */
  1170. IOMUXC_SetPinConfig(
  1171. IOMUXC_GPIO_EMC_B2_14_SEMC_DATA29, /* GPIO_EMC_B2_14 PAD functional properties : */
  1172. 0x08U); /* PDRV Field: high drive strength
  1173. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1174. Open Drain Field: Disabled
  1175. Domain write protection: Both cores are allowed
  1176. Domain write protection lock: Neither of DWP bits is locked */
  1177. IOMUXC_SetPinConfig(
  1178. IOMUXC_GPIO_EMC_B2_15_SEMC_DATA30, /* GPIO_EMC_B2_15 PAD functional properties : */
  1179. 0x08U); /* PDRV Field: high drive strength
  1180. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1181. Open Drain Field: Disabled
  1182. Domain write protection: Both cores are allowed
  1183. Domain write protection lock: Neither of DWP bits is locked */
  1184. IOMUXC_SetPinConfig(
  1185. IOMUXC_GPIO_EMC_B2_16_SEMC_DATA31, /* GPIO_EMC_B2_16 PAD functional properties : */
  1186. 0x08U); /* PDRV Field: high drive strength
  1187. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1188. Open Drain Field: Disabled
  1189. Domain write protection: Both cores are allowed
  1190. Domain write protection lock: Neither of DWP bits is locked */
  1191. IOMUXC_SetPinConfig(
  1192. IOMUXC_GPIO_EMC_B2_17_SEMC_DM03, /* GPIO_EMC_B2_17 PAD functional properties : */
  1193. 0x08U); /* PDRV Field: high drive strength
  1194. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1195. Open Drain Field: Disabled
  1196. Domain write protection: Both cores are allowed
  1197. Domain write protection lock: Neither of DWP bits is locked */
  1198. IOMUXC_SetPinConfig(
  1199. IOMUXC_GPIO_EMC_B2_18_SEMC_DQS4, /* GPIO_EMC_B2_18 PAD functional properties : */
  1200. 0x08U); /* PDRV Field: high drive strength
  1201. Pull Down Pull Up Field: Internal pulldown resistor enabled
  1202. Open Drain Field: Disabled
  1203. Domain write protection: Both cores are allowed
  1204. Domain write protection lock: Neither of DWP bits is locked */
  1205. }
  1206. #endif
  1207. #ifdef BSP_USING_CAN
  1208. void imxrt_can_pins_init(void)
  1209. {
  1210. #ifdef BSP_USING_CAN3
  1211. CLOCK_EnableClock(kCLOCK_Iomuxc_Lpsr); /* LPCG on: LPCG is ON. */
  1212. IOMUXC_SetPinMux(
  1213. IOMUXC_GPIO_LPSR_00_FLEXCAN3_TX, /* GPIO_LPSR_00 is configured as FLEXCAN3_TX */
  1214. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1215. IOMUXC_SetPinMux(
  1216. IOMUXC_GPIO_LPSR_01_FLEXCAN3_RX, /* GPIO_LPSR_01 is configured as FLEXCAN3_RX */
  1217. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1218. #endif
  1219. }
  1220. #endif
  1221. #ifdef BSP_USING_FLEXSPI
  1222. void imxrt_flexspi_pins_init(void)
  1223. {
  1224. #ifdef BSP_USING_FLEXSPI1
  1225. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  1226. IOMUXC_SetPinMux(
  1227. IOMUXC_GPIO_SD_B2_00_FLEXSPI1_B_DATA03, /* GPIO_SD_B2_00 is configured as FLEXSPI1_B_DATA03 */
  1228. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1229. IOMUXC_SetPinMux(
  1230. IOMUXC_GPIO_SD_B2_01_FLEXSPI1_B_DATA02, /* GPIO_SD_B2_01 is configured as FLEXSPI1_B_DATA02 */
  1231. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1232. IOMUXC_SetPinMux(
  1233. IOMUXC_GPIO_SD_B2_02_FLEXSPI1_B_DATA01, /* GPIO_SD_B2_02 is configured as FLEXSPI1_B_DATA01 */
  1234. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1235. IOMUXC_SetPinMux(
  1236. IOMUXC_GPIO_SD_B2_03_FLEXSPI1_B_DATA00, /* GPIO_SD_B2_03 is configured as FLEXSPI1_B_DATA00 */
  1237. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1238. IOMUXC_SetPinMux(
  1239. IOMUXC_GPIO_SD_B2_05_FLEXSPI1_A_DQS, /* GPIO_SD_B2_05 is configured as FLEXSPI1_A_DQS */
  1240. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1241. IOMUXC_SetPinMux(
  1242. IOMUXC_GPIO_SD_B2_06_FLEXSPI1_A_SS0_B, /* GPIO_SD_B2_06 is configured as FLEXSPI1_A_SS0_B */
  1243. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1244. IOMUXC_SetPinMux(
  1245. IOMUXC_GPIO_SD_B2_07_FLEXSPI1_A_SCLK, /* GPIO_SD_B2_07 is configured as FLEXSPI1_A_SCLK */
  1246. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1247. IOMUXC_SetPinMux(
  1248. IOMUXC_GPIO_SD_B2_08_FLEXSPI1_A_DATA00, /* GPIO_SD_B2_08 is configured as FLEXSPI1_A_DATA00 */
  1249. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1250. IOMUXC_SetPinMux(
  1251. IOMUXC_GPIO_SD_B2_09_FLEXSPI1_A_DATA01, /* GPIO_SD_B2_09 is configured as FLEXSPI1_A_DATA01 */
  1252. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1253. IOMUXC_SetPinMux(
  1254. IOMUXC_GPIO_SD_B2_10_FLEXSPI1_A_DATA02, /* GPIO_SD_B2_10 is configured as FLEXSPI1_A_DATA02 */
  1255. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1256. IOMUXC_SetPinMux(
  1257. IOMUXC_GPIO_SD_B2_11_FLEXSPI1_A_DATA03, /* GPIO_SD_B2_11 is configured as FLEXSPI1_A_DATA03 */
  1258. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1259. #endif
  1260. }
  1261. #endif
  1262. #ifdef BSP_USING_LCD_MIPI
  1263. void imxrt_mipi_dsi_pins_init(void)
  1264. {
  1265. #ifdef BSP_USING_LCD_MIPI
  1266. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  1267. IOMUXC_SetPinMux(
  1268. IOMUXC_GPIO_AD_02_GPIO9_IO01, /* GPIO_AD_02 is configured as GPIO9_IO01 */
  1269. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1270. IOMUXC_SetPinMux(
  1271. IOMUXC_GPIO_AD_30_GPIO9_IO29, /* GPIO_AD_30 is configured as GPIO9_IO29 */
  1272. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1273. IOMUXC_SetPinMux(
  1274. IOMUXC_GPIO_DISP_B2_15_GPIO11_IO16, /* GPIO_DISP_B2_15 is configured as GPIO11_IO16 */
  1275. 0U); /* Software Input On Field: Input Path is determined by functionality */
  1276. #endif
  1277. }
  1278. #endif
  1279. void rt_hw_board_init()
  1280. {
  1281. BOARD_ConfigMPU();
  1282. BOARD_InitPins();
  1283. BOARD_BootClockRUN();
  1284. NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
  1285. SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
  1286. #ifdef BSP_USING_LPUART
  1287. imxrt_uart_pins_init();
  1288. #endif
  1289. #ifdef BSP_USING_SDRAM
  1290. imxrt_sdram_pins_init();
  1291. #endif
  1292. #ifdef RT_USING_HEAP
  1293. rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
  1294. #endif
  1295. #ifdef RT_USING_COMPONENTS_INIT
  1296. rt_components_board_init();
  1297. #endif
  1298. #ifdef RT_USING_CONSOLE
  1299. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  1300. #endif
  1301. #ifdef BSP_USING_SDIO
  1302. imxrt_SDcard_pins_init();
  1303. #endif
  1304. #ifdef BSP_USING_ETH
  1305. imxrt_eth_pins_init();
  1306. #endif
  1307. #ifdef BSP_USING_CAN
  1308. imxrt_can_pins_init();
  1309. #endif
  1310. #ifdef BSP_USING_FLEXSPI
  1311. imxrt_flexspi_pins_init();
  1312. #endif
  1313. #ifdef BSP_USING_LCD_MIPI
  1314. imxrt_mipi_dsi_pins_init();
  1315. #endif
  1316. }