board.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  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 ST STM32F0-Discovery board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_ST_STM32F0_DISCOVERY
  29. #define BOARD_NAME "ST STM32F0-Discovery"
  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 << 3U)
  39. #if !defined(STM32_HSECLK)
  40. #define STM32_HSECLK 0U
  41. #endif
  42. #define STM32_HSE_BYPASS
  43. /*
  44. * MCU type as defined in the ST header.
  45. */
  46. #define STM32F051x8
  47. /*
  48. * IO pins assignments.
  49. */
  50. #define GPIOA_BUTTON 0U
  51. #define GPIOA_PIN1 1U
  52. #define GPIOA_PIN2 2U
  53. #define GPIOA_PIN3 3U
  54. #define GPIOA_PIN4 4U
  55. #define GPIOA_PIN5 5U
  56. #define GPIOA_PIN6 6U
  57. #define GPIOA_PIN7 7U
  58. #define GPIOA_PIN8 8U
  59. #define GPIOA_PIN9 9U
  60. #define GPIOA_PIN10 10U
  61. #define GPIOA_PIN11 11U
  62. #define GPIOA_PIN12 12U
  63. #define GPIOA_SWDAT 13U
  64. #define GPIOA_SWCLK 14U
  65. #define GPIOA_PIN15 15U
  66. #define GPIOB_PIN0 0U
  67. #define GPIOB_PIN1 1U
  68. #define GPIOB_PIN2 2U
  69. #define GPIOB_PIN3 3U
  70. #define GPIOB_PIN4 4U
  71. #define GPIOB_PIN5 5U
  72. #define GPIOB_PIN6 6U
  73. #define GPIOB_PIN7 7U
  74. #define GPIOB_PIN8 8U
  75. #define GPIOB_PIN9 9U
  76. #define GPIOB_PIN10 10U
  77. #define GPIOB_PIN11 11U
  78. #define GPIOB_PIN12 12U
  79. #define GPIOB_PIN13 13U
  80. #define GPIOB_PIN14 14U
  81. #define GPIOB_PIN15 15U
  82. #define GPIOC_PIN0 0U
  83. #define GPIOC_PIN1 1U
  84. #define GPIOC_PIN2 2U
  85. #define GPIOC_PIN3 3U
  86. #define GPIOC_PIN4 4U
  87. #define GPIOC_PIN5 5U
  88. #define GPIOC_PIN6 6U
  89. #define GPIOC_PIN7 7U
  90. #define GPIOC_LED4 8U
  91. #define GPIOC_LED3 9U
  92. #define GPIOC_PIN10 10U
  93. #define GPIOC_PIN11 11U
  94. #define GPIOC_PIN12 12U
  95. #define GPIOC_PIN13 13U
  96. #define GPIOC_OSC32_IN 14U
  97. #define GPIOC_OSC32_OUT 15U
  98. #define GPIOD_PIN0 0U
  99. #define GPIOD_PIN1 1U
  100. #define GPIOD_PIN2 2U
  101. #define GPIOD_PIN3 3U
  102. #define GPIOD_PIN4 4U
  103. #define GPIOD_PIN5 5U
  104. #define GPIOD_PIN6 6U
  105. #define GPIOD_PIN7 7U
  106. #define GPIOD_PIN8 8U
  107. #define GPIOD_PIN9 9U
  108. #define GPIOD_PIN10 10U
  109. #define GPIOD_PIN11 11U
  110. #define GPIOD_PIN12 12U
  111. #define GPIOD_PIN13 13U
  112. #define GPIOD_PIN14 14U
  113. #define GPIOD_PIN15 15U
  114. #define GPIOF_OSC_IN 0U
  115. #define GPIOF_OSC_OUT 1U
  116. #define GPIOF_PIN2 2U
  117. #define GPIOF_PIN3 3U
  118. #define GPIOF_PIN4 4U
  119. #define GPIOF_PIN5 5U
  120. #define GPIOF_PIN6 6U
  121. #define GPIOF_PIN7 7U
  122. #define GPIOF_PIN8 8U
  123. #define GPIOF_PIN9 9U
  124. #define GPIOF_PIN10 10U
  125. #define GPIOF_PIN11 11U
  126. #define GPIOF_PIN12 12U
  127. #define GPIOF_PIN13 13U
  128. #define GPIOF_PIN14 14U
  129. #define GPIOF_PIN15 15U
  130. /*
  131. * IO lines assignments.
  132. */
  133. #define LINE_BUTTON PAL_LINE(GPIOA, 0U)
  134. #define LINE_SWDAT PAL_LINE(GPIOA, 13U)
  135. #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
  136. #define LINE_LED4 PAL_LINE(GPIOC, 8U)
  137. #define LINE_LED3 PAL_LINE(GPIOC, 9U)
  138. #define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
  139. #define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
  140. #define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
  141. #define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
  142. /*===========================================================================*/
  143. /* Driver pre-compile time settings. */
  144. /*===========================================================================*/
  145. /*===========================================================================*/
  146. /* Derived constants and error checks. */
  147. /*===========================================================================*/
  148. /*===========================================================================*/
  149. /* Driver data structures and types. */
  150. /*===========================================================================*/
  151. /*===========================================================================*/
  152. /* Driver macros. */
  153. /*===========================================================================*/
  154. /*
  155. * I/O ports initial setup, this configuration is established soon after reset
  156. * in the initialization code.
  157. * Please refer to the STM32 Reference Manual for details.
  158. */
  159. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  160. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  161. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  162. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  163. #define PIN_ODR_LOW(n) (0U << (n))
  164. #define PIN_ODR_HIGH(n) (1U << (n))
  165. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  166. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  167. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  168. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  169. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  170. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  171. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  172. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  173. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  174. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  175. /*
  176. * GPIOA setup:
  177. *
  178. * PA0 - BUTTON (input floating).
  179. * PA1 - PIN1 (input pullup).
  180. * PA2 - PIN2 (input pullup).
  181. * PA3 - PIN3 (input pullup).
  182. * PA4 - PIN4 (input pullup).
  183. * PA5 - PIN5 (input pullup).
  184. * PA6 - PIN6 (input pullup).
  185. * PA7 - PIN7 (input pullup).
  186. * PA8 - PIN8 (input pullup).
  187. * PA9 - PIN9 (input pullup).
  188. * PA10 - PIN10 (input pullup).
  189. * PA11 - PIN11 (input pullup).
  190. * PA12 - PIN12 (input pullup).
  191. * PA13 - SWDAT (alternate 0).
  192. * PA14 - SWCLK (alternate 0).
  193. * PA15 - PIN15 (input pullup).
  194. */
  195. #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
  196. PIN_MODE_INPUT(GPIOA_PIN1) | \
  197. PIN_MODE_INPUT(GPIOA_PIN2) | \
  198. PIN_MODE_INPUT(GPIOA_PIN3) | \
  199. PIN_MODE_INPUT(GPIOA_PIN4) | \
  200. PIN_MODE_INPUT(GPIOA_PIN5) | \
  201. PIN_MODE_INPUT(GPIOA_PIN6) | \
  202. PIN_MODE_INPUT(GPIOA_PIN7) | \
  203. PIN_MODE_INPUT(GPIOA_PIN8) | \
  204. PIN_MODE_INPUT(GPIOA_PIN9) | \
  205. PIN_MODE_INPUT(GPIOA_PIN10) | \
  206. PIN_MODE_INPUT(GPIOA_PIN11) | \
  207. PIN_MODE_INPUT(GPIOA_PIN12) | \
  208. PIN_MODE_ALTERNATE(GPIOA_SWDAT) | \
  209. PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
  210. PIN_MODE_INPUT(GPIOA_PIN15))
  211. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
  212. PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
  213. PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
  214. PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
  215. PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
  216. PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
  217. PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
  218. PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
  219. PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
  220. PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
  221. PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
  222. PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \
  223. PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \
  224. PIN_OTYPE_PUSHPULL(GPIOA_SWDAT) | \
  225. PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
  226. PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
  227. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
  228. PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
  229. PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
  230. PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
  231. PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
  232. PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
  233. PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
  234. PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
  235. PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
  236. PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
  237. PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
  238. PIN_OSPEED_VERYLOW(GPIOA_PIN11) | \
  239. PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \
  240. PIN_OSPEED_HIGH(GPIOA_SWDAT) | \
  241. PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
  242. PIN_OSPEED_HIGH(GPIOA_PIN15))
  243. #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
  244. PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
  245. PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
  246. PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
  247. PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
  248. PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
  249. PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
  250. PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
  251. PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
  252. PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
  253. PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
  254. PIN_PUPDR_PULLUP(GPIOA_PIN11) | \
  255. PIN_PUPDR_PULLUP(GPIOA_PIN12) | \
  256. PIN_PUPDR_PULLUP(GPIOA_SWDAT) | \
  257. PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
  258. PIN_PUPDR_PULLUP(GPIOA_PIN15))
  259. #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
  260. PIN_ODR_HIGH(GPIOA_PIN1) | \
  261. PIN_ODR_HIGH(GPIOA_PIN2) | \
  262. PIN_ODR_HIGH(GPIOA_PIN3) | \
  263. PIN_ODR_HIGH(GPIOA_PIN4) | \
  264. PIN_ODR_HIGH(GPIOA_PIN5) | \
  265. PIN_ODR_HIGH(GPIOA_PIN6) | \
  266. PIN_ODR_HIGH(GPIOA_PIN7) | \
  267. PIN_ODR_HIGH(GPIOA_PIN8) | \
  268. PIN_ODR_HIGH(GPIOA_PIN9) | \
  269. PIN_ODR_HIGH(GPIOA_PIN10) | \
  270. PIN_ODR_HIGH(GPIOA_PIN11) | \
  271. PIN_ODR_HIGH(GPIOA_PIN12) | \
  272. PIN_ODR_HIGH(GPIOA_SWDAT) | \
  273. PIN_ODR_HIGH(GPIOA_SWCLK) | \
  274. PIN_ODR_HIGH(GPIOA_PIN15))
  275. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
  276. PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
  277. PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
  278. PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
  279. PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
  280. PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
  281. PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
  282. PIN_AFIO_AF(GPIOA_PIN7, 0U))
  283. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
  284. PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
  285. PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
  286. PIN_AFIO_AF(GPIOA_PIN11, 0U) | \
  287. PIN_AFIO_AF(GPIOA_PIN12, 0U) | \
  288. PIN_AFIO_AF(GPIOA_SWDAT, 0U) | \
  289. PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
  290. PIN_AFIO_AF(GPIOA_PIN15, 0U))
  291. /*
  292. * GPIOB setup:
  293. *
  294. * PB0 - PIN0 (input pullup).
  295. * PB1 - PIN1 (input pullup).
  296. * PB2 - PIN2 (input pullup).
  297. * PB3 - PIN3 (input pullup).
  298. * PB4 - PIN4 (input pullup).
  299. * PB5 - PIN5 (input pullup).
  300. * PB6 - PIN6 (input pullup).
  301. * PB7 - PIN7 (input pullup).
  302. * PB8 - PIN8 (input pullup).
  303. * PB9 - PIN9 (input pullup).
  304. * PB10 - PIN10 (input pullup).
  305. * PB11 - PIN11 (input pullup).
  306. * PB12 - PIN12 (input pullup).
  307. * PB13 - PIN13 (input pullup).
  308. * PB14 - PIN14 (input pullup).
  309. * PB15 - PIN15 (input pullup).
  310. */
  311. #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
  312. PIN_MODE_INPUT(GPIOB_PIN1) | \
  313. PIN_MODE_INPUT(GPIOB_PIN2) | \
  314. PIN_MODE_INPUT(GPIOB_PIN3) | \
  315. PIN_MODE_INPUT(GPIOB_PIN4) | \
  316. PIN_MODE_INPUT(GPIOB_PIN5) | \
  317. PIN_MODE_INPUT(GPIOB_PIN6) | \
  318. PIN_MODE_INPUT(GPIOB_PIN7) | \
  319. PIN_MODE_INPUT(GPIOB_PIN8) | \
  320. PIN_MODE_INPUT(GPIOB_PIN9) | \
  321. PIN_MODE_INPUT(GPIOB_PIN10) | \
  322. PIN_MODE_INPUT(GPIOB_PIN11) | \
  323. PIN_MODE_INPUT(GPIOB_PIN12) | \
  324. PIN_MODE_INPUT(GPIOB_PIN13) | \
  325. PIN_MODE_INPUT(GPIOB_PIN14) | \
  326. PIN_MODE_INPUT(GPIOB_PIN15))
  327. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
  328. PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
  329. PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
  330. PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
  331. PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
  332. PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
  333. PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
  334. PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
  335. PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
  336. PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
  337. PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
  338. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  339. PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
  340. PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
  341. PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
  342. PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
  343. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
  344. PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
  345. PIN_OSPEED_HIGH(GPIOB_PIN2) | \
  346. PIN_OSPEED_HIGH(GPIOB_PIN3) | \
  347. PIN_OSPEED_HIGH(GPIOB_PIN4) | \
  348. PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
  349. PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
  350. PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
  351. PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
  352. PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
  353. PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
  354. PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
  355. PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
  356. PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
  357. PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
  358. PIN_OSPEED_VERYLOW(GPIOB_PIN15))
  359. #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
  360. PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
  361. PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
  362. PIN_PUPDR_PULLUP(GPIOB_PIN3) | \
  363. PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
  364. PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
  365. PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
  366. PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
  367. PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
  368. PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
  369. PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
  370. PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
  371. PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
  372. PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
  373. PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
  374. PIN_PUPDR_PULLUP(GPIOB_PIN15))
  375. #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
  376. PIN_ODR_HIGH(GPIOB_PIN1) | \
  377. PIN_ODR_HIGH(GPIOB_PIN2) | \
  378. PIN_ODR_HIGH(GPIOB_PIN3) | \
  379. PIN_ODR_HIGH(GPIOB_PIN4) | \
  380. PIN_ODR_HIGH(GPIOB_PIN5) | \
  381. PIN_ODR_HIGH(GPIOB_PIN6) | \
  382. PIN_ODR_HIGH(GPIOB_PIN7) | \
  383. PIN_ODR_HIGH(GPIOB_PIN8) | \
  384. PIN_ODR_HIGH(GPIOB_PIN9) | \
  385. PIN_ODR_HIGH(GPIOB_PIN10) | \
  386. PIN_ODR_HIGH(GPIOB_PIN11) | \
  387. PIN_ODR_HIGH(GPIOB_PIN12) | \
  388. PIN_ODR_HIGH(GPIOB_PIN13) | \
  389. PIN_ODR_HIGH(GPIOB_PIN14) | \
  390. PIN_ODR_HIGH(GPIOB_PIN15))
  391. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
  392. PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
  393. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  394. PIN_AFIO_AF(GPIOB_PIN3, 0U) | \
  395. PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
  396. PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
  397. PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
  398. PIN_AFIO_AF(GPIOB_PIN7, 0U))
  399. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  400. PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
  401. PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
  402. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  403. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  404. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  405. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  406. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  407. /*
  408. * GPIOC setup:
  409. *
  410. * PC0 - PIN0 (input pullup).
  411. * PC1 - PIN1 (input pullup).
  412. * PC2 - PIN2 (input pullup).
  413. * PC3 - PIN3 (input pullup).
  414. * PC4 - PIN4 (input pullup).
  415. * PC5 - PIN5 (input pullup).
  416. * PC6 - PIN6 (input pullup).
  417. * PC7 - PIN7 (input pullup).
  418. * PC8 - LED4 (output pushpull maximum).
  419. * PC9 - LED3 (output pushpull maximum).
  420. * PC10 - PIN10 (input pullup).
  421. * PC11 - PIN11 (input pullup).
  422. * PC12 - PIN12 (input pullup).
  423. * PC13 - PIN13 (input pullup).
  424. * PC14 - OSC32_IN (input floating).
  425. * PC15 - OSC32_OUT (input floating).
  426. */
  427. #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
  428. PIN_MODE_INPUT(GPIOC_PIN1) | \
  429. PIN_MODE_INPUT(GPIOC_PIN2) | \
  430. PIN_MODE_INPUT(GPIOC_PIN3) | \
  431. PIN_MODE_INPUT(GPIOC_PIN4) | \
  432. PIN_MODE_INPUT(GPIOC_PIN5) | \
  433. PIN_MODE_INPUT(GPIOC_PIN6) | \
  434. PIN_MODE_INPUT(GPIOC_PIN7) | \
  435. PIN_MODE_OUTPUT(GPIOC_LED4) | \
  436. PIN_MODE_OUTPUT(GPIOC_LED3) | \
  437. PIN_MODE_INPUT(GPIOC_PIN10) | \
  438. PIN_MODE_INPUT(GPIOC_PIN11) | \
  439. PIN_MODE_INPUT(GPIOC_PIN12) | \
  440. PIN_MODE_INPUT(GPIOC_PIN13) | \
  441. PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
  442. PIN_MODE_INPUT(GPIOC_OSC32_OUT))
  443. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  444. PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
  445. PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
  446. PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
  447. PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
  448. PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
  449. PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
  450. PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
  451. PIN_OTYPE_PUSHPULL(GPIOC_LED4) | \
  452. PIN_OTYPE_PUSHPULL(GPIOC_LED3) | \
  453. PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
  454. PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
  455. PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
  456. PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
  457. PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
  458. PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
  459. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
  460. PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
  461. PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
  462. PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
  463. PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
  464. PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
  465. PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
  466. PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
  467. PIN_OSPEED_HIGH(GPIOC_LED4) | \
  468. PIN_OSPEED_HIGH(GPIOC_LED3) | \
  469. PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
  470. PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
  471. PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
  472. PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
  473. PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
  474. PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
  475. #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
  476. PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
  477. PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
  478. PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
  479. PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
  480. PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
  481. PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
  482. PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
  483. PIN_PUPDR_FLOATING(GPIOC_LED4) | \
  484. PIN_PUPDR_FLOATING(GPIOC_LED3) | \
  485. PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
  486. PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
  487. PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
  488. PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
  489. PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
  490. PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
  491. #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
  492. PIN_ODR_HIGH(GPIOC_PIN1) | \
  493. PIN_ODR_HIGH(GPIOC_PIN2) | \
  494. PIN_ODR_HIGH(GPIOC_PIN3) | \
  495. PIN_ODR_HIGH(GPIOC_PIN4) | \
  496. PIN_ODR_HIGH(GPIOC_PIN5) | \
  497. PIN_ODR_HIGH(GPIOC_PIN6) | \
  498. PIN_ODR_HIGH(GPIOC_PIN7) | \
  499. PIN_ODR_LOW(GPIOC_LED4) | \
  500. PIN_ODR_LOW(GPIOC_LED3) | \
  501. PIN_ODR_HIGH(GPIOC_PIN10) | \
  502. PIN_ODR_HIGH(GPIOC_PIN11) | \
  503. PIN_ODR_HIGH(GPIOC_PIN12) | \
  504. PIN_ODR_HIGH(GPIOC_PIN13) | \
  505. PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
  506. PIN_ODR_HIGH(GPIOC_OSC32_OUT))
  507. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  508. PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
  509. PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
  510. PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
  511. PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
  512. PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
  513. PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
  514. PIN_AFIO_AF(GPIOC_PIN7, 0U))
  515. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED4, 0U) | \
  516. PIN_AFIO_AF(GPIOC_LED3, 0U) | \
  517. PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
  518. PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
  519. PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
  520. PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
  521. PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
  522. PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
  523. /*
  524. * GPIOD setup:
  525. *
  526. * PD0 - PIN0 (input pullup).
  527. * PD1 - PIN1 (input pullup).
  528. * PD2 - PIN2 (input pullup).
  529. * PD3 - PIN3 (input pullup).
  530. * PD4 - PIN4 (input pullup).
  531. * PD5 - PIN5 (input pullup).
  532. * PD6 - PIN6 (input pullup).
  533. * PD7 - PIN7 (input pullup).
  534. * PD8 - PIN8 (input pullup).
  535. * PD9 - PIN9 (input pullup).
  536. * PD10 - PIN10 (input pullup).
  537. * PD11 - PIN11 (input pullup).
  538. * PD12 - PIN12 (input pullup).
  539. * PD13 - PIN13 (input pullup).
  540. * PD14 - PIN14 (input pullup).
  541. * PD15 - PIN15 (input pullup).
  542. */
  543. #define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
  544. PIN_MODE_INPUT(GPIOD_PIN1) | \
  545. PIN_MODE_INPUT(GPIOD_PIN2) | \
  546. PIN_MODE_INPUT(GPIOD_PIN3) | \
  547. PIN_MODE_INPUT(GPIOD_PIN4) | \
  548. PIN_MODE_INPUT(GPIOD_PIN5) | \
  549. PIN_MODE_INPUT(GPIOD_PIN6) | \
  550. PIN_MODE_INPUT(GPIOD_PIN7) | \
  551. PIN_MODE_INPUT(GPIOD_PIN8) | \
  552. PIN_MODE_INPUT(GPIOD_PIN9) | \
  553. PIN_MODE_INPUT(GPIOD_PIN10) | \
  554. PIN_MODE_INPUT(GPIOD_PIN11) | \
  555. PIN_MODE_INPUT(GPIOD_PIN12) | \
  556. PIN_MODE_INPUT(GPIOD_PIN13) | \
  557. PIN_MODE_INPUT(GPIOD_PIN14) | \
  558. PIN_MODE_INPUT(GPIOD_PIN15))
  559. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  560. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  561. PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
  562. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  563. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  564. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  565. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  566. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  567. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  568. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  569. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  570. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  571. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  572. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  573. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  574. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  575. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
  576. PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
  577. PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
  578. PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
  579. PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
  580. PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
  581. PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
  582. PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
  583. PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
  584. PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
  585. PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
  586. PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
  587. PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
  588. PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
  589. PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
  590. PIN_OSPEED_VERYLOW(GPIOD_PIN15))
  591. #define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
  592. PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
  593. PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
  594. PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
  595. PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
  596. PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
  597. PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
  598. PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
  599. PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
  600. PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
  601. PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
  602. PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
  603. PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
  604. PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
  605. PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
  606. PIN_PUPDR_PULLUP(GPIOD_PIN15))
  607. #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
  608. PIN_ODR_HIGH(GPIOD_PIN1) | \
  609. PIN_ODR_HIGH(GPIOD_PIN2) | \
  610. PIN_ODR_HIGH(GPIOD_PIN3) | \
  611. PIN_ODR_HIGH(GPIOD_PIN4) | \
  612. PIN_ODR_HIGH(GPIOD_PIN5) | \
  613. PIN_ODR_HIGH(GPIOD_PIN6) | \
  614. PIN_ODR_HIGH(GPIOD_PIN7) | \
  615. PIN_ODR_HIGH(GPIOD_PIN8) | \
  616. PIN_ODR_HIGH(GPIOD_PIN9) | \
  617. PIN_ODR_HIGH(GPIOD_PIN10) | \
  618. PIN_ODR_HIGH(GPIOD_PIN11) | \
  619. PIN_ODR_HIGH(GPIOD_PIN12) | \
  620. PIN_ODR_HIGH(GPIOD_PIN13) | \
  621. PIN_ODR_HIGH(GPIOD_PIN14) | \
  622. PIN_ODR_HIGH(GPIOD_PIN15))
  623. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
  624. PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
  625. PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
  626. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  627. PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
  628. PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
  629. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  630. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  631. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
  632. PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
  633. PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
  634. PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
  635. PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
  636. PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
  637. PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
  638. PIN_AFIO_AF(GPIOD_PIN15, 0U))
  639. /*
  640. * GPIOF setup:
  641. *
  642. * PF0 - OSC_IN (input floating).
  643. * PF1 - OSC_OUT (input floating).
  644. * PF2 - PIN2 (input pullup).
  645. * PF3 - PIN3 (input pullup).
  646. * PF4 - PIN4 (input pullup).
  647. * PF5 - PIN5 (input pullup).
  648. * PF6 - PIN6 (input pullup).
  649. * PF7 - PIN7 (input pullup).
  650. * PF8 - PIN8 (input pullup).
  651. * PF9 - PIN9 (input pullup).
  652. * PF10 - PIN10 (input pullup).
  653. * PF11 - PIN11 (input pullup).
  654. * PF12 - PIN12 (input pullup).
  655. * PF13 - PIN13 (input pullup).
  656. * PF14 - PIN14 (input pullup).
  657. * PF15 - PIN15 (input pullup).
  658. */
  659. #define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
  660. PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
  661. PIN_MODE_INPUT(GPIOF_PIN2) | \
  662. PIN_MODE_INPUT(GPIOF_PIN3) | \
  663. PIN_MODE_INPUT(GPIOF_PIN4) | \
  664. PIN_MODE_INPUT(GPIOF_PIN5) | \
  665. PIN_MODE_INPUT(GPIOF_PIN6) | \
  666. PIN_MODE_INPUT(GPIOF_PIN7) | \
  667. PIN_MODE_INPUT(GPIOF_PIN8) | \
  668. PIN_MODE_INPUT(GPIOF_PIN9) | \
  669. PIN_MODE_INPUT(GPIOF_PIN10) | \
  670. PIN_MODE_INPUT(GPIOF_PIN11) | \
  671. PIN_MODE_INPUT(GPIOF_PIN12) | \
  672. PIN_MODE_INPUT(GPIOF_PIN13) | \
  673. PIN_MODE_INPUT(GPIOF_PIN14) | \
  674. PIN_MODE_INPUT(GPIOF_PIN15))
  675. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
  676. PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
  677. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  678. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  679. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  680. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  681. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  682. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  683. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  684. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  685. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  686. PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
  687. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  688. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  689. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  690. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  691. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
  692. PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
  693. PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
  694. PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
  695. PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
  696. PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
  697. PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
  698. PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
  699. PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
  700. PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
  701. PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
  702. PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
  703. PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
  704. PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
  705. PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
  706. PIN_OSPEED_VERYLOW(GPIOF_PIN15))
  707. #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
  708. PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
  709. PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
  710. PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
  711. PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
  712. PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
  713. PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
  714. PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
  715. PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
  716. PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
  717. PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
  718. PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
  719. PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
  720. PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
  721. PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
  722. PIN_PUPDR_PULLUP(GPIOF_PIN15))
  723. #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
  724. PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
  725. PIN_ODR_HIGH(GPIOF_PIN2) | \
  726. PIN_ODR_HIGH(GPIOF_PIN3) | \
  727. PIN_ODR_HIGH(GPIOF_PIN4) | \
  728. PIN_ODR_HIGH(GPIOF_PIN5) | \
  729. PIN_ODR_HIGH(GPIOF_PIN6) | \
  730. PIN_ODR_HIGH(GPIOF_PIN7) | \
  731. PIN_ODR_HIGH(GPIOF_PIN8) | \
  732. PIN_ODR_HIGH(GPIOF_PIN9) | \
  733. PIN_ODR_HIGH(GPIOF_PIN10) | \
  734. PIN_ODR_HIGH(GPIOF_PIN11) | \
  735. PIN_ODR_HIGH(GPIOF_PIN12) | \
  736. PIN_ODR_HIGH(GPIOF_PIN13) | \
  737. PIN_ODR_HIGH(GPIOF_PIN14) | \
  738. PIN_ODR_HIGH(GPIOF_PIN15))
  739. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
  740. PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
  741. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  742. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  743. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  744. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  745. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  746. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  747. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  748. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  749. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  750. PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
  751. PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
  752. PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
  753. PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
  754. PIN_AFIO_AF(GPIOF_PIN15, 0U))
  755. /*===========================================================================*/
  756. /* External declarations. */
  757. /*===========================================================================*/
  758. #if !defined(_FROM_ASM_)
  759. #ifdef __cplusplus
  760. extern "C" {
  761. #endif
  762. void boardInit(void);
  763. #ifdef __cplusplus
  764. }
  765. #endif
  766. #endif /* _FROM_ASM_ */
  767. #endif /* BOARD_H */