board.h 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486
  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-L432KC board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_ST_NUCLEO32_L432KC
  29. #define BOARD_NAME "STMicroelectronics STM32 Nucleo32-L432KC"
  30. /*
  31. * Board oscillators-related settings.
  32. * NOTE: HSE not fitted.
  33. */
  34. #if !defined(STM32_LSECLK)
  35. #define STM32_LSECLK 32768U
  36. #endif
  37. #define STM32_LSEDRV (2U << 3U)
  38. #if !defined(STM32_HSECLK)
  39. #define STM32_HSECLK 0U
  40. #endif
  41. /*
  42. * Board voltages.
  43. * Required for performance limits calculation.
  44. */
  45. #define STM32_VDD 300U
  46. /*
  47. * MCU type as defined in the ST header.
  48. */
  49. #define STM32L432xx
  50. /*
  51. * IO pins assignments.
  52. */
  53. #define GPIOA_ARD_A0 0U
  54. #define GPIOA_ARD_A1 1U
  55. #define GPIOA_VCP_TX 2U
  56. #define GPIOA_ARD_A2 3U
  57. #define GPIOA_ARD_A3 4U
  58. #define GPIOA_ARD_A4 5U
  59. #define GPIOA_ARD_A5 6U
  60. #define GPIOA_ARD_A6 7U
  61. #define GPIOA_ARD_D9 8U
  62. #define GPIOA_ARD_D1 9U
  63. #define GPIOA_ARD_D0 10U
  64. #define GPIOA_ARD_D10 11U
  65. #define GPIOA_ARD_D2 12U
  66. #define GPIOA_SWDIO 13U
  67. #define GPIOA_SWCLK 14U
  68. #define GPIOA_VCP_RX 15U
  69. #define GPIOB_ARD_D3 0U
  70. #define GPIOB_ARD_D6 1U
  71. #define GPIOB_PIN2 2U
  72. #define GPIOB_ARD_D13 3U
  73. #define GPIOB_LED_GREEN 3U
  74. #define GPIOB_ARD_D12 4U
  75. #define GPIOB_ARD_D11 5U
  76. #define GPIOB_ARD_D5 6U
  77. #define GPIOB_ARD_A5_ALT 6U
  78. #define GPIOB_ARD_D4 7U
  79. #define GPIOB_ARD_A4_ALT 7U
  80. #define GPIOB_PIN8 8U
  81. #define GPIOB_PIN9 9U
  82. #define GPIOB_PIN10 10U
  83. #define GPIOB_PIN11 11U
  84. #define GPIOB_PIN12 12U
  85. #define GPIOB_PIN13 13U
  86. #define GPIOB_PIN14 14U
  87. #define GPIOB_PIN15 15U
  88. #define GPIOC_PIN0 0U
  89. #define GPIOC_PIN1 1U
  90. #define GPIOC_PIN2 2U
  91. #define GPIOC_PIN3 3U
  92. #define GPIOC_PIN4 4U
  93. #define GPIOC_PIN5 5U
  94. #define GPIOC_PIN6 6U
  95. #define GPIOC_PIN7 7U
  96. #define GPIOC_PIN8 8U
  97. #define GPIOC_PIN9 9U
  98. #define GPIOC_PIN10 10U
  99. #define GPIOC_PIN11 11U
  100. #define GPIOC_PIN12 12U
  101. #define GPIOC_PIN13 13U
  102. #define GPIOC_ARD_D7 14U
  103. #define GPIOC_ARD_D8 15U
  104. #define GPIOD_PIN0 0U
  105. #define GPIOD_PIN1 1U
  106. #define GPIOD_PIN2 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_PIN11 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_PIN10 10U
  163. #define GPIOG_PIN11 11U
  164. #define GPIOG_PIN12 12U
  165. #define GPIOG_PIN13 13U
  166. #define GPIOG_PIN14 14U
  167. #define GPIOG_PIN15 15U
  168. #define GPIOH_PIN0 0U
  169. #define GPIOH_PIN1 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. /*
  185. * IO lines assignments.
  186. */
  187. #define LINE_ARD_A0 PAL_LINE(GPIOA, 0U)
  188. #define LINE_ARD_A1 PAL_LINE(GPIOA, 1U)
  189. #define LINE_VCP_TX PAL_LINE(GPIOA, 2U)
  190. #define LINE_ARD_A2 PAL_LINE(GPIOA, 3U)
  191. #define LINE_ARD_A3 PAL_LINE(GPIOA, 4U)
  192. #define LINE_ARD_A4 PAL_LINE(GPIOA, 5U)
  193. #define LINE_ARD_A5 PAL_LINE(GPIOA, 6U)
  194. #define LINE_ARD_A6 PAL_LINE(GPIOA, 7U)
  195. #define LINE_ARD_D9 PAL_LINE(GPIOA, 8U)
  196. #define LINE_ARD_D1 PAL_LINE(GPIOA, 9U)
  197. #define LINE_ARD_D0 PAL_LINE(GPIOA, 10U)
  198. #define LINE_ARD_D10 PAL_LINE(GPIOA, 11U)
  199. #define LINE_ARD_D2 PAL_LINE(GPIOA, 12U)
  200. #define LINE_SWDIO PAL_LINE(GPIOA, 13U)
  201. #define LINE_SWCLK PAL_LINE(GPIOA, 14U)
  202. #define LINE_VCP_RX PAL_LINE(GPIOA, 15U)
  203. #define LINE_ARD_D3 PAL_LINE(GPIOB, 0U)
  204. #define LINE_ARD_D6 PAL_LINE(GPIOB, 1U)
  205. #define LINE_ARD_D13 PAL_LINE(GPIOB, 3U)
  206. #define LINE_LED_GREEN PAL_LINE(GPIOB, 3U)
  207. #define LINE_ARD_D12 PAL_LINE(GPIOB, 4U)
  208. #define LINE_ARD_D11 PAL_LINE(GPIOB, 5U)
  209. #define LINE_ARD_D5 PAL_LINE(GPIOB, 6U)
  210. #define LINE_ARD_A5_ALT PAL_LINE(GPIOB, 6U)
  211. #define LINE_ARD_D4 PAL_LINE(GPIOB, 7U)
  212. #define LINE_ARD_A4_ALT PAL_LINE(GPIOB, 7U)
  213. #define LINE_ARD_D7 PAL_LINE(GPIOC, 14U)
  214. #define LINE_ARD_D8 PAL_LINE(GPIOC, 15U)
  215. /*===========================================================================*/
  216. /* Driver pre-compile time settings. */
  217. /*===========================================================================*/
  218. /*===========================================================================*/
  219. /* Derived constants and error checks. */
  220. /*===========================================================================*/
  221. /*===========================================================================*/
  222. /* Driver data structures and types. */
  223. /*===========================================================================*/
  224. /*===========================================================================*/
  225. /* Driver macros. */
  226. /*===========================================================================*/
  227. /*
  228. * I/O ports initial setup, this configuration is established soon after reset
  229. * in the initialization code.
  230. * Please refer to the STM32 Reference Manual for details.
  231. */
  232. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  233. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  234. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  235. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  236. #define PIN_ODR_LOW(n) (0U << (n))
  237. #define PIN_ODR_HIGH(n) (1U << (n))
  238. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  239. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  240. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  241. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  242. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  243. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  244. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  245. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  246. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  247. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  248. #define PIN_ASCR_DISABLED(n) (0U << (n))
  249. #define PIN_ASCR_ENABLED(n) (1U << (n))
  250. #define PIN_LOCKR_DISABLED(n) (0U << (n))
  251. #define PIN_LOCKR_ENABLED(n) (1U << (n))
  252. /*
  253. * GPIOA setup:
  254. *
  255. * PA0 - ARD_A0 (analog).
  256. * PA1 - ARD_A1 (analog).
  257. * PA2 - VCP_TX (alternate 7).
  258. * PA3 - ARD_A2 (analog).
  259. * PA4 - ARD_A3 (analog).
  260. * PA5 - ARD_A4 (analog).
  261. * PA6 - ARD_A5 (analog).
  262. * PA7 - ARD_A6 (analog).
  263. * PA8 - ARD_D9 (analog).
  264. * PA9 - ARD_D1 (analog).
  265. * PA10 - ARD_D0 (analog).
  266. * PA11 - ARD_D10 (analog).
  267. * PA12 - ARD_D2 (analog).
  268. * PA13 - SWDIO (alternate 0).
  269. * PA14 - SWCLK (alternate 0).
  270. * PA15 - VCP_RX (alternate 3).
  271. */
  272. #define VAL_GPIOA_MODER (PIN_MODE_ANALOG(GPIOA_ARD_A0) | \
  273. PIN_MODE_ANALOG(GPIOA_ARD_A1) | \
  274. PIN_MODE_ALTERNATE(GPIOA_VCP_TX) | \
  275. PIN_MODE_ANALOG(GPIOA_ARD_A2) | \
  276. PIN_MODE_ANALOG(GPIOA_ARD_A3) | \
  277. PIN_MODE_ANALOG(GPIOA_ARD_A4) | \
  278. PIN_MODE_ANALOG(GPIOA_ARD_A5) | \
  279. PIN_MODE_ANALOG(GPIOA_ARD_A6) | \
  280. PIN_MODE_ANALOG(GPIOA_ARD_D9) | \
  281. PIN_MODE_ANALOG(GPIOA_ARD_D1) | \
  282. PIN_MODE_ANALOG(GPIOA_ARD_D0) | \
  283. PIN_MODE_ANALOG(GPIOA_ARD_D10) | \
  284. PIN_MODE_ANALOG(GPIOA_ARD_D2) | \
  285. PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
  286. PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
  287. PIN_MODE_ALTERNATE(GPIOA_VCP_RX))
  288. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_ARD_A0) | \
  289. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A1) | \
  290. PIN_OTYPE_PUSHPULL(GPIOA_VCP_TX) | \
  291. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A2) | \
  292. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A3) | \
  293. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A4) | \
  294. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A5) | \
  295. PIN_OTYPE_PUSHPULL(GPIOA_ARD_A6) | \
  296. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D9) | \
  297. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D1) | \
  298. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D0) | \
  299. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D10) | \
  300. PIN_OTYPE_PUSHPULL(GPIOA_ARD_D2) | \
  301. PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
  302. PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
  303. PIN_OTYPE_PUSHPULL(GPIOA_VCP_RX))
  304. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_ARD_A0) | \
  305. PIN_OSPEED_HIGH(GPIOA_ARD_A1) | \
  306. PIN_OSPEED_MEDIUM(GPIOA_VCP_TX) | \
  307. PIN_OSPEED_MEDIUM(GPIOA_ARD_A2) | \
  308. PIN_OSPEED_HIGH(GPIOA_ARD_A3) | \
  309. PIN_OSPEED_HIGH(GPIOA_ARD_A4) | \
  310. PIN_OSPEED_HIGH(GPIOA_ARD_A5) | \
  311. PIN_OSPEED_HIGH(GPIOA_ARD_A6) | \
  312. PIN_OSPEED_HIGH(GPIOA_ARD_D9) | \
  313. PIN_OSPEED_HIGH(GPIOA_ARD_D1) | \
  314. PIN_OSPEED_HIGH(GPIOA_ARD_D0) | \
  315. PIN_OSPEED_HIGH(GPIOA_ARD_D10) | \
  316. PIN_OSPEED_HIGH(GPIOA_ARD_D2) | \
  317. PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
  318. PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
  319. PIN_OSPEED_HIGH(GPIOA_VCP_RX))
  320. #define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_ARD_A0) | \
  321. PIN_PUPDR_FLOATING(GPIOA_ARD_A1) | \
  322. PIN_PUPDR_FLOATING(GPIOA_VCP_TX) | \
  323. PIN_PUPDR_FLOATING(GPIOA_ARD_A2) | \
  324. PIN_PUPDR_FLOATING(GPIOA_ARD_A3) | \
  325. PIN_PUPDR_FLOATING(GPIOA_ARD_A4) | \
  326. PIN_PUPDR_FLOATING(GPIOA_ARD_A5) | \
  327. PIN_PUPDR_FLOATING(GPIOA_ARD_A6) | \
  328. PIN_PUPDR_FLOATING(GPIOA_ARD_D9) | \
  329. PIN_PUPDR_FLOATING(GPIOA_ARD_D1) | \
  330. PIN_PUPDR_FLOATING(GPIOA_ARD_D0) | \
  331. PIN_PUPDR_FLOATING(GPIOA_ARD_D10) | \
  332. PIN_PUPDR_FLOATING(GPIOA_ARD_D2) | \
  333. PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
  334. PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
  335. PIN_PUPDR_FLOATING(GPIOA_VCP_RX))
  336. #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_ARD_A0) | \
  337. PIN_ODR_HIGH(GPIOA_ARD_A1) | \
  338. PIN_ODR_HIGH(GPIOA_VCP_TX) | \
  339. PIN_ODR_HIGH(GPIOA_ARD_A2) | \
  340. PIN_ODR_HIGH(GPIOA_ARD_A3) | \
  341. PIN_ODR_HIGH(GPIOA_ARD_A4) | \
  342. PIN_ODR_HIGH(GPIOA_ARD_A5) | \
  343. PIN_ODR_HIGH(GPIOA_ARD_A6) | \
  344. PIN_ODR_HIGH(GPIOA_ARD_D9) | \
  345. PIN_ODR_HIGH(GPIOA_ARD_D1) | \
  346. PIN_ODR_HIGH(GPIOA_ARD_D0) | \
  347. PIN_ODR_HIGH(GPIOA_ARD_D10) | \
  348. PIN_ODR_HIGH(GPIOA_ARD_D2) | \
  349. PIN_ODR_HIGH(GPIOA_SWDIO) | \
  350. PIN_ODR_HIGH(GPIOA_SWCLK) | \
  351. PIN_ODR_HIGH(GPIOA_VCP_RX))
  352. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_ARD_A0, 0U) | \
  353. PIN_AFIO_AF(GPIOA_ARD_A1, 0U) | \
  354. PIN_AFIO_AF(GPIOA_VCP_TX, 7U) | \
  355. PIN_AFIO_AF(GPIOA_ARD_A2, 0U) | \
  356. PIN_AFIO_AF(GPIOA_ARD_A3, 0U) | \
  357. PIN_AFIO_AF(GPIOA_ARD_A4, 0U) | \
  358. PIN_AFIO_AF(GPIOA_ARD_A5, 0U) | \
  359. PIN_AFIO_AF(GPIOA_ARD_A6, 0U))
  360. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_ARD_D9, 0U) | \
  361. PIN_AFIO_AF(GPIOA_ARD_D1, 0U) | \
  362. PIN_AFIO_AF(GPIOA_ARD_D0, 0U) | \
  363. PIN_AFIO_AF(GPIOA_ARD_D10, 0U) | \
  364. PIN_AFIO_AF(GPIOA_ARD_D2, 0U) | \
  365. PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
  366. PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
  367. PIN_AFIO_AF(GPIOA_VCP_RX, 3U))
  368. #define VAL_GPIOA_ASCR (PIN_ASCR_DISABLED(GPIOA_ARD_A0) | \
  369. PIN_ASCR_DISABLED(GPIOA_ARD_A1) | \
  370. PIN_ASCR_DISABLED(GPIOA_VCP_TX) | \
  371. PIN_ASCR_DISABLED(GPIOA_ARD_A2) | \
  372. PIN_ASCR_DISABLED(GPIOA_ARD_A3) | \
  373. PIN_ASCR_DISABLED(GPIOA_ARD_A4) | \
  374. PIN_ASCR_DISABLED(GPIOA_ARD_A5) | \
  375. PIN_ASCR_DISABLED(GPIOA_ARD_A6) | \
  376. PIN_ASCR_DISABLED(GPIOA_ARD_D9) | \
  377. PIN_ASCR_DISABLED(GPIOA_ARD_D1) | \
  378. PIN_ASCR_DISABLED(GPIOA_ARD_D0) | \
  379. PIN_ASCR_DISABLED(GPIOA_ARD_D10) | \
  380. PIN_ASCR_DISABLED(GPIOA_ARD_D2) | \
  381. PIN_ASCR_DISABLED(GPIOA_SWDIO) | \
  382. PIN_ASCR_DISABLED(GPIOA_SWCLK) | \
  383. PIN_ASCR_DISABLED(GPIOA_VCP_RX))
  384. #define VAL_GPIOA_LOCKR (PIN_LOCKR_DISABLED(GPIOA_ARD_A0) | \
  385. PIN_LOCKR_DISABLED(GPIOA_ARD_A1) | \
  386. PIN_LOCKR_DISABLED(GPIOA_VCP_TX) | \
  387. PIN_LOCKR_DISABLED(GPIOA_ARD_A2) | \
  388. PIN_LOCKR_DISABLED(GPIOA_ARD_A3) | \
  389. PIN_LOCKR_DISABLED(GPIOA_ARD_A4) | \
  390. PIN_LOCKR_DISABLED(GPIOA_ARD_A5) | \
  391. PIN_LOCKR_DISABLED(GPIOA_ARD_A6) | \
  392. PIN_LOCKR_DISABLED(GPIOA_ARD_D9) | \
  393. PIN_LOCKR_DISABLED(GPIOA_ARD_D1) | \
  394. PIN_LOCKR_DISABLED(GPIOA_ARD_D0) | \
  395. PIN_LOCKR_DISABLED(GPIOA_ARD_D10) | \
  396. PIN_LOCKR_DISABLED(GPIOA_ARD_D2) | \
  397. PIN_LOCKR_DISABLED(GPIOA_SWDIO) | \
  398. PIN_LOCKR_DISABLED(GPIOA_SWCLK) | \
  399. PIN_LOCKR_DISABLED(GPIOA_VCP_RX))
  400. /*
  401. * GPIOB setup:
  402. *
  403. * PB0 - ARD_D3 (input pullup).
  404. * PB1 - ARD_D6 (analog).
  405. * PB2 - PIN2 (analog).
  406. * PB3 - ARD_D13 LED_GREEN (output pushpull maximum).
  407. * PB4 - ARD_D12 (analog).
  408. * PB5 - ARD_D11 (analog).
  409. * PB6 - ARD_D5 ARD_A5_ALT (analog).
  410. * PB7 - ARD_D4 ARD_A4_ALT (analog).
  411. * PB8 - PIN8 (analog).
  412. * PB9 - PIN9 (analog).
  413. * PB10 - PIN10 (analog).
  414. * PB11 - PIN11 (analog).
  415. * PB12 - PIN12 (analog).
  416. * PB13 - PIN13 (analog).
  417. * PB14 - PIN14 (analog).
  418. * PB15 - PIN15 (analog).
  419. */
  420. #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_ARD_D3) | \
  421. PIN_MODE_ANALOG(GPIOB_ARD_D6) | \
  422. PIN_MODE_ANALOG(GPIOB_PIN2) | \
  423. PIN_MODE_OUTPUT(GPIOB_ARD_D13) | \
  424. PIN_MODE_ANALOG(GPIOB_ARD_D12) | \
  425. PIN_MODE_ANALOG(GPIOB_ARD_D11) | \
  426. PIN_MODE_ANALOG(GPIOB_ARD_D5) | \
  427. PIN_MODE_ANALOG(GPIOB_ARD_D4) | \
  428. PIN_MODE_ANALOG(GPIOB_PIN8) | \
  429. PIN_MODE_ANALOG(GPIOB_PIN9) | \
  430. PIN_MODE_ANALOG(GPIOB_PIN10) | \
  431. PIN_MODE_ANALOG(GPIOB_PIN11) | \
  432. PIN_MODE_ANALOG(GPIOB_PIN12) | \
  433. PIN_MODE_ANALOG(GPIOB_PIN13) | \
  434. PIN_MODE_ANALOG(GPIOB_PIN14) | \
  435. PIN_MODE_ANALOG(GPIOB_PIN15))
  436. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_ARD_D3) | \
  437. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D6) | \
  438. PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
  439. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D13) | \
  440. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D12) | \
  441. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D11) | \
  442. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D5) | \
  443. PIN_OTYPE_PUSHPULL(GPIOB_ARD_D4) | \
  444. PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
  445. PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
  446. PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
  447. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  448. PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
  449. PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
  450. PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
  451. PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
  452. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_ARD_D3) | \
  453. PIN_OSPEED_HIGH(GPIOB_ARD_D6) | \
  454. PIN_OSPEED_HIGH(GPIOB_PIN2) | \
  455. PIN_OSPEED_HIGH(GPIOB_ARD_D13) | \
  456. PIN_OSPEED_HIGH(GPIOB_ARD_D12) | \
  457. PIN_OSPEED_HIGH(GPIOB_ARD_D11) | \
  458. PIN_OSPEED_HIGH(GPIOB_ARD_D5) | \
  459. PIN_OSPEED_HIGH(GPIOB_ARD_D4) | \
  460. PIN_OSPEED_HIGH(GPIOB_PIN8) | \
  461. PIN_OSPEED_HIGH(GPIOB_PIN9) | \
  462. PIN_OSPEED_HIGH(GPIOB_PIN10) | \
  463. PIN_OSPEED_HIGH(GPIOB_PIN11) | \
  464. PIN_OSPEED_HIGH(GPIOB_PIN12) | \
  465. PIN_OSPEED_HIGH(GPIOB_PIN13) | \
  466. PIN_OSPEED_HIGH(GPIOB_PIN14) | \
  467. PIN_OSPEED_HIGH(GPIOB_PIN15))
  468. #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_ARD_D3) | \
  469. PIN_PUPDR_FLOATING(GPIOB_ARD_D6) | \
  470. PIN_PUPDR_FLOATING(GPIOB_PIN2) | \
  471. PIN_PUPDR_FLOATING(GPIOB_ARD_D13) | \
  472. PIN_PUPDR_FLOATING(GPIOB_ARD_D12) | \
  473. PIN_PUPDR_FLOATING(GPIOB_ARD_D11) | \
  474. PIN_PUPDR_FLOATING(GPIOB_ARD_D5) | \
  475. PIN_PUPDR_FLOATING(GPIOB_ARD_D4) | \
  476. PIN_PUPDR_FLOATING(GPIOB_PIN8) | \
  477. PIN_PUPDR_FLOATING(GPIOB_PIN9) | \
  478. PIN_PUPDR_FLOATING(GPIOB_PIN10) | \
  479. PIN_PUPDR_FLOATING(GPIOB_PIN11) | \
  480. PIN_PUPDR_FLOATING(GPIOB_PIN12) | \
  481. PIN_PUPDR_FLOATING(GPIOB_PIN13) | \
  482. PIN_PUPDR_FLOATING(GPIOB_PIN14) | \
  483. PIN_PUPDR_FLOATING(GPIOB_PIN15))
  484. #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_ARD_D3) | \
  485. PIN_ODR_HIGH(GPIOB_ARD_D6) | \
  486. PIN_ODR_HIGH(GPIOB_PIN2) | \
  487. PIN_ODR_LOW(GPIOB_ARD_D13) | \
  488. PIN_ODR_HIGH(GPIOB_ARD_D12) | \
  489. PIN_ODR_HIGH(GPIOB_ARD_D11) | \
  490. PIN_ODR_HIGH(GPIOB_ARD_D5) | \
  491. PIN_ODR_HIGH(GPIOB_ARD_D4) | \
  492. PIN_ODR_HIGH(GPIOB_PIN8) | \
  493. PIN_ODR_HIGH(GPIOB_PIN9) | \
  494. PIN_ODR_HIGH(GPIOB_PIN10) | \
  495. PIN_ODR_HIGH(GPIOB_PIN11) | \
  496. PIN_ODR_HIGH(GPIOB_PIN12) | \
  497. PIN_ODR_HIGH(GPIOB_PIN13) | \
  498. PIN_ODR_HIGH(GPIOB_PIN14) | \
  499. PIN_ODR_HIGH(GPIOB_PIN15))
  500. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_ARD_D3, 0U) | \
  501. PIN_AFIO_AF(GPIOB_ARD_D6, 0U) | \
  502. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  503. PIN_AFIO_AF(GPIOB_ARD_D13, 0U) | \
  504. PIN_AFIO_AF(GPIOB_ARD_D12, 0U) | \
  505. PIN_AFIO_AF(GPIOB_ARD_D11, 0U) | \
  506. PIN_AFIO_AF(GPIOB_ARD_D5, 0U) | \
  507. PIN_AFIO_AF(GPIOB_ARD_D4, 0U))
  508. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  509. PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
  510. PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
  511. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  512. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  513. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  514. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  515. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  516. #define VAL_GPIOB_ASCR (PIN_ASCR_DISABLED(GPIOB_ARD_D3) | \
  517. PIN_ASCR_DISABLED(GPIOB_ARD_D6) | \
  518. PIN_ASCR_DISABLED(GPIOB_PIN2) | \
  519. PIN_ASCR_DISABLED(GPIOB_ARD_D13) | \
  520. PIN_ASCR_DISABLED(GPIOB_ARD_D12) | \
  521. PIN_ASCR_DISABLED(GPIOB_ARD_D11) | \
  522. PIN_ASCR_DISABLED(GPIOB_ARD_D5) | \
  523. PIN_ASCR_DISABLED(GPIOB_ARD_D4) | \
  524. PIN_ASCR_DISABLED(GPIOB_PIN8) | \
  525. PIN_ASCR_DISABLED(GPIOB_PIN9) | \
  526. PIN_ASCR_DISABLED(GPIOB_PIN10) | \
  527. PIN_ASCR_DISABLED(GPIOB_PIN11) | \
  528. PIN_ASCR_DISABLED(GPIOB_PIN12) | \
  529. PIN_ASCR_DISABLED(GPIOB_PIN13) | \
  530. PIN_ASCR_DISABLED(GPIOB_PIN14) | \
  531. PIN_ASCR_DISABLED(GPIOB_PIN15))
  532. #define VAL_GPIOB_LOCKR (PIN_LOCKR_DISABLED(GPIOB_ARD_D3) | \
  533. PIN_LOCKR_DISABLED(GPIOB_ARD_D6) | \
  534. PIN_LOCKR_DISABLED(GPIOB_PIN2) | \
  535. PIN_LOCKR_DISABLED(GPIOB_ARD_D13) | \
  536. PIN_LOCKR_DISABLED(GPIOB_ARD_D12) | \
  537. PIN_LOCKR_DISABLED(GPIOB_ARD_D11) | \
  538. PIN_LOCKR_DISABLED(GPIOB_ARD_D5) | \
  539. PIN_LOCKR_DISABLED(GPIOB_ARD_D4) | \
  540. PIN_LOCKR_DISABLED(GPIOB_PIN8) | \
  541. PIN_LOCKR_DISABLED(GPIOB_PIN9) | \
  542. PIN_LOCKR_DISABLED(GPIOB_PIN10) | \
  543. PIN_LOCKR_DISABLED(GPIOB_PIN11) | \
  544. PIN_LOCKR_DISABLED(GPIOB_PIN12) | \
  545. PIN_LOCKR_DISABLED(GPIOB_PIN13) | \
  546. PIN_LOCKR_DISABLED(GPIOB_PIN14) | \
  547. PIN_LOCKR_DISABLED(GPIOB_PIN15))
  548. /*
  549. * GPIOC setup:
  550. *
  551. * PC0 - PIN0 (analog).
  552. * PC1 - PIN1 (analog).
  553. * PC2 - PIN2 (analog).
  554. * PC3 - PIN3 (analog).
  555. * PC4 - PIN4 (analog).
  556. * PC5 - PIN5 (analog).
  557. * PC6 - PIN6 (analog).
  558. * PC7 - PIN7 (analog).
  559. * PC8 - PIN8 (analog).
  560. * PC9 - PIN9 (analog).
  561. * PC10 - PIN10 (analog).
  562. * PC11 - PIN11 (analog).
  563. * PC12 - PIN12 (analog).
  564. * PC13 - PIN13 (analog).
  565. * PC14 - ARD_D7 (analog).
  566. * PC15 - ARD_D8 (analog).
  567. */
  568. #define VAL_GPIOC_MODER (PIN_MODE_ANALOG(GPIOC_PIN0) | \
  569. PIN_MODE_ANALOG(GPIOC_PIN1) | \
  570. PIN_MODE_ANALOG(GPIOC_PIN2) | \
  571. PIN_MODE_ANALOG(GPIOC_PIN3) | \
  572. PIN_MODE_ANALOG(GPIOC_PIN4) | \
  573. PIN_MODE_ANALOG(GPIOC_PIN5) | \
  574. PIN_MODE_ANALOG(GPIOC_PIN6) | \
  575. PIN_MODE_ANALOG(GPIOC_PIN7) | \
  576. PIN_MODE_ANALOG(GPIOC_PIN8) | \
  577. PIN_MODE_ANALOG(GPIOC_PIN9) | \
  578. PIN_MODE_ANALOG(GPIOC_PIN10) | \
  579. PIN_MODE_ANALOG(GPIOC_PIN11) | \
  580. PIN_MODE_ANALOG(GPIOC_PIN12) | \
  581. PIN_MODE_ANALOG(GPIOC_PIN13) | \
  582. PIN_MODE_ANALOG(GPIOC_ARD_D7) | \
  583. PIN_MODE_ANALOG(GPIOC_ARD_D8))
  584. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  585. PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
  586. PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
  587. PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
  588. PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
  589. PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
  590. PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
  591. PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
  592. PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
  593. PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
  594. PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
  595. PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
  596. PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
  597. PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
  598. PIN_OTYPE_PUSHPULL(GPIOC_ARD_D7) | \
  599. PIN_OTYPE_PUSHPULL(GPIOC_ARD_D8))
  600. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \
  601. PIN_OSPEED_HIGH(GPIOC_PIN1) | \
  602. PIN_OSPEED_HIGH(GPIOC_PIN2) | \
  603. PIN_OSPEED_HIGH(GPIOC_PIN3) | \
  604. PIN_OSPEED_HIGH(GPIOC_PIN4) | \
  605. PIN_OSPEED_HIGH(GPIOC_PIN5) | \
  606. PIN_OSPEED_HIGH(GPIOC_PIN6) | \
  607. PIN_OSPEED_HIGH(GPIOC_PIN7) | \
  608. PIN_OSPEED_HIGH(GPIOC_PIN8) | \
  609. PIN_OSPEED_HIGH(GPIOC_PIN9) | \
  610. PIN_OSPEED_HIGH(GPIOC_PIN10) | \
  611. PIN_OSPEED_HIGH(GPIOC_PIN11) | \
  612. PIN_OSPEED_HIGH(GPIOC_PIN12) | \
  613. PIN_OSPEED_HIGH(GPIOC_PIN13) | \
  614. PIN_OSPEED_HIGH(GPIOC_ARD_D7) | \
  615. PIN_OSPEED_HIGH(GPIOC_ARD_D8))
  616. #define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_PIN0) | \
  617. PIN_PUPDR_FLOATING(GPIOC_PIN1) | \
  618. PIN_PUPDR_FLOATING(GPIOC_PIN2) | \
  619. PIN_PUPDR_FLOATING(GPIOC_PIN3) | \
  620. PIN_PUPDR_FLOATING(GPIOC_PIN4) | \
  621. PIN_PUPDR_FLOATING(GPIOC_PIN5) | \
  622. PIN_PUPDR_FLOATING(GPIOC_PIN6) | \
  623. PIN_PUPDR_FLOATING(GPIOC_PIN7) | \
  624. PIN_PUPDR_FLOATING(GPIOC_PIN8) | \
  625. PIN_PUPDR_FLOATING(GPIOC_PIN9) | \
  626. PIN_PUPDR_FLOATING(GPIOC_PIN10) | \
  627. PIN_PUPDR_FLOATING(GPIOC_PIN11) | \
  628. PIN_PUPDR_FLOATING(GPIOC_PIN12) | \
  629. PIN_PUPDR_FLOATING(GPIOC_PIN13) | \
  630. PIN_PUPDR_FLOATING(GPIOC_ARD_D7) | \
  631. PIN_PUPDR_FLOATING(GPIOC_ARD_D8))
  632. #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
  633. PIN_ODR_HIGH(GPIOC_PIN1) | \
  634. PIN_ODR_HIGH(GPIOC_PIN2) | \
  635. PIN_ODR_HIGH(GPIOC_PIN3) | \
  636. PIN_ODR_HIGH(GPIOC_PIN4) | \
  637. PIN_ODR_HIGH(GPIOC_PIN5) | \
  638. PIN_ODR_HIGH(GPIOC_PIN6) | \
  639. PIN_ODR_HIGH(GPIOC_PIN7) | \
  640. PIN_ODR_HIGH(GPIOC_PIN8) | \
  641. PIN_ODR_HIGH(GPIOC_PIN9) | \
  642. PIN_ODR_HIGH(GPIOC_PIN10) | \
  643. PIN_ODR_HIGH(GPIOC_PIN11) | \
  644. PIN_ODR_HIGH(GPIOC_PIN12) | \
  645. PIN_ODR_HIGH(GPIOC_PIN13) | \
  646. PIN_ODR_HIGH(GPIOC_ARD_D7) | \
  647. PIN_ODR_HIGH(GPIOC_ARD_D8))
  648. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  649. PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
  650. PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
  651. PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
  652. PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
  653. PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
  654. PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
  655. PIN_AFIO_AF(GPIOC_PIN7, 0U))
  656. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \
  657. PIN_AFIO_AF(GPIOC_PIN9, 0U) | \
  658. PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
  659. PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
  660. PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
  661. PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
  662. PIN_AFIO_AF(GPIOC_ARD_D7, 0U) | \
  663. PIN_AFIO_AF(GPIOC_ARD_D8, 0U))
  664. #define VAL_GPIOC_ASCR (PIN_ASCR_DISABLED(GPIOC_PIN0) | \
  665. PIN_ASCR_DISABLED(GPIOC_PIN1) | \
  666. PIN_ASCR_DISABLED(GPIOC_PIN2) | \
  667. PIN_ASCR_DISABLED(GPIOC_PIN3) | \
  668. PIN_ASCR_DISABLED(GPIOC_PIN4) | \
  669. PIN_ASCR_DISABLED(GPIOC_PIN5) | \
  670. PIN_ASCR_DISABLED(GPIOC_PIN6) | \
  671. PIN_ASCR_DISABLED(GPIOC_PIN7) | \
  672. PIN_ASCR_DISABLED(GPIOC_PIN8) | \
  673. PIN_ASCR_DISABLED(GPIOC_PIN9) | \
  674. PIN_ASCR_DISABLED(GPIOC_PIN10) | \
  675. PIN_ASCR_DISABLED(GPIOC_PIN11) | \
  676. PIN_ASCR_DISABLED(GPIOC_PIN12) | \
  677. PIN_ASCR_DISABLED(GPIOC_PIN13) | \
  678. PIN_ASCR_DISABLED(GPIOC_ARD_D7) | \
  679. PIN_ASCR_DISABLED(GPIOC_ARD_D8))
  680. #define VAL_GPIOC_LOCKR (PIN_LOCKR_DISABLED(GPIOC_PIN0) | \
  681. PIN_LOCKR_DISABLED(GPIOC_PIN1) | \
  682. PIN_LOCKR_DISABLED(GPIOC_PIN2) | \
  683. PIN_LOCKR_DISABLED(GPIOC_PIN3) | \
  684. PIN_LOCKR_DISABLED(GPIOC_PIN4) | \
  685. PIN_LOCKR_DISABLED(GPIOC_PIN5) | \
  686. PIN_LOCKR_DISABLED(GPIOC_PIN6) | \
  687. PIN_LOCKR_DISABLED(GPIOC_PIN7) | \
  688. PIN_LOCKR_DISABLED(GPIOC_PIN8) | \
  689. PIN_LOCKR_DISABLED(GPIOC_PIN9) | \
  690. PIN_LOCKR_DISABLED(GPIOC_PIN10) | \
  691. PIN_LOCKR_DISABLED(GPIOC_PIN11) | \
  692. PIN_LOCKR_DISABLED(GPIOC_PIN12) | \
  693. PIN_LOCKR_DISABLED(GPIOC_PIN13) | \
  694. PIN_LOCKR_DISABLED(GPIOC_ARD_D7) | \
  695. PIN_LOCKR_DISABLED(GPIOC_ARD_D8))
  696. /*
  697. * GPIOD setup:
  698. *
  699. * PD0 - PIN0 (analog).
  700. * PD1 - PIN1 (analog).
  701. * PD2 - PIN2 (analog).
  702. * PD3 - PIN3 (analog).
  703. * PD4 - PIN4 (analog).
  704. * PD5 - PIN5 (analog).
  705. * PD6 - PIN6 (analog).
  706. * PD7 - PIN7 (analog).
  707. * PD8 - PIN8 (analog).
  708. * PD9 - PIN9 (analog).
  709. * PD10 - PIN10 (analog).
  710. * PD11 - PIN11 (analog).
  711. * PD12 - PIN12 (analog).
  712. * PD13 - PIN13 (analog).
  713. * PD14 - PIN14 (analog).
  714. * PD15 - PIN15 (analog).
  715. */
  716. #define VAL_GPIOD_MODER (PIN_MODE_ANALOG(GPIOD_PIN0) | \
  717. PIN_MODE_ANALOG(GPIOD_PIN1) | \
  718. PIN_MODE_ANALOG(GPIOD_PIN2) | \
  719. PIN_MODE_ANALOG(GPIOD_PIN3) | \
  720. PIN_MODE_ANALOG(GPIOD_PIN4) | \
  721. PIN_MODE_ANALOG(GPIOD_PIN5) | \
  722. PIN_MODE_ANALOG(GPIOD_PIN6) | \
  723. PIN_MODE_ANALOG(GPIOD_PIN7) | \
  724. PIN_MODE_ANALOG(GPIOD_PIN8) | \
  725. PIN_MODE_ANALOG(GPIOD_PIN9) | \
  726. PIN_MODE_ANALOG(GPIOD_PIN10) | \
  727. PIN_MODE_ANALOG(GPIOD_PIN11) | \
  728. PIN_MODE_ANALOG(GPIOD_PIN12) | \
  729. PIN_MODE_ANALOG(GPIOD_PIN13) | \
  730. PIN_MODE_ANALOG(GPIOD_PIN14) | \
  731. PIN_MODE_ANALOG(GPIOD_PIN15))
  732. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  733. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  734. PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
  735. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  736. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  737. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  738. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  739. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  740. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  741. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  742. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  743. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  744. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  745. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  746. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  747. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  748. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
  749. PIN_OSPEED_HIGH(GPIOD_PIN1) | \
  750. PIN_OSPEED_HIGH(GPIOD_PIN2) | \
  751. PIN_OSPEED_HIGH(GPIOD_PIN3) | \
  752. PIN_OSPEED_HIGH(GPIOD_PIN4) | \
  753. PIN_OSPEED_HIGH(GPIOD_PIN5) | \
  754. PIN_OSPEED_HIGH(GPIOD_PIN6) | \
  755. PIN_OSPEED_HIGH(GPIOD_PIN7) | \
  756. PIN_OSPEED_HIGH(GPIOD_PIN8) | \
  757. PIN_OSPEED_HIGH(GPIOD_PIN9) | \
  758. PIN_OSPEED_HIGH(GPIOD_PIN10) | \
  759. PIN_OSPEED_HIGH(GPIOD_PIN11) | \
  760. PIN_OSPEED_HIGH(GPIOD_PIN12) | \
  761. PIN_OSPEED_HIGH(GPIOD_PIN13) | \
  762. PIN_OSPEED_HIGH(GPIOD_PIN14) | \
  763. PIN_OSPEED_HIGH(GPIOD_PIN15))
  764. #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \
  765. PIN_PUPDR_FLOATING(GPIOD_PIN1) | \
  766. PIN_PUPDR_FLOATING(GPIOD_PIN2) | \
  767. PIN_PUPDR_FLOATING(GPIOD_PIN3) | \
  768. PIN_PUPDR_FLOATING(GPIOD_PIN4) | \
  769. PIN_PUPDR_FLOATING(GPIOD_PIN5) | \
  770. PIN_PUPDR_FLOATING(GPIOD_PIN6) | \
  771. PIN_PUPDR_FLOATING(GPIOD_PIN7) | \
  772. PIN_PUPDR_FLOATING(GPIOD_PIN8) | \
  773. PIN_PUPDR_FLOATING(GPIOD_PIN9) | \
  774. PIN_PUPDR_FLOATING(GPIOD_PIN10) | \
  775. PIN_PUPDR_FLOATING(GPIOD_PIN11) | \
  776. PIN_PUPDR_FLOATING(GPIOD_PIN12) | \
  777. PIN_PUPDR_FLOATING(GPIOD_PIN13) | \
  778. PIN_PUPDR_FLOATING(GPIOD_PIN14) | \
  779. PIN_PUPDR_FLOATING(GPIOD_PIN15))
  780. #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
  781. PIN_ODR_HIGH(GPIOD_PIN1) | \
  782. PIN_ODR_HIGH(GPIOD_PIN2) | \
  783. PIN_ODR_HIGH(GPIOD_PIN3) | \
  784. PIN_ODR_HIGH(GPIOD_PIN4) | \
  785. PIN_ODR_HIGH(GPIOD_PIN5) | \
  786. PIN_ODR_HIGH(GPIOD_PIN6) | \
  787. PIN_ODR_HIGH(GPIOD_PIN7) | \
  788. PIN_ODR_HIGH(GPIOD_PIN8) | \
  789. PIN_ODR_HIGH(GPIOD_PIN9) | \
  790. PIN_ODR_HIGH(GPIOD_PIN10) | \
  791. PIN_ODR_HIGH(GPIOD_PIN11) | \
  792. PIN_ODR_HIGH(GPIOD_PIN12) | \
  793. PIN_ODR_HIGH(GPIOD_PIN13) | \
  794. PIN_ODR_HIGH(GPIOD_PIN14) | \
  795. PIN_ODR_HIGH(GPIOD_PIN15))
  796. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
  797. PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
  798. PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
  799. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  800. PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
  801. PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
  802. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  803. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  804. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
  805. PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
  806. PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
  807. PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
  808. PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
  809. PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
  810. PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
  811. PIN_AFIO_AF(GPIOD_PIN15, 0U))
  812. #define VAL_GPIOD_ASCR (PIN_ASCR_DISABLED(GPIOD_PIN0) | \
  813. PIN_ASCR_DISABLED(GPIOD_PIN1) | \
  814. PIN_ASCR_DISABLED(GPIOD_PIN2) | \
  815. PIN_ASCR_DISABLED(GPIOD_PIN3) | \
  816. PIN_ASCR_DISABLED(GPIOD_PIN4) | \
  817. PIN_ASCR_DISABLED(GPIOD_PIN5) | \
  818. PIN_ASCR_DISABLED(GPIOD_PIN6) | \
  819. PIN_ASCR_DISABLED(GPIOD_PIN7) | \
  820. PIN_ASCR_DISABLED(GPIOD_PIN8) | \
  821. PIN_ASCR_DISABLED(GPIOD_PIN9) | \
  822. PIN_ASCR_DISABLED(GPIOD_PIN10) | \
  823. PIN_ASCR_DISABLED(GPIOD_PIN11) | \
  824. PIN_ASCR_DISABLED(GPIOD_PIN12) | \
  825. PIN_ASCR_DISABLED(GPIOD_PIN13) | \
  826. PIN_ASCR_DISABLED(GPIOD_PIN14) | \
  827. PIN_ASCR_DISABLED(GPIOD_PIN15))
  828. #define VAL_GPIOD_LOCKR (PIN_LOCKR_DISABLED(GPIOD_PIN0) | \
  829. PIN_LOCKR_DISABLED(GPIOD_PIN1) | \
  830. PIN_LOCKR_DISABLED(GPIOD_PIN2) | \
  831. PIN_LOCKR_DISABLED(GPIOD_PIN3) | \
  832. PIN_LOCKR_DISABLED(GPIOD_PIN4) | \
  833. PIN_LOCKR_DISABLED(GPIOD_PIN5) | \
  834. PIN_LOCKR_DISABLED(GPIOD_PIN6) | \
  835. PIN_LOCKR_DISABLED(GPIOD_PIN7) | \
  836. PIN_LOCKR_DISABLED(GPIOD_PIN8) | \
  837. PIN_LOCKR_DISABLED(GPIOD_PIN9) | \
  838. PIN_LOCKR_DISABLED(GPIOD_PIN10) | \
  839. PIN_LOCKR_DISABLED(GPIOD_PIN11) | \
  840. PIN_LOCKR_DISABLED(GPIOD_PIN12) | \
  841. PIN_LOCKR_DISABLED(GPIOD_PIN13) | \
  842. PIN_LOCKR_DISABLED(GPIOD_PIN14) | \
  843. PIN_LOCKR_DISABLED(GPIOD_PIN15))
  844. /*
  845. * GPIOE setup:
  846. *
  847. * PE0 - PIN0 (analog).
  848. * PE1 - PIN1 (analog).
  849. * PE2 - PIN2 (analog).
  850. * PE3 - PIN3 (analog).
  851. * PE4 - PIN4 (analog).
  852. * PE5 - PIN5 (analog).
  853. * PE6 - PIN6 (analog).
  854. * PE7 - PIN7 (analog).
  855. * PE8 - PIN8 (analog).
  856. * PE9 - PIN9 (analog).
  857. * PE10 - PIN10 (analog).
  858. * PE11 - PIN11 (analog).
  859. * PE12 - PIN12 (analog).
  860. * PE13 - PIN13 (analog).
  861. * PE14 - PIN14 (analog).
  862. * PE15 - PIN15 (analog).
  863. */
  864. #define VAL_GPIOE_MODER (PIN_MODE_ANALOG(GPIOE_PIN0) | \
  865. PIN_MODE_ANALOG(GPIOE_PIN1) | \
  866. PIN_MODE_ANALOG(GPIOE_PIN2) | \
  867. PIN_MODE_ANALOG(GPIOE_PIN3) | \
  868. PIN_MODE_ANALOG(GPIOE_PIN4) | \
  869. PIN_MODE_ANALOG(GPIOE_PIN5) | \
  870. PIN_MODE_ANALOG(GPIOE_PIN6) | \
  871. PIN_MODE_ANALOG(GPIOE_PIN7) | \
  872. PIN_MODE_ANALOG(GPIOE_PIN8) | \
  873. PIN_MODE_ANALOG(GPIOE_PIN9) | \
  874. PIN_MODE_ANALOG(GPIOE_PIN10) | \
  875. PIN_MODE_ANALOG(GPIOE_PIN11) | \
  876. PIN_MODE_ANALOG(GPIOE_PIN12) | \
  877. PIN_MODE_ANALOG(GPIOE_PIN13) | \
  878. PIN_MODE_ANALOG(GPIOE_PIN14) | \
  879. PIN_MODE_ANALOG(GPIOE_PIN15))
  880. #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
  881. PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
  882. PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
  883. PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
  884. PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
  885. PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
  886. PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
  887. PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
  888. PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
  889. PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
  890. PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
  891. PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
  892. PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
  893. PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
  894. PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
  895. PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
  896. #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
  897. PIN_OSPEED_HIGH(GPIOE_PIN1) | \
  898. PIN_OSPEED_HIGH(GPIOE_PIN2) | \
  899. PIN_OSPEED_HIGH(GPIOE_PIN3) | \
  900. PIN_OSPEED_HIGH(GPIOE_PIN4) | \
  901. PIN_OSPEED_HIGH(GPIOE_PIN5) | \
  902. PIN_OSPEED_HIGH(GPIOE_PIN6) | \
  903. PIN_OSPEED_HIGH(GPIOE_PIN7) | \
  904. PIN_OSPEED_HIGH(GPIOE_PIN8) | \
  905. PIN_OSPEED_HIGH(GPIOE_PIN9) | \
  906. PIN_OSPEED_HIGH(GPIOE_PIN10) | \
  907. PIN_OSPEED_HIGH(GPIOE_PIN11) | \
  908. PIN_OSPEED_HIGH(GPIOE_PIN12) | \
  909. PIN_OSPEED_HIGH(GPIOE_PIN13) | \
  910. PIN_OSPEED_HIGH(GPIOE_PIN14) | \
  911. PIN_OSPEED_HIGH(GPIOE_PIN15))
  912. #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \
  913. PIN_PUPDR_FLOATING(GPIOE_PIN1) | \
  914. PIN_PUPDR_FLOATING(GPIOE_PIN2) | \
  915. PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
  916. PIN_PUPDR_FLOATING(GPIOE_PIN4) | \
  917. PIN_PUPDR_FLOATING(GPIOE_PIN5) | \
  918. PIN_PUPDR_FLOATING(GPIOE_PIN6) | \
  919. PIN_PUPDR_FLOATING(GPIOE_PIN7) | \
  920. PIN_PUPDR_FLOATING(GPIOE_PIN8) | \
  921. PIN_PUPDR_FLOATING(GPIOE_PIN9) | \
  922. PIN_PUPDR_FLOATING(GPIOE_PIN10) | \
  923. PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
  924. PIN_PUPDR_FLOATING(GPIOE_PIN12) | \
  925. PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
  926. PIN_PUPDR_FLOATING(GPIOE_PIN14) | \
  927. PIN_PUPDR_FLOATING(GPIOE_PIN15))
  928. #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
  929. PIN_ODR_HIGH(GPIOE_PIN1) | \
  930. PIN_ODR_HIGH(GPIOE_PIN2) | \
  931. PIN_ODR_HIGH(GPIOE_PIN3) | \
  932. PIN_ODR_HIGH(GPIOE_PIN4) | \
  933. PIN_ODR_HIGH(GPIOE_PIN5) | \
  934. PIN_ODR_HIGH(GPIOE_PIN6) | \
  935. PIN_ODR_HIGH(GPIOE_PIN7) | \
  936. PIN_ODR_HIGH(GPIOE_PIN8) | \
  937. PIN_ODR_HIGH(GPIOE_PIN9) | \
  938. PIN_ODR_HIGH(GPIOE_PIN10) | \
  939. PIN_ODR_HIGH(GPIOE_PIN11) | \
  940. PIN_ODR_HIGH(GPIOE_PIN12) | \
  941. PIN_ODR_HIGH(GPIOE_PIN13) | \
  942. PIN_ODR_HIGH(GPIOE_PIN14) | \
  943. PIN_ODR_HIGH(GPIOE_PIN15))
  944. #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
  945. PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
  946. PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
  947. PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
  948. PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
  949. PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
  950. PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
  951. PIN_AFIO_AF(GPIOE_PIN7, 0U))
  952. #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
  953. PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
  954. PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
  955. PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
  956. PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
  957. PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
  958. PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
  959. PIN_AFIO_AF(GPIOE_PIN15, 0U))
  960. #define VAL_GPIOE_ASCR (PIN_ASCR_DISABLED(GPIOE_PIN0) | \
  961. PIN_ASCR_DISABLED(GPIOE_PIN1) | \
  962. PIN_ASCR_DISABLED(GPIOE_PIN2) | \
  963. PIN_ASCR_DISABLED(GPIOE_PIN3) | \
  964. PIN_ASCR_DISABLED(GPIOE_PIN4) | \
  965. PIN_ASCR_DISABLED(GPIOE_PIN5) | \
  966. PIN_ASCR_DISABLED(GPIOE_PIN6) | \
  967. PIN_ASCR_DISABLED(GPIOE_PIN7) | \
  968. PIN_ASCR_DISABLED(GPIOE_PIN8) | \
  969. PIN_ASCR_DISABLED(GPIOE_PIN9) | \
  970. PIN_ASCR_DISABLED(GPIOE_PIN10) | \
  971. PIN_ASCR_DISABLED(GPIOE_PIN11) | \
  972. PIN_ASCR_DISABLED(GPIOE_PIN12) | \
  973. PIN_ASCR_DISABLED(GPIOE_PIN13) | \
  974. PIN_ASCR_DISABLED(GPIOE_PIN14) | \
  975. PIN_ASCR_DISABLED(GPIOE_PIN15))
  976. #define VAL_GPIOE_LOCKR (PIN_LOCKR_DISABLED(GPIOE_PIN0) | \
  977. PIN_LOCKR_DISABLED(GPIOE_PIN1) | \
  978. PIN_LOCKR_DISABLED(GPIOE_PIN2) | \
  979. PIN_LOCKR_DISABLED(GPIOE_PIN3) | \
  980. PIN_LOCKR_DISABLED(GPIOE_PIN4) | \
  981. PIN_LOCKR_DISABLED(GPIOE_PIN5) | \
  982. PIN_LOCKR_DISABLED(GPIOE_PIN6) | \
  983. PIN_LOCKR_DISABLED(GPIOE_PIN7) | \
  984. PIN_LOCKR_DISABLED(GPIOE_PIN8) | \
  985. PIN_LOCKR_DISABLED(GPIOE_PIN9) | \
  986. PIN_LOCKR_DISABLED(GPIOE_PIN10) | \
  987. PIN_LOCKR_DISABLED(GPIOE_PIN11) | \
  988. PIN_LOCKR_DISABLED(GPIOE_PIN12) | \
  989. PIN_LOCKR_DISABLED(GPIOE_PIN13) | \
  990. PIN_LOCKR_DISABLED(GPIOE_PIN14) | \
  991. PIN_LOCKR_DISABLED(GPIOE_PIN15))
  992. /*
  993. * GPIOF setup:
  994. *
  995. * PF0 - PIN0 (analog).
  996. * PF1 - PIN1 (analog).
  997. * PF2 - PIN2 (analog).
  998. * PF3 - PIN3 (analog).
  999. * PF4 - PIN4 (analog).
  1000. * PF5 - PIN5 (analog).
  1001. * PF6 - PIN6 (analog).
  1002. * PF7 - PIN7 (analog).
  1003. * PF8 - PIN8 (analog).
  1004. * PF9 - PIN9 (analog).
  1005. * PF10 - PIN10 (analog).
  1006. * PF11 - PIN11 (analog).
  1007. * PF12 - PIN12 (analog).
  1008. * PF13 - PIN13 (analog).
  1009. * PF14 - PIN14 (analog).
  1010. * PF15 - PIN15 (analog).
  1011. */
  1012. #define VAL_GPIOF_MODER (PIN_MODE_ANALOG(GPIOF_PIN0) | \
  1013. PIN_MODE_ANALOG(GPIOF_PIN1) | \
  1014. PIN_MODE_ANALOG(GPIOF_PIN2) | \
  1015. PIN_MODE_ANALOG(GPIOF_PIN3) | \
  1016. PIN_MODE_ANALOG(GPIOF_PIN4) | \
  1017. PIN_MODE_ANALOG(GPIOF_PIN5) | \
  1018. PIN_MODE_ANALOG(GPIOF_PIN6) | \
  1019. PIN_MODE_ANALOG(GPIOF_PIN7) | \
  1020. PIN_MODE_ANALOG(GPIOF_PIN8) | \
  1021. PIN_MODE_ANALOG(GPIOF_PIN9) | \
  1022. PIN_MODE_ANALOG(GPIOF_PIN10) | \
  1023. PIN_MODE_ANALOG(GPIOF_PIN11) | \
  1024. PIN_MODE_ANALOG(GPIOF_PIN12) | \
  1025. PIN_MODE_ANALOG(GPIOF_PIN13) | \
  1026. PIN_MODE_ANALOG(GPIOF_PIN14) | \
  1027. PIN_MODE_ANALOG(GPIOF_PIN15))
  1028. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \
  1029. PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \
  1030. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  1031. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  1032. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  1033. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  1034. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  1035. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  1036. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  1037. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  1038. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  1039. PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
  1040. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  1041. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  1042. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  1043. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  1044. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \
  1045. PIN_OSPEED_HIGH(GPIOF_PIN1) | \
  1046. PIN_OSPEED_HIGH(GPIOF_PIN2) | \
  1047. PIN_OSPEED_HIGH(GPIOF_PIN3) | \
  1048. PIN_OSPEED_HIGH(GPIOF_PIN4) | \
  1049. PIN_OSPEED_HIGH(GPIOF_PIN5) | \
  1050. PIN_OSPEED_HIGH(GPIOF_PIN6) | \
  1051. PIN_OSPEED_HIGH(GPIOF_PIN7) | \
  1052. PIN_OSPEED_HIGH(GPIOF_PIN8) | \
  1053. PIN_OSPEED_HIGH(GPIOF_PIN9) | \
  1054. PIN_OSPEED_HIGH(GPIOF_PIN10) | \
  1055. PIN_OSPEED_HIGH(GPIOF_PIN11) | \
  1056. PIN_OSPEED_HIGH(GPIOF_PIN12) | \
  1057. PIN_OSPEED_HIGH(GPIOF_PIN13) | \
  1058. PIN_OSPEED_HIGH(GPIOF_PIN14) | \
  1059. PIN_OSPEED_HIGH(GPIOF_PIN15))
  1060. #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \
  1061. PIN_PUPDR_FLOATING(GPIOF_PIN1) | \
  1062. PIN_PUPDR_FLOATING(GPIOF_PIN2) | \
  1063. PIN_PUPDR_FLOATING(GPIOF_PIN3) | \
  1064. PIN_PUPDR_FLOATING(GPIOF_PIN4) | \
  1065. PIN_PUPDR_FLOATING(GPIOF_PIN5) | \
  1066. PIN_PUPDR_FLOATING(GPIOF_PIN6) | \
  1067. PIN_PUPDR_FLOATING(GPIOF_PIN7) | \
  1068. PIN_PUPDR_FLOATING(GPIOF_PIN8) | \
  1069. PIN_PUPDR_FLOATING(GPIOF_PIN9) | \
  1070. PIN_PUPDR_FLOATING(GPIOF_PIN10) | \
  1071. PIN_PUPDR_FLOATING(GPIOF_PIN11) | \
  1072. PIN_PUPDR_FLOATING(GPIOF_PIN12) | \
  1073. PIN_PUPDR_FLOATING(GPIOF_PIN13) | \
  1074. PIN_PUPDR_FLOATING(GPIOF_PIN14) | \
  1075. PIN_PUPDR_FLOATING(GPIOF_PIN15))
  1076. #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \
  1077. PIN_ODR_HIGH(GPIOF_PIN1) | \
  1078. PIN_ODR_HIGH(GPIOF_PIN2) | \
  1079. PIN_ODR_HIGH(GPIOF_PIN3) | \
  1080. PIN_ODR_HIGH(GPIOF_PIN4) | \
  1081. PIN_ODR_HIGH(GPIOF_PIN5) | \
  1082. PIN_ODR_HIGH(GPIOF_PIN6) | \
  1083. PIN_ODR_HIGH(GPIOF_PIN7) | \
  1084. PIN_ODR_HIGH(GPIOF_PIN8) | \
  1085. PIN_ODR_HIGH(GPIOF_PIN9) | \
  1086. PIN_ODR_HIGH(GPIOF_PIN10) | \
  1087. PIN_ODR_HIGH(GPIOF_PIN11) | \
  1088. PIN_ODR_HIGH(GPIOF_PIN12) | \
  1089. PIN_ODR_HIGH(GPIOF_PIN13) | \
  1090. PIN_ODR_HIGH(GPIOF_PIN14) | \
  1091. PIN_ODR_HIGH(GPIOF_PIN15))
  1092. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \
  1093. PIN_AFIO_AF(GPIOF_PIN1, 0U) | \
  1094. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  1095. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  1096. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  1097. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  1098. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  1099. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  1100. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  1101. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  1102. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  1103. PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
  1104. PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
  1105. PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
  1106. PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
  1107. PIN_AFIO_AF(GPIOF_PIN15, 0U))
  1108. #define VAL_GPIOF_ASCR (PIN_ASCR_DISABLED(GPIOF_PIN0) | \
  1109. PIN_ASCR_DISABLED(GPIOF_PIN1) | \
  1110. PIN_ASCR_DISABLED(GPIOF_PIN2) | \
  1111. PIN_ASCR_DISABLED(GPIOF_PIN3) | \
  1112. PIN_ASCR_DISABLED(GPIOF_PIN4) | \
  1113. PIN_ASCR_DISABLED(GPIOF_PIN5) | \
  1114. PIN_ASCR_DISABLED(GPIOF_PIN6) | \
  1115. PIN_ASCR_DISABLED(GPIOF_PIN7) | \
  1116. PIN_ASCR_DISABLED(GPIOF_PIN8) | \
  1117. PIN_ASCR_DISABLED(GPIOF_PIN9) | \
  1118. PIN_ASCR_DISABLED(GPIOF_PIN10) | \
  1119. PIN_ASCR_DISABLED(GPIOF_PIN11) | \
  1120. PIN_ASCR_DISABLED(GPIOF_PIN12) | \
  1121. PIN_ASCR_DISABLED(GPIOF_PIN13) | \
  1122. PIN_ASCR_DISABLED(GPIOF_PIN14) | \
  1123. PIN_ASCR_DISABLED(GPIOF_PIN15))
  1124. #define VAL_GPIOF_LOCKR (PIN_LOCKR_DISABLED(GPIOF_PIN0) | \
  1125. PIN_LOCKR_DISABLED(GPIOF_PIN1) | \
  1126. PIN_LOCKR_DISABLED(GPIOF_PIN2) | \
  1127. PIN_LOCKR_DISABLED(GPIOF_PIN3) | \
  1128. PIN_LOCKR_DISABLED(GPIOF_PIN4) | \
  1129. PIN_LOCKR_DISABLED(GPIOF_PIN5) | \
  1130. PIN_LOCKR_DISABLED(GPIOF_PIN6) | \
  1131. PIN_LOCKR_DISABLED(GPIOF_PIN7) | \
  1132. PIN_LOCKR_DISABLED(GPIOF_PIN8) | \
  1133. PIN_LOCKR_DISABLED(GPIOF_PIN9) | \
  1134. PIN_LOCKR_DISABLED(GPIOF_PIN10) | \
  1135. PIN_LOCKR_DISABLED(GPIOF_PIN11) | \
  1136. PIN_LOCKR_DISABLED(GPIOF_PIN12) | \
  1137. PIN_LOCKR_DISABLED(GPIOF_PIN13) | \
  1138. PIN_LOCKR_DISABLED(GPIOF_PIN14) | \
  1139. PIN_LOCKR_DISABLED(GPIOF_PIN15))
  1140. /*
  1141. * GPIOG setup:
  1142. *
  1143. * PG0 - PIN0 (analog).
  1144. * PG1 - PIN1 (analog).
  1145. * PG2 - PIN2 (analog).
  1146. * PG3 - PIN3 (analog).
  1147. * PG4 - PIN4 (analog).
  1148. * PG5 - PIN5 (analog).
  1149. * PG6 - PIN6 (analog).
  1150. * PG7 - PIN7 (analog).
  1151. * PG8 - PIN8 (analog).
  1152. * PG9 - PIN9 (analog).
  1153. * PG10 - PIN10 (analog).
  1154. * PG11 - PIN11 (analog).
  1155. * PG12 - PIN12 (analog).
  1156. * PG13 - PIN13 (analog).
  1157. * PG14 - PIN14 (analog).
  1158. * PG15 - PIN15 (analog).
  1159. */
  1160. #define VAL_GPIOG_MODER (PIN_MODE_ANALOG(GPIOG_PIN0) | \
  1161. PIN_MODE_ANALOG(GPIOG_PIN1) | \
  1162. PIN_MODE_ANALOG(GPIOG_PIN2) | \
  1163. PIN_MODE_ANALOG(GPIOG_PIN3) | \
  1164. PIN_MODE_ANALOG(GPIOG_PIN4) | \
  1165. PIN_MODE_ANALOG(GPIOG_PIN5) | \
  1166. PIN_MODE_ANALOG(GPIOG_PIN6) | \
  1167. PIN_MODE_ANALOG(GPIOG_PIN7) | \
  1168. PIN_MODE_ANALOG(GPIOG_PIN8) | \
  1169. PIN_MODE_ANALOG(GPIOG_PIN9) | \
  1170. PIN_MODE_ANALOG(GPIOG_PIN10) | \
  1171. PIN_MODE_ANALOG(GPIOG_PIN11) | \
  1172. PIN_MODE_ANALOG(GPIOG_PIN12) | \
  1173. PIN_MODE_ANALOG(GPIOG_PIN13) | \
  1174. PIN_MODE_ANALOG(GPIOG_PIN14) | \
  1175. PIN_MODE_ANALOG(GPIOG_PIN15))
  1176. #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
  1177. PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
  1178. PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
  1179. PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
  1180. PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
  1181. PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
  1182. PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
  1183. PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
  1184. PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
  1185. PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
  1186. PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
  1187. PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
  1188. PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
  1189. PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
  1190. PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
  1191. PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
  1192. #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
  1193. PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
  1194. PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
  1195. PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
  1196. PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
  1197. PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
  1198. PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
  1199. PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
  1200. PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
  1201. PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
  1202. PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
  1203. PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
  1204. PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
  1205. PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
  1206. PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
  1207. PIN_OSPEED_VERYLOW(GPIOG_PIN15))
  1208. #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \
  1209. PIN_PUPDR_FLOATING(GPIOG_PIN1) | \
  1210. PIN_PUPDR_FLOATING(GPIOG_PIN2) | \
  1211. PIN_PUPDR_FLOATING(GPIOG_PIN3) | \
  1212. PIN_PUPDR_FLOATING(GPIOG_PIN4) | \
  1213. PIN_PUPDR_FLOATING(GPIOG_PIN5) | \
  1214. PIN_PUPDR_FLOATING(GPIOG_PIN6) | \
  1215. PIN_PUPDR_FLOATING(GPIOG_PIN7) | \
  1216. PIN_PUPDR_FLOATING(GPIOG_PIN8) | \
  1217. PIN_PUPDR_FLOATING(GPIOG_PIN9) | \
  1218. PIN_PUPDR_FLOATING(GPIOG_PIN10) | \
  1219. PIN_PUPDR_FLOATING(GPIOG_PIN11) | \
  1220. PIN_PUPDR_FLOATING(GPIOG_PIN12) | \
  1221. PIN_PUPDR_FLOATING(GPIOG_PIN13) | \
  1222. PIN_PUPDR_FLOATING(GPIOG_PIN14) | \
  1223. PIN_PUPDR_FLOATING(GPIOG_PIN15))
  1224. #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
  1225. PIN_ODR_HIGH(GPIOG_PIN1) | \
  1226. PIN_ODR_HIGH(GPIOG_PIN2) | \
  1227. PIN_ODR_HIGH(GPIOG_PIN3) | \
  1228. PIN_ODR_HIGH(GPIOG_PIN4) | \
  1229. PIN_ODR_HIGH(GPIOG_PIN5) | \
  1230. PIN_ODR_HIGH(GPIOG_PIN6) | \
  1231. PIN_ODR_HIGH(GPIOG_PIN7) | \
  1232. PIN_ODR_HIGH(GPIOG_PIN8) | \
  1233. PIN_ODR_HIGH(GPIOG_PIN9) | \
  1234. PIN_ODR_HIGH(GPIOG_PIN10) | \
  1235. PIN_ODR_HIGH(GPIOG_PIN11) | \
  1236. PIN_ODR_HIGH(GPIOG_PIN12) | \
  1237. PIN_ODR_HIGH(GPIOG_PIN13) | \
  1238. PIN_ODR_HIGH(GPIOG_PIN14) | \
  1239. PIN_ODR_HIGH(GPIOG_PIN15))
  1240. #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0U) | \
  1241. PIN_AFIO_AF(GPIOG_PIN1, 0U) | \
  1242. PIN_AFIO_AF(GPIOG_PIN2, 0U) | \
  1243. PIN_AFIO_AF(GPIOG_PIN3, 0U) | \
  1244. PIN_AFIO_AF(GPIOG_PIN4, 0U) | \
  1245. PIN_AFIO_AF(GPIOG_PIN5, 0U) | \
  1246. PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
  1247. PIN_AFIO_AF(GPIOG_PIN7, 0U))
  1248. #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
  1249. PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
  1250. PIN_AFIO_AF(GPIOG_PIN10, 0U) | \
  1251. PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
  1252. PIN_AFIO_AF(GPIOG_PIN12, 0U) | \
  1253. PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
  1254. PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
  1255. PIN_AFIO_AF(GPIOG_PIN15, 0U))
  1256. #define VAL_GPIOG_ASCR (PIN_ASCR_DISABLED(GPIOG_PIN0) | \
  1257. PIN_ASCR_DISABLED(GPIOG_PIN1) | \
  1258. PIN_ASCR_DISABLED(GPIOG_PIN2) | \
  1259. PIN_ASCR_DISABLED(GPIOG_PIN3) | \
  1260. PIN_ASCR_DISABLED(GPIOG_PIN4) | \
  1261. PIN_ASCR_DISABLED(GPIOG_PIN5) | \
  1262. PIN_ASCR_DISABLED(GPIOG_PIN6) | \
  1263. PIN_ASCR_DISABLED(GPIOG_PIN7) | \
  1264. PIN_ASCR_DISABLED(GPIOG_PIN8) | \
  1265. PIN_ASCR_DISABLED(GPIOG_PIN9) | \
  1266. PIN_ASCR_DISABLED(GPIOG_PIN10) | \
  1267. PIN_ASCR_DISABLED(GPIOG_PIN11) | \
  1268. PIN_ASCR_DISABLED(GPIOG_PIN12) | \
  1269. PIN_ASCR_DISABLED(GPIOG_PIN13) | \
  1270. PIN_ASCR_DISABLED(GPIOG_PIN14) | \
  1271. PIN_ASCR_DISABLED(GPIOG_PIN15))
  1272. #define VAL_GPIOG_LOCKR (PIN_LOCKR_DISABLED(GPIOG_PIN0) | \
  1273. PIN_LOCKR_DISABLED(GPIOG_PIN1) | \
  1274. PIN_LOCKR_DISABLED(GPIOG_PIN2) | \
  1275. PIN_LOCKR_DISABLED(GPIOG_PIN3) | \
  1276. PIN_LOCKR_DISABLED(GPIOG_PIN4) | \
  1277. PIN_LOCKR_DISABLED(GPIOG_PIN5) | \
  1278. PIN_LOCKR_DISABLED(GPIOG_PIN6) | \
  1279. PIN_LOCKR_DISABLED(GPIOG_PIN7) | \
  1280. PIN_LOCKR_DISABLED(GPIOG_PIN8) | \
  1281. PIN_LOCKR_DISABLED(GPIOG_PIN9) | \
  1282. PIN_LOCKR_DISABLED(GPIOG_PIN10) | \
  1283. PIN_LOCKR_DISABLED(GPIOG_PIN11) | \
  1284. PIN_LOCKR_DISABLED(GPIOG_PIN12) | \
  1285. PIN_LOCKR_DISABLED(GPIOG_PIN13) | \
  1286. PIN_LOCKR_DISABLED(GPIOG_PIN14) | \
  1287. PIN_LOCKR_DISABLED(GPIOG_PIN15))
  1288. /*
  1289. * GPIOH setup:
  1290. *
  1291. * PH0 - PIN0 (analog).
  1292. * PH1 - PIN1 (analog).
  1293. * PH2 - PIN2 (analog).
  1294. * PH3 - PIN3 (analog).
  1295. * PH4 - PIN4 (analog).
  1296. * PH5 - PIN5 (analog).
  1297. * PH6 - PIN6 (analog).
  1298. * PH7 - PIN7 (analog).
  1299. * PH8 - PIN8 (analog).
  1300. * PH9 - PIN9 (analog).
  1301. * PH10 - PIN10 (analog).
  1302. * PH11 - PIN11 (analog).
  1303. * PH12 - PIN12 (analog).
  1304. * PH13 - PIN13 (analog).
  1305. * PH14 - PIN14 (analog).
  1306. * PH15 - PIN15 (analog).
  1307. */
  1308. #define VAL_GPIOH_MODER (PIN_MODE_ANALOG(GPIOH_PIN0) | \
  1309. PIN_MODE_ANALOG(GPIOH_PIN1) | \
  1310. PIN_MODE_ANALOG(GPIOH_PIN2) | \
  1311. PIN_MODE_ANALOG(GPIOH_PIN3) | \
  1312. PIN_MODE_ANALOG(GPIOH_PIN4) | \
  1313. PIN_MODE_ANALOG(GPIOH_PIN5) | \
  1314. PIN_MODE_ANALOG(GPIOH_PIN6) | \
  1315. PIN_MODE_ANALOG(GPIOH_PIN7) | \
  1316. PIN_MODE_ANALOG(GPIOH_PIN8) | \
  1317. PIN_MODE_ANALOG(GPIOH_PIN9) | \
  1318. PIN_MODE_ANALOG(GPIOH_PIN10) | \
  1319. PIN_MODE_ANALOG(GPIOH_PIN11) | \
  1320. PIN_MODE_ANALOG(GPIOH_PIN12) | \
  1321. PIN_MODE_ANALOG(GPIOH_PIN13) | \
  1322. PIN_MODE_ANALOG(GPIOH_PIN14) | \
  1323. PIN_MODE_ANALOG(GPIOH_PIN15))
  1324. #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
  1325. PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
  1326. PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
  1327. PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
  1328. PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
  1329. PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
  1330. PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
  1331. PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
  1332. PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
  1333. PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
  1334. PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
  1335. PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
  1336. PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
  1337. PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
  1338. PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
  1339. PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
  1340. #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_PIN0) | \
  1341. PIN_OSPEED_HIGH(GPIOH_PIN1) | \
  1342. PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
  1343. PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
  1344. PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
  1345. PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
  1346. PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
  1347. PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
  1348. PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
  1349. PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
  1350. PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
  1351. PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
  1352. PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
  1353. PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
  1354. PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
  1355. PIN_OSPEED_VERYLOW(GPIOH_PIN15))
  1356. #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_PIN0) | \
  1357. PIN_PUPDR_FLOATING(GPIOH_PIN1) | \
  1358. PIN_PUPDR_FLOATING(GPIOH_PIN2) | \
  1359. PIN_PUPDR_FLOATING(GPIOH_PIN3) | \
  1360. PIN_PUPDR_FLOATING(GPIOH_PIN4) | \
  1361. PIN_PUPDR_FLOATING(GPIOH_PIN5) | \
  1362. PIN_PUPDR_FLOATING(GPIOH_PIN6) | \
  1363. PIN_PUPDR_FLOATING(GPIOH_PIN7) | \
  1364. PIN_PUPDR_FLOATING(GPIOH_PIN8) | \
  1365. PIN_PUPDR_FLOATING(GPIOH_PIN9) | \
  1366. PIN_PUPDR_FLOATING(GPIOH_PIN10) | \
  1367. PIN_PUPDR_FLOATING(GPIOH_PIN11) | \
  1368. PIN_PUPDR_FLOATING(GPIOH_PIN12) | \
  1369. PIN_PUPDR_FLOATING(GPIOH_PIN13) | \
  1370. PIN_PUPDR_FLOATING(GPIOH_PIN14) | \
  1371. PIN_PUPDR_FLOATING(GPIOH_PIN15))
  1372. #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
  1373. PIN_ODR_HIGH(GPIOH_PIN1) | \
  1374. PIN_ODR_HIGH(GPIOH_PIN2) | \
  1375. PIN_ODR_HIGH(GPIOH_PIN3) | \
  1376. PIN_ODR_HIGH(GPIOH_PIN4) | \
  1377. PIN_ODR_HIGH(GPIOH_PIN5) | \
  1378. PIN_ODR_HIGH(GPIOH_PIN6) | \
  1379. PIN_ODR_HIGH(GPIOH_PIN7) | \
  1380. PIN_ODR_HIGH(GPIOH_PIN8) | \
  1381. PIN_ODR_HIGH(GPIOH_PIN9) | \
  1382. PIN_ODR_HIGH(GPIOH_PIN10) | \
  1383. PIN_ODR_HIGH(GPIOH_PIN11) | \
  1384. PIN_ODR_HIGH(GPIOH_PIN12) | \
  1385. PIN_ODR_HIGH(GPIOH_PIN13) | \
  1386. PIN_ODR_HIGH(GPIOH_PIN14) | \
  1387. PIN_ODR_HIGH(GPIOH_PIN15))
  1388. #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \
  1389. PIN_AFIO_AF(GPIOH_PIN1, 0U) | \
  1390. PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
  1391. PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
  1392. PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
  1393. PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
  1394. PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
  1395. PIN_AFIO_AF(GPIOH_PIN7, 0U))
  1396. #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
  1397. PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
  1398. PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
  1399. PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
  1400. PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
  1401. PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
  1402. PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
  1403. PIN_AFIO_AF(GPIOH_PIN15, 0U))
  1404. #define VAL_GPIOH_ASCR (PIN_ASCR_DISABLED(GPIOH_PIN0) | \
  1405. PIN_ASCR_DISABLED(GPIOH_PIN1) | \
  1406. PIN_ASCR_DISABLED(GPIOH_PIN2) | \
  1407. PIN_ASCR_DISABLED(GPIOH_PIN3) | \
  1408. PIN_ASCR_DISABLED(GPIOH_PIN4) | \
  1409. PIN_ASCR_DISABLED(GPIOH_PIN5) | \
  1410. PIN_ASCR_DISABLED(GPIOH_PIN6) | \
  1411. PIN_ASCR_DISABLED(GPIOH_PIN7) | \
  1412. PIN_ASCR_DISABLED(GPIOH_PIN8) | \
  1413. PIN_ASCR_DISABLED(GPIOH_PIN9) | \
  1414. PIN_ASCR_DISABLED(GPIOH_PIN10) | \
  1415. PIN_ASCR_DISABLED(GPIOH_PIN11) | \
  1416. PIN_ASCR_DISABLED(GPIOH_PIN12) | \
  1417. PIN_ASCR_DISABLED(GPIOH_PIN13) | \
  1418. PIN_ASCR_DISABLED(GPIOH_PIN14) | \
  1419. PIN_ASCR_DISABLED(GPIOH_PIN15))
  1420. #define VAL_GPIOH_LOCKR (PIN_LOCKR_DISABLED(GPIOH_PIN0) | \
  1421. PIN_LOCKR_DISABLED(GPIOH_PIN1) | \
  1422. PIN_LOCKR_DISABLED(GPIOH_PIN2) | \
  1423. PIN_LOCKR_DISABLED(GPIOH_PIN3) | \
  1424. PIN_LOCKR_DISABLED(GPIOH_PIN4) | \
  1425. PIN_LOCKR_DISABLED(GPIOH_PIN5) | \
  1426. PIN_LOCKR_DISABLED(GPIOH_PIN6) | \
  1427. PIN_LOCKR_DISABLED(GPIOH_PIN7) | \
  1428. PIN_LOCKR_DISABLED(GPIOH_PIN8) | \
  1429. PIN_LOCKR_DISABLED(GPIOH_PIN9) | \
  1430. PIN_LOCKR_DISABLED(GPIOH_PIN10) | \
  1431. PIN_LOCKR_DISABLED(GPIOH_PIN11) | \
  1432. PIN_LOCKR_DISABLED(GPIOH_PIN12) | \
  1433. PIN_LOCKR_DISABLED(GPIOH_PIN13) | \
  1434. PIN_LOCKR_DISABLED(GPIOH_PIN14) | \
  1435. PIN_LOCKR_DISABLED(GPIOH_PIN15))
  1436. /*===========================================================================*/
  1437. /* External declarations. */
  1438. /*===========================================================================*/
  1439. #if !defined(_FROM_ASM_)
  1440. #ifdef __cplusplus
  1441. extern "C" {
  1442. #endif
  1443. void boardInit(void);
  1444. #ifdef __cplusplus
  1445. }
  1446. #endif
  1447. #endif /* _FROM_ASM_ */
  1448. #endif /* BOARD_H */