board.h 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  1. /*
  2. ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * This file has been automatically generated using ChibiStudio board
  15. * generator plugin. Do not edit manually.
  16. */
  17. #ifndef BOARD_H
  18. #define BOARD_H
  19. /*===========================================================================*/
  20. /* Driver constants. */
  21. /*===========================================================================*/
  22. /*
  23. * Setup for STMicroelectronics STM32L4R9I-Discovery board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_ST_STM32L4R9I_DISCOVERY
  29. #define BOARD_NAME "STMicroelectronics STM32L4R9I-Discovery"
  30. /*
  31. * Board oscillators-related settings.
  32. */
  33. #if !defined(STM32_LSECLK)
  34. #define STM32_LSECLK 32768U
  35. #endif
  36. #define STM32_LSEDRV (3U << 3U)
  37. #if !defined(STM32_HSECLK)
  38. #define STM32_HSECLK 16000000U
  39. #endif
  40. /*
  41. * Board voltages.
  42. * Required for performance limits calculation.
  43. */
  44. #define STM32_VDD 300U
  45. /*
  46. * MCU type as defined in the ST header.
  47. */
  48. #define STM32L4R9xx
  49. /*
  50. * IO pins assignments.
  51. */
  52. #define GPIOA_PIN0 0U
  53. #define GPIOA_PIN1 1U
  54. #define GPIOA_STLINK_USART2_TX 2U
  55. #define GPIOA_STLINK_USART2_RX 3U
  56. #define GPIOA_PIN4 4U
  57. #define GPIOA_PIN5 5U
  58. #define GPIOA_PIN6 6U
  59. #define GPIOA_PIN7 7U
  60. #define GPIOA_PIN8 8U
  61. #define GPIOA_USB_OTGFS_VBUS 9U
  62. #define GPIOA_USB_OTGFS_ID 10U
  63. #define GPIOA_USB_OTGFS_DM 11U
  64. #define GPIOA_USB_OTGFS_DP 12U
  65. #define GPIOA_SWDIO 13U
  66. #define GPIOA_SWCLK 14U
  67. #define GPIOA_PIN15 15U
  68. #define GPIOB_PIN0 0U
  69. #define GPIOB_PIN1 1U
  70. #define GPIOB_PIN2 2U
  71. #define GPIOB_SWO 3U
  72. #define GPIOB_PIN4 4U
  73. #define GPIOB_PIN5 5U
  74. #define GPIOB_PIN6 6U
  75. #define GPIOB_PIN7 7U
  76. #define GPIOB_PIN8 8U
  77. #define GPIOB_PIN9 9U
  78. #define GPIOB_PIN10 10U
  79. #define GPIOB_PIN11 11U
  80. #define GPIOB_PIN12 12U
  81. #define GPIOB_PIN13 13U
  82. #define GPIOB_PIN14 14U
  83. #define GPIOB_PIN15 15U
  84. #define GPIOC_PIN0 0U
  85. #define GPIOC_PIN1 1U
  86. #define GPIOC_PIN2 2U
  87. #define GPIOC_PIN3 3U
  88. #define GPIOC_PIN4 4U
  89. #define GPIOC_PIN5 5U
  90. #define GPIOC_PIN6 6U
  91. #define GPIOC_PIN7 7U
  92. #define GPIOC_SDMMC_1_D0 8U
  93. #define GPIOC_SDMMC_1_D1 9U
  94. #define GPIOC_SDMMC_1_D2 10U
  95. #define GPIOC_SDMMC_1_D3 11U
  96. #define GPIOC_SDMMC_1_CK 12U
  97. #define GPIOC_JOY_SEL 13U
  98. #define GPIOC_BUTTON 13U
  99. #define GPIOC_PIN14 14U
  100. #define GPIOC_PIN15 15U
  101. #define GPIOD_PIN0 0U
  102. #define GPIOD_PIN1 1U
  103. #define GPIOD_SDMMC_1_CMD 2U
  104. #define GPIOD_PIN3 3U
  105. #define GPIOD_PIN4 4U
  106. #define GPIOD_PIN5 5U
  107. #define GPIOD_PIN6 6U
  108. #define GPIOD_PIN7 7U
  109. #define GPIOD_PIN8 8U
  110. #define GPIOD_PIN9 9U
  111. #define GPIOD_PIN10 10U
  112. #define GPIOD_PIN11 11U
  113. #define GPIOD_PIN12 12U
  114. #define GPIOD_PIN13 13U
  115. #define GPIOD_PIN14 14U
  116. #define GPIOD_PIN15 15U
  117. #define GPIOE_PIN0 0U
  118. #define GPIOE_PIN1 1U
  119. #define GPIOE_PIN2 2U
  120. #define GPIOE_PIN3 3U
  121. #define GPIOE_PIN4 4U
  122. #define GPIOE_PIN5 5U
  123. #define GPIOE_PIN6 6U
  124. #define GPIOE_PIN7 7U
  125. #define GPIOE_PIN8 8U
  126. #define GPIOE_PIN9 9U
  127. #define GPIOE_PIN10 10U
  128. #define GPIOE_PIN11 11U
  129. #define GPIOE_PIN12 12U
  130. #define GPIOE_PIN13 13U
  131. #define GPIOE_PIN14 14U
  132. #define GPIOE_PIN15 15U
  133. #define GPIOF_PIN0 0U
  134. #define GPIOF_PIN1 1U
  135. #define GPIOF_PIN2 2U
  136. #define GPIOF_PIN3 3U
  137. #define GPIOF_PIN4 4U
  138. #define GPIOF_PIN5 5U
  139. #define GPIOF_PIN6 6U
  140. #define GPIOF_PIN7 7U
  141. #define GPIOF_PIN8 8U
  142. #define GPIOF_PIN9 9U
  143. #define GPIOF_PIN10 10U
  144. #define GPIOF_PIN11 11U
  145. #define GPIOF_PIN12 12U
  146. #define GPIOF_PIN13 13U
  147. #define GPIOF_PIN14 14U
  148. #define GPIOF_PIN15 15U
  149. #define GPIOG_PIN0 0U
  150. #define GPIOG_PIN1 1U
  151. #define GPIOG_PIN2 2U
  152. #define GPIOG_PIN3 3U
  153. #define GPIOG_PIN4 4U
  154. #define GPIOG_PIN5 5U
  155. #define GPIOG_PIN6 6U
  156. #define GPIOG_PIN7 7U
  157. #define GPIOG_PIN8 8U
  158. #define GPIOG_OCTOSPIM_P2_IO6 9U
  159. #define GPIOG_OCTOSPIM_P2_IO7 10U
  160. #define GPIOG_PIN11 11U
  161. #define GPIOG_OCTOSPIM_P2_NCS 12U
  162. #define GPIOG_PIN13 13U
  163. #define GPIOG_PIN14 14U
  164. #define GPIOG_OCTOSPIM_P2_DQS 15U
  165. #define GPIOH_OSC_IN 0U
  166. #define GPIOH_OSC_OUT 1U
  167. #define GPIOH_PIN2 2U
  168. #define GPIOH_BOOT0 3U
  169. #define GPIOH_LED 4U
  170. #define GPIOH_LED_GREEN 4U
  171. #define GPIOH_PIN5 5U
  172. #define GPIOH_PIN6 6U
  173. #define GPIOH_PIN7 7U
  174. #define GPIOH_OCTOSPIM_P2_IO3 8U
  175. #define GPIOH_OCTOSPIM_P2_IO4 9U
  176. #define GPIOH_OCTOSPIM_P2_IO5 10U
  177. #define GPIOH_PIN11 11U
  178. #define GPIOH_PIN12 12U
  179. #define GPIOH_PIN13 13U
  180. #define GPIOH_PIN14 14U
  181. #define GPIOH_PIN15 15U
  182. #define GPIOI_PIN0 0U
  183. #define GPIOI_PIN1 1U
  184. #define GPIOI_PIN2 2U
  185. #define GPIOI_PIN3 3U
  186. #define GPIOI_PIN4 4U
  187. #define GPIOI_PIN5 5U
  188. #define GPIOI_OCTOSPIM_P2_CLK 6U
  189. #define GPIOI_PIN7 7U
  190. #define GPIOI_PIN8 8U
  191. #define GPIOI_OCTOSPIM_P2_IO2 9U
  192. #define GPIOI_OCTOSPIM_P2_IO1 10U
  193. #define GPIOI_OCTOSPIM_P2_IO0 11U
  194. #define GPIOI_PIN12 12U
  195. #define GPIOI_PIN13 13U
  196. #define GPIOI_PIN14 14U
  197. #define GPIOI_PIN15 15U
  198. /*
  199. * IO lines assignments.
  200. */
  201. #define LINE_STLINK_USART2_TX PAL_LINE(GPIOA, 2U)
  202. #define LINE_STLINK_USART2_RX PAL_LINE(GPIOA, 3U)
  203. #define LINE_USB_OTGFS_VBUS PAL_LINE(GPIOA, 9U)
  204. #define LINE_USB_OTGFS_ID PAL_LINE(GPIOA, 10U)
  205. #define LINE_USB_OTGFS_DM PAL_LINE(GPIOA, 11U)
  206. #define LINE_USB_OTGFS_DP PAL_LINE(GPIOA, 12U)
  207. #define LINE_SWDIO PAL_LINE(GPIOA, 13U)
  208. #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
  209. #define LINE_SWO PAL_LINE(GPIOB, 3U)
  210. #define LINE_SDMMC_1_D0 PAL_LINE(GPIOC, 8U)
  211. #define LINE_SDMMC_1_D1 PAL_LINE(GPIOC, 9U)
  212. #define LINE_SDMMC_1_D2 PAL_LINE(GPIOC, 10U)
  213. #define LINE_SDMMC_1_D3 PAL_LINE(GPIOC, 11U)
  214. #define LINE_SDMMC_1_CK PAL_LINE(GPIOC, 12U)
  215. #define LINE_JOY_SEL PAL_LINE(GPIOC, 13U)
  216. #define LINE_BUTTON PAL_LINE(GPIOC, 13U)
  217. #define LINE_SDMMC_1_CMD PAL_LINE(GPIOD, 2U)
  218. #define LINE_OCTOSPIM_P2_IO6 PAL_LINE(GPIOG, 9U)
  219. #define LINE_OCTOSPIM_P2_IO7 PAL_LINE(GPIOG, 10U)
  220. #define LINE_OCTOSPIM_P2_NCS PAL_LINE(GPIOG, 12U)
  221. #define LINE_OCTOSPIM_P2_DQS PAL_LINE(GPIOG, 15U)
  222. #define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
  223. #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
  224. #define LINE_BOOT0 PAL_LINE(GPIOH, 3U)
  225. #define LINE_LED PAL_LINE(GPIOH, 4U)
  226. #define LINE_LED_GREEN PAL_LINE(GPIOH, 4U)
  227. #define LINE_OCTOSPIM_P2_IO3 PAL_LINE(GPIOH, 8U)
  228. #define LINE_OCTOSPIM_P2_IO4 PAL_LINE(GPIOH, 9U)
  229. #define LINE_OCTOSPIM_P2_IO5 PAL_LINE(GPIOH, 10U)
  230. #define LINE_OCTOSPIM_P2_CLK PAL_LINE(GPIOI, 6U)
  231. #define LINE_OCTOSPIM_P2_IO2 PAL_LINE(GPIOI, 9U)
  232. #define LINE_OCTOSPIM_P2_IO1 PAL_LINE(GPIOI, 10U)
  233. #define LINE_OCTOSPIM_P2_IO0 PAL_LINE(GPIOI, 11U)
  234. /*===========================================================================*/
  235. /* Driver pre-compile time settings. */
  236. /*===========================================================================*/
  237. /*===========================================================================*/
  238. /* Derived constants and error checks. */
  239. /*===========================================================================*/
  240. /*===========================================================================*/
  241. /* Driver data structures and types. */
  242. /*===========================================================================*/
  243. /*===========================================================================*/
  244. /* Driver macros. */
  245. /*===========================================================================*/
  246. /*
  247. * I/O ports initial setup, this configuration is established soon after reset
  248. * in the initialization code.
  249. * Please refer to the STM32 Reference Manual for details.
  250. */
  251. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  252. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  253. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  254. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  255. #define PIN_ODR_LOW(n) (0U << (n))
  256. #define PIN_ODR_HIGH(n) (1U << (n))
  257. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  258. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  259. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  260. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  261. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  262. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  263. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  264. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  265. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  266. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  267. #define PIN_ASCR_DISABLED(n) (0U << (n))
  268. #define PIN_ASCR_ENABLED(n) (1U << (n))
  269. #define PIN_LOCKR_DISABLED(n) (0U << (n))
  270. #define PIN_LOCKR_ENABLED(n) (1U << (n))
  271. /*
  272. * GPIOA setup:
  273. *
  274. * PA0 - PIN0 (analog).
  275. * PA1 - PIN1 (analog).
  276. * PA2 - STLINK_USART2_TX (alternate 7).
  277. * PA3 - STLINK_USART2_RX (alternate 7).
  278. * PA4 - PIN4 (analog).
  279. * PA5 - PIN5 (analog).
  280. * PA6 - PIN6 (analog).
  281. * PA7 - PIN7 (analog).
  282. * PA8 - PIN8 (analog).
  283. * PA9 - USB_OTGFS_VBUS (input pullup).
  284. * PA10 - USB_OTGFS_ID (alternate 10).
  285. * PA11 - USB_OTGFS_DM (alternate 10).
  286. * PA12 - USB_OTGFS_DP (alternate 10).
  287. * PA13 - SWDIO (alternate 0).
  288. * PA14 - SWCLK (alternate 0).
  289. * PA15 - PIN15 (analog).
  290. */
  291. #define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_PIN0) | \
  292. PIN_MODE_ANALOG(GPIOA_PIN1) | \
  293. PIN_MODE_ALTERNATE(GPIOA_STLINK_USART2_TX) |\
  294. PIN_MODE_ALTERNATE(GPIOA_STLINK_USART2_RX) |\
  295. PIN_MODE_ANALOG(GPIOA_PIN4) | \
  296. PIN_MODE_ANALOG(GPIOA_PIN5) | \
  297. PIN_MODE_ANALOG(GPIOA_PIN6) | \
  298. PIN_MODE_ANALOG(GPIOA_PIN7) | \
  299. PIN_MODE_ANALOG(GPIOA_PIN8) | \
  300. PIN_MODE_INPUT(GPIOA_USB_OTGFS_VBUS) | \
  301. PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_ID) |\
  302. PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_DM) |\
  303. PIN_MODE_ALTERNATE(GPIOA_USB_OTGFS_DP) |\
  304. PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
  305. PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
  306. PIN_MODE_ANALOG(GPIOA_PIN15))
  307. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
  308. PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
  309. PIN_OTYPE_PUSHPULL(GPIOA_STLINK_USART2_TX) |\
  310. PIN_OTYPE_PUSHPULL(GPIOA_STLINK_USART2_RX) |\
  311. PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
  312. PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
  313. PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
  314. PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
  315. PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
  316. PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_VBUS) |\
  317. PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_ID) |\
  318. PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_DM) |\
  319. PIN_OTYPE_PUSHPULL(GPIOA_USB_OTGFS_DP) |\
  320. PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
  321. PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
  322. PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
  323. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \
  324. PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
  325. PIN_OSPEED_HIGH(GPIOA_STLINK_USART2_TX) |\
  326. PIN_OSPEED_HIGH(GPIOA_STLINK_USART2_RX) |\
  327. PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
  328. PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
  329. PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
  330. PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
  331. PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
  332. PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_VBUS) |\
  333. PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_ID) | \
  334. PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_DM) | \
  335. PIN_OSPEED_HIGH(GPIOA_USB_OTGFS_DP) | \
  336. PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
  337. PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
  338. PIN_OSPEED_VERYLOW(GPIOA_PIN15))
  339. #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \
  340. PIN_PUPDR_FLOATING(GPIOA_PIN1) | \
  341. PIN_PUPDR_FLOATING(GPIOA_STLINK_USART2_TX) |\
  342. PIN_PUPDR_FLOATING(GPIOA_STLINK_USART2_RX) |\
  343. PIN_PUPDR_FLOATING(GPIOA_PIN4) | \
  344. PIN_PUPDR_FLOATING(GPIOA_PIN5) | \
  345. PIN_PUPDR_FLOATING(GPIOA_PIN6) | \
  346. PIN_PUPDR_FLOATING(GPIOA_PIN7) | \
  347. PIN_PUPDR_FLOATING(GPIOA_PIN8) | \
  348. PIN_PUPDR_PULLUP(GPIOA_USB_OTGFS_VBUS) |\
  349. PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_ID) |\
  350. PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_DM) |\
  351. PIN_PUPDR_FLOATING(GPIOA_USB_OTGFS_DP) |\
  352. PIN_PUPDR_PULLDOWN(GPIOA_SWDIO) | \
  353. PIN_PUPDR_PULLUP(GPIOA_SWCLK) | \
  354. PIN_PUPDR_FLOATING(GPIOA_PIN15))
  355. #define VAL_GPIOA_ODR (PIN_ODR_LOW(GPIOA_PIN0) | \
  356. PIN_ODR_LOW(GPIOA_PIN1) | \
  357. PIN_ODR_LOW(GPIOA_STLINK_USART2_TX) | \
  358. PIN_ODR_LOW(GPIOA_STLINK_USART2_RX) | \
  359. PIN_ODR_LOW(GPIOA_PIN4) | \
  360. PIN_ODR_LOW(GPIOA_PIN5) | \
  361. PIN_ODR_LOW(GPIOA_PIN6) | \
  362. PIN_ODR_LOW(GPIOA_PIN7) | \
  363. PIN_ODR_LOW(GPIOA_PIN8) | \
  364. PIN_ODR_LOW(GPIOA_USB_OTGFS_VBUS) | \
  365. PIN_ODR_LOW(GPIOA_USB_OTGFS_ID) | \
  366. PIN_ODR_LOW(GPIOA_USB_OTGFS_DM) | \
  367. PIN_ODR_LOW(GPIOA_USB_OTGFS_DP) | \
  368. PIN_ODR_LOW(GPIOA_SWDIO) | \
  369. PIN_ODR_LOW(GPIOA_SWCLK) | \
  370. PIN_ODR_LOW(GPIOA_PIN15))
  371. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \
  372. PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
  373. PIN_AFIO_AF(GPIOA_STLINK_USART2_TX, 7U) |\
  374. PIN_AFIO_AF(GPIOA_STLINK_USART2_RX, 7U) |\
  375. PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
  376. PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
  377. PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
  378. PIN_AFIO_AF(GPIOA_PIN7, 0U))
  379. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
  380. PIN_AFIO_AF(GPIOA_USB_OTGFS_VBUS, 0U) |\
  381. PIN_AFIO_AF(GPIOA_USB_OTGFS_ID, 10U) | \
  382. PIN_AFIO_AF(GPIOA_USB_OTGFS_DM, 10U) | \
  383. PIN_AFIO_AF(GPIOA_USB_OTGFS_DP, 10U) | \
  384. PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
  385. PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
  386. PIN_AFIO_AF(GPIOA_PIN15, 0U))
  387. #define VAL_GPIOA_ASCR (PIN_ASCR_DISABLED(GPIOA_PIN0) | \
  388. PIN_ASCR_DISABLED(GPIOA_PIN1) | \
  389. PIN_ASCR_DISABLED(GPIOA_STLINK_USART2_TX) |\
  390. PIN_ASCR_DISABLED(GPIOA_STLINK_USART2_RX) |\
  391. PIN_ASCR_DISABLED(GPIOA_PIN4) | \
  392. PIN_ASCR_DISABLED(GPIOA_PIN5) | \
  393. PIN_ASCR_DISABLED(GPIOA_PIN6) | \
  394. PIN_ASCR_DISABLED(GPIOA_PIN7) | \
  395. PIN_ASCR_DISABLED(GPIOA_PIN8) | \
  396. PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_VBUS) |\
  397. PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_ID) |\
  398. PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_DM) |\
  399. PIN_ASCR_DISABLED(GPIOA_USB_OTGFS_DP) |\
  400. PIN_ASCR_DISABLED(GPIOA_SWDIO) | \
  401. PIN_ASCR_DISABLED(GPIOA_SWCLK) | \
  402. PIN_ASCR_DISABLED(GPIOA_PIN15))
  403. #define VAL_GPIOA_LOCKR (PIN_LOCKR_DISABLED(GPIOA_PIN0) | \
  404. PIN_LOCKR_DISABLED(GPIOA_PIN1) | \
  405. PIN_LOCKR_DISABLED(GPIOA_STLINK_USART2_TX) |\
  406. PIN_LOCKR_DISABLED(GPIOA_STLINK_USART2_RX) |\
  407. PIN_LOCKR_DISABLED(GPIOA_PIN4) | \
  408. PIN_LOCKR_DISABLED(GPIOA_PIN5) | \
  409. PIN_LOCKR_DISABLED(GPIOA_PIN6) | \
  410. PIN_LOCKR_DISABLED(GPIOA_PIN7) | \
  411. PIN_LOCKR_DISABLED(GPIOA_PIN8) | \
  412. PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_VBUS) |\
  413. PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_ID) |\
  414. PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_DM) |\
  415. PIN_LOCKR_DISABLED(GPIOA_USB_OTGFS_DP) |\
  416. PIN_LOCKR_DISABLED(GPIOA_SWDIO) | \
  417. PIN_LOCKR_DISABLED(GPIOA_SWCLK) | \
  418. PIN_LOCKR_DISABLED(GPIOA_PIN15))
  419. /*
  420. * GPIOB setup:
  421. *
  422. * PB0 - PIN0 (analog).
  423. * PB1 - PIN1 (analog).
  424. * PB2 - PIN2 (analog).
  425. * PB3 - SWO (alternate 0).
  426. * PB4 - PIN4 (analog).
  427. * PB5 - PIN5 (analog).
  428. * PB6 - PIN6 (analog).
  429. * PB7 - PIN7 (analog).
  430. * PB8 - PIN8 (analog).
  431. * PB9 - PIN9 (analog).
  432. * PB10 - PIN10 (analog).
  433. * PB11 - PIN11 (analog).
  434. * PB12 - PIN12 (analog).
  435. * PB13 - PIN13 (analog).
  436. * PB14 - PIN14 (analog).
  437. * PB15 - PIN15 (analog).
  438. */
  439. #define VAL_GPIOB_MODER (PIN_MODE_ANALOG(GPIOB_PIN0) | \
  440. PIN_MODE_ANALOG(GPIOB_PIN1) | \
  441. PIN_MODE_ANALOG(GPIOB_PIN2) | \
  442. PIN_MODE_ALTERNATE(GPIOB_SWO) | \
  443. PIN_MODE_ANALOG(GPIOB_PIN4) | \
  444. PIN_MODE_ANALOG(GPIOB_PIN5) | \
  445. PIN_MODE_ANALOG(GPIOB_PIN6) | \
  446. PIN_MODE_ANALOG(GPIOB_PIN7) | \
  447. PIN_MODE_ANALOG(GPIOB_PIN8) | \
  448. PIN_MODE_ANALOG(GPIOB_PIN9) | \
  449. PIN_MODE_ANALOG(GPIOB_PIN10) | \
  450. PIN_MODE_ANALOG(GPIOB_PIN11) | \
  451. PIN_MODE_ANALOG(GPIOB_PIN12) | \
  452. PIN_MODE_ANALOG(GPIOB_PIN13) | \
  453. PIN_MODE_ANALOG(GPIOB_PIN14) | \
  454. PIN_MODE_ANALOG(GPIOB_PIN15))
  455. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
  456. PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
  457. PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
  458. PIN_OTYPE_PUSHPULL(GPIOB_SWO) | \
  459. PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
  460. PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
  461. PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
  462. PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
  463. PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
  464. PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
  465. PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
  466. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  467. PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
  468. PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
  469. PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
  470. PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
  471. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
  472. PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
  473. PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
  474. PIN_OSPEED_HIGH(GPIOB_SWO) | \
  475. PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
  476. PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
  477. PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
  478. PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
  479. PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
  480. PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
  481. PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
  482. PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
  483. PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
  484. PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
  485. PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
  486. PIN_OSPEED_VERYLOW(GPIOB_PIN15))
  487. #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_PIN0) | \
  488. PIN_PUPDR_FLOATING(GPIOB_PIN1) | \
  489. PIN_PUPDR_FLOATING(GPIOB_PIN2) | \
  490. PIN_PUPDR_FLOATING(GPIOB_SWO) | \
  491. PIN_PUPDR_FLOATING(GPIOB_PIN4) | \
  492. PIN_PUPDR_FLOATING(GPIOB_PIN5) | \
  493. PIN_PUPDR_FLOATING(GPIOB_PIN6) | \
  494. PIN_PUPDR_FLOATING(GPIOB_PIN7) | \
  495. PIN_PUPDR_FLOATING(GPIOB_PIN8) | \
  496. PIN_PUPDR_FLOATING(GPIOB_PIN9) | \
  497. PIN_PUPDR_FLOATING(GPIOB_PIN10) | \
  498. PIN_PUPDR_FLOATING(GPIOB_PIN11) | \
  499. PIN_PUPDR_FLOATING(GPIOB_PIN12) | \
  500. PIN_PUPDR_FLOATING(GPIOB_PIN13) | \
  501. PIN_PUPDR_FLOATING(GPIOB_PIN14) | \
  502. PIN_PUPDR_FLOATING(GPIOB_PIN15))
  503. #define VAL_GPIOB_ODR (PIN_ODR_LOW(GPIOB_PIN0) | \
  504. PIN_ODR_LOW(GPIOB_PIN1) | \
  505. PIN_ODR_LOW(GPIOB_PIN2) | \
  506. PIN_ODR_LOW(GPIOB_SWO) | \
  507. PIN_ODR_LOW(GPIOB_PIN4) | \
  508. PIN_ODR_LOW(GPIOB_PIN5) | \
  509. PIN_ODR_LOW(GPIOB_PIN6) | \
  510. PIN_ODR_LOW(GPIOB_PIN7) | \
  511. PIN_ODR_LOW(GPIOB_PIN8) | \
  512. PIN_ODR_LOW(GPIOB_PIN9) | \
  513. PIN_ODR_LOW(GPIOB_PIN10) | \
  514. PIN_ODR_LOW(GPIOB_PIN11) | \
  515. PIN_ODR_LOW(GPIOB_PIN12) | \
  516. PIN_ODR_LOW(GPIOB_PIN13) | \
  517. PIN_ODR_LOW(GPIOB_PIN14) | \
  518. PIN_ODR_LOW(GPIOB_PIN15))
  519. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
  520. PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
  521. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  522. PIN_AFIO_AF(GPIOB_SWO, 0U) | \
  523. PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
  524. PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
  525. PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
  526. PIN_AFIO_AF(GPIOB_PIN7, 0U))
  527. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  528. PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
  529. PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
  530. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  531. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  532. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  533. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  534. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  535. #define VAL_GPIOB_ASCR (PIN_ASCR_DISABLED(GPIOB_PIN0) | \
  536. PIN_ASCR_DISABLED(GPIOB_PIN1) | \
  537. PIN_ASCR_DISABLED(GPIOB_PIN2) | \
  538. PIN_ASCR_DISABLED(GPIOB_SWO) | \
  539. PIN_ASCR_DISABLED(GPIOB_PIN4) | \
  540. PIN_ASCR_DISABLED(GPIOB_PIN5) | \
  541. PIN_ASCR_DISABLED(GPIOB_PIN6) | \
  542. PIN_ASCR_DISABLED(GPIOB_PIN7) | \
  543. PIN_ASCR_DISABLED(GPIOB_PIN8) | \
  544. PIN_ASCR_DISABLED(GPIOB_PIN9) | \
  545. PIN_ASCR_DISABLED(GPIOB_PIN10) | \
  546. PIN_ASCR_DISABLED(GPIOB_PIN11) | \
  547. PIN_ASCR_DISABLED(GPIOB_PIN12) | \
  548. PIN_ASCR_DISABLED(GPIOB_PIN13) | \
  549. PIN_ASCR_DISABLED(GPIOB_PIN14) | \
  550. PIN_ASCR_DISABLED(GPIOB_PIN15))
  551. #define VAL_GPIOB_LOCKR (PIN_LOCKR_DISABLED(GPIOB_PIN0) | \
  552. PIN_LOCKR_DISABLED(GPIOB_PIN1) | \
  553. PIN_LOCKR_DISABLED(GPIOB_PIN2) | \
  554. PIN_LOCKR_DISABLED(GPIOB_SWO) | \
  555. PIN_LOCKR_DISABLED(GPIOB_PIN4) | \
  556. PIN_LOCKR_DISABLED(GPIOB_PIN5) | \
  557. PIN_LOCKR_DISABLED(GPIOB_PIN6) | \
  558. PIN_LOCKR_DISABLED(GPIOB_PIN7) | \
  559. PIN_LOCKR_DISABLED(GPIOB_PIN8) | \
  560. PIN_LOCKR_DISABLED(GPIOB_PIN9) | \
  561. PIN_LOCKR_DISABLED(GPIOB_PIN10) | \
  562. PIN_LOCKR_DISABLED(GPIOB_PIN11) | \
  563. PIN_LOCKR_DISABLED(GPIOB_PIN12) | \
  564. PIN_LOCKR_DISABLED(GPIOB_PIN13) | \
  565. PIN_LOCKR_DISABLED(GPIOB_PIN14) | \
  566. PIN_LOCKR_DISABLED(GPIOB_PIN15))
  567. /*
  568. * GPIOC setup:
  569. *
  570. * PC0 - PIN0 (analog).
  571. * PC1 - PIN1 (analog).
  572. * PC2 - PIN2 (analog).
  573. * PC3 - PIN3 (analog).
  574. * PC4 - PIN4 (analog).
  575. * PC5 - PIN5 (analog).
  576. * PC6 - PIN6 (analog).
  577. * PC7 - PIN7 (analog).
  578. * PC8 - SDMMC_1_D0 (alternate 12).
  579. * PC9 - SDMMC_1_D1 (alternate 12).
  580. * PC10 - SDMMC_1_D2 (alternate 12).
  581. * PC11 - SDMMC_1_D3 (alternate 12).
  582. * PC12 - SDMMC_1_CK (alternate 12).
  583. * PC13 - JOY_SEL BUTTON (input floating).
  584. * PC14 - PIN14 (analog).
  585. * PC15 - PIN15 (analog).
  586. */
  587. #define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \
  588. PIN_MODE_ANALOG(GPIOC_PIN1) | \
  589. PIN_MODE_ANALOG(GPIOC_PIN2) | \
  590. PIN_MODE_ANALOG(GPIOC_PIN3) | \
  591. PIN_MODE_ANALOG(GPIOC_PIN4) | \
  592. PIN_MODE_ANALOG(GPIOC_PIN5) | \
  593. PIN_MODE_ANALOG(GPIOC_PIN6) | \
  594. PIN_MODE_ANALOG(GPIOC_PIN7) | \
  595. PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D0) | \
  596. PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D1) | \
  597. PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D2) | \
  598. PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_D3) | \
  599. PIN_MODE_ALTERNATE(GPIOC_SDMMC_1_CK) | \
  600. PIN_MODE_INPUT(GPIOC_JOY_SEL) | \
  601. PIN_MODE_ANALOG(GPIOC_PIN14) | \
  602. PIN_MODE_ANALOG(GPIOC_PIN15))
  603. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  604. PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
  605. PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
  606. PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
  607. PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
  608. PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
  609. PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
  610. PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
  611. PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D0) | \
  612. PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D1) | \
  613. PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D2) | \
  614. PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_D3) | \
  615. PIN_OTYPE_PUSHPULL(GPIOC_SDMMC_1_CK) | \
  616. PIN_OTYPE_PUSHPULL(GPIOC_JOY_SEL) | \
  617. PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
  618. PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
  619. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
  620. PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
  621. PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
  622. PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
  623. PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
  624. PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
  625. PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
  626. PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
  627. PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D0) | \
  628. PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D1) | \
  629. PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D2) | \
  630. PIN_OSPEED_HIGH(GPIOC_SDMMC_1_D3) | \
  631. PIN_OSPEED_HIGH(GPIOC_SDMMC_1_CK) | \
  632. PIN_OSPEED_VERYLOW(GPIOC_JOY_SEL) | \
  633. PIN_OSPEED_VERYLOW(GPIOC_PIN14) | \
  634. PIN_OSPEED_VERYLOW(GPIOC_PIN15))
  635. #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \
  636. PIN_PUPDR_FLOATING(GPIOC_PIN1) | \
  637. PIN_PUPDR_FLOATING(GPIOC_PIN2) | \
  638. PIN_PUPDR_FLOATING(GPIOC_PIN3) | \
  639. PIN_PUPDR_FLOATING(GPIOC_PIN4) | \
  640. PIN_PUPDR_FLOATING(GPIOC_PIN5) | \
  641. PIN_PUPDR_FLOATING(GPIOC_PIN6) | \
  642. PIN_PUPDR_FLOATING(GPIOC_PIN7) | \
  643. PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D0) | \
  644. PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D1) | \
  645. PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D2) | \
  646. PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_D3) | \
  647. PIN_PUPDR_FLOATING(GPIOC_SDMMC_1_CK) | \
  648. PIN_PUPDR_FLOATING(GPIOC_JOY_SEL) | \
  649. PIN_PUPDR_FLOATING(GPIOC_PIN14) | \
  650. PIN_PUPDR_FLOATING(GPIOC_PIN15))
  651. #define VAL_GPIOC_ODR (PIN_ODR_LOW(GPIOC_PIN0) | \
  652. PIN_ODR_LOW(GPIOC_PIN1) | \
  653. PIN_ODR_LOW(GPIOC_PIN2) | \
  654. PIN_ODR_LOW(GPIOC_PIN3) | \
  655. PIN_ODR_LOW(GPIOC_PIN4) | \
  656. PIN_ODR_LOW(GPIOC_PIN5) | \
  657. PIN_ODR_LOW(GPIOC_PIN6) | \
  658. PIN_ODR_LOW(GPIOC_PIN7) | \
  659. PIN_ODR_LOW(GPIOC_SDMMC_1_D0) | \
  660. PIN_ODR_LOW(GPIOC_SDMMC_1_D1) | \
  661. PIN_ODR_LOW(GPIOC_SDMMC_1_D2) | \
  662. PIN_ODR_LOW(GPIOC_SDMMC_1_D3) | \
  663. PIN_ODR_LOW(GPIOC_SDMMC_1_CK) | \
  664. PIN_ODR_LOW(GPIOC_JOY_SEL) | \
  665. PIN_ODR_LOW(GPIOC_PIN14) | \
  666. PIN_ODR_LOW(GPIOC_PIN15))
  667. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  668. PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
  669. PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
  670. PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
  671. PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
  672. PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
  673. PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
  674. PIN_AFIO_AF(GPIOC_PIN7, 0U))
  675. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_SDMMC_1_D0, 12U) | \
  676. PIN_AFIO_AF(GPIOC_SDMMC_1_D1, 12U) | \
  677. PIN_AFIO_AF(GPIOC_SDMMC_1_D2, 12U) | \
  678. PIN_AFIO_AF(GPIOC_SDMMC_1_D3, 12U) | \
  679. PIN_AFIO_AF(GPIOC_SDMMC_1_CK, 12U) | \
  680. PIN_AFIO_AF(GPIOC_JOY_SEL, 0U) | \
  681. PIN_AFIO_AF(GPIOC_PIN14, 0U) | \
  682. PIN_AFIO_AF(GPIOC_PIN15, 0U))
  683. #define VAL_GPIOC_ASCR (PIN_ASCR_DISABLED(GPIOC_PIN0) | \
  684. PIN_ASCR_DISABLED(GPIOC_PIN1) | \
  685. PIN_ASCR_DISABLED(GPIOC_PIN2) | \
  686. PIN_ASCR_DISABLED(GPIOC_PIN3) | \
  687. PIN_ASCR_DISABLED(GPIOC_PIN4) | \
  688. PIN_ASCR_DISABLED(GPIOC_PIN5) | \
  689. PIN_ASCR_DISABLED(GPIOC_PIN6) | \
  690. PIN_ASCR_DISABLED(GPIOC_PIN7) | \
  691. PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D0) | \
  692. PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D1) | \
  693. PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D2) | \
  694. PIN_ASCR_DISABLED(GPIOC_SDMMC_1_D3) | \
  695. PIN_ASCR_DISABLED(GPIOC_SDMMC_1_CK) | \
  696. PIN_ASCR_DISABLED(GPIOC_JOY_SEL) | \
  697. PIN_ASCR_DISABLED(GPIOC_PIN14) | \
  698. PIN_ASCR_DISABLED(GPIOC_PIN15))
  699. #define VAL_GPIOC_LOCKR (PIN_LOCKR_DISABLED(GPIOC_PIN0) | \
  700. PIN_LOCKR_DISABLED(GPIOC_PIN1) | \
  701. PIN_LOCKR_DISABLED(GPIOC_PIN2) | \
  702. PIN_LOCKR_DISABLED(GPIOC_PIN3) | \
  703. PIN_LOCKR_DISABLED(GPIOC_PIN4) | \
  704. PIN_LOCKR_DISABLED(GPIOC_PIN5) | \
  705. PIN_LOCKR_DISABLED(GPIOC_PIN6) | \
  706. PIN_LOCKR_DISABLED(GPIOC_PIN7) | \
  707. PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D0) | \
  708. PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D1) | \
  709. PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D2) | \
  710. PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_D3) | \
  711. PIN_LOCKR_DISABLED(GPIOC_SDMMC_1_CK) | \
  712. PIN_LOCKR_DISABLED(GPIOC_JOY_SEL) | \
  713. PIN_LOCKR_DISABLED(GPIOC_PIN14) | \
  714. PIN_LOCKR_DISABLED(GPIOC_PIN15))
  715. /*
  716. * GPIOD setup:
  717. *
  718. * PD0 - PIN0 (analog).
  719. * PD1 - PIN1 (analog).
  720. * PD2 - SDMMC_1_CMD (alternate 12).
  721. * PD3 - PIN3 (analog).
  722. * PD4 - PIN4 (analog).
  723. * PD5 - PIN5 (analog).
  724. * PD6 - PIN6 (analog).
  725. * PD7 - PIN7 (analog).
  726. * PD8 - PIN8 (analog).
  727. * PD9 - PIN9 (analog).
  728. * PD10 - PIN10 (analog).
  729. * PD11 - PIN11 (analog).
  730. * PD12 - PIN12 (analog).
  731. * PD13 - PIN13 (analog).
  732. * PD14 - PIN14 (analog).
  733. * PD15 - PIN15 (analog).
  734. */
  735. #define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \
  736. PIN_MODE_ANALOG(GPIOD_PIN1) | \
  737. PIN_MODE_ALTERNATE(GPIOD_SDMMC_1_CMD) |\
  738. PIN_MODE_ANALOG(GPIOD_PIN3) | \
  739. PIN_MODE_ANALOG(GPIOD_PIN4) | \
  740. PIN_MODE_ANALOG(GPIOD_PIN5) | \
  741. PIN_MODE_ANALOG(GPIOD_PIN6) | \
  742. PIN_MODE_ANALOG(GPIOD_PIN7) | \
  743. PIN_MODE_ANALOG(GPIOD_PIN8) | \
  744. PIN_MODE_ANALOG(GPIOD_PIN9) | \
  745. PIN_MODE_ANALOG(GPIOD_PIN10) | \
  746. PIN_MODE_ANALOG(GPIOD_PIN11) | \
  747. PIN_MODE_ANALOG(GPIOD_PIN12) | \
  748. PIN_MODE_ANALOG(GPIOD_PIN13) | \
  749. PIN_MODE_ANALOG(GPIOD_PIN14) | \
  750. PIN_MODE_ANALOG(GPIOD_PIN15))
  751. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  752. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  753. PIN_OTYPE_PUSHPULL(GPIOD_SDMMC_1_CMD) |\
  754. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  755. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  756. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  757. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  758. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  759. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  760. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  761. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  762. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  763. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  764. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  765. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  766. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  767. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
  768. PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
  769. PIN_OSPEED_HIGH(GPIOD_SDMMC_1_CMD) | \
  770. PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
  771. PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
  772. PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
  773. PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
  774. PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
  775. PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
  776. PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
  777. PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
  778. PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
  779. PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
  780. PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
  781. PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
  782. PIN_OSPEED_VERYLOW(GPIOD_PIN15))
  783. #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \
  784. PIN_PUPDR_FLOATING(GPIOD_PIN1) | \
  785. PIN_PUPDR_FLOATING(GPIOD_SDMMC_1_CMD) |\
  786. PIN_PUPDR_FLOATING(GPIOD_PIN3) | \
  787. PIN_PUPDR_FLOATING(GPIOD_PIN4) | \
  788. PIN_PUPDR_FLOATING(GPIOD_PIN5) | \
  789. PIN_PUPDR_FLOATING(GPIOD_PIN6) | \
  790. PIN_PUPDR_FLOATING(GPIOD_PIN7) | \
  791. PIN_PUPDR_FLOATING(GPIOD_PIN8) | \
  792. PIN_PUPDR_FLOATING(GPIOD_PIN9) | \
  793. PIN_PUPDR_FLOATING(GPIOD_PIN10) | \
  794. PIN_PUPDR_FLOATING(GPIOD_PIN11) | \
  795. PIN_PUPDR_FLOATING(GPIOD_PIN12) | \
  796. PIN_PUPDR_FLOATING(GPIOD_PIN13) | \
  797. PIN_PUPDR_FLOATING(GPIOD_PIN14) | \
  798. PIN_PUPDR_FLOATING(GPIOD_PIN15))
  799. #define VAL_GPIOD_ODR (PIN_ODR_LOW(GPIOD_PIN0) | \
  800. PIN_ODR_LOW(GPIOD_PIN1) | \
  801. PIN_ODR_LOW(GPIOD_SDMMC_1_CMD) | \
  802. PIN_ODR_LOW(GPIOD_PIN3) | \
  803. PIN_ODR_LOW(GPIOD_PIN4) | \
  804. PIN_ODR_LOW(GPIOD_PIN5) | \
  805. PIN_ODR_LOW(GPIOD_PIN6) | \
  806. PIN_ODR_LOW(GPIOD_PIN7) | \
  807. PIN_ODR_LOW(GPIOD_PIN8) | \
  808. PIN_ODR_LOW(GPIOD_PIN9) | \
  809. PIN_ODR_LOW(GPIOD_PIN10) | \
  810. PIN_ODR_LOW(GPIOD_PIN11) | \
  811. PIN_ODR_LOW(GPIOD_PIN12) | \
  812. PIN_ODR_LOW(GPIOD_PIN13) | \
  813. PIN_ODR_LOW(GPIOD_PIN14) | \
  814. PIN_ODR_LOW(GPIOD_PIN15))
  815. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
  816. PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
  817. PIN_AFIO_AF(GPIOD_SDMMC_1_CMD, 12U) | \
  818. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  819. PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
  820. PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
  821. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  822. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  823. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
  824. PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
  825. PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
  826. PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
  827. PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
  828. PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
  829. PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
  830. PIN_AFIO_AF(GPIOD_PIN15, 0U))
  831. #define VAL_GPIOD_ASCR (PIN_ASCR_DISABLED(GPIOD_PIN0) | \
  832. PIN_ASCR_DISABLED(GPIOD_PIN1) | \
  833. PIN_ASCR_DISABLED(GPIOD_SDMMC_1_CMD) | \
  834. PIN_ASCR_DISABLED(GPIOD_PIN3) | \
  835. PIN_ASCR_DISABLED(GPIOD_PIN4) | \
  836. PIN_ASCR_DISABLED(GPIOD_PIN5) | \
  837. PIN_ASCR_DISABLED(GPIOD_PIN6) | \
  838. PIN_ASCR_DISABLED(GPIOD_PIN7) | \
  839. PIN_ASCR_DISABLED(GPIOD_PIN8) | \
  840. PIN_ASCR_DISABLED(GPIOD_PIN9) | \
  841. PIN_ASCR_DISABLED(GPIOD_PIN10) | \
  842. PIN_ASCR_DISABLED(GPIOD_PIN11) | \
  843. PIN_ASCR_DISABLED(GPIOD_PIN12) | \
  844. PIN_ASCR_DISABLED(GPIOD_PIN13) | \
  845. PIN_ASCR_DISABLED(GPIOD_PIN14) | \
  846. PIN_ASCR_DISABLED(GPIOD_PIN15))
  847. #define VAL_GPIOD_LOCKR (PIN_LOCKR_DISABLED(GPIOD_PIN0) | \
  848. PIN_LOCKR_DISABLED(GPIOD_PIN1) | \
  849. PIN_LOCKR_DISABLED(GPIOD_SDMMC_1_CMD) |\
  850. PIN_LOCKR_DISABLED(GPIOD_PIN3) | \
  851. PIN_LOCKR_DISABLED(GPIOD_PIN4) | \
  852. PIN_LOCKR_DISABLED(GPIOD_PIN5) | \
  853. PIN_LOCKR_DISABLED(GPIOD_PIN6) | \
  854. PIN_LOCKR_DISABLED(GPIOD_PIN7) | \
  855. PIN_LOCKR_DISABLED(GPIOD_PIN8) | \
  856. PIN_LOCKR_DISABLED(GPIOD_PIN9) | \
  857. PIN_LOCKR_DISABLED(GPIOD_PIN10) | \
  858. PIN_LOCKR_DISABLED(GPIOD_PIN11) | \
  859. PIN_LOCKR_DISABLED(GPIOD_PIN12) | \
  860. PIN_LOCKR_DISABLED(GPIOD_PIN13) | \
  861. PIN_LOCKR_DISABLED(GPIOD_PIN14) | \
  862. PIN_LOCKR_DISABLED(GPIOD_PIN15))
  863. /*
  864. * GPIOE setup:
  865. *
  866. * PE0 - PIN0 (analog).
  867. * PE1 - PIN1 (analog).
  868. * PE2 - PIN2 (analog).
  869. * PE3 - PIN3 (analog).
  870. * PE4 - PIN4 (analog).
  871. * PE5 - PIN5 (analog).
  872. * PE6 - PIN6 (analog).
  873. * PE7 - PIN7 (analog).
  874. * PE8 - PIN8 (analog).
  875. * PE9 - PIN9 (analog).
  876. * PE10 - PIN10 (analog).
  877. * PE11 - PIN11 (analog).
  878. * PE12 - PIN12 (analog).
  879. * PE13 - PIN13 (analog).
  880. * PE14 - PIN14 (analog).
  881. * PE15 - PIN15 (analog).
  882. */
  883. #define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \
  884. PIN_MODE_ANALOG(GPIOE_PIN1) | \
  885. PIN_MODE_ANALOG(GPIOE_PIN2) | \
  886. PIN_MODE_ANALOG(GPIOE_PIN3) | \
  887. PIN_MODE_ANALOG(GPIOE_PIN4) | \
  888. PIN_MODE_ANALOG(GPIOE_PIN5) | \
  889. PIN_MODE_ANALOG(GPIOE_PIN6) | \
  890. PIN_MODE_ANALOG(GPIOE_PIN7) | \
  891. PIN_MODE_ANALOG(GPIOE_PIN8) | \
  892. PIN_MODE_ANALOG(GPIOE_PIN9) | \
  893. PIN_MODE_ANALOG(GPIOE_PIN10) | \
  894. PIN_MODE_ANALOG(GPIOE_PIN11) | \
  895. PIN_MODE_ANALOG(GPIOE_PIN12) | \
  896. PIN_MODE_ANALOG(GPIOE_PIN13) | \
  897. PIN_MODE_ANALOG(GPIOE_PIN14) | \
  898. PIN_MODE_ANALOG(GPIOE_PIN15))
  899. #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
  900. PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
  901. PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
  902. PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
  903. PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
  904. PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
  905. PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
  906. PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
  907. PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
  908. PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
  909. PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
  910. PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
  911. PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
  912. PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
  913. PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
  914. PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
  915. #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
  916. PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
  917. PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
  918. PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
  919. PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
  920. PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
  921. PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
  922. PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
  923. PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
  924. PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
  925. PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
  926. PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
  927. PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
  928. PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
  929. PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
  930. PIN_OSPEED_VERYLOW(GPIOE_PIN15))
  931. #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \
  932. PIN_PUPDR_FLOATING(GPIOE_PIN1) | \
  933. PIN_PUPDR_FLOATING(GPIOE_PIN2) | \
  934. PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
  935. PIN_PUPDR_FLOATING(GPIOE_PIN4) | \
  936. PIN_PUPDR_FLOATING(GPIOE_PIN5) | \
  937. PIN_PUPDR_FLOATING(GPIOE_PIN6) | \
  938. PIN_PUPDR_FLOATING(GPIOE_PIN7) | \
  939. PIN_PUPDR_FLOATING(GPIOE_PIN8) | \
  940. PIN_PUPDR_FLOATING(GPIOE_PIN9) | \
  941. PIN_PUPDR_FLOATING(GPIOE_PIN10) | \
  942. PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
  943. PIN_PUPDR_FLOATING(GPIOE_PIN12) | \
  944. PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
  945. PIN_PUPDR_FLOATING(GPIOE_PIN14) | \
  946. PIN_PUPDR_FLOATING(GPIOE_PIN15))
  947. #define VAL_GPIOE_ODR (PIN_ODR_LOW(GPIOE_PIN0) | \
  948. PIN_ODR_LOW(GPIOE_PIN1) | \
  949. PIN_ODR_LOW(GPIOE_PIN2) | \
  950. PIN_ODR_LOW(GPIOE_PIN3) | \
  951. PIN_ODR_LOW(GPIOE_PIN4) | \
  952. PIN_ODR_LOW(GPIOE_PIN5) | \
  953. PIN_ODR_LOW(GPIOE_PIN6) | \
  954. PIN_ODR_LOW(GPIOE_PIN7) | \
  955. PIN_ODR_LOW(GPIOE_PIN8) | \
  956. PIN_ODR_LOW(GPIOE_PIN9) | \
  957. PIN_ODR_LOW(GPIOE_PIN10) | \
  958. PIN_ODR_LOW(GPIOE_PIN11) | \
  959. PIN_ODR_LOW(GPIOE_PIN12) | \
  960. PIN_ODR_LOW(GPIOE_PIN13) | \
  961. PIN_ODR_LOW(GPIOE_PIN14) | \
  962. PIN_ODR_LOW(GPIOE_PIN15))
  963. #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
  964. PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
  965. PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
  966. PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
  967. PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
  968. PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
  969. PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
  970. PIN_AFIO_AF(GPIOE_PIN7, 0U))
  971. #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
  972. PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
  973. PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
  974. PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
  975. PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
  976. PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
  977. PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
  978. PIN_AFIO_AF(GPIOE_PIN15, 0U))
  979. #define VAL_GPIOE_ASCR (PIN_ASCR_DISABLED(GPIOE_PIN0) | \
  980. PIN_ASCR_DISABLED(GPIOE_PIN1) | \
  981. PIN_ASCR_DISABLED(GPIOE_PIN2) | \
  982. PIN_ASCR_DISABLED(GPIOE_PIN3) | \
  983. PIN_ASCR_DISABLED(GPIOE_PIN4) | \
  984. PIN_ASCR_DISABLED(GPIOE_PIN5) | \
  985. PIN_ASCR_DISABLED(GPIOE_PIN6) | \
  986. PIN_ASCR_DISABLED(GPIOE_PIN7) | \
  987. PIN_ASCR_DISABLED(GPIOE_PIN8) | \
  988. PIN_ASCR_DISABLED(GPIOE_PIN9) | \
  989. PIN_ASCR_DISABLED(GPIOE_PIN10) | \
  990. PIN_ASCR_DISABLED(GPIOE_PIN11) | \
  991. PIN_ASCR_DISABLED(GPIOE_PIN12) | \
  992. PIN_ASCR_DISABLED(GPIOE_PIN13) | \
  993. PIN_ASCR_DISABLED(GPIOE_PIN14) | \
  994. PIN_ASCR_DISABLED(GPIOE_PIN15))
  995. #define VAL_GPIOE_LOCKR (PIN_LOCKR_DISABLED(GPIOE_PIN0) | \
  996. PIN_LOCKR_DISABLED(GPIOE_PIN1) | \
  997. PIN_LOCKR_DISABLED(GPIOE_PIN2) | \
  998. PIN_LOCKR_DISABLED(GPIOE_PIN3) | \
  999. PIN_LOCKR_DISABLED(GPIOE_PIN4) | \
  1000. PIN_LOCKR_DISABLED(GPIOE_PIN5) | \
  1001. PIN_LOCKR_DISABLED(GPIOE_PIN6) | \
  1002. PIN_LOCKR_DISABLED(GPIOE_PIN7) | \
  1003. PIN_LOCKR_DISABLED(GPIOE_PIN8) | \
  1004. PIN_LOCKR_DISABLED(GPIOE_PIN9) | \
  1005. PIN_LOCKR_DISABLED(GPIOE_PIN10) | \
  1006. PIN_LOCKR_DISABLED(GPIOE_PIN11) | \
  1007. PIN_LOCKR_DISABLED(GPIOE_PIN12) | \
  1008. PIN_LOCKR_DISABLED(GPIOE_PIN13) | \
  1009. PIN_LOCKR_DISABLED(GPIOE_PIN14) | \
  1010. PIN_LOCKR_DISABLED(GPIOE_PIN15))
  1011. /*
  1012. * GPIOF setup:
  1013. *
  1014. * PF0 - PIN0 (analog).
  1015. * PF1 - PIN1 (analog).
  1016. * PF2 - PIN2 (analog).
  1017. * PF3 - PIN3 (analog).
  1018. * PF4 - PIN4 (analog).
  1019. * PF5 - PIN5 (analog).
  1020. * PF6 - PIN6 (analog).
  1021. * PF7 - PIN7 (analog).
  1022. * PF8 - PIN8 (analog).
  1023. * PF9 - PIN9 (analog).
  1024. * PF10 - PIN10 (analog).
  1025. * PF11 - PIN11 (analog).
  1026. * PF12 - PIN12 (analog).
  1027. * PF13 - PIN13 (analog).
  1028. * PF14 - PIN14 (analog).
  1029. * PF15 - PIN15 (analog).
  1030. */
  1031. #define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_PIN0) | \
  1032. PIN_MODE_ANALOG(GPIOF_PIN1) | \
  1033. PIN_MODE_ANALOG(GPIOF_PIN2) | \
  1034. PIN_MODE_ANALOG(GPIOF_PIN3) | \
  1035. PIN_MODE_ANALOG(GPIOF_PIN4) | \
  1036. PIN_MODE_ANALOG(GPIOF_PIN5) | \
  1037. PIN_MODE_ANALOG(GPIOF_PIN6) | \
  1038. PIN_MODE_ANALOG(GPIOF_PIN7) | \
  1039. PIN_MODE_ANALOG(GPIOF_PIN8) | \
  1040. PIN_MODE_ANALOG(GPIOF_PIN9) | \
  1041. PIN_MODE_ANALOG(GPIOF_PIN10) | \
  1042. PIN_MODE_ANALOG(GPIOF_PIN11) | \
  1043. PIN_MODE_ANALOG(GPIOF_PIN12) | \
  1044. PIN_MODE_ANALOG(GPIOF_PIN13) | \
  1045. PIN_MODE_ANALOG(GPIOF_PIN14) | \
  1046. PIN_MODE_ANALOG(GPIOF_PIN15))
  1047. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \
  1048. PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \
  1049. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  1050. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  1051. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  1052. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  1053. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  1054. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  1055. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  1056. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  1057. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  1058. PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
  1059. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  1060. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  1061. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  1062. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  1063. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \
  1064. PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \
  1065. PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
  1066. PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
  1067. PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
  1068. PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
  1069. PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
  1070. PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
  1071. PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
  1072. PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
  1073. PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
  1074. PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
  1075. PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
  1076. PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
  1077. PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
  1078. PIN_OSPEED_VERYLOW(GPIOF_PIN15))
  1079. #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \
  1080. PIN_PUPDR_FLOATING(GPIOF_PIN1) | \
  1081. PIN_PUPDR_FLOATING(GPIOF_PIN2) | \
  1082. PIN_PUPDR_FLOATING(GPIOF_PIN3) | \
  1083. PIN_PUPDR_FLOATING(GPIOF_PIN4) | \
  1084. PIN_PUPDR_FLOATING(GPIOF_PIN5) | \
  1085. PIN_PUPDR_FLOATING(GPIOF_PIN6) | \
  1086. PIN_PUPDR_FLOATING(GPIOF_PIN7) | \
  1087. PIN_PUPDR_FLOATING(GPIOF_PIN8) | \
  1088. PIN_PUPDR_FLOATING(GPIOF_PIN9) | \
  1089. PIN_PUPDR_FLOATING(GPIOF_PIN10) | \
  1090. PIN_PUPDR_FLOATING(GPIOF_PIN11) | \
  1091. PIN_PUPDR_FLOATING(GPIOF_PIN12) | \
  1092. PIN_PUPDR_FLOATING(GPIOF_PIN13) | \
  1093. PIN_PUPDR_FLOATING(GPIOF_PIN14) | \
  1094. PIN_PUPDR_FLOATING(GPIOF_PIN15))
  1095. #define VAL_GPIOF_ODR (PIN_ODR_LOW(GPIOF_PIN0) | \
  1096. PIN_ODR_LOW(GPIOF_PIN1) | \
  1097. PIN_ODR_LOW(GPIOF_PIN2) | \
  1098. PIN_ODR_LOW(GPIOF_PIN3) | \
  1099. PIN_ODR_LOW(GPIOF_PIN4) | \
  1100. PIN_ODR_LOW(GPIOF_PIN5) | \
  1101. PIN_ODR_LOW(GPIOF_PIN6) | \
  1102. PIN_ODR_LOW(GPIOF_PIN7) | \
  1103. PIN_ODR_LOW(GPIOF_PIN8) | \
  1104. PIN_ODR_LOW(GPIOF_PIN9) | \
  1105. PIN_ODR_LOW(GPIOF_PIN10) | \
  1106. PIN_ODR_LOW(GPIOF_PIN11) | \
  1107. PIN_ODR_LOW(GPIOF_PIN12) | \
  1108. PIN_ODR_LOW(GPIOF_PIN13) | \
  1109. PIN_ODR_LOW(GPIOF_PIN14) | \
  1110. PIN_ODR_LOW(GPIOF_PIN15))
  1111. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \
  1112. PIN_AFIO_AF(GPIOF_PIN1, 0U) | \
  1113. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  1114. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  1115. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  1116. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  1117. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  1118. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  1119. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  1120. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  1121. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  1122. PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
  1123. PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
  1124. PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
  1125. PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
  1126. PIN_AFIO_AF(GPIOF_PIN15, 0U))
  1127. #define VAL_GPIOF_ASCR (PIN_ASCR_DISABLED(GPIOF_PIN0) | \
  1128. PIN_ASCR_DISABLED(GPIOF_PIN1) | \
  1129. PIN_ASCR_DISABLED(GPIOF_PIN2) | \
  1130. PIN_ASCR_DISABLED(GPIOF_PIN3) | \
  1131. PIN_ASCR_DISABLED(GPIOF_PIN4) | \
  1132. PIN_ASCR_DISABLED(GPIOF_PIN5) | \
  1133. PIN_ASCR_DISABLED(GPIOF_PIN6) | \
  1134. PIN_ASCR_DISABLED(GPIOF_PIN7) | \
  1135. PIN_ASCR_DISABLED(GPIOF_PIN8) | \
  1136. PIN_ASCR_DISABLED(GPIOF_PIN9) | \
  1137. PIN_ASCR_DISABLED(GPIOF_PIN10) | \
  1138. PIN_ASCR_DISABLED(GPIOF_PIN11) | \
  1139. PIN_ASCR_DISABLED(GPIOF_PIN12) | \
  1140. PIN_ASCR_DISABLED(GPIOF_PIN13) | \
  1141. PIN_ASCR_DISABLED(GPIOF_PIN14) | \
  1142. PIN_ASCR_DISABLED(GPIOF_PIN15))
  1143. #define VAL_GPIOF_LOCKR (PIN_LOCKR_DISABLED(GPIOF_PIN0) | \
  1144. PIN_LOCKR_DISABLED(GPIOF_PIN1) | \
  1145. PIN_LOCKR_DISABLED(GPIOF_PIN2) | \
  1146. PIN_LOCKR_DISABLED(GPIOF_PIN3) | \
  1147. PIN_LOCKR_DISABLED(GPIOF_PIN4) | \
  1148. PIN_LOCKR_DISABLED(GPIOF_PIN5) | \
  1149. PIN_LOCKR_DISABLED(GPIOF_PIN6) | \
  1150. PIN_LOCKR_DISABLED(GPIOF_PIN7) | \
  1151. PIN_LOCKR_DISABLED(GPIOF_PIN8) | \
  1152. PIN_LOCKR_DISABLED(GPIOF_PIN9) | \
  1153. PIN_LOCKR_DISABLED(GPIOF_PIN10) | \
  1154. PIN_LOCKR_DISABLED(GPIOF_PIN11) | \
  1155. PIN_LOCKR_DISABLED(GPIOF_PIN12) | \
  1156. PIN_LOCKR_DISABLED(GPIOF_PIN13) | \
  1157. PIN_LOCKR_DISABLED(GPIOF_PIN14) | \
  1158. PIN_LOCKR_DISABLED(GPIOF_PIN15))
  1159. /*
  1160. * GPIOG setup:
  1161. *
  1162. * PG0 - PIN0 (analog).
  1163. * PG1 - PIN1 (analog).
  1164. * PG2 - PIN2 (analog).
  1165. * PG3 - PIN3 (analog).
  1166. * PG4 - PIN4 (analog).
  1167. * PG5 - PIN5 (analog).
  1168. * PG6 - PIN6 (analog).
  1169. * PG7 - PIN7 (analog).
  1170. * PG8 - PIN8 (analog).
  1171. * PG9 - OCTOSPIM_P2_IO6 (alternate 5).
  1172. * PG10 - OCTOSPIM_P2_IO7 (alternate 5).
  1173. * PG11 - PIN11 (analog).
  1174. * PG12 - OCTOSPIM_P2_NCS (alternate 5).
  1175. * PG13 - PIN13 (analog).
  1176. * PG14 - PIN14 (analog).
  1177. * PG15 - OCTOSPIM_P2_DQS (alternate 5).
  1178. */
  1179. #define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \
  1180. PIN_MODE_ANALOG(GPIOG_PIN1) | \
  1181. PIN_MODE_ANALOG(GPIOG_PIN2) | \
  1182. PIN_MODE_ANALOG(GPIOG_PIN3) | \
  1183. PIN_MODE_ANALOG(GPIOG_PIN4) | \
  1184. PIN_MODE_ANALOG(GPIOG_PIN5) | \
  1185. PIN_MODE_ANALOG(GPIOG_PIN6) | \
  1186. PIN_MODE_ANALOG(GPIOG_PIN7) | \
  1187. PIN_MODE_ANALOG(GPIOG_PIN8) | \
  1188. PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_IO6) |\
  1189. PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_IO7) |\
  1190. PIN_MODE_ANALOG(GPIOG_PIN11) | \
  1191. PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_NCS) |\
  1192. PIN_MODE_ANALOG(GPIOG_PIN13) | \
  1193. PIN_MODE_ANALOG(GPIOG_PIN14) | \
  1194. PIN_MODE_ALTERNATE(GPIOG_OCTOSPIM_P2_DQS))
  1195. #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
  1196. PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
  1197. PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
  1198. PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
  1199. PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
  1200. PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
  1201. PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
  1202. PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
  1203. PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
  1204. PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_IO6) |\
  1205. PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_IO7) |\
  1206. PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
  1207. PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_NCS) |\
  1208. PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
  1209. PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
  1210. PIN_OTYPE_PUSHPULL(GPIOG_OCTOSPIM_P2_DQS))
  1211. #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
  1212. PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
  1213. PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
  1214. PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
  1215. PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
  1216. PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
  1217. PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
  1218. PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
  1219. PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
  1220. PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_IO6) |\
  1221. PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_IO7) |\
  1222. PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
  1223. PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_NCS) |\
  1224. PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
  1225. PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
  1226. PIN_OSPEED_HIGH(GPIOG_OCTOSPIM_P2_DQS))
  1227. #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \
  1228. PIN_PUPDR_FLOATING(GPIOG_PIN1) | \
  1229. PIN_PUPDR_FLOATING(GPIOG_PIN2) | \
  1230. PIN_PUPDR_FLOATING(GPIOG_PIN3) | \
  1231. PIN_PUPDR_FLOATING(GPIOG_PIN4) | \
  1232. PIN_PUPDR_FLOATING(GPIOG_PIN5) | \
  1233. PIN_PUPDR_FLOATING(GPIOG_PIN6) | \
  1234. PIN_PUPDR_FLOATING(GPIOG_PIN7) | \
  1235. PIN_PUPDR_FLOATING(GPIOG_PIN8) | \
  1236. PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_IO6) |\
  1237. PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_IO7) |\
  1238. PIN_PUPDR_FLOATING(GPIOG_PIN11) | \
  1239. PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_NCS) |\
  1240. PIN_PUPDR_FLOATING(GPIOG_PIN13) | \
  1241. PIN_PUPDR_FLOATING(GPIOG_PIN14) | \
  1242. PIN_PUPDR_FLOATING(GPIOG_OCTOSPIM_P2_DQS))
  1243. #define VAL_GPIOG_ODR (PIN_ODR_LOW(GPIOG_PIN0) | \
  1244. PIN_ODR_LOW(GPIOG_PIN1) | \
  1245. PIN_ODR_LOW(GPIOG_PIN2) | \
  1246. PIN_ODR_LOW(GPIOG_PIN3) | \
  1247. PIN_ODR_LOW(GPIOG_PIN4) | \
  1248. PIN_ODR_LOW(GPIOG_PIN5) | \
  1249. PIN_ODR_LOW(GPIOG_PIN6) | \
  1250. PIN_ODR_LOW(GPIOG_PIN7) | \
  1251. PIN_ODR_LOW(GPIOG_PIN8) | \
  1252. PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_IO6) | \
  1253. PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_IO7) | \
  1254. PIN_ODR_LOW(GPIOG_PIN11) | \
  1255. PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_NCS) | \
  1256. PIN_ODR_LOW(GPIOG_PIN13) | \
  1257. PIN_ODR_LOW(GPIOG_PIN14) | \
  1258. PIN_ODR_LOW(GPIOG_OCTOSPIM_P2_DQS))
  1259. #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
  1260. PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
  1261. PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
  1262. PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
  1263. PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
  1264. PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
  1265. PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
  1266. PIN_AFIO_AF(GPIOG_PIN7, 8U))
  1267. #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 8U) | \
  1268. PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_IO6, 5U) |\
  1269. PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_IO7, 5U) |\
  1270. PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
  1271. PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_NCS, 5U) |\
  1272. PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
  1273. PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
  1274. PIN_AFIO_AF(GPIOG_OCTOSPIM_P2_DQS, 5U))
  1275. #define VAL_GPIOG_ASCR (PIN_ASCR_DISABLED(GPIOG_PIN0) | \
  1276. PIN_ASCR_DISABLED(GPIOG_PIN1) | \
  1277. PIN_ASCR_DISABLED(GPIOG_PIN2) | \
  1278. PIN_ASCR_DISABLED(GPIOG_PIN3) | \
  1279. PIN_ASCR_DISABLED(GPIOG_PIN4) | \
  1280. PIN_ASCR_DISABLED(GPIOG_PIN5) | \
  1281. PIN_ASCR_DISABLED(GPIOG_PIN6) | \
  1282. PIN_ASCR_DISABLED(GPIOG_PIN7) | \
  1283. PIN_ASCR_DISABLED(GPIOG_PIN8) | \
  1284. PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_IO6) |\
  1285. PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_IO7) |\
  1286. PIN_ASCR_DISABLED(GPIOG_PIN11) | \
  1287. PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_NCS) |\
  1288. PIN_ASCR_DISABLED(GPIOG_PIN13) | \
  1289. PIN_ASCR_DISABLED(GPIOG_PIN14) | \
  1290. PIN_ASCR_DISABLED(GPIOG_OCTOSPIM_P2_DQS))
  1291. #define VAL_GPIOG_LOCKR (PIN_LOCKR_DISABLED(GPIOG_PIN0) | \
  1292. PIN_LOCKR_DISABLED(GPIOG_PIN1) | \
  1293. PIN_LOCKR_DISABLED(GPIOG_PIN2) | \
  1294. PIN_LOCKR_DISABLED(GPIOG_PIN3) | \
  1295. PIN_LOCKR_DISABLED(GPIOG_PIN4) | \
  1296. PIN_LOCKR_DISABLED(GPIOG_PIN5) | \
  1297. PIN_LOCKR_DISABLED(GPIOG_PIN6) | \
  1298. PIN_LOCKR_DISABLED(GPIOG_PIN7) | \
  1299. PIN_LOCKR_DISABLED(GPIOG_PIN8) | \
  1300. PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_IO6) |\
  1301. PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_IO7) |\
  1302. PIN_LOCKR_DISABLED(GPIOG_PIN11) | \
  1303. PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_NCS) |\
  1304. PIN_LOCKR_DISABLED(GPIOG_PIN13) | \
  1305. PIN_LOCKR_DISABLED(GPIOG_PIN14) | \
  1306. PIN_LOCKR_DISABLED(GPIOG_OCTOSPIM_P2_DQS))
  1307. /*
  1308. * GPIOH setup:
  1309. *
  1310. * PH0 - OSC_IN (analog).
  1311. * PH1 - OSC_OUT (analog).
  1312. * PH2 - PIN2 (analog).
  1313. * PH3 - BOOT0 (input floating).
  1314. * PH4 - LED LED_GREEN (output pushpull maximum).
  1315. * PH5 - PIN5 (analog).
  1316. * PH6 - PIN6 (analog).
  1317. * PH7 - PIN7 (analog).
  1318. * PH8 - OCTOSPIM_P2_IO3 (alternate 5).
  1319. * PH9 - OCTOSPIM_P2_IO4 (alternate 5).
  1320. * PH10 - OCTOSPIM_P2_IO5 (alternate 5).
  1321. * PH11 - PIN11 (analog).
  1322. * PH12 - PIN12 (analog).
  1323. * PH13 - PIN13 (analog).
  1324. * PH14 - PIN14 (analog).
  1325. * PH15 - PIN15 (analog).
  1326. */
  1327. #define VAL_GPIOH_MODER (PIN_MODE_ANALOG(GPIOH_OSC_IN) | \
  1328. PIN_MODE_ANALOG(GPIOH_OSC_OUT) | \
  1329. PIN_MODE_ANALOG(GPIOH_PIN2) | \
  1330. PIN_MODE_INPUT(GPIOH_BOOT0) | \
  1331. PIN_MODE_OUTPUT(GPIOH_LED) | \
  1332. PIN_MODE_ANALOG(GPIOH_PIN5) | \
  1333. PIN_MODE_ANALOG(GPIOH_PIN6) | \
  1334. PIN_MODE_ANALOG(GPIOH_PIN7) | \
  1335. PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO3) |\
  1336. PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO4) |\
  1337. PIN_MODE_ALTERNATE(GPIOH_OCTOSPIM_P2_IO5) |\
  1338. PIN_MODE_ANALOG(GPIOH_PIN11) | \
  1339. PIN_MODE_ANALOG(GPIOH_PIN12) | \
  1340. PIN_MODE_ANALOG(GPIOH_PIN13) | \
  1341. PIN_MODE_ANALOG(GPIOH_PIN14) | \
  1342. PIN_MODE_ANALOG(GPIOH_PIN15))
  1343. #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \
  1344. PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \
  1345. PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
  1346. PIN_OTYPE_PUSHPULL(GPIOH_BOOT0) | \
  1347. PIN_OTYPE_PUSHPULL(GPIOH_LED) | \
  1348. PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
  1349. PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
  1350. PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
  1351. PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO3) |\
  1352. PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO4) |\
  1353. PIN_OTYPE_PUSHPULL(GPIOH_OCTOSPIM_P2_IO5) |\
  1354. PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
  1355. PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
  1356. PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
  1357. PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
  1358. PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
  1359. #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_OSC_IN) | \
  1360. PIN_OSPEED_VERYLOW(GPIOH_OSC_OUT) | \
  1361. PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
  1362. PIN_OSPEED_VERYLOW(GPIOH_BOOT0) | \
  1363. PIN_OSPEED_HIGH(GPIOH_LED) | \
  1364. PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
  1365. PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
  1366. PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
  1367. PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO3) |\
  1368. PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO4) |\
  1369. PIN_OSPEED_HIGH(GPIOH_OCTOSPIM_P2_IO5) |\
  1370. PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
  1371. PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
  1372. PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
  1373. PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
  1374. PIN_OSPEED_VERYLOW(GPIOH_PIN15))
  1375. #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \
  1376. PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \
  1377. PIN_PUPDR_FLOATING(GPIOH_PIN2) | \
  1378. PIN_PUPDR_FLOATING(GPIOH_BOOT0) | \
  1379. PIN_PUPDR_FLOATING(GPIOH_LED) | \
  1380. PIN_PUPDR_FLOATING(GPIOH_PIN5) | \
  1381. PIN_PUPDR_FLOATING(GPIOH_PIN6) | \
  1382. PIN_PUPDR_FLOATING(GPIOH_PIN7) | \
  1383. PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO3) |\
  1384. PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO4) |\
  1385. PIN_PUPDR_FLOATING(GPIOH_OCTOSPIM_P2_IO5) |\
  1386. PIN_PUPDR_FLOATING(GPIOH_PIN11) | \
  1387. PIN_PUPDR_FLOATING(GPIOH_PIN12) | \
  1388. PIN_PUPDR_FLOATING(GPIOH_PIN13) | \
  1389. PIN_PUPDR_FLOATING(GPIOH_PIN14) | \
  1390. PIN_PUPDR_FLOATING(GPIOH_PIN15))
  1391. #define VAL_GPIOH_ODR (PIN_ODR_LOW(GPIOH_OSC_IN) | \
  1392. PIN_ODR_LOW(GPIOH_OSC_OUT) | \
  1393. PIN_ODR_LOW(GPIOH_PIN2) | \
  1394. PIN_ODR_LOW(GPIOH_BOOT0) | \
  1395. PIN_ODR_HIGH(GPIOH_LED) | \
  1396. PIN_ODR_LOW(GPIOH_PIN5) | \
  1397. PIN_ODR_LOW(GPIOH_PIN6) | \
  1398. PIN_ODR_LOW(GPIOH_PIN7) | \
  1399. PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO3) | \
  1400. PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO4) | \
  1401. PIN_ODR_LOW(GPIOH_OCTOSPIM_P2_IO5) | \
  1402. PIN_ODR_LOW(GPIOH_PIN11) | \
  1403. PIN_ODR_LOW(GPIOH_PIN12) | \
  1404. PIN_ODR_LOW(GPIOH_PIN13) | \
  1405. PIN_ODR_LOW(GPIOH_PIN14) | \
  1406. PIN_ODR_LOW(GPIOH_PIN15))
  1407. #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \
  1408. PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \
  1409. PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
  1410. PIN_AFIO_AF(GPIOH_BOOT0, 0U) | \
  1411. PIN_AFIO_AF(GPIOH_LED, 0U) | \
  1412. PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
  1413. PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
  1414. PIN_AFIO_AF(GPIOH_PIN7, 0U))
  1415. #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO3, 5U) |\
  1416. PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO4, 5U) |\
  1417. PIN_AFIO_AF(GPIOH_OCTOSPIM_P2_IO5, 5U) |\
  1418. PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
  1419. PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
  1420. PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
  1421. PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
  1422. PIN_AFIO_AF(GPIOH_PIN15, 0U))
  1423. #define VAL_GPIOH_ASCR (PIN_ASCR_DISABLED(GPIOH_OSC_IN) | \
  1424. PIN_ASCR_DISABLED(GPIOH_OSC_OUT) | \
  1425. PIN_ASCR_DISABLED(GPIOH_PIN2) | \
  1426. PIN_ASCR_DISABLED(GPIOH_BOOT0) | \
  1427. PIN_ASCR_DISABLED(GPIOH_LED) | \
  1428. PIN_ASCR_DISABLED(GPIOH_PIN5) | \
  1429. PIN_ASCR_DISABLED(GPIOH_PIN6) | \
  1430. PIN_ASCR_DISABLED(GPIOH_PIN7) | \
  1431. PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO3) |\
  1432. PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO4) |\
  1433. PIN_ASCR_DISABLED(GPIOH_OCTOSPIM_P2_IO5) |\
  1434. PIN_ASCR_DISABLED(GPIOH_PIN11) | \
  1435. PIN_ASCR_DISABLED(GPIOH_PIN12) | \
  1436. PIN_ASCR_DISABLED(GPIOH_PIN13) | \
  1437. PIN_ASCR_DISABLED(GPIOH_PIN14) | \
  1438. PIN_ASCR_DISABLED(GPIOH_PIN15))
  1439. #define VAL_GPIOH_LOCKR (PIN_LOCKR_DISABLED(GPIOH_OSC_IN) | \
  1440. PIN_LOCKR_DISABLED(GPIOH_OSC_OUT) | \
  1441. PIN_LOCKR_DISABLED(GPIOH_PIN2) | \
  1442. PIN_LOCKR_DISABLED(GPIOH_BOOT0) | \
  1443. PIN_LOCKR_DISABLED(GPIOH_LED) | \
  1444. PIN_LOCKR_DISABLED(GPIOH_PIN5) | \
  1445. PIN_LOCKR_DISABLED(GPIOH_PIN6) | \
  1446. PIN_LOCKR_DISABLED(GPIOH_PIN7) | \
  1447. PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO3) |\
  1448. PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO4) |\
  1449. PIN_LOCKR_DISABLED(GPIOH_OCTOSPIM_P2_IO5) |\
  1450. PIN_LOCKR_DISABLED(GPIOH_PIN11) | \
  1451. PIN_LOCKR_DISABLED(GPIOH_PIN12) | \
  1452. PIN_LOCKR_DISABLED(GPIOH_PIN13) | \
  1453. PIN_LOCKR_DISABLED(GPIOH_PIN14) | \
  1454. PIN_LOCKR_DISABLED(GPIOH_PIN15))
  1455. /*
  1456. * GPIOI setup:
  1457. *
  1458. * PI0 - PIN0 (analog).
  1459. * PI1 - PIN1 (analog).
  1460. * PI2 - PIN2 (analog).
  1461. * PI3 - PIN3 (analog).
  1462. * PI4 - PIN4 (analog).
  1463. * PI5 - PIN5 (analog).
  1464. * PI6 - OCTOSPIM_P2_CLK (alternate 5).
  1465. * PI7 - PIN7 (analog).
  1466. * PI8 - PIN8 (analog).
  1467. * PI9 - OCTOSPIM_P2_IO2 (alternate 5).
  1468. * PI10 - OCTOSPIM_P2_IO1 (alternate 5).
  1469. * PI11 - OCTOSPIM_P2_IO0 (alternate 5).
  1470. * PI12 - PIN12 (analog).
  1471. * PI13 - PIN13 (analog).
  1472. * PI14 - PIN14 (analog).
  1473. * PI15 - PIN15 (analog).
  1474. */
  1475. #define VAL_GPIOI_MODER (PIN_MODE_ANALOG(GPIOI_PIN0) | \
  1476. PIN_MODE_ANALOG(GPIOI_PIN1) | \
  1477. PIN_MODE_ANALOG(GPIOI_PIN2) | \
  1478. PIN_MODE_ANALOG(GPIOI_PIN3) | \
  1479. PIN_MODE_ANALOG(GPIOI_PIN4) | \
  1480. PIN_MODE_ANALOG(GPIOI_PIN5) | \
  1481. PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_CLK) |\
  1482. PIN_MODE_ANALOG(GPIOI_PIN7) | \
  1483. PIN_MODE_ANALOG(GPIOI_PIN8) | \
  1484. PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO2) |\
  1485. PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO1) |\
  1486. PIN_MODE_ALTERNATE(GPIOI_OCTOSPIM_P2_IO0) |\
  1487. PIN_MODE_ANALOG(GPIOI_PIN12) | \
  1488. PIN_MODE_ANALOG(GPIOI_PIN13) | \
  1489. PIN_MODE_ANALOG(GPIOI_PIN14) | \
  1490. PIN_MODE_ANALOG(GPIOI_PIN15))
  1491. #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \
  1492. PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \
  1493. PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \
  1494. PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \
  1495. PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \
  1496. PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \
  1497. PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_CLK) |\
  1498. PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \
  1499. PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \
  1500. PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO2) |\
  1501. PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO1) |\
  1502. PIN_OTYPE_PUSHPULL(GPIOI_OCTOSPIM_P2_IO0) |\
  1503. PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \
  1504. PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \
  1505. PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \
  1506. PIN_OTYPE_PUSHPULL(GPIOI_PIN15))
  1507. #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOI_PIN0) | \
  1508. PIN_OSPEED_VERYLOW(GPIOI_PIN1) | \
  1509. PIN_OSPEED_VERYLOW(GPIOI_PIN2) | \
  1510. PIN_OSPEED_VERYLOW(GPIOI_PIN3) | \
  1511. PIN_OSPEED_VERYLOW(GPIOI_PIN4) | \
  1512. PIN_OSPEED_VERYLOW(GPIOI_PIN5) | \
  1513. PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_CLK) |\
  1514. PIN_OSPEED_VERYLOW(GPIOI_PIN7) | \
  1515. PIN_OSPEED_VERYLOW(GPIOI_PIN8) | \
  1516. PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO2) |\
  1517. PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO1) |\
  1518. PIN_OSPEED_HIGH(GPIOI_OCTOSPIM_P2_IO0) |\
  1519. PIN_OSPEED_VERYLOW(GPIOI_PIN12) | \
  1520. PIN_OSPEED_VERYLOW(GPIOI_PIN13) | \
  1521. PIN_OSPEED_VERYLOW(GPIOI_PIN14) | \
  1522. PIN_OSPEED_VERYLOW(GPIOI_PIN15))
  1523. #define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING(GPIOI_PIN0) | \
  1524. PIN_PUPDR_FLOATING(GPIOI_PIN1) | \
  1525. PIN_PUPDR_FLOATING(GPIOI_PIN2) | \
  1526. PIN_PUPDR_FLOATING(GPIOI_PIN3) | \
  1527. PIN_PUPDR_FLOATING(GPIOI_PIN4) | \
  1528. PIN_PUPDR_FLOATING(GPIOI_PIN5) | \
  1529. PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_CLK) |\
  1530. PIN_PUPDR_FLOATING(GPIOI_PIN7) | \
  1531. PIN_PUPDR_FLOATING(GPIOI_PIN8) | \
  1532. PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO2) |\
  1533. PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO1) |\
  1534. PIN_PUPDR_FLOATING(GPIOI_OCTOSPIM_P2_IO0) |\
  1535. PIN_PUPDR_FLOATING(GPIOI_PIN12) | \
  1536. PIN_PUPDR_FLOATING(GPIOI_PIN13) | \
  1537. PIN_PUPDR_FLOATING(GPIOI_PIN14) | \
  1538. PIN_PUPDR_FLOATING(GPIOI_PIN15))
  1539. #define VAL_GPIOI_ODR (PIN_ODR_LOW(GPIOI_PIN0) | \
  1540. PIN_ODR_LOW(GPIOI_PIN1) | \
  1541. PIN_ODR_LOW(GPIOI_PIN2) | \
  1542. PIN_ODR_LOW(GPIOI_PIN3) | \
  1543. PIN_ODR_LOW(GPIOI_PIN4) | \
  1544. PIN_ODR_LOW(GPIOI_PIN5) | \
  1545. PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_CLK) | \
  1546. PIN_ODR_LOW(GPIOI_PIN7) | \
  1547. PIN_ODR_LOW(GPIOI_PIN8) | \
  1548. PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO2) | \
  1549. PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO1) | \
  1550. PIN_ODR_LOW(GPIOI_OCTOSPIM_P2_IO0) | \
  1551. PIN_ODR_LOW(GPIOI_PIN12) | \
  1552. PIN_ODR_LOW(GPIOI_PIN13) | \
  1553. PIN_ODR_LOW(GPIOI_PIN14) | \
  1554. PIN_ODR_LOW(GPIOI_PIN15))
  1555. #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \
  1556. PIN_AFIO_AF(GPIOI_PIN1, 0U) | \
  1557. PIN_AFIO_AF(GPIOI_PIN2, 0U) | \
  1558. PIN_AFIO_AF(GPIOI_PIN3, 0U) | \
  1559. PIN_AFIO_AF(GPIOI_PIN4, 0U) | \
  1560. PIN_AFIO_AF(GPIOI_PIN5, 0U) | \
  1561. PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_CLK, 5U) |\
  1562. PIN_AFIO_AF(GPIOI_PIN7, 0U))
  1563. #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \
  1564. PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO2, 5U) |\
  1565. PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO1, 5U) |\
  1566. PIN_AFIO_AF(GPIOI_OCTOSPIM_P2_IO0, 5U) |\
  1567. PIN_AFIO_AF(GPIOI_PIN12, 0U) | \
  1568. PIN_AFIO_AF(GPIOI_PIN13, 0U) | \
  1569. PIN_AFIO_AF(GPIOI_PIN14, 0U) | \
  1570. PIN_AFIO_AF(GPIOI_PIN15, 0U))
  1571. #define VAL_GPIOI_ASCR (PIN_ASCR_DISABLED(GPIOI_PIN0) | \
  1572. PIN_ASCR_DISABLED(GPIOI_PIN1) | \
  1573. PIN_ASCR_DISABLED(GPIOI_PIN2) | \
  1574. PIN_ASCR_DISABLED(GPIOI_PIN3) | \
  1575. PIN_ASCR_DISABLED(GPIOI_PIN4) | \
  1576. PIN_ASCR_DISABLED(GPIOI_PIN5) | \
  1577. PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_CLK) |\
  1578. PIN_ASCR_DISABLED(GPIOI_PIN7) | \
  1579. PIN_ASCR_DISABLED(GPIOI_PIN8) | \
  1580. PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO2) |\
  1581. PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO1) |\
  1582. PIN_ASCR_DISABLED(GPIOI_OCTOSPIM_P2_IO0) |\
  1583. PIN_ASCR_DISABLED(GPIOI_PIN12) | \
  1584. PIN_ASCR_DISABLED(GPIOI_PIN13) | \
  1585. PIN_ASCR_DISABLED(GPIOI_PIN14) | \
  1586. PIN_ASCR_DISABLED(GPIOI_PIN15))
  1587. #define VAL_GPIOI_LOCKR (PIN_LOCKR_DISABLED(GPIOI_PIN0) | \
  1588. PIN_LOCKR_DISABLED(GPIOI_PIN1) | \
  1589. PIN_LOCKR_DISABLED(GPIOI_PIN2) | \
  1590. PIN_LOCKR_DISABLED(GPIOI_PIN3) | \
  1591. PIN_LOCKR_DISABLED(GPIOI_PIN4) | \
  1592. PIN_LOCKR_DISABLED(GPIOI_PIN5) | \
  1593. PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_CLK) |\
  1594. PIN_LOCKR_DISABLED(GPIOI_PIN7) | \
  1595. PIN_LOCKR_DISABLED(GPIOI_PIN8) | \
  1596. PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO2) |\
  1597. PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO1) |\
  1598. PIN_LOCKR_DISABLED(GPIOI_OCTOSPIM_P2_IO0) |\
  1599. PIN_LOCKR_DISABLED(GPIOI_PIN12) | \
  1600. PIN_LOCKR_DISABLED(GPIOI_PIN13) | \
  1601. PIN_LOCKR_DISABLED(GPIOI_PIN14) | \
  1602. PIN_LOCKR_DISABLED(GPIOI_PIN15))
  1603. /*===========================================================================*/
  1604. /* External declarations. */
  1605. /*===========================================================================*/
  1606. #if !defined(_FROM_ASM_)
  1607. #ifdef __cplusplus
  1608. extern "C" {
  1609. #endif
  1610. void boardInit(void);
  1611. #ifdef __cplusplus
  1612. }
  1613. #endif
  1614. #endif /* _FROM_ASM_ */
  1615. #endif /* BOARD_H */