board.h 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  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 STMicroelectronics STM32 Nucleo32-L031K6 board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_ST_NUCLEO32_L031K6
  29. #define BOARD_NAME "STMicroelectronics STM32 Nucleo32-L031K6"
  30. /*
  31. * Board oscillators-related settings.
  32. * NOTE: LSE not fitted.
  33. * NOTE: HSE not fitted.
  34. */
  35. #if !defined(STM32_LSECLK)
  36. #define STM32_LSECLK 0U
  37. #endif
  38. #define STM32_LSEDRV (3U << 11U)
  39. #if !defined(STM32_HSECLK)
  40. #define STM32_HSECLK 0U
  41. #endif
  42. /*
  43. * MCU type as defined in the ST header.
  44. */
  45. #define STM32L031xx
  46. /*
  47. * IO pins assignments.
  48. */
  49. #define GPIOA_ARD_A0 0U
  50. #define GPIOA_ARD_A1 1U
  51. #define GPIOA_VCP_TX 2U
  52. #define GPIOA_ARD_A2 3U
  53. #define GPIOA_ARD_A3 4U
  54. #define GPIOA_ARD_A4 5U
  55. #define GPIOA_ARD_A5 6U
  56. #define GPIOA_ARD_A6 7U
  57. #define GPIOA_ARD_D9 8U
  58. #define GPIOA_ARD_D1 9U
  59. #define GPIOA_ARD_D0 10U
  60. #define GPIOA_ARD_D10 11U
  61. #define GPIOA_ARD_D2 12U
  62. #define GPIOA_SWDIO 13U
  63. #define GPIOA_SWCLK 14U
  64. #define GPIOA_VCP_RX 15U
  65. #define GPIOB_ARD_D3 0U
  66. #define GPIOB_ARD_D6 1U
  67. #define GPIOB_PIN2 2U
  68. #define GPIOB_ARD_D13 3U
  69. #define GPIOB_LED_GREEN 3U
  70. #define GPIOB_ARD_D12 4U
  71. #define GPIOB_ARD_D11 5U
  72. #define GPIOB_ARD_D5 6U
  73. #define GPIOB_ARD_A5_ALT 6U
  74. #define GPIOB_ARD_D4 7U
  75. #define GPIOB_ARD_A4_ALT 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_PIN8 8U
  93. #define GPIOC_PIN9 9U
  94. #define GPIOC_PIN10 10U
  95. #define GPIOC_PIN11 11U
  96. #define GPIOC_PIN12 12U
  97. #define GPIOC_PIN13 13U
  98. #define GPIOC_PIN14 14U
  99. #define GPIOC_PIN15 15U
  100. #define GPIOD_PIN0 0U
  101. #define GPIOD_PIN1 1U
  102. #define GPIOD_PIN2 2U
  103. #define GPIOD_PIN3 3U
  104. #define GPIOD_PIN4 4U
  105. #define GPIOD_PIN5 5U
  106. #define GPIOD_PIN6 6U
  107. #define GPIOD_PIN7 7U
  108. #define GPIOD_PIN8 8U
  109. #define GPIOD_PIN9 9U
  110. #define GPIOD_PIN10 10U
  111. #define GPIOD_PIN11 11U
  112. #define GPIOD_PIN12 12U
  113. #define GPIOD_PIN13 13U
  114. #define GPIOD_PIN14 14U
  115. #define GPIOD_PIN15 15U
  116. #define GPIOE_PIN0 0U
  117. #define GPIOE_PIN1 1U
  118. #define GPIOE_PIN2 2U
  119. #define GPIOE_PIN3 3U
  120. #define GPIOE_PIN4 4U
  121. #define GPIOE_PIN5 5U
  122. #define GPIOE_PIN6 6U
  123. #define GPIOE_PIN7 7U
  124. #define GPIOE_PIN8 8U
  125. #define GPIOE_PIN9 9U
  126. #define GPIOE_PIN10 10U
  127. #define GPIOE_PIN11 11U
  128. #define GPIOE_PIN12 12U
  129. #define GPIOE_PIN13 13U
  130. #define GPIOE_PIN14 14U
  131. #define GPIOE_PIN15 15U
  132. #define GPIOF_ARD_D7 0U
  133. #define GPIOF_ARD_D8 1U
  134. #define GPIOF_PIN2 2U
  135. #define GPIOF_PIN3 3U
  136. #define GPIOF_PIN4 4U
  137. #define GPIOF_PIN5 5U
  138. #define GPIOF_PIN6 6U
  139. #define GPIOF_PIN7 7U
  140. #define GPIOF_PIN8 8U
  141. #define GPIOF_PIN9 9U
  142. #define GPIOF_PIN10 10U
  143. #define GPIOF_PIN11 11U
  144. #define GPIOF_PIN12 12U
  145. #define GPIOF_PIN13 13U
  146. #define GPIOF_PIN14 14U
  147. #define GPIOF_PIN15 15U
  148. #define GPIOH_OSC_IN 0U
  149. #define GPIOH_OSC_OUT 1U
  150. #define GPIOH_PIN2 2U
  151. #define GPIOH_PIN3 3U
  152. #define GPIOH_PIN4 4U
  153. #define GPIOH_PIN5 5U
  154. #define GPIOH_PIN6 6U
  155. #define GPIOH_PIN7 7U
  156. #define GPIOH_PIN8 8U
  157. #define GPIOH_PIN9 9U
  158. #define GPIOH_PIN10 10U
  159. #define GPIOH_PIN11 11U
  160. #define GPIOH_PIN12 12U
  161. #define GPIOH_PIN13 13U
  162. #define GPIOH_PIN14 14U
  163. #define GPIOH_PIN15 15U
  164. /*
  165. * IO lines assignments.
  166. */
  167. #define LINE_ARD_A0 PAL_LINE(GPIOA, 0U)
  168. #define LINE_ARD_A1 PAL_LINE(GPIOA, 1U)
  169. #define LINE_VCP_TX PAL_LINE(GPIOA, 2U)
  170. #define LINE_ARD_A2 PAL_LINE(GPIOA, 3U)
  171. #define LINE_ARD_A3 PAL_LINE(GPIOA, 4U)
  172. #define LINE_ARD_A4 PAL_LINE(GPIOA, 5U)
  173. #define LINE_ARD_A5 PAL_LINE(GPIOA, 6U)
  174. #define LINE_ARD_A6 PAL_LINE(GPIOA, 7U)
  175. #define LINE_ARD_D9 PAL_LINE(GPIOA, 8U)
  176. #define LINE_ARD_D1 PAL_LINE(GPIOA, 9U)
  177. #define LINE_ARD_D0 PAL_LINE(GPIOA, 10U)
  178. #define LINE_ARD_D10 PAL_LINE(GPIOA, 11U)
  179. #define LINE_ARD_D2 PAL_LINE(GPIOA, 12U)
  180. #define LINE_SWDIO PAL_LINE(GPIOA, 13U)
  181. #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
  182. #define LINE_VCP_RX PAL_LINE(GPIOA, 15U)
  183. #define LINE_ARD_D3 PAL_LINE(GPIOB, 0U)
  184. #define LINE_ARD_D6 PAL_LINE(GPIOB, 1U)
  185. #define LINE_ARD_D13 PAL_LINE(GPIOB, 3U)
  186. #define LINE_LED_GREEN PAL_LINE(GPIOB, 3U)
  187. #define LINE_ARD_D12 PAL_LINE(GPIOB, 4U)
  188. #define LINE_ARD_D11 PAL_LINE(GPIOB, 5U)
  189. #define LINE_ARD_D5 PAL_LINE(GPIOB, 6U)
  190. #define LINE_ARD_A5_ALT PAL_LINE(GPIOB, 6U)
  191. #define LINE_ARD_D4 PAL_LINE(GPIOB, 7U)
  192. #define LINE_ARD_A4_ALT PAL_LINE(GPIOB, 7U)
  193. #define LINE_ARD_D7 PAL_LINE(GPIOF, 0U)
  194. #define LINE_ARD_D8 PAL_LINE(GPIOF, 1U)
  195. #define LINE_OSC_IN PAL_LINE(GPIOH, 0U)
  196. #define LINE_OSC_OUT PAL_LINE(GPIOH, 1U)
  197. /*===========================================================================*/
  198. /* Driver pre-compile time settings. */
  199. /*===========================================================================*/
  200. /*===========================================================================*/
  201. /* Derived constants and error checks. */
  202. /*===========================================================================*/
  203. /*===========================================================================*/
  204. /* Driver data structures and types. */
  205. /*===========================================================================*/
  206. /*===========================================================================*/
  207. /* Driver macros. */
  208. /*===========================================================================*/
  209. /*
  210. * I/O ports initial setup, this configuration is established soon after reset
  211. * in the initialization code.
  212. * Please refer to the STM32 Reference Manual for details.
  213. */
  214. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  215. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  216. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  217. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  218. #define PIN_ODR_LOW(n) (0U << (n))
  219. #define PIN_ODR_HIGH(n) (1U << (n))
  220. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  221. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  222. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  223. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  224. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  225. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  226. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  227. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  228. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  229. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  230. /*
  231. * GPIOA setup:
  232. *
  233. * PA0 - ARD_A0 (input pullup).
  234. * PA1 - ARD_A1 (input pullup).
  235. * PA2 - VCP_TX (alternate 4).
  236. * PA3 - ARD_A2 (input pullup).
  237. * PA4 - ARD_A3 (input pullup).
  238. * PA5 - ARD_A4 (input pullup).
  239. * PA6 - ARD_A5 (input pullup).
  240. * PA7 - ARD_A6 (input pullup).
  241. * PA8 - ARD_D9 (input pullup).
  242. * PA9 - ARD_D1 (input pullup).
  243. * PA10 - ARD_D0 (input pullup).
  244. * PA11 - ARD_D10 (input pullup).
  245. * PA12 - ARD_D2 (input pullup).
  246. * PA13 - SWDIO (alternate 0).
  247. * PA14 - SWCLK (alternate 0).
  248. * PA15 - VCP_RX (alternate 4).
  249. */
  250. #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_ARD_A0) | \
  251. PIN_MODE_INPUT(GPIOA_ARD_A1) | \
  252. PIN_MODE_ALTERNATE(GPIOA_VCP_TX) | \
  253. PIN_MODE_INPUT(GPIOA_ARD_A2) | \
  254. PIN_MODE_INPUT(GPIOA_ARD_A3) | \
  255. PIN_MODE_INPUT(GPIOA_ARD_A4) | \
  256. PIN_MODE_INPUT(GPIOA_ARD_A5) | \
  257. PIN_MODE_INPUT(GPIOA_ARD_A6) | \
  258. PIN_MODE_INPUT(GPIOA_ARD_D9) | \
  259. PIN_MODE_INPUT(GPIOA_ARD_D1) | \
  260. PIN_MODE_INPUT(GPIOA_ARD_D0) | \
  261. PIN_MODE_INPUT(GPIOA_ARD_D10) | \
  262. PIN_MODE_INPUT(GPIOA_ARD_D2) | \
  263. PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
  264. PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
  265. PIN_MODE_ALTERNATE(GPIOA_VCP_RX))
  266. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \
  267. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \
  268. PIN_OTYPE_PUSHPULL(GPIOA_VCP_TX) | \
  269. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A2) | \
  270. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A3) | \
  271. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A4) | \
  272. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A5) | \
  273. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A6) | \
  274. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D9) | \
  275. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D1) | \
  276. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D0) | \
  277. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D10) | \
  278. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D2) | \
  279. PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
  280. PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
  281. PIN_OTYPE_PUSHPULL(GPIOA_VCP_RX))
  282. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_ARD_A0) | \
  283. PIN_OSPEED_HIGH(GPIOA_ARD_A1) | \
  284. PIN_OSPEED_MEDIUM(GPIOA_VCP_TX) | \
  285. PIN_OSPEED_MEDIUM(GPIOA_ARD_A2) | \
  286. PIN_OSPEED_HIGH(GPIOA_ARD_A3) | \
  287. PIN_OSPEED_MEDIUM(GPIOA_ARD_A4) | \
  288. PIN_OSPEED_HIGH(GPIOA_ARD_A5) | \
  289. PIN_OSPEED_HIGH(GPIOA_ARD_A6) | \
  290. PIN_OSPEED_HIGH(GPIOA_ARD_D9) | \
  291. PIN_OSPEED_HIGH(GPIOA_ARD_D1) | \
  292. PIN_OSPEED_HIGH(GPIOA_ARD_D0) | \
  293. PIN_OSPEED_HIGH(GPIOA_ARD_D10) | \
  294. PIN_OSPEED_HIGH(GPIOA_ARD_D2) | \
  295. PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
  296. PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
  297. PIN_OSPEED_HIGH(GPIOA_VCP_RX))
  298. #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_ARD_A0) | \
  299. PIN_PUPDR_PULLUP(GPIOA_ARD_A1) | \
  300. PIN_PUPDR_FLOATING(GPIOA_VCP_TX) | \
  301. PIN_PUPDR_PULLUP(GPIOA_ARD_A2) | \
  302. PIN_PUPDR_PULLUP(GPIOA_ARD_A3) | \
  303. PIN_PUPDR_PULLUP(GPIOA_ARD_A4) | \
  304. PIN_PUPDR_PULLUP(GPIOA_ARD_A5) | \
  305. PIN_PUPDR_PULLUP(GPIOA_ARD_A6) | \
  306. PIN_PUPDR_PULLUP(GPIOA_ARD_D9) | \
  307. PIN_PUPDR_PULLUP(GPIOA_ARD_D1) | \
  308. PIN_PUPDR_PULLUP(GPIOA_ARD_D0) | \
  309. PIN_PUPDR_PULLUP(GPIOA_ARD_D10) | \
  310. PIN_PUPDR_PULLUP(GPIOA_ARD_D2) | \
  311. PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
  312. PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
  313. PIN_PUPDR_FLOATING(GPIOA_VCP_RX))
  314. #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_ARD_A0) | \
  315. PIN_ODR_HIGH(GPIOA_ARD_A1) | \
  316. PIN_ODR_HIGH(GPIOA_VCP_TX) | \
  317. PIN_ODR_HIGH(GPIOA_ARD_A2) | \
  318. PIN_ODR_HIGH(GPIOA_ARD_A3) | \
  319. PIN_ODR_LOW(GPIOA_ARD_A4) | \
  320. PIN_ODR_HIGH(GPIOA_ARD_A5) | \
  321. PIN_ODR_HIGH(GPIOA_ARD_A6) | \
  322. PIN_ODR_HIGH(GPIOA_ARD_D9) | \
  323. PIN_ODR_HIGH(GPIOA_ARD_D1) | \
  324. PIN_ODR_HIGH(GPIOA_ARD_D0) | \
  325. PIN_ODR_HIGH(GPIOA_ARD_D10) | \
  326. PIN_ODR_HIGH(GPIOA_ARD_D2) | \
  327. PIN_ODR_HIGH(GPIOA_SWDIO) | \
  328. PIN_ODR_HIGH(GPIOA_SWCLK) | \
  329. PIN_ODR_HIGH(GPIOA_VCP_RX))
  330. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \
  331. PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \
  332. PIN_AFIO_AF(GPIOA_VCP_TX, 4U) | \
  333. PIN_AFIO_AF(GPIOA_ARD_A2, 0U) | \
  334. PIN_AFIO_AF(GPIOA_ARD_A3, 0U) | \
  335. PIN_AFIO_AF(GPIOA_ARD_A4, 0U) | \
  336. PIN_AFIO_AF(GPIOA_ARD_A5, 0U) | \
  337. PIN_AFIO_AF(GPIOA_ARD_A6, 0U))
  338. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_ARD_D9, 0U) | \
  339. PIN_AFIO_AF(GPIOA_ARD_D1, 0U) | \
  340. PIN_AFIO_AF(GPIOA_ARD_D0, 0U) | \
  341. PIN_AFIO_AF(GPIOA_ARD_D10, 0U) | \
  342. PIN_AFIO_AF(GPIOA_ARD_D2, 0U) | \
  343. PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
  344. PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
  345. PIN_AFIO_AF(GPIOA_VCP_RX, 4U))
  346. /*
  347. * GPIOB setup:
  348. *
  349. * PB0 - ARD_D3 (input pullup).
  350. * PB1 - ARD_D6 (input pullup).
  351. * PB2 - PIN2 (input pullup).
  352. * PB3 - ARD_D13 LED_GREEN (output pushpull maximum).
  353. * PB4 - ARD_D12 (input pullup).
  354. * PB5 - ARD_D11 (input pullup).
  355. * PB6 - ARD_D5 ARD_A5_ALT (input pullup).
  356. * PB7 - ARD_D4 ARD_A4_ALT (input pullup).
  357. * PB8 - PIN8 (input pullup).
  358. * PB9 - PIN9 (input pullup).
  359. * PB10 - PIN10 (input pullup).
  360. * PB11 - PIN11 (input pullup).
  361. * PB12 - PIN12 (input pullup).
  362. * PB13 - PIN13 (input pullup).
  363. * PB14 - PIN14 (input pullup).
  364. * PB15 - PIN15 (input pullup).
  365. */
  366. #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ARD_D3) | \
  367. PIN_MODE_INPUT(GPIOB_ARD_D6) | \
  368. PIN_MODE_INPUT(GPIOB_PIN2) | \
  369. PIN_MODE_OUTPUT(GPIOB_ARD_D13) | \
  370. PIN_MODE_INPUT(GPIOB_ARD_D12) | \
  371. PIN_MODE_INPUT(GPIOB_ARD_D11) | \
  372. PIN_MODE_INPUT(GPIOB_ARD_D5) | \
  373. PIN_MODE_INPUT(GPIOB_ARD_D4) | \
  374. PIN_MODE_INPUT(GPIOB_PIN8) | \
  375. PIN_MODE_INPUT(GPIOB_PIN9) | \
  376. PIN_MODE_INPUT(GPIOB_PIN10) | \
  377. PIN_MODE_INPUT(GPIOB_PIN11) | \
  378. PIN_MODE_INPUT(GPIOB_PIN12) | \
  379. PIN_MODE_INPUT(GPIOB_PIN13) | \
  380. PIN_MODE_INPUT(GPIOB_PIN14) | \
  381. PIN_MODE_INPUT(GPIOB_PIN15))
  382. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ARD_D3) | \
  383. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D6) | \
  384. PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
  385. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D13) | \
  386. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D12) | \
  387. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D11) | \
  388. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D5) | \
  389. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D4) | \
  390. PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
  391. PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
  392. PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
  393. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  394. PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
  395. PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
  396. PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
  397. PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
  398. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ARD_D3) | \
  399. PIN_OSPEED_HIGH(GPIOB_ARD_D6) | \
  400. PIN_OSPEED_HIGH(GPIOB_PIN2) | \
  401. PIN_OSPEED_HIGH(GPIOB_ARD_D13) | \
  402. PIN_OSPEED_HIGH(GPIOB_ARD_D12) | \
  403. PIN_OSPEED_HIGH(GPIOB_ARD_D11) | \
  404. PIN_OSPEED_HIGH(GPIOB_ARD_D5) | \
  405. PIN_OSPEED_HIGH(GPIOB_ARD_D4) | \
  406. PIN_OSPEED_HIGH(GPIOB_PIN8) | \
  407. PIN_OSPEED_HIGH(GPIOB_PIN9) | \
  408. PIN_OSPEED_HIGH(GPIOB_PIN10) | \
  409. PIN_OSPEED_HIGH(GPIOB_PIN11) | \
  410. PIN_OSPEED_HIGH(GPIOB_PIN12) | \
  411. PIN_OSPEED_HIGH(GPIOB_PIN13) | \
  412. PIN_OSPEED_HIGH(GPIOB_PIN14) | \
  413. PIN_OSPEED_HIGH(GPIOB_PIN15))
  414. #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ARD_D3) | \
  415. PIN_PUPDR_PULLUP(GPIOB_ARD_D6) | \
  416. PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
  417. PIN_PUPDR_FLOATING(GPIOB_ARD_D13) | \
  418. PIN_PUPDR_PULLUP(GPIOB_ARD_D12) | \
  419. PIN_PUPDR_PULLUP(GPIOB_ARD_D11) | \
  420. PIN_PUPDR_PULLUP(GPIOB_ARD_D5) | \
  421. PIN_PUPDR_PULLUP(GPIOB_ARD_D4) | \
  422. PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
  423. PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
  424. PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
  425. PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
  426. PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
  427. PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
  428. PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
  429. PIN_PUPDR_PULLUP(GPIOB_PIN15))
  430. #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ARD_D3) | \
  431. PIN_ODR_HIGH(GPIOB_ARD_D6) | \
  432. PIN_ODR_HIGH(GPIOB_PIN2) | \
  433. PIN_ODR_LOW(GPIOB_ARD_D13) | \
  434. PIN_ODR_HIGH(GPIOB_ARD_D12) | \
  435. PIN_ODR_HIGH(GPIOB_ARD_D11) | \
  436. PIN_ODR_HIGH(GPIOB_ARD_D5) | \
  437. PIN_ODR_HIGH(GPIOB_ARD_D4) | \
  438. PIN_ODR_HIGH(GPIOB_PIN8) | \
  439. PIN_ODR_HIGH(GPIOB_PIN9) | \
  440. PIN_ODR_HIGH(GPIOB_PIN10) | \
  441. PIN_ODR_HIGH(GPIOB_PIN11) | \
  442. PIN_ODR_HIGH(GPIOB_PIN12) | \
  443. PIN_ODR_HIGH(GPIOB_PIN13) | \
  444. PIN_ODR_HIGH(GPIOB_PIN14) | \
  445. PIN_ODR_HIGH(GPIOB_PIN15))
  446. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ARD_D3, 0U) | \
  447. PIN_AFIO_AF(GPIOB_ARD_D6, 0U) | \
  448. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  449. PIN_AFIO_AF(GPIOB_ARD_D13, 0U) | \
  450. PIN_AFIO_AF(GPIOB_ARD_D12, 0U) | \
  451. PIN_AFIO_AF(GPIOB_ARD_D11, 0U) | \
  452. PIN_AFIO_AF(GPIOB_ARD_D5, 0U) | \
  453. PIN_AFIO_AF(GPIOB_ARD_D4, 0U))
  454. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  455. PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
  456. PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
  457. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  458. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  459. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  460. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  461. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  462. /*
  463. * GPIOC setup:
  464. *
  465. * PC0 - PIN0 (input pullup).
  466. * PC1 - PIN1 (input pullup).
  467. * PC2 - PIN2 (input pullup).
  468. * PC3 - PIN3 (input pullup).
  469. * PC4 - PIN4 (input pullup).
  470. * PC5 - PIN5 (input pullup).
  471. * PC6 - PIN6 (input pullup).
  472. * PC7 - PIN7 (input pullup).
  473. * PC8 - PIN8 (input pullup).
  474. * PC9 - PIN9 (input pullup).
  475. * PC10 - PIN10 (input pullup).
  476. * PC11 - PIN11 (input pullup).
  477. * PC12 - PIN12 (input pullup).
  478. * PC13 - PIN13 (input pullup).
  479. * PC14 - PIN14 (input pullup).
  480. * PC15 - PIN15 (input pullup).
  481. */
  482. #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
  483. PIN_MODE_INPUT(GPIOC_PIN1) | \
  484. PIN_MODE_INPUT(GPIOC_PIN2) | \
  485. PIN_MODE_INPUT(GPIOC_PIN3) | \
  486. PIN_MODE_INPUT(GPIOC_PIN4) | \
  487. PIN_MODE_INPUT(GPIOC_PIN5) | \
  488. PIN_MODE_INPUT(GPIOC_PIN6) | \
  489. PIN_MODE_INPUT(GPIOC_PIN7) | \
  490. PIN_MODE_INPUT(GPIOC_PIN8) | \
  491. PIN_MODE_INPUT(GPIOC_PIN9) | \
  492. PIN_MODE_INPUT(GPIOC_PIN10) | \
  493. PIN_MODE_INPUT(GPIOC_PIN11) | \
  494. PIN_MODE_INPUT(GPIOC_PIN12) | \
  495. PIN_MODE_INPUT(GPIOC_PIN13) | \
  496. PIN_MODE_INPUT(GPIOC_PIN14) | \
  497. PIN_MODE_INPUT(GPIOC_PIN15))
  498. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  499. PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
  500. PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
  501. PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
  502. PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
  503. PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
  504. PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
  505. PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
  506. PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
  507. PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
  508. PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
  509. PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
  510. PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
  511. PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
  512. PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
  513. PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
  514. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \
  515. PIN_OSPEED_HIGH(GPIOC_PIN1) | \
  516. PIN_OSPEED_HIGH(GPIOC_PIN2) | \
  517. PIN_OSPEED_HIGH(GPIOC_PIN3) | \
  518. PIN_OSPEED_HIGH(GPIOC_PIN4) | \
  519. PIN_OSPEED_HIGH(GPIOC_PIN5) | \
  520. PIN_OSPEED_HIGH(GPIOC_PIN6) | \
  521. PIN_OSPEED_HIGH(GPIOC_PIN7) | \
  522. PIN_OSPEED_HIGH(GPIOC_PIN8) | \
  523. PIN_OSPEED_HIGH(GPIOC_PIN9) | \
  524. PIN_OSPEED_HIGH(GPIOC_PIN10) | \
  525. PIN_OSPEED_HIGH(GPIOC_PIN11) | \
  526. PIN_OSPEED_HIGH(GPIOC_PIN12) | \
  527. PIN_OSPEED_HIGH(GPIOC_PIN13) | \
  528. PIN_OSPEED_HIGH(GPIOC_PIN14) | \
  529. PIN_OSPEED_HIGH(GPIOC_PIN15))
  530. #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
  531. PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
  532. PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
  533. PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
  534. PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
  535. PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
  536. PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
  537. PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
  538. PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
  539. PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
  540. PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
  541. PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
  542. PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
  543. PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
  544. PIN_PUPDR_PULLUP(GPIOC_PIN14) | \
  545. PIN_PUPDR_PULLUP(GPIOC_PIN15))
  546. #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
  547. PIN_ODR_HIGH(GPIOC_PIN1) | \
  548. PIN_ODR_HIGH(GPIOC_PIN2) | \
  549. PIN_ODR_HIGH(GPIOC_PIN3) | \
  550. PIN_ODR_HIGH(GPIOC_PIN4) | \
  551. PIN_ODR_HIGH(GPIOC_PIN5) | \
  552. PIN_ODR_HIGH(GPIOC_PIN6) | \
  553. PIN_ODR_HIGH(GPIOC_PIN7) | \
  554. PIN_ODR_HIGH(GPIOC_PIN8) | \
  555. PIN_ODR_HIGH(GPIOC_PIN9) | \
  556. PIN_ODR_HIGH(GPIOC_PIN10) | \
  557. PIN_ODR_HIGH(GPIOC_PIN11) | \
  558. PIN_ODR_HIGH(GPIOC_PIN12) | \
  559. PIN_ODR_HIGH(GPIOC_PIN13) | \
  560. PIN_ODR_HIGH(GPIOC_PIN14) | \
  561. PIN_ODR_HIGH(GPIOC_PIN15))
  562. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  563. PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
  564. PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
  565. PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
  566. PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
  567. PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
  568. PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
  569. PIN_AFIO_AF(GPIOC_PIN7, 0U))
  570. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
  571. PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
  572. PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
  573. PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
  574. PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
  575. PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
  576. PIN_AFIO_AF(GPIOC_PIN14, 0U) | \
  577. PIN_AFIO_AF(GPIOC_PIN15, 0U))
  578. /*
  579. * GPIOD setup:
  580. *
  581. * PD0 - PIN0 (input pullup).
  582. * PD1 - PIN1 (input pullup).
  583. * PD2 - PIN2 (input pullup).
  584. * PD3 - PIN3 (input pullup).
  585. * PD4 - PIN4 (input pullup).
  586. * PD5 - PIN5 (input pullup).
  587. * PD6 - PIN6 (input pullup).
  588. * PD7 - PIN7 (input pullup).
  589. * PD8 - PIN8 (input pullup).
  590. * PD9 - PIN9 (input pullup).
  591. * PD10 - PIN10 (input pullup).
  592. * PD11 - PIN11 (input pullup).
  593. * PD12 - PIN12 (input pullup).
  594. * PD13 - PIN13 (input pullup).
  595. * PD14 - PIN14 (input pullup).
  596. * PD15 - PIN15 (input pullup).
  597. */
  598. #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
  599. PIN_MODE_INPUT(GPIOD_PIN1) | \
  600. PIN_MODE_INPUT(GPIOD_PIN2) | \
  601. PIN_MODE_INPUT(GPIOD_PIN3) | \
  602. PIN_MODE_INPUT(GPIOD_PIN4) | \
  603. PIN_MODE_INPUT(GPIOD_PIN5) | \
  604. PIN_MODE_INPUT(GPIOD_PIN6) | \
  605. PIN_MODE_INPUT(GPIOD_PIN7) | \
  606. PIN_MODE_INPUT(GPIOD_PIN8) | \
  607. PIN_MODE_INPUT(GPIOD_PIN9) | \
  608. PIN_MODE_INPUT(GPIOD_PIN10) | \
  609. PIN_MODE_INPUT(GPIOD_PIN11) | \
  610. PIN_MODE_INPUT(GPIOD_PIN12) | \
  611. PIN_MODE_INPUT(GPIOD_PIN13) | \
  612. PIN_MODE_INPUT(GPIOD_PIN14) | \
  613. PIN_MODE_INPUT(GPIOD_PIN15))
  614. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  615. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  616. PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
  617. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  618. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  619. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  620. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  621. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  622. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  623. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  624. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  625. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  626. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  627. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  628. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  629. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  630. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
  631. PIN_OSPEED_HIGH(GPIOD_PIN1) | \
  632. PIN_OSPEED_HIGH(GPIOD_PIN2) | \
  633. PIN_OSPEED_HIGH(GPIOD_PIN3) | \
  634. PIN_OSPEED_HIGH(GPIOD_PIN4) | \
  635. PIN_OSPEED_HIGH(GPIOD_PIN5) | \
  636. PIN_OSPEED_HIGH(GPIOD_PIN6) | \
  637. PIN_OSPEED_HIGH(GPIOD_PIN7) | \
  638. PIN_OSPEED_HIGH(GPIOD_PIN8) | \
  639. PIN_OSPEED_HIGH(GPIOD_PIN9) | \
  640. PIN_OSPEED_HIGH(GPIOD_PIN10) | \
  641. PIN_OSPEED_HIGH(GPIOD_PIN11) | \
  642. PIN_OSPEED_HIGH(GPIOD_PIN12) | \
  643. PIN_OSPEED_HIGH(GPIOD_PIN13) | \
  644. PIN_OSPEED_HIGH(GPIOD_PIN14) | \
  645. PIN_OSPEED_HIGH(GPIOD_PIN15))
  646. #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
  647. PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
  648. PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
  649. PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
  650. PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
  651. PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
  652. PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
  653. PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
  654. PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
  655. PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
  656. PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
  657. PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
  658. PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
  659. PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
  660. PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
  661. PIN_PUPDR_PULLUP(GPIOD_PIN15))
  662. #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
  663. PIN_ODR_HIGH(GPIOD_PIN1) | \
  664. PIN_ODR_HIGH(GPIOD_PIN2) | \
  665. PIN_ODR_HIGH(GPIOD_PIN3) | \
  666. PIN_ODR_HIGH(GPIOD_PIN4) | \
  667. PIN_ODR_HIGH(GPIOD_PIN5) | \
  668. PIN_ODR_HIGH(GPIOD_PIN6) | \
  669. PIN_ODR_HIGH(GPIOD_PIN7) | \
  670. PIN_ODR_HIGH(GPIOD_PIN8) | \
  671. PIN_ODR_HIGH(GPIOD_PIN9) | \
  672. PIN_ODR_HIGH(GPIOD_PIN10) | \
  673. PIN_ODR_HIGH(GPIOD_PIN11) | \
  674. PIN_ODR_HIGH(GPIOD_PIN12) | \
  675. PIN_ODR_HIGH(GPIOD_PIN13) | \
  676. PIN_ODR_HIGH(GPIOD_PIN14) | \
  677. PIN_ODR_HIGH(GPIOD_PIN15))
  678. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
  679. PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
  680. PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
  681. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  682. PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
  683. PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
  684. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  685. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  686. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
  687. PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
  688. PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
  689. PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
  690. PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
  691. PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
  692. PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
  693. PIN_AFIO_AF(GPIOD_PIN15, 0U))
  694. /*
  695. * GPIOE setup:
  696. *
  697. * PE0 - PIN0 (input pullup).
  698. * PE1 - PIN1 (input pullup).
  699. * PE2 - PIN2 (input pullup).
  700. * PE3 - PIN3 (input pullup).
  701. * PE4 - PIN4 (input pullup).
  702. * PE5 - PIN5 (input pullup).
  703. * PE6 - PIN6 (input pullup).
  704. * PE7 - PIN7 (input pullup).
  705. * PE8 - PIN8 (input pullup).
  706. * PE9 - PIN9 (input pullup).
  707. * PE10 - PIN10 (input pullup).
  708. * PE11 - PIN11 (input pullup).
  709. * PE12 - PIN12 (input pullup).
  710. * PE13 - PIN13 (input pullup).
  711. * PE14 - PIN14 (input pullup).
  712. * PE15 - PIN15 (input pullup).
  713. */
  714. #define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
  715. PIN_MODE_INPUT(GPIOE_PIN1) | \
  716. PIN_MODE_INPUT(GPIOE_PIN2) | \
  717. PIN_MODE_INPUT(GPIOE_PIN3) | \
  718. PIN_MODE_INPUT(GPIOE_PIN4) | \
  719. PIN_MODE_INPUT(GPIOE_PIN5) | \
  720. PIN_MODE_INPUT(GPIOE_PIN6) | \
  721. PIN_MODE_INPUT(GPIOE_PIN7) | \
  722. PIN_MODE_INPUT(GPIOE_PIN8) | \
  723. PIN_MODE_INPUT(GPIOE_PIN9) | \
  724. PIN_MODE_INPUT(GPIOE_PIN10) | \
  725. PIN_MODE_INPUT(GPIOE_PIN11) | \
  726. PIN_MODE_INPUT(GPIOE_PIN12) | \
  727. PIN_MODE_INPUT(GPIOE_PIN13) | \
  728. PIN_MODE_INPUT(GPIOE_PIN14) | \
  729. PIN_MODE_INPUT(GPIOE_PIN15))
  730. #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
  731. PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
  732. PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
  733. PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
  734. PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
  735. PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
  736. PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
  737. PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
  738. PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
  739. PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
  740. PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
  741. PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
  742. PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
  743. PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
  744. PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
  745. PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
  746. #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
  747. PIN_OSPEED_HIGH(GPIOE_PIN1) | \
  748. PIN_OSPEED_HIGH(GPIOE_PIN2) | \
  749. PIN_OSPEED_HIGH(GPIOE_PIN3) | \
  750. PIN_OSPEED_HIGH(GPIOE_PIN4) | \
  751. PIN_OSPEED_HIGH(GPIOE_PIN5) | \
  752. PIN_OSPEED_HIGH(GPIOE_PIN6) | \
  753. PIN_OSPEED_HIGH(GPIOE_PIN7) | \
  754. PIN_OSPEED_HIGH(GPIOE_PIN8) | \
  755. PIN_OSPEED_HIGH(GPIOE_PIN9) | \
  756. PIN_OSPEED_HIGH(GPIOE_PIN10) | \
  757. PIN_OSPEED_HIGH(GPIOE_PIN11) | \
  758. PIN_OSPEED_HIGH(GPIOE_PIN12) | \
  759. PIN_OSPEED_HIGH(GPIOE_PIN13) | \
  760. PIN_OSPEED_HIGH(GPIOE_PIN14) | \
  761. PIN_OSPEED_HIGH(GPIOE_PIN15))
  762. #define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
  763. PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
  764. PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
  765. PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
  766. PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
  767. PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
  768. PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
  769. PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
  770. PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
  771. PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
  772. PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
  773. PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
  774. PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
  775. PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
  776. PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
  777. PIN_PUPDR_PULLUP(GPIOE_PIN15))
  778. #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
  779. PIN_ODR_HIGH(GPIOE_PIN1) | \
  780. PIN_ODR_HIGH(GPIOE_PIN2) | \
  781. PIN_ODR_HIGH(GPIOE_PIN3) | \
  782. PIN_ODR_HIGH(GPIOE_PIN4) | \
  783. PIN_ODR_HIGH(GPIOE_PIN5) | \
  784. PIN_ODR_HIGH(GPIOE_PIN6) | \
  785. PIN_ODR_HIGH(GPIOE_PIN7) | \
  786. PIN_ODR_HIGH(GPIOE_PIN8) | \
  787. PIN_ODR_HIGH(GPIOE_PIN9) | \
  788. PIN_ODR_HIGH(GPIOE_PIN10) | \
  789. PIN_ODR_HIGH(GPIOE_PIN11) | \
  790. PIN_ODR_HIGH(GPIOE_PIN12) | \
  791. PIN_ODR_HIGH(GPIOE_PIN13) | \
  792. PIN_ODR_HIGH(GPIOE_PIN14) | \
  793. PIN_ODR_HIGH(GPIOE_PIN15))
  794. #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
  795. PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
  796. PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
  797. PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
  798. PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
  799. PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
  800. PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
  801. PIN_AFIO_AF(GPIOE_PIN7, 0U))
  802. #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
  803. PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
  804. PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
  805. PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
  806. PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
  807. PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
  808. PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
  809. PIN_AFIO_AF(GPIOE_PIN15, 0U))
  810. /*
  811. * GPIOF setup:
  812. *
  813. * PF0 - ARD_D7 (input pullup).
  814. * PF1 - ARD_D8 (input pullup).
  815. * PF2 - PIN2 (input pullup).
  816. * PF3 - PIN3 (input pullup).
  817. * PF4 - PIN4 (input pullup).
  818. * PF5 - PIN5 (input pullup).
  819. * PF6 - PIN6 (input pullup).
  820. * PF7 - PIN7 (input pullup).
  821. * PF8 - PIN8 (input pullup).
  822. * PF9 - PIN9 (input pullup).
  823. * PF10 - PIN10 (input pullup).
  824. * PF11 - PIN11 (input pullup).
  825. * PF12 - PIN12 (input pullup).
  826. * PF13 - PIN13 (input pullup).
  827. * PF14 - PIN14 (input pullup).
  828. * PF15 - PIN15 (input pullup).
  829. */
  830. #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_ARD_D7) | \
  831. PIN_MODE_INPUT(GPIOF_ARD_D8) | \
  832. PIN_MODE_INPUT(GPIOF_PIN2) | \
  833. PIN_MODE_INPUT(GPIOF_PIN3) | \
  834. PIN_MODE_INPUT(GPIOF_PIN4) | \
  835. PIN_MODE_INPUT(GPIOF_PIN5) | \
  836. PIN_MODE_INPUT(GPIOF_PIN6) | \
  837. PIN_MODE_INPUT(GPIOF_PIN7) | \
  838. PIN_MODE_INPUT(GPIOF_PIN8) | \
  839. PIN_MODE_INPUT(GPIOF_PIN9) | \
  840. PIN_MODE_INPUT(GPIOF_PIN10) | \
  841. PIN_MODE_INPUT(GPIOF_PIN11) | \
  842. PIN_MODE_INPUT(GPIOF_PIN12) | \
  843. PIN_MODE_INPUT(GPIOF_PIN13) | \
  844. PIN_MODE_INPUT(GPIOF_PIN14) | \
  845. PIN_MODE_INPUT(GPIOF_PIN15))
  846. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_ARD_D7) | \
  847. PIN_OTYPE_PUSHPULL(GPIOF_ARD_D8) | \
  848. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  849. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  850. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  851. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  852. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  853. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  854. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  855. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  856. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  857. PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
  858. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  859. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  860. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  861. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  862. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_ARD_D7) | \
  863. PIN_OSPEED_HIGH(GPIOF_ARD_D8) | \
  864. PIN_OSPEED_HIGH(GPIOF_PIN2) | \
  865. PIN_OSPEED_HIGH(GPIOF_PIN3) | \
  866. PIN_OSPEED_HIGH(GPIOF_PIN4) | \
  867. PIN_OSPEED_HIGH(GPIOF_PIN5) | \
  868. PIN_OSPEED_HIGH(GPIOF_PIN6) | \
  869. PIN_OSPEED_HIGH(GPIOF_PIN7) | \
  870. PIN_OSPEED_HIGH(GPIOF_PIN8) | \
  871. PIN_OSPEED_HIGH(GPIOF_PIN9) | \
  872. PIN_OSPEED_HIGH(GPIOF_PIN10) | \
  873. PIN_OSPEED_HIGH(GPIOF_PIN11) | \
  874. PIN_OSPEED_HIGH(GPIOF_PIN12) | \
  875. PIN_OSPEED_HIGH(GPIOF_PIN13) | \
  876. PIN_OSPEED_HIGH(GPIOF_PIN14) | \
  877. PIN_OSPEED_HIGH(GPIOF_PIN15))
  878. #define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_ARD_D7) | \
  879. PIN_PUPDR_PULLUP(GPIOF_ARD_D8) | \
  880. PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
  881. PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
  882. PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
  883. PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
  884. PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
  885. PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
  886. PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
  887. PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
  888. PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
  889. PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
  890. PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
  891. PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
  892. PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
  893. PIN_PUPDR_PULLUP(GPIOF_PIN15))
  894. #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_ARD_D7) | \
  895. PIN_ODR_HIGH(GPIOF_ARD_D8) | \
  896. PIN_ODR_HIGH(GPIOF_PIN2) | \
  897. PIN_ODR_HIGH(GPIOF_PIN3) | \
  898. PIN_ODR_HIGH(GPIOF_PIN4) | \
  899. PIN_ODR_HIGH(GPIOF_PIN5) | \
  900. PIN_ODR_HIGH(GPIOF_PIN6) | \
  901. PIN_ODR_HIGH(GPIOF_PIN7) | \
  902. PIN_ODR_HIGH(GPIOF_PIN8) | \
  903. PIN_ODR_HIGH(GPIOF_PIN9) | \
  904. PIN_ODR_HIGH(GPIOF_PIN10) | \
  905. PIN_ODR_HIGH(GPIOF_PIN11) | \
  906. PIN_ODR_HIGH(GPIOF_PIN12) | \
  907. PIN_ODR_HIGH(GPIOF_PIN13) | \
  908. PIN_ODR_HIGH(GPIOF_PIN14) | \
  909. PIN_ODR_HIGH(GPIOF_PIN15))
  910. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_ARD_D7, 0U) | \
  911. PIN_AFIO_AF(GPIOF_ARD_D8, 0U) | \
  912. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  913. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  914. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  915. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  916. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  917. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  918. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  919. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  920. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  921. PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
  922. PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
  923. PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
  924. PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
  925. PIN_AFIO_AF(GPIOF_PIN15, 0U))
  926. /*
  927. * GPIOH setup:
  928. *
  929. * PH0 - OSC_IN (input floating).
  930. * PH1 - OSC_OUT (input floating).
  931. * PH2 - PIN2 (input pullup).
  932. * PH3 - PIN3 (input pullup).
  933. * PH4 - PIN4 (input pullup).
  934. * PH5 - PIN5 (input pullup).
  935. * PH6 - PIN6 (input pullup).
  936. * PH7 - PIN7 (input pullup).
  937. * PH8 - PIN8 (input pullup).
  938. * PH9 - PIN9 (input pullup).
  939. * PH10 - PIN10 (input pullup).
  940. * PH11 - PIN11 (input pullup).
  941. * PH12 - PIN12 (input pullup).
  942. * PH13 - PIN13 (input pullup).
  943. * PH14 - PIN14 (input pullup).
  944. * PH15 - PIN15 (input pullup).
  945. */
  946. #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_OSC_IN) | \
  947. PIN_MODE_INPUT(GPIOH_OSC_OUT) | \
  948. PIN_MODE_INPUT(GPIOH_PIN2) | \
  949. PIN_MODE_INPUT(GPIOH_PIN3) | \
  950. PIN_MODE_INPUT(GPIOH_PIN4) | \
  951. PIN_MODE_INPUT(GPIOH_PIN5) | \
  952. PIN_MODE_INPUT(GPIOH_PIN6) | \
  953. PIN_MODE_INPUT(GPIOH_PIN7) | \
  954. PIN_MODE_INPUT(GPIOH_PIN8) | \
  955. PIN_MODE_INPUT(GPIOH_PIN9) | \
  956. PIN_MODE_INPUT(GPIOH_PIN10) | \
  957. PIN_MODE_INPUT(GPIOH_PIN11) | \
  958. PIN_MODE_INPUT(GPIOH_PIN12) | \
  959. PIN_MODE_INPUT(GPIOH_PIN13) | \
  960. PIN_MODE_INPUT(GPIOH_PIN14) | \
  961. PIN_MODE_INPUT(GPIOH_PIN15))
  962. #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_OSC_IN) | \
  963. PIN_OTYPE_PUSHPULL(GPIOH_OSC_OUT) | \
  964. PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
  965. PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
  966. PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
  967. PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
  968. PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
  969. PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
  970. PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
  971. PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
  972. PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
  973. PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
  974. PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
  975. PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
  976. PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
  977. PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
  978. #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_OSC_IN) | \
  979. PIN_OSPEED_HIGH(GPIOH_OSC_OUT) | \
  980. PIN_OSPEED_HIGH(GPIOH_PIN2) | \
  981. PIN_OSPEED_HIGH(GPIOH_PIN3) | \
  982. PIN_OSPEED_HIGH(GPIOH_PIN4) | \
  983. PIN_OSPEED_HIGH(GPIOH_PIN5) | \
  984. PIN_OSPEED_HIGH(GPIOH_PIN6) | \
  985. PIN_OSPEED_HIGH(GPIOH_PIN7) | \
  986. PIN_OSPEED_HIGH(GPIOH_PIN8) | \
  987. PIN_OSPEED_HIGH(GPIOH_PIN9) | \
  988. PIN_OSPEED_HIGH(GPIOH_PIN10) | \
  989. PIN_OSPEED_HIGH(GPIOH_PIN11) | \
  990. PIN_OSPEED_HIGH(GPIOH_PIN12) | \
  991. PIN_OSPEED_HIGH(GPIOH_PIN13) | \
  992. PIN_OSPEED_HIGH(GPIOH_PIN14) | \
  993. PIN_OSPEED_HIGH(GPIOH_PIN15))
  994. #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_OSC_IN) | \
  995. PIN_PUPDR_FLOATING(GPIOH_OSC_OUT) | \
  996. PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
  997. PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
  998. PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
  999. PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
  1000. PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
  1001. PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
  1002. PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
  1003. PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
  1004. PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
  1005. PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
  1006. PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
  1007. PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
  1008. PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
  1009. PIN_PUPDR_PULLUP(GPIOH_PIN15))
  1010. #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_OSC_IN) | \
  1011. PIN_ODR_HIGH(GPIOH_OSC_OUT) | \
  1012. PIN_ODR_HIGH(GPIOH_PIN2) | \
  1013. PIN_ODR_HIGH(GPIOH_PIN3) | \
  1014. PIN_ODR_HIGH(GPIOH_PIN4) | \
  1015. PIN_ODR_HIGH(GPIOH_PIN5) | \
  1016. PIN_ODR_HIGH(GPIOH_PIN6) | \
  1017. PIN_ODR_HIGH(GPIOH_PIN7) | \
  1018. PIN_ODR_HIGH(GPIOH_PIN8) | \
  1019. PIN_ODR_HIGH(GPIOH_PIN9) | \
  1020. PIN_ODR_HIGH(GPIOH_PIN10) | \
  1021. PIN_ODR_HIGH(GPIOH_PIN11) | \
  1022. PIN_ODR_HIGH(GPIOH_PIN12) | \
  1023. PIN_ODR_HIGH(GPIOH_PIN13) | \
  1024. PIN_ODR_HIGH(GPIOH_PIN14) | \
  1025. PIN_ODR_HIGH(GPIOH_PIN15))
  1026. #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_OSC_IN, 0U) | \
  1027. PIN_AFIO_AF(GPIOH_OSC_OUT, 0U) | \
  1028. PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
  1029. PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
  1030. PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
  1031. PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
  1032. PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
  1033. PIN_AFIO_AF(GPIOH_PIN7, 0U))
  1034. #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
  1035. PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
  1036. PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
  1037. PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
  1038. PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
  1039. PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
  1040. PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
  1041. PIN_AFIO_AF(GPIOH_PIN15, 0U))
  1042. /*===========================================================================*/
  1043. /* External declarations. */
  1044. /*===========================================================================*/
  1045. #if !defined(_FROM_ASM_)
  1046. #ifdef __cplusplus
  1047. extern "C" {
  1048. #endif
  1049. void boardInit(void);
  1050. #ifdef __cplusplus
  1051. }
  1052. #endif
  1053. #endif /* _FROM_ASM_ */
  1054. #endif /* BOARD_H */