board.h 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 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 Seeed Arch Max board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_SEEED_ARCH_MAX
  29. #define BOARD_NAME "Seeed Arch Max"
  30. /*
  31. * Ethernet PHY type.
  32. */
  33. #define BOARD_PHY_ID MII_KS8721_ID
  34. #define BOARD_PHY_RMII
  35. /*
  36. * Board oscillators-related settings.
  37. */
  38. #if !defined(STM32_LSECLK)
  39. #define STM32_LSECLK 32768U
  40. #endif
  41. #if !defined(STM32_HSECLK)
  42. #define STM32_HSECLK 8000000U
  43. #endif
  44. /*
  45. * Board voltages.
  46. * Required for performance limits calculation.
  47. */
  48. #define STM32_VDD 330U
  49. /*
  50. * MCU type as defined in the ST header.
  51. */
  52. #define STM32F407xx
  53. /*
  54. * IO pins assignments.
  55. */
  56. #define GPIOA_BUTTON_WKUP 0U
  57. #define GPIOA_ETH_RMII_REF_CLK 1U
  58. #define GPIOA_ETH_RMII_MDIO 2U
  59. #define GPIOA_ETH_RMII_MDINT 3U
  60. #define GPIOA_PIN4 4U
  61. #define GPIOA_PIN5 5U
  62. #define GPIOA_PIN6 6U
  63. #define GPIOA_ETH_RMII_CRS_DV 7U
  64. #define GPIOA_USB_HS_BUSON 8U
  65. #define GPIOA_OTG_FS_VBUS 9U
  66. #define GPIOA_OTG_FS_ID 10U
  67. #define GPIOA_OTG_FS_DM 11U
  68. #define GPIOA_OTG_FS_DP 12U
  69. #define GPIOA_JTAG_TMS 13U
  70. #define GPIOA_JTAG_TCK 14U
  71. #define GPIOA_JTAG_TDI 15U
  72. #define GPIOB_USB_FS_BUSON 0U
  73. #define GPIOB_USB_HS_FAULT 1U
  74. #define GPIOB_BOOT1 2U
  75. #define GPIOB_JTAG_TDO 3U
  76. #define GPIOB_JTAG_TRST 4U
  77. #define GPIOB_PIN5 5U
  78. #define GPIOB_PIN6 6U
  79. #define GPIOB_PIN7 7U
  80. #define GPIOB_I2C1_SCL 8U
  81. #define GPIOB_I2C1_SDA 9U
  82. #define GPIOB_SPI2_SCK 10U
  83. #define GPIOB_PIN11 11U
  84. #define GPIOB_OTG_HS_ID 12U
  85. #define GPIOB_OTG_HS_VBUS 13U
  86. #define GPIOB_OTG_HS_DM 14U
  87. #define GPIOB_OTG_HS_DP 15U
  88. #define GPIOC_PIN0 0U
  89. #define GPIOC_ETH_RMII_MDC 1U
  90. #define GPIOC_SPI2_MISO 2U
  91. #define GPIOC_SPI2_MOSI 3U
  92. #define GPIOC_ETH_RMII_RXD0 4U
  93. #define GPIOC_ETH_RMII_RXD1 5U
  94. #define GPIOC_USART6_TX 6U
  95. #define GPIOC_USART6_RX 7U
  96. #define GPIOC_SD_D0 8U
  97. #define GPIOC_SD_D1 9U
  98. #define GPIOC_SD_D2 10U
  99. #define GPIOC_SD_D3 11U
  100. #define GPIOC_SD_CLK 12U
  101. #define GPIOC_LED 13U
  102. #define GPIOC_OSC32_IN 14U
  103. #define GPIOC_OSC32_OUT 15U
  104. #define GPIOD_PIN0 0U
  105. #define GPIOD_PIN1 1U
  106. #define GPIOD_SD_CMD 2U
  107. #define GPIOD_PIN3 3U
  108. #define GPIOD_PIN4 4U
  109. #define GPIOD_PIN5 5U
  110. #define GPIOD_PIN6 6U
  111. #define GPIOD_PIN7 7U
  112. #define GPIOD_PIN8 8U
  113. #define GPIOD_PIN9 9U
  114. #define GPIOD_PIN10 10U
  115. #define GPIOD_PIN11 11U
  116. #define GPIOD_PIN12 12U
  117. #define GPIOD_PIN13 13U
  118. #define GPIOD_PIN14 14U
  119. #define GPIOD_PIN15 15U
  120. #define GPIOE_PIN0 0U
  121. #define GPIOE_PIN1 1U
  122. #define GPIOE_PIN2 2U
  123. #define GPIOE_PIN3 3U
  124. #define GPIOE_PIN4 4U
  125. #define GPIOE_PIN5 5U
  126. #define GPIOE_PIN6 6U
  127. #define GPIOE_PIN7 7U
  128. #define GPIOE_PIN8 8U
  129. #define GPIOE_PIN9 9U
  130. #define GPIOE_PIN10 10U
  131. #define GPIOE_PIN11 11U
  132. #define GPIOE_PIN12 12U
  133. #define GPIOE_PIN13 13U
  134. #define GPIOE_PIN14 14U
  135. #define GPIOE_PIN15 15U
  136. #define GPIOF_PIN0 0U
  137. #define GPIOF_PIN1 1U
  138. #define GPIOF_PIN2 2U
  139. #define GPIOF_PIN3 3U
  140. #define GPIOF_PIN4 4U
  141. #define GPIOF_PIN5 5U
  142. #define GPIOF_PIN6 6U
  143. #define GPIOF_PIN7 7U
  144. #define GPIOF_PIN8 8U
  145. #define GPIOF_PIN9 9U
  146. #define GPIOF_PIN10 10U
  147. #define GPIOF_USB_FS_FAULT 11U
  148. #define GPIOF_PIN12 12U
  149. #define GPIOF_PIN13 13U
  150. #define GPIOF_PIN14 14U
  151. #define GPIOF_PIN15 15U
  152. #define GPIOG_PIN0 0U
  153. #define GPIOG_PIN1 1U
  154. #define GPIOG_PIN2 2U
  155. #define GPIOG_PIN3 3U
  156. #define GPIOG_PIN4 4U
  157. #define GPIOG_PIN5 5U
  158. #define GPIOG_PIN6 6U
  159. #define GPIOG_PIN7 7U
  160. #define GPIOG_PIN8 8U
  161. #define GPIOG_PIN9 9U
  162. #define GPIOG_SPI2_CS 10U
  163. #define GPIOG_ETH_RMII_TXEN 11U
  164. #define GPIOG_PIN12 12U
  165. #define GPIOG_ETH_RMII_TXD0 13U
  166. #define GPIOG_ETH_RMII_TXD1 14U
  167. #define GPIOG_PIN15 15U
  168. #define GPIOH_OSC_IN 0U
  169. #define GPIOH_OSC_OUT 1U
  170. #define GPIOH_PIN2 2U
  171. #define GPIOH_PIN3 3U
  172. #define GPIOH_PIN4 4U
  173. #define GPIOH_PIN5 5U
  174. #define GPIOH_PIN6 6U
  175. #define GPIOH_PIN7 7U
  176. #define GPIOH_PIN8 8U
  177. #define GPIOH_PIN9 9U
  178. #define GPIOH_PIN10 10U
  179. #define GPIOH_PIN11 11U
  180. #define GPIOH_PIN12 12U
  181. #define GPIOH_PIN13 13U
  182. #define GPIOH_PIN14 14U
  183. #define GPIOH_PIN15 15U
  184. #define GPIOI_PIN0 0U
  185. #define GPIOI_PIN1 1U
  186. #define GPIOI_PIN2 2U
  187. #define GPIOI_PIN3 3U
  188. #define GPIOI_PIN4 4U
  189. #define GPIOI_PIN5 5U
  190. #define GPIOI_PIN6 6U
  191. #define GPIOI_PIN7 7U
  192. #define GPIOI_PIN8 8U
  193. #define GPIOI_PIN9 9U
  194. #define GPIOI_PIN10 10U
  195. #define GPIOI_PIN11 11U
  196. #define GPIOI_PIN12 12U
  197. #define GPIOI_PIN13 13U
  198. #define GPIOI_PIN14 14U
  199. #define GPIOI_PIN15 15U
  200. /*
  201. * IO lines assignments.
  202. */
  203. #define LINE_BUTTON_WKUP PAL_LINE(GPIOA, 0U)
  204. #define LINE_ETH_RMII_REF_CLK PAL_LINE(GPIOA, 1U)
  205. #define LINE_ETH_RMII_MDIO PAL_LINE(GPIOA, 2U)
  206. #define LINE_ETH_RMII_MDINT PAL_LINE(GPIOA, 3U)
  207. #define LINE_ETH_RMII_CRS_DV PAL_LINE(GPIOA, 7U)
  208. #define LINE_USB_HS_BUSON PAL_LINE(GPIOA, 8U)
  209. #define LINE_OTG_FS_VBUS PAL_LINE(GPIOA, 9U)
  210. #define LINE_OTG_FS_ID PAL_LINE(GPIOA, 10U)
  211. #define LINE_OTG_FS_DM PAL_LINE(GPIOA, 11U)
  212. #define LINE_OTG_FS_DP PAL_LINE(GPIOA, 12U)
  213. #define LINE_JTAG_TMS PAL_LINE(GPIOA, 13U)
  214. #define LINE_JTAG_TCK PAL_LINE(GPIOA, 14U)
  215. #define LINE_JTAG_TDI PAL_LINE(GPIOA, 15U)
  216. #define LINE_USB_FS_BUSON PAL_LINE(GPIOB, 0U)
  217. #define LINE_USB_HS_FAULT PAL_LINE(GPIOB, 1U)
  218. #define LINE_BOOT1 PAL_LINE(GPIOB, 2U)
  219. #define LINE_JTAG_TDO PAL_LINE(GPIOB, 3U)
  220. #define LINE_JTAG_TRST PAL_LINE(GPIOB, 4U)
  221. #define LINE_I2C1_SCL PAL_LINE(GPIOB, 8U)
  222. #define LINE_I2C1_SDA PAL_LINE(GPIOB, 9U)
  223. #define LINE_SPI2_SCK PAL_LINE(GPIOB, 10U)
  224. #define LINE_OTG_HS_ID PAL_LINE(GPIOB, 12U)
  225. #define LINE_OTG_HS_VBUS PAL_LINE(GPIOB, 13U)
  226. #define LINE_OTG_HS_DM PAL_LINE(GPIOB, 14U)
  227. #define LINE_OTG_HS_DP PAL_LINE(GPIOB, 15U)
  228. #define LINE_ETH_RMII_MDC PAL_LINE(GPIOC, 1U)
  229. #define LINE_SPI2_MISO PAL_LINE(GPIOC, 2U)
  230. #define LINE_SPI2_MOSI PAL_LINE(GPIOC, 3U)
  231. #define LINE_ETH_RMII_RXD0 PAL_LINE(GPIOC, 4U)
  232. #define LINE_ETH_RMII_RXD1 PAL_LINE(GPIOC, 5U)
  233. #define LINE_USART6_TX PAL_LINE(GPIOC, 6U)
  234. #define LINE_USART6_RX PAL_LINE(GPIOC, 7U)
  235. #define LINE_SD_D0 PAL_LINE(GPIOC, 8U)
  236. #define LINE_SD_D1 PAL_LINE(GPIOC, 9U)
  237. #define LINE_SD_D2 PAL_LINE(GPIOC, 10U)
  238. #define LINE_SD_D3 PAL_LINE(GPIOC, 11U)
  239. #define LINE_SD_CLK PAL_LINE(GPIOC, 12U)
  240. #define LINE_LED PAL_LINE(GPIOC, 13U)
  241. #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
  242. #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
  243. #define LINE_SD_CMD PAL_LINE(GPIOD, 2U)
  244. #define LINE_USB_FS_FAULT PAL_LINE(GPIOF, 11U)
  245. #define LINE_SPI2_CS PAL_LINE(GPIOG, 10U)
  246. #define LINE_ETH_RMII_TXEN PAL_LINE(GPIOG, 11U)
  247. #define LINE_ETH_RMII_TXD0 PAL_LINE(GPIOG, 13U)
  248. #define LINE_ETH_RMII_TXD1 PAL_LINE(GPIOG, 14U)
  249. #define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
  250. #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
  251. /*===========================================================================*/
  252. /* Driver pre-compile time settings. */
  253. /*===========================================================================*/
  254. /*===========================================================================*/
  255. /* Derived constants and error checks. */
  256. /*===========================================================================*/
  257. /*===========================================================================*/
  258. /* Driver data structures and types. */
  259. /*===========================================================================*/
  260. /*===========================================================================*/
  261. /* Driver macros. */
  262. /*===========================================================================*/
  263. /*
  264. * I/O ports initial setup, this configuration is established soon after reset
  265. * in the initialization code.
  266. * Please refer to the STM32 Reference Manual for details.
  267. */
  268. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  269. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  270. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  271. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  272. #define PIN_ODR_LOW(n) (0U << (n))
  273. #define PIN_ODR_HIGH(n) (1U << (n))
  274. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  275. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  276. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  277. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  278. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  279. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  280. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  281. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  282. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  283. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  284. /*
  285. * GPIOA setup:
  286. *
  287. * PA0 - BUTTON_WKUP (input floating).
  288. * PA1 - ETH_RMII_REF_CLK (alternate 11).
  289. * PA2 - ETH_RMII_MDIO (alternate 11).
  290. * PA3 - ETH_RMII_MDINT (input floating).
  291. * PA4 - PIN4 (input pullup).
  292. * PA5 - PIN5 (input pullup).
  293. * PA6 - PIN6 (input pullup).
  294. * PA7 - ETH_RMII_CRS_DV (alternate 11).
  295. * PA8 - USB_HS_BUSON (output pushpull maximum).
  296. * PA9 - OTG_FS_VBUS (input pulldown).
  297. * PA10 - OTG_FS_ID (alternate 10).
  298. * PA11 - OTG_FS_DM (alternate 10).
  299. * PA12 - OTG_FS_DP (alternate 10).
  300. * PA13 - JTAG_TMS (alternate 0).
  301. * PA14 - JTAG_TCK (alternate 0).
  302. * PA15 - JTAG_TDI (alternate 0).
  303. */
  304. #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON_WKUP) | \
  305. PIN_MODE_ALTERNATE(GPIOA_ETH_RMII_REF_CLK) |\
  306. PIN_MODE_ALTERNATE(GPIOA_ETH_RMII_MDIO) |\
  307. PIN_MODE_INPUT(GPIOA_ETH_RMII_MDINT) | \
  308. PIN_MODE_INPUT(GPIOA_PIN4) | \
  309. PIN_MODE_INPUT(GPIOA_PIN5) | \
  310. PIN_MODE_INPUT(GPIOA_PIN6) | \
  311. PIN_MODE_ALTERNATE(GPIOA_ETH_RMII_CRS_DV) |\
  312. PIN_MODE_OUTPUT(GPIOA_USB_HS_BUSON) | \
  313. PIN_MODE_INPUT(GPIOA_OTG_FS_VBUS) | \
  314. PIN_MODE_ALTERNATE(GPIOA_OTG_FS_ID) | \
  315. PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DM) | \
  316. PIN_MODE_ALTERNATE(GPIOA_OTG_FS_DP) | \
  317. PIN_MODE_ALTERNATE(GPIOA_JTAG_TMS) | \
  318. PIN_MODE_ALTERNATE(GPIOA_JTAG_TCK) | \
  319. PIN_MODE_ALTERNATE(GPIOA_JTAG_TDI))
  320. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON_WKUP) |\
  321. PIN_OTYPE_PUSHPULL(GPIOA_ETH_RMII_REF_CLK) |\
  322. PIN_OTYPE_PUSHPULL(GPIOA_ETH_RMII_MDIO) |\
  323. PIN_OTYPE_PUSHPULL(GPIOA_ETH_RMII_MDINT) |\
  324. PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
  325. PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
  326. PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
  327. PIN_OTYPE_PUSHPULL(GPIOA_ETH_RMII_CRS_DV) |\
  328. PIN_OTYPE_PUSHPULL(GPIOA_USB_HS_BUSON) |\
  329. PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_VBUS) |\
  330. PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_ID) | \
  331. PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DM) | \
  332. PIN_OTYPE_PUSHPULL(GPIOA_OTG_FS_DP) | \
  333. PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TMS) | \
  334. PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TCK) | \
  335. PIN_OTYPE_PUSHPULL(GPIOA_JTAG_TDI))
  336. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_BUTTON_WKUP) | \
  337. PIN_OSPEED_HIGH(GPIOA_ETH_RMII_REF_CLK) |\
  338. PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDIO) | \
  339. PIN_OSPEED_HIGH(GPIOA_ETH_RMII_MDINT) |\
  340. PIN_OSPEED_HIGH(GPIOA_PIN4) | \
  341. PIN_OSPEED_HIGH(GPIOA_PIN5) | \
  342. PIN_OSPEED_HIGH(GPIOA_PIN6) | \
  343. PIN_OSPEED_HIGH(GPIOA_ETH_RMII_CRS_DV) |\
  344. PIN_OSPEED_HIGH(GPIOA_USB_HS_BUSON) | \
  345. PIN_OSPEED_HIGH(GPIOA_OTG_FS_VBUS) | \
  346. PIN_OSPEED_HIGH(GPIOA_OTG_FS_ID) | \
  347. PIN_OSPEED_HIGH(GPIOA_OTG_FS_DM) | \
  348. PIN_OSPEED_HIGH(GPIOA_OTG_FS_DP) | \
  349. PIN_OSPEED_HIGH(GPIOA_JTAG_TMS) | \
  350. PIN_OSPEED_HIGH(GPIOA_JTAG_TCK) | \
  351. PIN_OSPEED_HIGH(GPIOA_JTAG_TDI))
  352. #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON_WKUP) |\
  353. PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_REF_CLK) |\
  354. PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_MDIO) |\
  355. PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_MDINT) |\
  356. PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
  357. PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
  358. PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
  359. PIN_PUPDR_FLOATING(GPIOA_ETH_RMII_CRS_DV) |\
  360. PIN_PUPDR_FLOATING(GPIOA_USB_HS_BUSON) |\
  361. PIN_PUPDR_PULLDOWN(GPIOA_OTG_FS_VBUS) |\
  362. PIN_PUPDR_FLOATING(GPIOA_OTG_FS_ID) | \
  363. PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DM) | \
  364. PIN_PUPDR_FLOATING(GPIOA_OTG_FS_DP) | \
  365. PIN_PUPDR_FLOATING(GPIOA_JTAG_TMS) | \
  366. PIN_PUPDR_PULLDOWN(GPIOA_JTAG_TCK) | \
  367. PIN_PUPDR_FLOATING(GPIOA_JTAG_TDI))
  368. #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON_WKUP) | \
  369. PIN_ODR_HIGH(GPIOA_ETH_RMII_REF_CLK) | \
  370. PIN_ODR_HIGH(GPIOA_ETH_RMII_MDIO) | \
  371. PIN_ODR_HIGH(GPIOA_ETH_RMII_MDINT) | \
  372. PIN_ODR_HIGH(GPIOA_PIN4) | \
  373. PIN_ODR_HIGH(GPIOA_PIN5) | \
  374. PIN_ODR_HIGH(GPIOA_PIN6) | \
  375. PIN_ODR_HIGH(GPIOA_ETH_RMII_CRS_DV) | \
  376. PIN_ODR_LOW(GPIOA_USB_HS_BUSON) | \
  377. PIN_ODR_HIGH(GPIOA_OTG_FS_VBUS) | \
  378. PIN_ODR_HIGH(GPIOA_OTG_FS_ID) | \
  379. PIN_ODR_HIGH(GPIOA_OTG_FS_DM) | \
  380. PIN_ODR_HIGH(GPIOA_OTG_FS_DP) | \
  381. PIN_ODR_HIGH(GPIOA_JTAG_TMS) | \
  382. PIN_ODR_HIGH(GPIOA_JTAG_TCK) | \
  383. PIN_ODR_HIGH(GPIOA_JTAG_TDI))
  384. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON_WKUP, 0U) | \
  385. PIN_AFIO_AF(GPIOA_ETH_RMII_REF_CLK, 11U) |\
  386. PIN_AFIO_AF(GPIOA_ETH_RMII_MDIO, 11U) |\
  387. PIN_AFIO_AF(GPIOA_ETH_RMII_MDINT, 0U) |\
  388. PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
  389. PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
  390. PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
  391. PIN_AFIO_AF(GPIOA_ETH_RMII_CRS_DV, 11U))
  392. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_USB_HS_BUSON, 0U) | \
  393. PIN_AFIO_AF(GPIOA_OTG_FS_VBUS, 0U) | \
  394. PIN_AFIO_AF(GPIOA_OTG_FS_ID, 10U) | \
  395. PIN_AFIO_AF(GPIOA_OTG_FS_DM, 10U) | \
  396. PIN_AFIO_AF(GPIOA_OTG_FS_DP, 10U) | \
  397. PIN_AFIO_AF(GPIOA_JTAG_TMS, 0U) | \
  398. PIN_AFIO_AF(GPIOA_JTAG_TCK, 0U) | \
  399. PIN_AFIO_AF(GPIOA_JTAG_TDI, 0U))
  400. /*
  401. * GPIOB setup:
  402. *
  403. * PB0 - USB_FS_BUSON (output pushpull maximum).
  404. * PB1 - USB_HS_FAULT (input floating).
  405. * PB2 - BOOT1 (input floating).
  406. * PB3 - JTAG_TDO (alternate 0).
  407. * PB4 - JTAG_TRST (alternate 0).
  408. * PB5 - PIN5 (input pullup).
  409. * PB6 - PIN6 (input pullup).
  410. * PB7 - PIN7 (input pullup).
  411. * PB8 - I2C1_SCL (alternate 4).
  412. * PB9 - I2C1_SDA (alternate 4).
  413. * PB10 - SPI2_SCK (alternate 5).
  414. * PB11 - PIN11 (input pullup).
  415. * PB12 - OTG_HS_ID (alternate 12).
  416. * PB13 - OTG_HS_VBUS (input pulldown).
  417. * PB14 - OTG_HS_DM (alternate 12).
  418. * PB15 - OTG_HS_DP (alternate 12).
  419. */
  420. #define VAL_GPIOB_MODER (PIN_MODE_OUTPUT(GPIOB_USB_FS_BUSON) | \
  421. PIN_MODE_INPUT(GPIOB_USB_HS_FAULT) | \
  422. PIN_MODE_INPUT(GPIOB_BOOT1) | \
  423. PIN_MODE_ALTERNATE(GPIOB_JTAG_TDO) | \
  424. PIN_MODE_ALTERNATE(GPIOB_JTAG_TRST) | \
  425. PIN_MODE_INPUT(GPIOB_PIN5) | \
  426. PIN_MODE_INPUT(GPIOB_PIN6) | \
  427. PIN_MODE_INPUT(GPIOB_PIN7) | \
  428. PIN_MODE_ALTERNATE(GPIOB_I2C1_SCL) | \
  429. PIN_MODE_ALTERNATE(GPIOB_I2C1_SDA) | \
  430. PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \
  431. PIN_MODE_INPUT(GPIOB_PIN11) | \
  432. PIN_MODE_ALTERNATE(GPIOB_OTG_HS_ID) | \
  433. PIN_MODE_INPUT(GPIOB_OTG_HS_VBUS) | \
  434. PIN_MODE_ALTERNATE(GPIOB_OTG_HS_DM) | \
  435. PIN_MODE_ALTERNATE(GPIOB_OTG_HS_DP))
  436. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_USB_FS_BUSON) |\
  437. PIN_OTYPE_PUSHPULL(GPIOB_USB_HS_FAULT) |\
  438. PIN_OTYPE_PUSHPULL(GPIOB_BOOT1) | \
  439. PIN_OTYPE_PUSHPULL(GPIOB_JTAG_TDO) | \
  440. PIN_OTYPE_PUSHPULL(GPIOB_JTAG_TRST) | \
  441. PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
  442. PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
  443. PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
  444. PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SCL) | \
  445. PIN_OTYPE_OPENDRAIN(GPIOB_I2C1_SDA) | \
  446. PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \
  447. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  448. PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_ID) | \
  449. PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_VBUS) |\
  450. PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DM) | \
  451. PIN_OTYPE_PUSHPULL(GPIOB_OTG_HS_DP))
  452. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_USB_FS_BUSON) | \
  453. PIN_OSPEED_HIGH(GPIOB_USB_HS_FAULT) | \
  454. PIN_OSPEED_HIGH(GPIOB_BOOT1) | \
  455. PIN_OSPEED_HIGH(GPIOB_JTAG_TDO) | \
  456. PIN_OSPEED_HIGH(GPIOB_JTAG_TRST) | \
  457. PIN_OSPEED_HIGH(GPIOB_PIN5) | \
  458. PIN_OSPEED_HIGH(GPIOB_PIN6) | \
  459. PIN_OSPEED_HIGH(GPIOB_PIN7) | \
  460. PIN_OSPEED_HIGH(GPIOB_I2C1_SCL) | \
  461. PIN_OSPEED_HIGH(GPIOB_I2C1_SDA) | \
  462. PIN_OSPEED_HIGH(GPIOB_SPI2_SCK) | \
  463. PIN_OSPEED_HIGH(GPIOB_PIN11) | \
  464. PIN_OSPEED_HIGH(GPIOB_OTG_HS_ID) | \
  465. PIN_OSPEED_HIGH(GPIOB_OTG_HS_VBUS) | \
  466. PIN_OSPEED_HIGH(GPIOB_OTG_HS_DM) | \
  467. PIN_OSPEED_HIGH(GPIOB_OTG_HS_DP))
  468. #define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING(GPIOB_USB_FS_BUSON) |\
  469. PIN_PUPDR_FLOATING(GPIOB_USB_HS_FAULT) |\
  470. PIN_PUPDR_FLOATING(GPIOB_BOOT1) | \
  471. PIN_PUPDR_FLOATING(GPIOB_JTAG_TDO) | \
  472. PIN_PUPDR_FLOATING(GPIOB_JTAG_TRST) | \
  473. PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
  474. PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
  475. PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
  476. PIN_PUPDR_FLOATING(GPIOB_I2C1_SCL) | \
  477. PIN_PUPDR_FLOATING(GPIOB_I2C1_SDA) | \
  478. PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \
  479. PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
  480. PIN_PUPDR_FLOATING(GPIOB_OTG_HS_ID) | \
  481. PIN_PUPDR_PULLDOWN(GPIOB_OTG_HS_VBUS) |\
  482. PIN_PUPDR_FLOATING(GPIOB_OTG_HS_DM) | \
  483. PIN_PUPDR_FLOATING(GPIOB_OTG_HS_DP))
  484. #define VAL_GPIOB_ODR (PIN_ODR_LOW(GPIOB_USB_FS_BUSON) | \
  485. PIN_ODR_HIGH(GPIOB_USB_HS_FAULT) | \
  486. PIN_ODR_HIGH(GPIOB_BOOT1) | \
  487. PIN_ODR_HIGH(GPIOB_JTAG_TDO) | \
  488. PIN_ODR_HIGH(GPIOB_JTAG_TRST) | \
  489. PIN_ODR_HIGH(GPIOB_PIN5) | \
  490. PIN_ODR_HIGH(GPIOB_PIN6) | \
  491. PIN_ODR_HIGH(GPIOB_PIN7) | \
  492. PIN_ODR_HIGH(GPIOB_I2C1_SCL) | \
  493. PIN_ODR_HIGH(GPIOB_I2C1_SDA) | \
  494. PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \
  495. PIN_ODR_HIGH(GPIOB_PIN11) | \
  496. PIN_ODR_HIGH(GPIOB_OTG_HS_ID) | \
  497. PIN_ODR_HIGH(GPIOB_OTG_HS_VBUS) | \
  498. PIN_ODR_HIGH(GPIOB_OTG_HS_DM) | \
  499. PIN_ODR_HIGH(GPIOB_OTG_HS_DP))
  500. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_USB_FS_BUSON, 0U) | \
  501. PIN_AFIO_AF(GPIOB_USB_HS_FAULT, 0U) | \
  502. PIN_AFIO_AF(GPIOB_BOOT1, 0U) | \
  503. PIN_AFIO_AF(GPIOB_JTAG_TDO, 0U) | \
  504. PIN_AFIO_AF(GPIOB_JTAG_TRST, 0U) | \
  505. PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
  506. PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
  507. PIN_AFIO_AF(GPIOB_PIN7, 0U))
  508. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_I2C1_SCL, 4U) | \
  509. PIN_AFIO_AF(GPIOB_I2C1_SDA, 4U) | \
  510. PIN_AFIO_AF(GPIOB_SPI2_SCK, 5U) | \
  511. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  512. PIN_AFIO_AF(GPIOB_OTG_HS_ID, 12U) | \
  513. PIN_AFIO_AF(GPIOB_OTG_HS_VBUS, 0U) | \
  514. PIN_AFIO_AF(GPIOB_OTG_HS_DM, 12U) | \
  515. PIN_AFIO_AF(GPIOB_OTG_HS_DP, 12U))
  516. /*
  517. * GPIOC setup:
  518. *
  519. * PC0 - PIN0 (input pullup).
  520. * PC1 - ETH_RMII_MDC (alternate 11).
  521. * PC2 - SPI2_MISO (alternate 5).
  522. * PC3 - SPI2_MOSI (alternate 5).
  523. * PC4 - ETH_RMII_RXD0 (alternate 11).
  524. * PC5 - ETH_RMII_RXD1 (alternate 11).
  525. * PC6 - USART6_TX (alternate 8).
  526. * PC7 - USART6_RX (alternate 8).
  527. * PC8 - SD_D0 (alternate 12).
  528. * PC9 - SD_D1 (alternate 12).
  529. * PC10 - SD_D2 (alternate 12).
  530. * PC11 - SD_D3 (alternate 12).
  531. * PC12 - SD_CLK (alternate 12).
  532. * PC13 - LED (output pushpull maximum).
  533. * PC14 - OSC32_IN (input floating).
  534. * PC15 - OSC32_OUT (input floating).
  535. */
  536. #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
  537. PIN_MODE_ALTERNATE(GPIOC_ETH_RMII_MDC) |\
  538. PIN_MODE_ALTERNATE(GPIOC_SPI2_MISO) | \
  539. PIN_MODE_ALTERNATE(GPIOC_SPI2_MOSI) | \
  540. PIN_MODE_ALTERNATE(GPIOC_ETH_RMII_RXD0) |\
  541. PIN_MODE_ALTERNATE(GPIOC_ETH_RMII_RXD1) |\
  542. PIN_MODE_ALTERNATE(GPIOC_USART6_TX) | \
  543. PIN_MODE_ALTERNATE(GPIOC_USART6_RX) | \
  544. PIN_MODE_ALTERNATE(GPIOC_SD_D0) | \
  545. PIN_MODE_ALTERNATE(GPIOC_SD_D1) | \
  546. PIN_MODE_ALTERNATE(GPIOC_SD_D2) | \
  547. PIN_MODE_ALTERNATE(GPIOC_SD_D3) | \
  548. PIN_MODE_ALTERNATE(GPIOC_SD_CLK) | \
  549. PIN_MODE_OUTPUT(GPIOC_LED) | \
  550. PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
  551. PIN_MODE_INPUT(GPIOC_OSC32_OUT))
  552. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  553. PIN_OTYPE_PUSHPULL(GPIOC_ETH_RMII_MDC) |\
  554. PIN_OTYPE_PUSHPULL(GPIOC_SPI2_MISO) | \
  555. PIN_OTYPE_PUSHPULL(GPIOC_SPI2_MOSI) | \
  556. PIN_OTYPE_PUSHPULL(GPIOC_ETH_RMII_RXD0) |\
  557. PIN_OTYPE_PUSHPULL(GPIOC_ETH_RMII_RXD1) |\
  558. PIN_OTYPE_PUSHPULL(GPIOC_USART6_TX) | \
  559. PIN_OTYPE_PUSHPULL(GPIOC_USART6_RX) | \
  560. PIN_OTYPE_PUSHPULL(GPIOC_SD_D0) | \
  561. PIN_OTYPE_PUSHPULL(GPIOC_SD_D1) | \
  562. PIN_OTYPE_PUSHPULL(GPIOC_SD_D2) | \
  563. PIN_OTYPE_PUSHPULL(GPIOC_SD_D3) | \
  564. PIN_OTYPE_PUSHPULL(GPIOC_SD_CLK) | \
  565. PIN_OTYPE_PUSHPULL(GPIOC_LED) | \
  566. PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
  567. PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
  568. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \
  569. PIN_OSPEED_HIGH(GPIOC_ETH_RMII_MDC) | \
  570. PIN_OSPEED_HIGH(GPIOC_SPI2_MISO) | \
  571. PIN_OSPEED_HIGH(GPIOC_SPI2_MOSI) | \
  572. PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD0) | \
  573. PIN_OSPEED_HIGH(GPIOC_ETH_RMII_RXD1) | \
  574. PIN_OSPEED_HIGH(GPIOC_USART6_TX) | \
  575. PIN_OSPEED_HIGH(GPIOC_USART6_RX) | \
  576. PIN_OSPEED_HIGH(GPIOC_SD_D0) | \
  577. PIN_OSPEED_HIGH(GPIOC_SD_D1) | \
  578. PIN_OSPEED_HIGH(GPIOC_SD_D2) | \
  579. PIN_OSPEED_HIGH(GPIOC_SD_D3) | \
  580. PIN_OSPEED_HIGH(GPIOC_SD_CLK) | \
  581. PIN_OSPEED_HIGH(GPIOC_LED) | \
  582. PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
  583. PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
  584. #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
  585. PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_MDC) |\
  586. PIN_PUPDR_FLOATING(GPIOC_SPI2_MISO) | \
  587. PIN_PUPDR_FLOATING(GPIOC_SPI2_MOSI) | \
  588. PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_RXD0) |\
  589. PIN_PUPDR_FLOATING(GPIOC_ETH_RMII_RXD1) |\
  590. PIN_PUPDR_FLOATING(GPIOC_USART6_TX) | \
  591. PIN_PUPDR_FLOATING(GPIOC_USART6_RX) | \
  592. PIN_PUPDR_FLOATING(GPIOC_SD_D0) | \
  593. PIN_PUPDR_FLOATING(GPIOC_SD_D1) | \
  594. PIN_PUPDR_FLOATING(GPIOC_SD_D2) | \
  595. PIN_PUPDR_FLOATING(GPIOC_SD_D3) | \
  596. PIN_PUPDR_FLOATING(GPIOC_SD_CLK) | \
  597. PIN_PUPDR_FLOATING(GPIOC_LED) | \
  598. PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
  599. PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
  600. #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
  601. PIN_ODR_HIGH(GPIOC_ETH_RMII_MDC) | \
  602. PIN_ODR_HIGH(GPIOC_SPI2_MISO) | \
  603. PIN_ODR_HIGH(GPIOC_SPI2_MOSI) | \
  604. PIN_ODR_HIGH(GPIOC_ETH_RMII_RXD0) | \
  605. PIN_ODR_HIGH(GPIOC_ETH_RMII_RXD1) | \
  606. PIN_ODR_HIGH(GPIOC_USART6_TX) | \
  607. PIN_ODR_HIGH(GPIOC_USART6_RX) | \
  608. PIN_ODR_HIGH(GPIOC_SD_D0) | \
  609. PIN_ODR_HIGH(GPIOC_SD_D1) | \
  610. PIN_ODR_HIGH(GPIOC_SD_D2) | \
  611. PIN_ODR_HIGH(GPIOC_SD_D3) | \
  612. PIN_ODR_HIGH(GPIOC_SD_CLK) | \
  613. PIN_ODR_HIGH(GPIOC_LED) | \
  614. PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
  615. PIN_ODR_HIGH(GPIOC_OSC32_OUT))
  616. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  617. PIN_AFIO_AF(GPIOC_ETH_RMII_MDC, 11U) | \
  618. PIN_AFIO_AF(GPIOC_SPI2_MISO, 5U) | \
  619. PIN_AFIO_AF(GPIOC_SPI2_MOSI, 5U) | \
  620. PIN_AFIO_AF(GPIOC_ETH_RMII_RXD0, 11U) |\
  621. PIN_AFIO_AF(GPIOC_ETH_RMII_RXD1, 11U) |\
  622. PIN_AFIO_AF(GPIOC_USART6_TX, 8U) | \
  623. PIN_AFIO_AF(GPIOC_USART6_RX, 8U))
  624. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_SD_D0, 12U) | \
  625. PIN_AFIO_AF(GPIOC_SD_D1, 12U) | \
  626. PIN_AFIO_AF(GPIOC_SD_D2, 12U) | \
  627. PIN_AFIO_AF(GPIOC_SD_D3, 12U) | \
  628. PIN_AFIO_AF(GPIOC_SD_CLK, 12U) | \
  629. PIN_AFIO_AF(GPIOC_LED, 0U) | \
  630. PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
  631. PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
  632. /*
  633. * GPIOD setup:
  634. *
  635. * PD0 - PIN0 (input pullup).
  636. * PD1 - PIN1 (input pullup).
  637. * PD2 - SD_CMD (alternate 12).
  638. * PD3 - PIN3 (input pullup).
  639. * PD4 - PIN4 (input pullup).
  640. * PD5 - PIN5 (input pullup).
  641. * PD6 - PIN6 (input pullup).
  642. * PD7 - PIN7 (input pullup).
  643. * PD8 - PIN8 (input pullup).
  644. * PD9 - PIN9 (input pullup).
  645. * PD10 - PIN10 (input pullup).
  646. * PD11 - PIN11 (input pullup).
  647. * PD12 - PIN12 (input pullup).
  648. * PD13 - PIN13 (input pullup).
  649. * PD14 - PIN14 (input pullup).
  650. * PD15 - PIN15 (input pullup).
  651. */
  652. #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
  653. PIN_MODE_INPUT(GPIOD_PIN1) | \
  654. PIN_MODE_ALTERNATE(GPIOD_SD_CMD) | \
  655. PIN_MODE_INPUT(GPIOD_PIN3) | \
  656. PIN_MODE_INPUT(GPIOD_PIN4) | \
  657. PIN_MODE_INPUT(GPIOD_PIN5) | \
  658. PIN_MODE_INPUT(GPIOD_PIN6) | \
  659. PIN_MODE_INPUT(GPIOD_PIN7) | \
  660. PIN_MODE_INPUT(GPIOD_PIN8) | \
  661. PIN_MODE_INPUT(GPIOD_PIN9) | \
  662. PIN_MODE_INPUT(GPIOD_PIN10) | \
  663. PIN_MODE_INPUT(GPIOD_PIN11) | \
  664. PIN_MODE_INPUT(GPIOD_PIN12) | \
  665. PIN_MODE_INPUT(GPIOD_PIN13) | \
  666. PIN_MODE_INPUT(GPIOD_PIN14) | \
  667. PIN_MODE_INPUT(GPIOD_PIN15))
  668. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  669. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  670. PIN_OTYPE_PUSHPULL(GPIOD_SD_CMD) | \
  671. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  672. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  673. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  674. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  675. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  676. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  677. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  678. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  679. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  680. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  681. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  682. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  683. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  684. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
  685. PIN_OSPEED_HIGH(GPIOD_PIN1) | \
  686. PIN_OSPEED_HIGH(GPIOD_SD_CMD) | \
  687. PIN_OSPEED_HIGH(GPIOD_PIN3) | \
  688. PIN_OSPEED_HIGH(GPIOD_PIN4) | \
  689. PIN_OSPEED_HIGH(GPIOD_PIN5) | \
  690. PIN_OSPEED_HIGH(GPIOD_PIN6) | \
  691. PIN_OSPEED_HIGH(GPIOD_PIN7) | \
  692. PIN_OSPEED_HIGH(GPIOD_PIN8) | \
  693. PIN_OSPEED_HIGH(GPIOD_PIN9) | \
  694. PIN_OSPEED_HIGH(GPIOD_PIN10) | \
  695. PIN_OSPEED_HIGH(GPIOD_PIN11) | \
  696. PIN_OSPEED_HIGH(GPIOD_PIN12) | \
  697. PIN_OSPEED_HIGH(GPIOD_PIN13) | \
  698. PIN_OSPEED_HIGH(GPIOD_PIN14) | \
  699. PIN_OSPEED_HIGH(GPIOD_PIN15))
  700. #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
  701. PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
  702. PIN_PUPDR_FLOATING(GPIOD_SD_CMD) | \
  703. PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
  704. PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
  705. PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
  706. PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
  707. PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
  708. PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
  709. PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
  710. PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
  711. PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
  712. PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
  713. PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
  714. PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
  715. PIN_PUPDR_PULLUP(GPIOD_PIN15))
  716. #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
  717. PIN_ODR_HIGH(GPIOD_PIN1) | \
  718. PIN_ODR_HIGH(GPIOD_SD_CMD) | \
  719. PIN_ODR_HIGH(GPIOD_PIN3) | \
  720. PIN_ODR_HIGH(GPIOD_PIN4) | \
  721. PIN_ODR_HIGH(GPIOD_PIN5) | \
  722. PIN_ODR_HIGH(GPIOD_PIN6) | \
  723. PIN_ODR_HIGH(GPIOD_PIN7) | \
  724. PIN_ODR_HIGH(GPIOD_PIN8) | \
  725. PIN_ODR_HIGH(GPIOD_PIN9) | \
  726. PIN_ODR_HIGH(GPIOD_PIN10) | \
  727. PIN_ODR_HIGH(GPIOD_PIN11) | \
  728. PIN_ODR_HIGH(GPIOD_PIN12) | \
  729. PIN_ODR_HIGH(GPIOD_PIN13) | \
  730. PIN_ODR_HIGH(GPIOD_PIN14) | \
  731. PIN_ODR_HIGH(GPIOD_PIN15))
  732. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
  733. PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
  734. PIN_AFIO_AF(GPIOD_SD_CMD, 12U) | \
  735. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  736. PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
  737. PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
  738. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  739. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  740. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
  741. PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
  742. PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
  743. PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
  744. PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
  745. PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
  746. PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
  747. PIN_AFIO_AF(GPIOD_PIN15, 0U))
  748. /*
  749. * GPIOE setup:
  750. *
  751. * PE0 - PIN0 (input pullup).
  752. * PE1 - PIN1 (input pullup).
  753. * PE2 - PIN2 (input pullup).
  754. * PE3 - PIN3 (input pullup).
  755. * PE4 - PIN4 (input pullup).
  756. * PE5 - PIN5 (input pullup).
  757. * PE6 - PIN6 (input pullup).
  758. * PE7 - PIN7 (input pullup).
  759. * PE8 - PIN8 (input pullup).
  760. * PE9 - PIN9 (input pullup).
  761. * PE10 - PIN10 (input pullup).
  762. * PE11 - PIN11 (input pullup).
  763. * PE12 - PIN12 (input pullup).
  764. * PE13 - PIN13 (input pullup).
  765. * PE14 - PIN14 (input pullup).
  766. * PE15 - PIN15 (input pullup).
  767. */
  768. #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
  769. PIN_MODE_INPUT(GPIOE_PIN1) | \
  770. PIN_MODE_INPUT(GPIOE_PIN2) | \
  771. PIN_MODE_INPUT(GPIOE_PIN3) | \
  772. PIN_MODE_INPUT(GPIOE_PIN4) | \
  773. PIN_MODE_INPUT(GPIOE_PIN5) | \
  774. PIN_MODE_INPUT(GPIOE_PIN6) | \
  775. PIN_MODE_INPUT(GPIOE_PIN7) | \
  776. PIN_MODE_INPUT(GPIOE_PIN8) | \
  777. PIN_MODE_INPUT(GPIOE_PIN9) | \
  778. PIN_MODE_INPUT(GPIOE_PIN10) | \
  779. PIN_MODE_INPUT(GPIOE_PIN11) | \
  780. PIN_MODE_INPUT(GPIOE_PIN12) | \
  781. PIN_MODE_INPUT(GPIOE_PIN13) | \
  782. PIN_MODE_INPUT(GPIOE_PIN14) | \
  783. PIN_MODE_INPUT(GPIOE_PIN15))
  784. #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
  785. PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
  786. PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
  787. PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
  788. PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
  789. PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
  790. PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
  791. PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
  792. PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
  793. PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
  794. PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
  795. PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
  796. PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
  797. PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
  798. PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
  799. PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
  800. #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
  801. PIN_OSPEED_HIGH(GPIOE_PIN1) | \
  802. PIN_OSPEED_HIGH(GPIOE_PIN2) | \
  803. PIN_OSPEED_HIGH(GPIOE_PIN3) | \
  804. PIN_OSPEED_HIGH(GPIOE_PIN4) | \
  805. PIN_OSPEED_HIGH(GPIOE_PIN5) | \
  806. PIN_OSPEED_HIGH(GPIOE_PIN6) | \
  807. PIN_OSPEED_HIGH(GPIOE_PIN7) | \
  808. PIN_OSPEED_HIGH(GPIOE_PIN8) | \
  809. PIN_OSPEED_HIGH(GPIOE_PIN9) | \
  810. PIN_OSPEED_HIGH(GPIOE_PIN10) | \
  811. PIN_OSPEED_HIGH(GPIOE_PIN11) | \
  812. PIN_OSPEED_HIGH(GPIOE_PIN12) | \
  813. PIN_OSPEED_HIGH(GPIOE_PIN13) | \
  814. PIN_OSPEED_HIGH(GPIOE_PIN14) | \
  815. PIN_OSPEED_HIGH(GPIOE_PIN15))
  816. #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
  817. PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
  818. PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
  819. PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
  820. PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
  821. PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
  822. PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
  823. PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
  824. PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
  825. PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
  826. PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
  827. PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
  828. PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
  829. PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
  830. PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
  831. PIN_PUPDR_PULLUP(GPIOE_PIN15))
  832. #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
  833. PIN_ODR_HIGH(GPIOE_PIN1) | \
  834. PIN_ODR_HIGH(GPIOE_PIN2) | \
  835. PIN_ODR_HIGH(GPIOE_PIN3) | \
  836. PIN_ODR_HIGH(GPIOE_PIN4) | \
  837. PIN_ODR_HIGH(GPIOE_PIN5) | \
  838. PIN_ODR_HIGH(GPIOE_PIN6) | \
  839. PIN_ODR_HIGH(GPIOE_PIN7) | \
  840. PIN_ODR_HIGH(GPIOE_PIN8) | \
  841. PIN_ODR_HIGH(GPIOE_PIN9) | \
  842. PIN_ODR_HIGH(GPIOE_PIN10) | \
  843. PIN_ODR_HIGH(GPIOE_PIN11) | \
  844. PIN_ODR_HIGH(GPIOE_PIN12) | \
  845. PIN_ODR_HIGH(GPIOE_PIN13) | \
  846. PIN_ODR_HIGH(GPIOE_PIN14) | \
  847. PIN_ODR_HIGH(GPIOE_PIN15))
  848. #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
  849. PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
  850. PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
  851. PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
  852. PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
  853. PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
  854. PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
  855. PIN_AFIO_AF(GPIOE_PIN7, 0U))
  856. #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
  857. PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
  858. PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
  859. PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
  860. PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
  861. PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
  862. PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
  863. PIN_AFIO_AF(GPIOE_PIN15, 0U))
  864. /*
  865. * GPIOF setup:
  866. *
  867. * PF0 - PIN0 (input pullup).
  868. * PF1 - PIN1 (input pullup).
  869. * PF2 - PIN2 (input pullup).
  870. * PF3 - PIN3 (input pullup).
  871. * PF4 - PIN4 (input pullup).
  872. * PF5 - PIN5 (input pullup).
  873. * PF6 - PIN6 (input pullup).
  874. * PF7 - PIN7 (input pullup).
  875. * PF8 - PIN8 (input pullup).
  876. * PF9 - PIN9 (input pullup).
  877. * PF10 - PIN10 (input pullup).
  878. * PF11 - USB_FS_FAULT (input floating).
  879. * PF12 - PIN12 (input pullup).
  880. * PF13 - PIN13 (input pullup).
  881. * PF14 - PIN14 (input pullup).
  882. * PF15 - PIN15 (input pullup).
  883. */
  884. #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \
  885. PIN_MODE_INPUT(GPIOF_PIN1) | \
  886. PIN_MODE_INPUT(GPIOF_PIN2) | \
  887. PIN_MODE_INPUT(GPIOF_PIN3) | \
  888. PIN_MODE_INPUT(GPIOF_PIN4) | \
  889. PIN_MODE_INPUT(GPIOF_PIN5) | \
  890. PIN_MODE_INPUT(GPIOF_PIN6) | \
  891. PIN_MODE_INPUT(GPIOF_PIN7) | \
  892. PIN_MODE_INPUT(GPIOF_PIN8) | \
  893. PIN_MODE_INPUT(GPIOF_PIN9) | \
  894. PIN_MODE_INPUT(GPIOF_PIN10) | \
  895. PIN_MODE_INPUT(GPIOF_USB_FS_FAULT) | \
  896. PIN_MODE_INPUT(GPIOF_PIN12) | \
  897. PIN_MODE_INPUT(GPIOF_PIN13) | \
  898. PIN_MODE_INPUT(GPIOF_PIN14) | \
  899. PIN_MODE_INPUT(GPIOF_PIN15))
  900. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \
  901. PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \
  902. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  903. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  904. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  905. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  906. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  907. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  908. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  909. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  910. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  911. PIN_OTYPE_PUSHPULL(GPIOF_USB_FS_FAULT) |\
  912. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  913. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  914. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  915. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  916. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \
  917. PIN_OSPEED_HIGH(GPIOF_PIN1) | \
  918. PIN_OSPEED_HIGH(GPIOF_PIN2) | \
  919. PIN_OSPEED_HIGH(GPIOF_PIN3) | \
  920. PIN_OSPEED_HIGH(GPIOF_PIN4) | \
  921. PIN_OSPEED_HIGH(GPIOF_PIN5) | \
  922. PIN_OSPEED_HIGH(GPIOF_PIN6) | \
  923. PIN_OSPEED_HIGH(GPIOF_PIN7) | \
  924. PIN_OSPEED_HIGH(GPIOF_PIN8) | \
  925. PIN_OSPEED_HIGH(GPIOF_PIN9) | \
  926. PIN_OSPEED_HIGH(GPIOF_PIN10) | \
  927. PIN_OSPEED_HIGH(GPIOF_USB_FS_FAULT) | \
  928. PIN_OSPEED_HIGH(GPIOF_PIN12) | \
  929. PIN_OSPEED_HIGH(GPIOF_PIN13) | \
  930. PIN_OSPEED_HIGH(GPIOF_PIN14) | \
  931. PIN_OSPEED_HIGH(GPIOF_PIN15))
  932. #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \
  933. PIN_PUPDR_PULLUP(GPIOF_PIN1) | \
  934. PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
  935. PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
  936. PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
  937. PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
  938. PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
  939. PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
  940. PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
  941. PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
  942. PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
  943. PIN_PUPDR_FLOATING(GPIOF_USB_FS_FAULT) |\
  944. PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
  945. PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
  946. PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
  947. PIN_PUPDR_PULLUP(GPIOF_PIN15))
  948. #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \
  949. PIN_ODR_HIGH(GPIOF_PIN1) | \
  950. PIN_ODR_HIGH(GPIOF_PIN2) | \
  951. PIN_ODR_HIGH(GPIOF_PIN3) | \
  952. PIN_ODR_HIGH(GPIOF_PIN4) | \
  953. PIN_ODR_HIGH(GPIOF_PIN5) | \
  954. PIN_ODR_HIGH(GPIOF_PIN6) | \
  955. PIN_ODR_HIGH(GPIOF_PIN7) | \
  956. PIN_ODR_HIGH(GPIOF_PIN8) | \
  957. PIN_ODR_HIGH(GPIOF_PIN9) | \
  958. PIN_ODR_HIGH(GPIOF_PIN10) | \
  959. PIN_ODR_HIGH(GPIOF_USB_FS_FAULT) | \
  960. PIN_ODR_HIGH(GPIOF_PIN12) | \
  961. PIN_ODR_HIGH(GPIOF_PIN13) | \
  962. PIN_ODR_HIGH(GPIOF_PIN14) | \
  963. PIN_ODR_HIGH(GPIOF_PIN15))
  964. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \
  965. PIN_AFIO_AF(GPIOF_PIN1, 0U) | \
  966. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  967. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  968. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  969. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  970. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  971. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  972. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  973. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  974. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  975. PIN_AFIO_AF(GPIOF_USB_FS_FAULT, 0U) | \
  976. PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
  977. PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
  978. PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
  979. PIN_AFIO_AF(GPIOF_PIN15, 0U))
  980. /*
  981. * GPIOG setup:
  982. *
  983. * PG0 - PIN0 (input pullup).
  984. * PG1 - PIN1 (input pullup).
  985. * PG2 - PIN2 (input pullup).
  986. * PG3 - PIN3 (input pullup).
  987. * PG4 - PIN4 (input pullup).
  988. * PG5 - PIN5 (input pullup).
  989. * PG6 - PIN6 (input pullup).
  990. * PG7 - PIN7 (input pullup).
  991. * PG8 - PIN8 (input pullup).
  992. * PG9 - PIN9 (input pullup).
  993. * PG10 - SPI2_CS (output pushpull maximum).
  994. * PG11 - ETH_RMII_TXEN (alternate 11).
  995. * PG12 - PIN12 (input pullup).
  996. * PG13 - ETH_RMII_TXD0 (alternate 11).
  997. * PG14 - ETH_RMII_TXD1 (alternate 11).
  998. * PG15 - PIN15 (input pullup).
  999. */
  1000. #define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \
  1001. PIN_MODE_INPUT(GPIOG_PIN1) | \
  1002. PIN_MODE_INPUT(GPIOG_PIN2) | \
  1003. PIN_MODE_INPUT(GPIOG_PIN3) | \
  1004. PIN_MODE_INPUT(GPIOG_PIN4) | \
  1005. PIN_MODE_INPUT(GPIOG_PIN5) | \
  1006. PIN_MODE_INPUT(GPIOG_PIN6) | \
  1007. PIN_MODE_INPUT(GPIOG_PIN7) | \
  1008. PIN_MODE_INPUT(GPIOG_PIN8) | \
  1009. PIN_MODE_INPUT(GPIOG_PIN9) | \
  1010. PIN_MODE_OUTPUT(GPIOG_SPI2_CS) | \
  1011. PIN_MODE_ALTERNATE(GPIOG_ETH_RMII_TXEN) |\
  1012. PIN_MODE_INPUT(GPIOG_PIN12) | \
  1013. PIN_MODE_ALTERNATE(GPIOG_ETH_RMII_TXD0) |\
  1014. PIN_MODE_ALTERNATE(GPIOG_ETH_RMII_TXD1) |\
  1015. PIN_MODE_INPUT(GPIOG_PIN15))
  1016. #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
  1017. PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
  1018. PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
  1019. PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
  1020. PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
  1021. PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
  1022. PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
  1023. PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
  1024. PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
  1025. PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
  1026. PIN_OTYPE_PUSHPULL(GPIOG_SPI2_CS) | \
  1027. PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXEN) |\
  1028. PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
  1029. PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD0) |\
  1030. PIN_OTYPE_PUSHPULL(GPIOG_ETH_RMII_TXD1) |\
  1031. PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
  1032. #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \
  1033. PIN_OSPEED_HIGH(GPIOG_PIN1) | \
  1034. PIN_OSPEED_HIGH(GPIOG_PIN2) | \
  1035. PIN_OSPEED_HIGH(GPIOG_PIN3) | \
  1036. PIN_OSPEED_HIGH(GPIOG_PIN4) | \
  1037. PIN_OSPEED_HIGH(GPIOG_PIN5) | \
  1038. PIN_OSPEED_HIGH(GPIOG_PIN6) | \
  1039. PIN_OSPEED_HIGH(GPIOG_PIN7) | \
  1040. PIN_OSPEED_HIGH(GPIOG_PIN8) | \
  1041. PIN_OSPEED_HIGH(GPIOG_PIN9) | \
  1042. PIN_OSPEED_HIGH(GPIOG_SPI2_CS) | \
  1043. PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXEN) | \
  1044. PIN_OSPEED_HIGH(GPIOG_PIN12) | \
  1045. PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD0) | \
  1046. PIN_OSPEED_HIGH(GPIOG_ETH_RMII_TXD1) | \
  1047. PIN_OSPEED_HIGH(GPIOG_PIN15))
  1048. #define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \
  1049. PIN_PUPDR_PULLUP(GPIOG_PIN1) | \
  1050. PIN_PUPDR_PULLUP(GPIOG_PIN2) | \
  1051. PIN_PUPDR_PULLUP(GPIOG_PIN3) | \
  1052. PIN_PUPDR_PULLUP(GPIOG_PIN4) | \
  1053. PIN_PUPDR_PULLUP(GPIOG_PIN5) | \
  1054. PIN_PUPDR_PULLUP(GPIOG_PIN6) | \
  1055. PIN_PUPDR_PULLUP(GPIOG_PIN7) | \
  1056. PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
  1057. PIN_PUPDR_PULLUP(GPIOG_PIN9) | \
  1058. PIN_PUPDR_FLOATING(GPIOG_SPI2_CS) | \
  1059. PIN_PUPDR_FLOATING(GPIOG_ETH_RMII_TXEN) |\
  1060. PIN_PUPDR_PULLUP(GPIOG_PIN12) | \
  1061. PIN_PUPDR_FLOATING(GPIOG_ETH_RMII_TXD0) |\
  1062. PIN_PUPDR_FLOATING(GPIOG_ETH_RMII_TXD1) |\
  1063. PIN_PUPDR_PULLUP(GPIOG_PIN15))
  1064. #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
  1065. PIN_ODR_HIGH(GPIOG_PIN1) | \
  1066. PIN_ODR_HIGH(GPIOG_PIN2) | \
  1067. PIN_ODR_HIGH(GPIOG_PIN3) | \
  1068. PIN_ODR_HIGH(GPIOG_PIN4) | \
  1069. PIN_ODR_HIGH(GPIOG_PIN5) | \
  1070. PIN_ODR_HIGH(GPIOG_PIN6) | \
  1071. PIN_ODR_HIGH(GPIOG_PIN7) | \
  1072. PIN_ODR_HIGH(GPIOG_PIN8) | \
  1073. PIN_ODR_HIGH(GPIOG_PIN9) | \
  1074. PIN_ODR_HIGH(GPIOG_SPI2_CS) | \
  1075. PIN_ODR_HIGH(GPIOG_ETH_RMII_TXEN) | \
  1076. PIN_ODR_HIGH(GPIOG_PIN12) | \
  1077. PIN_ODR_HIGH(GPIOG_ETH_RMII_TXD0) | \
  1078. PIN_ODR_HIGH(GPIOG_ETH_RMII_TXD1) | \
  1079. PIN_ODR_HIGH(GPIOG_PIN15))
  1080. #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
  1081. PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
  1082. PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
  1083. PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
  1084. PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
  1085. PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
  1086. PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
  1087. PIN_AFIO_AF(GPIOG_PIN7, 0U))
  1088. #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
  1089. PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
  1090. PIN_AFIO_AF(GPIOG_SPI2_CS, 0U) | \
  1091. PIN_AFIO_AF(GPIOG_ETH_RMII_TXEN, 11U) |\
  1092. PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
  1093. PIN_AFIO_AF(GPIOG_ETH_RMII_TXD0, 11U) |\
  1094. PIN_AFIO_AF(GPIOG_ETH_RMII_TXD1, 11U) |\
  1095. PIN_AFIO_AF(GPIOG_PIN15, 0U))
  1096. /*
  1097. * GPIOH setup:
  1098. *
  1099. * PH0 - OSC_IN (input floating).
  1100. * PH1 - OSC_OUT (input floating).
  1101. * PH2 - PIN2 (input pullup).
  1102. * PH3 - PIN3 (input pullup).
  1103. * PH4 - PIN4 (input pullup).
  1104. * PH5 - PIN5 (input pullup).
  1105. * PH6 - PIN6 (input pullup).
  1106. * PH7 - PIN7 (input pullup).
  1107. * PH8 - PIN8 (input pullup).
  1108. * PH9 - PIN9 (input pullup).
  1109. * PH10 - PIN10 (input pullup).
  1110. * PH11 - PIN11 (input pullup).
  1111. * PH12 - PIN12 (input pullup).
  1112. * PH13 - PIN13 (input pullup).
  1113. * PH14 - PIN14 (input pullup).
  1114. * PH15 - PIN15 (input pullup).
  1115. */
  1116. #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \
  1117. PIN_MODE_INPUT(GPIOH_OSC_OUT) | \
  1118. PIN_MODE_INPUT(GPIOH_PIN2) | \
  1119. PIN_MODE_INPUT(GPIOH_PIN3) | \
  1120. PIN_MODE_INPUT(GPIOH_PIN4) | \
  1121. PIN_MODE_INPUT(GPIOH_PIN5) | \
  1122. PIN_MODE_INPUT(GPIOH_PIN6) | \
  1123. PIN_MODE_INPUT(GPIOH_PIN7) | \
  1124. PIN_MODE_INPUT(GPIOH_PIN8) | \
  1125. PIN_MODE_INPUT(GPIOH_PIN9) | \
  1126. PIN_MODE_INPUT(GPIOH_PIN10) | \
  1127. PIN_MODE_INPUT(GPIOH_PIN11) | \
  1128. PIN_MODE_INPUT(GPIOH_PIN12) | \
  1129. PIN_MODE_INPUT(GPIOH_PIN13) | \
  1130. PIN_MODE_INPUT(GPIOH_PIN14) | \
  1131. PIN_MODE_INPUT(GPIOH_PIN15))
  1132. #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \
  1133. PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \
  1134. PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
  1135. PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
  1136. PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
  1137. PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
  1138. PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
  1139. PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
  1140. PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
  1141. PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
  1142. PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
  1143. PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
  1144. PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
  1145. PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
  1146. PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
  1147. PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
  1148. #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \
  1149. PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \
  1150. PIN_OSPEED_HIGH(GPIOH_PIN2) | \
  1151. PIN_OSPEED_HIGH(GPIOH_PIN3) | \
  1152. PIN_OSPEED_HIGH(GPIOH_PIN4) | \
  1153. PIN_OSPEED_HIGH(GPIOH_PIN5) | \
  1154. PIN_OSPEED_HIGH(GPIOH_PIN6) | \
  1155. PIN_OSPEED_HIGH(GPIOH_PIN7) | \
  1156. PIN_OSPEED_HIGH(GPIOH_PIN8) | \
  1157. PIN_OSPEED_HIGH(GPIOH_PIN9) | \
  1158. PIN_OSPEED_HIGH(GPIOH_PIN10) | \
  1159. PIN_OSPEED_HIGH(GPIOH_PIN11) | \
  1160. PIN_OSPEED_HIGH(GPIOH_PIN12) | \
  1161. PIN_OSPEED_HIGH(GPIOH_PIN13) | \
  1162. PIN_OSPEED_HIGH(GPIOH_PIN14) | \
  1163. PIN_OSPEED_HIGH(GPIOH_PIN15))
  1164. #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \
  1165. PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \
  1166. PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
  1167. PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
  1168. PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
  1169. PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
  1170. PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
  1171. PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
  1172. PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
  1173. PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
  1174. PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
  1175. PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
  1176. PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
  1177. PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
  1178. PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
  1179. PIN_PUPDR_PULLUP(GPIOH_PIN15))
  1180. #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \
  1181. PIN_ODR_HIGH(GPIOH_OSC_OUT) | \
  1182. PIN_ODR_HIGH(GPIOH_PIN2) | \
  1183. PIN_ODR_HIGH(GPIOH_PIN3) | \
  1184. PIN_ODR_HIGH(GPIOH_PIN4) | \
  1185. PIN_ODR_HIGH(GPIOH_PIN5) | \
  1186. PIN_ODR_HIGH(GPIOH_PIN6) | \
  1187. PIN_ODR_HIGH(GPIOH_PIN7) | \
  1188. PIN_ODR_HIGH(GPIOH_PIN8) | \
  1189. PIN_ODR_HIGH(GPIOH_PIN9) | \
  1190. PIN_ODR_HIGH(GPIOH_PIN10) | \
  1191. PIN_ODR_HIGH(GPIOH_PIN11) | \
  1192. PIN_ODR_HIGH(GPIOH_PIN12) | \
  1193. PIN_ODR_HIGH(GPIOH_PIN13) | \
  1194. PIN_ODR_HIGH(GPIOH_PIN14) | \
  1195. PIN_ODR_HIGH(GPIOH_PIN15))
  1196. #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \
  1197. PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \
  1198. PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
  1199. PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
  1200. PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
  1201. PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
  1202. PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
  1203. PIN_AFIO_AF(GPIOH_PIN7, 0U))
  1204. #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
  1205. PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
  1206. PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
  1207. PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
  1208. PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
  1209. PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
  1210. PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
  1211. PIN_AFIO_AF(GPIOH_PIN15, 0U))
  1212. /*
  1213. * GPIOI setup:
  1214. *
  1215. * PI0 - PIN0 (input pullup).
  1216. * PI1 - PIN1 (input pullup).
  1217. * PI2 - PIN2 (input pullup).
  1218. * PI3 - PIN3 (input pullup).
  1219. * PI4 - PIN4 (input pullup).
  1220. * PI5 - PIN5 (input pullup).
  1221. * PI6 - PIN6 (input pullup).
  1222. * PI7 - PIN7 (input pullup).
  1223. * PI8 - PIN8 (input pullup).
  1224. * PI9 - PIN9 (input pullup).
  1225. * PI10 - PIN10 (input pullup).
  1226. * PI11 - PIN11 (input pullup).
  1227. * PI12 - PIN12 (input pullup).
  1228. * PI13 - PIN13 (input pullup).
  1229. * PI14 - PIN14 (input pullup).
  1230. * PI15 - PIN15 (input pullup).
  1231. */
  1232. #define VAL_GPIOI_MODER (PIN_MODE_INPUT(GPIOI_PIN0) | \
  1233. PIN_MODE_INPUT(GPIOI_PIN1) | \
  1234. PIN_MODE_INPUT(GPIOI_PIN2) | \
  1235. PIN_MODE_INPUT(GPIOI_PIN3) | \
  1236. PIN_MODE_INPUT(GPIOI_PIN4) | \
  1237. PIN_MODE_INPUT(GPIOI_PIN5) | \
  1238. PIN_MODE_INPUT(GPIOI_PIN6) | \
  1239. PIN_MODE_INPUT(GPIOI_PIN7) | \
  1240. PIN_MODE_INPUT(GPIOI_PIN8) | \
  1241. PIN_MODE_INPUT(GPIOI_PIN9) | \
  1242. PIN_MODE_INPUT(GPIOI_PIN10) | \
  1243. PIN_MODE_INPUT(GPIOI_PIN11) | \
  1244. PIN_MODE_INPUT(GPIOI_PIN12) | \
  1245. PIN_MODE_INPUT(GPIOI_PIN13) | \
  1246. PIN_MODE_INPUT(GPIOI_PIN14) | \
  1247. PIN_MODE_INPUT(GPIOI_PIN15))
  1248. #define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL(GPIOI_PIN0) | \
  1249. PIN_OTYPE_PUSHPULL(GPIOI_PIN1) | \
  1250. PIN_OTYPE_PUSHPULL(GPIOI_PIN2) | \
  1251. PIN_OTYPE_PUSHPULL(GPIOI_PIN3) | \
  1252. PIN_OTYPE_PUSHPULL(GPIOI_PIN4) | \
  1253. PIN_OTYPE_PUSHPULL(GPIOI_PIN5) | \
  1254. PIN_OTYPE_PUSHPULL(GPIOI_PIN6) | \
  1255. PIN_OTYPE_PUSHPULL(GPIOI_PIN7) | \
  1256. PIN_OTYPE_PUSHPULL(GPIOI_PIN8) | \
  1257. PIN_OTYPE_PUSHPULL(GPIOI_PIN9) | \
  1258. PIN_OTYPE_PUSHPULL(GPIOI_PIN10) | \
  1259. PIN_OTYPE_PUSHPULL(GPIOI_PIN11) | \
  1260. PIN_OTYPE_PUSHPULL(GPIOI_PIN12) | \
  1261. PIN_OTYPE_PUSHPULL(GPIOI_PIN13) | \
  1262. PIN_OTYPE_PUSHPULL(GPIOI_PIN14) | \
  1263. PIN_OTYPE_PUSHPULL(GPIOI_PIN15))
  1264. #define VAL_GPIOI_OSPEEDR (PIN_OSPEED_HIGH(GPIOI_PIN0) | \
  1265. PIN_OSPEED_HIGH(GPIOI_PIN1) | \
  1266. PIN_OSPEED_HIGH(GPIOI_PIN2) | \
  1267. PIN_OSPEED_HIGH(GPIOI_PIN3) | \
  1268. PIN_OSPEED_HIGH(GPIOI_PIN4) | \
  1269. PIN_OSPEED_HIGH(GPIOI_PIN5) | \
  1270. PIN_OSPEED_HIGH(GPIOI_PIN6) | \
  1271. PIN_OSPEED_HIGH(GPIOI_PIN7) | \
  1272. PIN_OSPEED_HIGH(GPIOI_PIN8) | \
  1273. PIN_OSPEED_HIGH(GPIOI_PIN9) | \
  1274. PIN_OSPEED_HIGH(GPIOI_PIN10) | \
  1275. PIN_OSPEED_HIGH(GPIOI_PIN11) | \
  1276. PIN_OSPEED_HIGH(GPIOI_PIN12) | \
  1277. PIN_OSPEED_HIGH(GPIOI_PIN13) | \
  1278. PIN_OSPEED_HIGH(GPIOI_PIN14) | \
  1279. PIN_OSPEED_HIGH(GPIOI_PIN15))
  1280. #define VAL_GPIOI_PUPDR (PIN_PUPDR_PULLUP(GPIOI_PIN0) | \
  1281. PIN_PUPDR_PULLUP(GPIOI_PIN1) | \
  1282. PIN_PUPDR_PULLUP(GPIOI_PIN2) | \
  1283. PIN_PUPDR_PULLUP(GPIOI_PIN3) | \
  1284. PIN_PUPDR_PULLUP(GPIOI_PIN4) | \
  1285. PIN_PUPDR_PULLUP(GPIOI_PIN5) | \
  1286. PIN_PUPDR_PULLUP(GPIOI_PIN6) | \
  1287. PIN_PUPDR_PULLUP(GPIOI_PIN7) | \
  1288. PIN_PUPDR_PULLUP(GPIOI_PIN8) | \
  1289. PIN_PUPDR_PULLUP(GPIOI_PIN9) | \
  1290. PIN_PUPDR_PULLUP(GPIOI_PIN10) | \
  1291. PIN_PUPDR_PULLUP(GPIOI_PIN11) | \
  1292. PIN_PUPDR_PULLUP(GPIOI_PIN12) | \
  1293. PIN_PUPDR_PULLUP(GPIOI_PIN13) | \
  1294. PIN_PUPDR_PULLUP(GPIOI_PIN14) | \
  1295. PIN_PUPDR_PULLUP(GPIOI_PIN15))
  1296. #define VAL_GPIOI_ODR (PIN_ODR_HIGH(GPIOI_PIN0) | \
  1297. PIN_ODR_HIGH(GPIOI_PIN1) | \
  1298. PIN_ODR_HIGH(GPIOI_PIN2) | \
  1299. PIN_ODR_HIGH(GPIOI_PIN3) | \
  1300. PIN_ODR_HIGH(GPIOI_PIN4) | \
  1301. PIN_ODR_HIGH(GPIOI_PIN5) | \
  1302. PIN_ODR_HIGH(GPIOI_PIN6) | \
  1303. PIN_ODR_HIGH(GPIOI_PIN7) | \
  1304. PIN_ODR_HIGH(GPIOI_PIN8) | \
  1305. PIN_ODR_HIGH(GPIOI_PIN9) | \
  1306. PIN_ODR_HIGH(GPIOI_PIN10) | \
  1307. PIN_ODR_HIGH(GPIOI_PIN11) | \
  1308. PIN_ODR_HIGH(GPIOI_PIN12) | \
  1309. PIN_ODR_HIGH(GPIOI_PIN13) | \
  1310. PIN_ODR_HIGH(GPIOI_PIN14) | \
  1311. PIN_ODR_HIGH(GPIOI_PIN15))
  1312. #define VAL_GPIOI_AFRL (PIN_AFIO_AF(GPIOI_PIN0, 0U) | \
  1313. PIN_AFIO_AF(GPIOI_PIN1, 0U) | \
  1314. PIN_AFIO_AF(GPIOI_PIN2, 0U) | \
  1315. PIN_AFIO_AF(GPIOI_PIN3, 0U) | \
  1316. PIN_AFIO_AF(GPIOI_PIN4, 0U) | \
  1317. PIN_AFIO_AF(GPIOI_PIN5, 0U) | \
  1318. PIN_AFIO_AF(GPIOI_PIN6, 0U) | \
  1319. PIN_AFIO_AF(GPIOI_PIN7, 0U))
  1320. #define VAL_GPIOI_AFRH (PIN_AFIO_AF(GPIOI_PIN8, 0U) | \
  1321. PIN_AFIO_AF(GPIOI_PIN9, 0U) | \
  1322. PIN_AFIO_AF(GPIOI_PIN10, 0U) | \
  1323. PIN_AFIO_AF(GPIOI_PIN11, 0U) | \
  1324. PIN_AFIO_AF(GPIOI_PIN12, 0U) | \
  1325. PIN_AFIO_AF(GPIOI_PIN13, 0U) | \
  1326. PIN_AFIO_AF(GPIOI_PIN14, 0U) | \
  1327. PIN_AFIO_AF(GPIOI_PIN15, 0U))
  1328. /*===========================================================================*/
  1329. /* External declarations. */
  1330. /*===========================================================================*/
  1331. #if !defined(_FROM_ASM_)
  1332. #ifdef __cplusplus
  1333. extern "C" {
  1334. #endif
  1335. void boardInit(void);
  1336. #ifdef __cplusplus
  1337. }
  1338. #endif
  1339. #endif /* _FROM_ASM_ */
  1340. #endif /* BOARD_H */