board.h 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  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 GPIOE_PINrmissions 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 STM32F4-Discovery board.
  24. */
  25. /*
  26. * Board identifier.
  27. */
  28. #define BOARD_ST_STM32F4_DISCOVERY
  29. #define BOARD_NAME "Black STM32F407ZG Board"
  30. /*
  31. * Board oscillators-related settings.
  32. */
  33. #if !defined(STM32_LSECLK)
  34. #define STM32_LSECLK 32768U
  35. #endif
  36. #if !defined(STM32_HSECLK)
  37. #define STM32_HSECLK 8000000U
  38. #endif
  39. /*
  40. * Board voltages.
  41. * Required for performance limits calculation.
  42. */
  43. #define STM32_VDD 330U
  44. /*
  45. * MCU type as defined in the ST header.
  46. */
  47. #define STM32F407xx
  48. /*
  49. * IO pins assignments.
  50. */
  51. #define GPIOA_PIN0 0U
  52. #define GPIOA_PIN1 1U
  53. #define GPIOA_PIN2 2U
  54. #define GPIOA_PIN3 3U
  55. #define GPIOA_PIN4 4U
  56. #define GPIOA_PIN5 5U
  57. #define GPIOA_PIN6 6U
  58. #define GPIOA_PIN7 7U
  59. #define GPIOA_PIN8 8U
  60. #define GPIOA_PIN9 9U
  61. #define GPIOA_PIN10 10U
  62. #define GPIOA_PIN11 11U
  63. #define GPIOA_PIN12 12U
  64. #define GPIOA_PIN13 13U
  65. #define GPIOA_PIN14 14U
  66. #define GPIOA_PIN15 15U
  67. #define GPIOB_PIN0 0U
  68. #define GPIOB_PIN1 1U
  69. #define GPIOB_PIN2 2U
  70. #define GPIOB_PIN3 3U
  71. #define GPIOB_PIN4 4U
  72. #define GPIOB_PIN5 5U
  73. #define GPIOB_PIN6 6U
  74. #define GPIOB_PIN7 7U
  75. #define GPIOB_PIN8 8U
  76. #define GPIOB_PIN9 9U
  77. #define GPIOB_PIN10 10U
  78. #define GPIOB_PIN11 11U
  79. #define GPIOB_PIN12 12U
  80. #define GPIOB_PIN13 13U
  81. #define GPIOB_PIN14 14U
  82. #define GPIOB_PIN15 15U
  83. #define GPIOC_PIN0 0U
  84. #define GPIOC_PIN1 1U
  85. #define GPIOC_PIN2 2U
  86. #define GPIOC_PIN3 3U
  87. #define GPIOC_PIN4 4U
  88. #define GPIOC_PIN5 5U
  89. #define GPIOC_PIN6 6U
  90. #define GPIOC_PIN7 7U
  91. #define GPIOC_PIN8 8U
  92. #define GPIOC_PIN9 9U
  93. #define GPIOC_PIN10 10U
  94. #define GPIOC_PIN11 11U
  95. #define GPIOC_PIN12 12U
  96. #define GPIOC_PIN13 13U
  97. #define GPIOC_PIN14 14U
  98. #define GPIOC_PIN15 15U
  99. #define GPIOD_PIN0 0U
  100. #define GPIOD_PIN1 1U
  101. #define GPIOD_PIN2 2U
  102. #define GPIOD_PIN3 3U
  103. #define GPIOD_PIN4 4U
  104. #define GPIOD_PIN5 5U
  105. #define GPIOD_PIN6 6U
  106. #define GPIOD_PIN7 7U
  107. #define GPIOD_PIN8 8U
  108. #define GPIOD_PIN9 9U
  109. #define GPIOD_PIN10 10U
  110. #define GPIOD_PIN11 11U
  111. #define GPIOD_PIN12 12U
  112. #define GPIOD_PIN13 13U
  113. #define GPIOD_PIN14 14U
  114. #define GPIOD_PIN15 15U
  115. #define GPIOE_PIN0 0U
  116. #define GPIOE_PIN1 1U
  117. #define GPIOE_PIN2 2U
  118. #define GPIOE_PIN3 3U
  119. #define GPIOE_PIN4 4U
  120. #define GPIOE_PIN5 5U
  121. #define GPIOE_PIN6 6U
  122. #define GPIOE_PIN7 7U
  123. #define GPIOE_PIN8 8U
  124. #define GPIOE_PIN9 9U
  125. #define GPIOE_PIN10 10U
  126. #define GPIOE_PIN11 11U
  127. #define GPIOE_PIN12 12U
  128. #define GPIOE_PIN13 13U
  129. #define GPIOE_PIN14 14U
  130. #define GPIOE_PIN15 15U
  131. #define GPIOF_PIN0 0U
  132. #define GPIOF_PIN1 1U
  133. #define GPIOF_PIN2 2U
  134. #define GPIOF_PIN3 3U
  135. #define GPIOF_PIN4 4U
  136. #define GPIOF_PIN5 5U
  137. #define GPIOF_PIN6 6U
  138. #define GPIOF_PIN7 7U
  139. #define GPIOF_PIN8 8U
  140. #define GPIOF_PIN9 9U
  141. #define GPIOF_PIN10 10U
  142. #define GPIOF_PIN11 11U
  143. #define GPIOF_PIN12 12U
  144. #define GPIOF_PIN13 13U
  145. #define GPIOF_PIN14 14U
  146. #define GPIOF_PIN15 15U
  147. #define GPIOG_PIN0 0U
  148. #define GPIOG_PIN1 1U
  149. #define GPIOG_PIN2 2U
  150. #define GPIOG_PIN3 3U
  151. #define GPIOG_PIN4 4U
  152. #define GPIOG_PIN5 5U
  153. #define GPIOG_PIN6 6U
  154. #define GPIOG_PIN7 7U
  155. #define GPIOG_PIN8 8U
  156. #define GPIOG_PIN9 9U
  157. #define GPIOG_PIN10 10U
  158. #define GPIOG_PIN11 11U
  159. #define GPIOG_PIN12 12U
  160. #define GPIOG_PIN13 13U
  161. #define GPIOG_PIN14 14U
  162. #define GPIOG_PIN15 15U
  163. #define GPIOH_PIN0 0U
  164. #define GPIOH_PIN1 1U
  165. #define GPIOH_PIN2 2U
  166. #define GPIOH_PIN3 3U
  167. #define GPIOH_PIN4 4U
  168. #define GPIOH_PIN5 5U
  169. #define GPIOH_PIN6 6U
  170. #define GPIOH_PIN7 7U
  171. #define GPIOH_PIN8 8U
  172. #define GPIOH_PIN9 9U
  173. #define GPIOH_PIN10 10U
  174. #define GPIOH_PIN11 11U
  175. #define GPIOH_PIN12 12U
  176. #define GPIOH_PIN13 13U
  177. #define GPIOH_PIN14 14U
  178. #define GPIOH_PIN15 15U
  179. /*
  180. * Board-integrated GPIOE_PINripherial
  181. */
  182. /* User-defined button */
  183. #define WAKE_UP GPIOA_PIN0
  184. #define WAKE_UP_PORT GPIOA
  185. #define KEY0 GPIOE_PIN4
  186. #define KEY1 GPIOE_PIN3
  187. #define KEY0_PORT GPIOE
  188. #define KEY1_PORT GPIOE
  189. /* Custom LED indicator */
  190. #define LED0 GPIOF_PIN9
  191. #define LED1 GPIOF_PIN10
  192. #define LED0_PORT GPIOF
  193. #define LED1_PORT GPIOF
  194. /* RELAY Control */
  195. #define RELAY0 GPIOB_PIN8
  196. #define RELAY1 GPIOB_PIN9
  197. #define RELAY0_PORT GPIOB
  198. #define RELAY1_PORT GPIOB
  199. /* FLASH - W25Q16 (16 Mbit / 2 Mbyte / 2097152 byte) */
  200. #define SPI1_SCK GPIOB_PIN3
  201. #define SPI1_MISO GPIOB_PIN4
  202. #define SPI1_MOSI GPIOB_PIN5
  203. #define F_CS GPIOB_PIN14
  204. /* NRF2401 wireless module interface */
  205. #define NRF_CE GPIOG_PIN6
  206. #define NRF_CS GPIOG_PIN7
  207. #define NRF_IRQ GPIOG_PIN8
  208. #define SPI1_SCK GPIOB_PIN3
  209. #define SPI1_MISO GPIOB_PIN4
  210. #define SPI1_MOSI GPIOB_PIN5
  211. /* TF uSD memory card holder */
  212. #define SDIO_D0 GPIOC_PIN8
  213. #define SDIO_D1 GPIOC_PIN9
  214. #define SDIO_D2 GPIOC_PIN10
  215. #define SDIO_D3 GPIOC_PIN11
  216. #define SDIO_SCK GPIOC_PIN12
  217. #define SDIO_CMD GPIOD_PIN2
  218. /* STM32 - USB Slave interface */
  219. #define USB_DM GPIOA_PIN11
  220. #define USB_DP GPIOA_PIN12
  221. /* JTAG/SWD debug interface */
  222. #define TDO GPIOB_PIN3
  223. #define TRST GPIOB_PIN4
  224. #define TMS GPIOA_PIN13
  225. #define TCK GPIOA_PIN14
  226. #define TDI GPIOA_PIN15
  227. /* ISP Serial interface */
  228. #define TXD1 GPIOA_PIN9
  229. #define RXD1 GPIOA_PIN10
  230. /* SDRAM memory module */
  231. #define FSMC_D0 GPIOD_PIN14
  232. #define FSMC_D1 GPIOD_PIN15
  233. #define FSMC_D2 GPIOD_PIN0
  234. #define FSMC_D3 GPIOD_PIN1
  235. #define FSMC_D4 GPIOE_PIN7
  236. #define FSMC_D5 GPIOE_PIN8
  237. #define FSMC_D6 GPIOE_PIN9
  238. #define FSMC_D7 GPIOE_PIN10
  239. #define FSMC_D8 GPIOE_PIN11
  240. #define FSMC_D9 GPIOE_PIN12
  241. #define FSMC_D10 GPIOE_PIN13
  242. #define FSMC_D11 GPIOE_PIN14
  243. #define FSMC_D12 GPIOE_PIN15
  244. #define FSMC_D13 GPIOD_PIN8
  245. #define FSMC_D14 GPIOD_PIN9
  246. #define FSMC_D15 GPIOD_PIN10
  247. #define FSMC_A0 GPIOF_PIN0
  248. #define FSMC_A1 GPIOF_PIN1
  249. #define FSMC_A2 GPIOF_PIN2
  250. #define FSMC_A3 GPIOF_PIN3
  251. #define FSMC_A4 GPIOF_PIN4
  252. #define FSMC_A5 GPIOF_PIN5
  253. #define FSMC_A6 GPIOF_PIN12
  254. #define FSMC_A7 GPIOF_PIN13
  255. #define FSMC_A8 GPIOF_PIN14
  256. #define FSMC_A9 GPIOF_PIN15
  257. #define FSMC_A10 GPIOG_PIN0
  258. #define FSMC_A11 GPIOG_PIN1
  259. #define FSMC_A12 GPIOG_PIN2
  260. #define FSMC_A13 GPIOG_PIN3
  261. #define FSMC_A14 GPIOG_PIN4
  262. #define FSMC_A15 GPIOG_PIN5
  263. #define FSMC_A16 GPIOD_PIN11
  264. #define FSMC_A17 GPIOD_PIN12
  265. #define FSMC_A18 GPIOD_PIN13
  266. #define FSMC_NE3 GPIOG_PIN10
  267. #define FSMC_NWE GPIOD_PIN5
  268. #define FSMC_NOE GPIOD_PIN4
  269. #define FSMC_NBL0 GPIOE_PIN0
  270. #define FSMC_NBL1 GPIOE_PIN1
  271. /* TFT LCD interface */
  272. // J6_1 GND
  273. // J6_2 RST
  274. #define J6_3 GPIOD_PIN10
  275. #define J6_4 GPIOD_PIN9
  276. #define J6_5 GPIOD_PIN8
  277. #define J6_6 GPIOE_PIN15
  278. #define J6_7 GPIOE_PIN14
  279. #define J6_8 GPIOE_PIN13
  280. #define J6_9 GPIOE_PIN12
  281. #define J6_10 GPIOE_PIN11
  282. #define J6_11 GPIOE_PIN10
  283. #define J6_12 GPIOE_PIN9
  284. #define J6_13 GPIOE_PIN8
  285. #define J6_14 GPIOE_PIN7
  286. #define J6_15 GPIOD_PIN1
  287. #define J6_16 GPIOD_PIN0
  288. #define J6_17 GPIOD_PIN15
  289. #define J6_18 GPIOD_PIN14
  290. #define J6_19 GPIOD_PIN4
  291. #define J6_20 GPIOD_PIN5
  292. #define J6_21 GPIOF_PIN12
  293. #define J6_22 GPIOG_PIN12
  294. #define J6_23 GPIOB_PIN0
  295. #define J6_24 GPIOC_PIN13
  296. #define J6_25 GPIOF_PIN11
  297. #define J6_26 GPIOB_PIN2
  298. #define J6_27 GPIOB_PIN1
  299. // J6_28 LCD_BL
  300. // J6_29 NC
  301. // J6_30 GND
  302. // J6_31 +3.3V
  303. // J6_32 GND
  304. // FSMC_D0 - FSMC_D15
  305. // FSMC_A6
  306. // FSMC_NOE
  307. // FSMC_NWE
  308. #define FSMC_NE4 GPIOG_PIN12
  309. #define LCD_BL GPIOB_PIN15
  310. // Soft SPI
  311. #define T_MOSI GPIOF_PIN11
  312. #define T_MISO GPIOB_PIN2
  313. #define T_SCK GPIOB_PIN0
  314. #define T_CS GPIOC_PIN13
  315. #define T_PEN GPIOB_PIN1
  316. /* System available I/O external interface */
  317. #define J2_1 GPIOE_PIN1
  318. #define J2_2 GPIOE_PIN0
  319. #define J2_3 GPIOE_PIN3
  320. #define J2_4 GPIOE_PIN2
  321. #define J2_5 GPIOE_PIN5
  322. #define J2_6 GPIOE_PIN4
  323. #define J2_7 GPIOC_PIN13
  324. #define J2_8 GPIOE_PIN6
  325. #define J2_9 GPIOF_PIN1
  326. #define J2_10 GPIOF_PIN0
  327. #define J2_11 GPIOF_PIN3
  328. #define J2_12 GPIOF_PIN2
  329. #define J2_13 GPIOF_PIN5
  330. #define J2_14 GPIOF_PIN4
  331. #define J2_15 GPIOF_PIN7
  332. #define J2_16 GPIOF_PIN6
  333. #define J2_17 GPIOF_PIN9
  334. #define J2_18 GPIOF_PIN8
  335. #define J2_19 GPIOC_PIN0
  336. #define J2_20 GPIOF_PIN10
  337. #define J2_21 GPIOC_PIN2
  338. #define J2_22 GPIOC_PIN3
  339. #define J2_23 GPIOA_PIN0
  340. #define J2_24 GPIOC_PIN3
  341. #define J2_25 GPIOA_PIN2
  342. #define J2_26 GPIOA_PIN1
  343. #define J2_27 GPIOA_PIN4
  344. #define J2_28 GPIOA_PIN3
  345. #define J2_29 GPIOA_PIN6
  346. #define J2_30 GPIOA_PIN5
  347. #define J2_31 GPIOC_PIN4
  348. #define J2_32 GPIOA_PIN7
  349. #define J2_33 GPIOB_PIN0
  350. #define J2_34 GPIOC_PIN5
  351. #define J2_35 GPIOB_PIN2
  352. #define J2_36 GPIOB_PIN1
  353. #define J2_37 GPIOF_PIN12
  354. #define J2_38 GPIOF_PIN11
  355. #define J2_39 GPIOF_PIN14
  356. #define J2_40 GPIOF_PIN13
  357. #define J2_41 GPIOG_PIN0
  358. #define J2_42 GPIOF_PIN15
  359. #define J2_43 GPIOE_PIN7
  360. #define J2_44 GPIOG_PIN1
  361. #define J2_45 GPIOE_PIN9
  362. #define J2_46 GPIOE_PIN8
  363. #define J2_47 GPIOE_PIN11
  364. #define J2_48 GPIOE_PIN10
  365. #define J2_49 GPIOE_PIN13
  366. #define J2_50 GPIOE_PIN12
  367. #define J2_51 GPIOE_PIN15
  368. #define J2_52 GPIOE_PIN14
  369. #define J2_53 GPIOB_PIN11
  370. #define J2_54 GPIOB_PIN10
  371. // J2_55 GND
  372. // J2_56 VREF+
  373. // J2_57 BOOT0
  374. // J2_58 BOOT1
  375. // J2_59 +3.3V
  376. // J2_60 +3.3V
  377. #define J3_1 GPIOB_PIN9
  378. #define J3_2 GPIOB_PIN8
  379. #define J3_3 GPIOB_PIN7
  380. #define J3_4 GPIOB_PIN6
  381. #define J3_5 GPIOB_PIN5
  382. #define J3_6 GPIOB_PIN4
  383. #define J3_7 GPIOB_PIN3
  384. #define J3_8 GPIOG_PIN15
  385. #define J3_9 GPIOG_PIN14
  386. #define J3_10 GPIOG_PIN13
  387. #define J3_11 GPIOG_PIN12
  388. #define J3_12 GPIOG_PIN11
  389. #define J3_13 GPIOG_PIN10
  390. #define J3_14 GPIOG_PIN9
  391. #define J3_15 GPIOD_PIN7
  392. #define J3_16 GPIOD_PIN6
  393. #define J3_17 GPIOD_PIN5
  394. #define J3_18 GPIOD_PIN4
  395. #define J3_19 GPIOD_PIN3
  396. #define J3_20 GPIOD_PIN2
  397. #define J3_21 GPIOD_PIN1
  398. #define J3_22 GPIOD_PIN0
  399. #define J3_23 GPIOC_PIN12
  400. #define J3_24 GPIOC_PIN11
  401. #define J3_25 GPIOC_PIN10
  402. #define J3_26 GPIOA_PIN15
  403. #define J3_27 GPIOA_PIN14
  404. #define J3_28 GPIOA_PIN13
  405. #define J3_29 GPIOA_PIN12
  406. #define J3_30 GPIOA_PIN11
  407. #define J3_31 GPIOA_PIN10
  408. #define J3_32 GPIOA_PIN9
  409. #define J3_33 GPIOA_PIN8
  410. #define J3_34 GPIOC_PIN9
  411. #define J3_35 GPIOC_PIN8
  412. #define J3_36 GPIOC_PIN7
  413. #define J3_37 GPIOC_PIN6
  414. #define J3_38 GPIOG_PIN8
  415. #define J3_39 GPIOG_PIN7
  416. #define J3_40 GPIOG_PIN6
  417. #define J3_41 GPIOG_PIN5
  418. #define J3_42 GPIOG_PIN4
  419. #define J3_43 GPIOG_PIN3
  420. #define J3_44 GPIOG_PIN2
  421. #define J3_45 GPIOD_PIN15
  422. #define J3_46 GPIOD_PIN14
  423. #define J3_47 GPIOD_PIN13
  424. #define J3_48 GPIOD_PIN12
  425. #define J3_49 GPIOD_PIN11
  426. #define J3_50 GPIOD_PIN10
  427. #define J3_51 GPIOD_PIN9
  428. #define J3_52 GPIOD_PIN8
  429. #define J3_53 GPIOB_PIN15
  430. #define J3_54 GPIOB_PIN14
  431. #define J3_55 GPIOB_PIN13
  432. #define J3_56 GPIOB_PIN12
  433. // J3_57 +3.3V
  434. // J3_58 GND
  435. // J3_59 +5V
  436. // J3_60 GND
  437. /*
  438. * IO lines assignments.
  439. */
  440. #define LINE_WAKE_UP PAL_LINE(GPIOA, WAKE_UP)
  441. #define LINE_KEY0 PAL_LINE(GPIOE, KEY0)
  442. #define LINE_KEY1 PAL_LINE(GPIOE, KEY1)
  443. #define LINE_BUTTON1 PAL_LINE(KEY0_PORT, KEY0)
  444. #define LINE_BUTTON2 PAL_LINE(KEY1_PORT, KEY1)
  445. #define LINE_LED1 PAL_LINE(LED0_PORT, LED0)
  446. #define LINE_LED2 PAL_LINE(LED1_PORT, LED1)
  447. #define LINE_RELAY1 PAL_LINE(RELAY0_PORT, RELAY0)
  448. #define LINE_RELAY2 PAL_LINE(RELAY0_PORT, RELAY1)
  449. #define LINE_NRF_IRQ PAL_LINE(GPIOG, NRF_IRQ)
  450. #define LINE_NRF_CS PAL_LINE(GPIOG, NRF_CS)
  451. #define LINE_NRF_CE PAL_LINE(GPIOG, NRF_CE)
  452. #define LINE_F_CS PAL_LINE(GPIOB, F_CS)
  453. #define LINE_LCD_BL PAL_LINE(GPIOB, LCD_BL)
  454. #define LINE_T_MOSI PAL_LINE(GPIOC, T_MOSI)
  455. #define LINE_T_MISO PAL_LINE(GPIOB, T_MISO)
  456. #define LINE_T_SCK PAL_LINE(GPIOB, T_SCK)
  457. #define LINE_T_CS PAL_LINE(GPIOC, T_CS)
  458. #define LINE_T_PEN PAL_LINE(GPIOB, T_PEN)
  459. /*===========================================================================*/
  460. /* Driver pre-compile time settings. */
  461. /*===========================================================================*/
  462. /*===========================================================================*/
  463. /* Derived constants and error checks. */
  464. /*===========================================================================*/
  465. /*===========================================================================*/
  466. /* Driver data structures and types. */
  467. /*===========================================================================*/
  468. /*===========================================================================*/
  469. /* Driver macros. */
  470. /*===========================================================================*/
  471. /*
  472. * I/O ports initial setup, this configuration is established soon after reset
  473. * in the initialization code.
  474. * Please refer to the STM32 Reference Manual for details.
  475. */
  476. #define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
  477. #define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
  478. #define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
  479. #define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
  480. #define PIN_ODR_LOW(n) (0U << (n))
  481. #define PIN_ODR_HIGH(n) (1U << (n))
  482. #define PIN_OTYPE_PUSHPULL(n) (0U << (n))
  483. #define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
  484. #define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
  485. #define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
  486. #define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
  487. #define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
  488. #define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
  489. #define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
  490. #define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
  491. #define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
  492. /*
  493. * GPIOA setup:
  494. *
  495. * PA0 - WK_UP (input pullup).
  496. * PA1 - PIN1 (input pullup).
  497. * PA2 - PIN2 (input pullup).
  498. * PA3 - PIN3 (input pullup).
  499. * PA4 - PIN4 (input pullup).
  500. * PA5 - PIN5 (input pullup).
  501. * PA6 - PIN6 (input pullup).
  502. * PA7 - PIN7 (input pullup).
  503. * PA8 - PIN8 (input pullup).
  504. * PA9 - TXD1 (alternate 7).
  505. * PA10 - RXD1 (alternate 7).
  506. * PA11 - USB_DM (alternate 10).
  507. * PA12 - USB_DP (alternate 10).
  508. * PA13 - SWDIO (alternate 0).
  509. * PA14 - SWCLK (alternate 0).
  510. * PA15 - PIN15 (input pullup).
  511. */
  512. #define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \
  513. PIN_MODE_INPUT(GPIOA_PIN1) | \
  514. PIN_MODE_INPUT(GPIOA_PIN2) | \
  515. PIN_MODE_INPUT(GPIOA_PIN3) | \
  516. PIN_MODE_INPUT(GPIOA_PIN4) | \
  517. PIN_MODE_INPUT(GPIOA_PIN5) | \
  518. PIN_MODE_INPUT(GPIOA_PIN6) | \
  519. PIN_MODE_INPUT(GPIOA_PIN7) | \
  520. PIN_MODE_INPUT(GPIOA_PIN8) | \
  521. PIN_MODE_ALTERNATE(GPIOA_PIN9) | \
  522. PIN_MODE_ALTERNATE(GPIOA_PIN10) | \
  523. PIN_MODE_ALTERNATE(GPIOA_PIN11) | \
  524. PIN_MODE_ALTERNATE(GPIOA_PIN12) | \
  525. PIN_MODE_ALTERNATE(GPIOA_PIN13) | \
  526. PIN_MODE_ALTERNATE(GPIOA_PIN14) | \
  527. PIN_MODE_INPUT(GPIOA_PIN15))
  528. #define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
  529. PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
  530. PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
  531. PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
  532. PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
  533. PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
  534. PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
  535. PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
  536. PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
  537. PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
  538. PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
  539. PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \
  540. PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \
  541. PIN_OTYPE_PUSHPULL(GPIOA_PIN13) | \
  542. PIN_OTYPE_PUSHPULL(GPIOA_PIN14) | \
  543. PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
  544. #define VAL_GPIOA_OSPEEDR (PIN_OSPEED_HIGH(GPIOA_PIN0) | \
  545. PIN_OSPEED_HIGH(GPIOA_PIN1) | \
  546. PIN_OSPEED_HIGH(GPIOA_PIN2) | \
  547. PIN_OSPEED_HIGH(GPIOA_PIN3) | \
  548. PIN_OSPEED_HIGH(GPIOA_PIN4) | \
  549. PIN_OSPEED_HIGH(GPIOA_PIN5) | \
  550. PIN_OSPEED_HIGH(GPIOA_PIN6) | \
  551. PIN_OSPEED_HIGH(GPIOA_PIN7) | \
  552. PIN_OSPEED_HIGH(GPIOA_PIN8) | \
  553. PIN_OSPEED_HIGH(GPIOA_PIN9) | \
  554. PIN_OSPEED_HIGH(GPIOA_PIN10) | \
  555. PIN_OSPEED_HIGH(GPIOA_PIN11) | \
  556. PIN_OSPEED_HIGH(GPIOA_PIN12) | \
  557. PIN_OSPEED_HIGH(GPIOA_PIN13) | \
  558. PIN_OSPEED_HIGH(GPIOA_PIN14) | \
  559. PIN_OSPEED_HIGH(GPIOA_PIN15))
  560. #define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \
  561. PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
  562. PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
  563. PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
  564. PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
  565. PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
  566. PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
  567. PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
  568. PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
  569. PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
  570. PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
  571. PIN_PUPDR_FLOATING(GPIOA_PIN11) | \
  572. PIN_PUPDR_FLOATING(GPIOA_PIN12) | \
  573. PIN_PUPDR_FLOATING(GPIOA_PIN13) | \
  574. PIN_PUPDR_FLOATING(GPIOA_PIN14) | \
  575. PIN_PUPDR_PULLUP(GPIOA_PIN15))
  576. #define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \
  577. PIN_ODR_HIGH(GPIOA_PIN1) | \
  578. PIN_ODR_HIGH(GPIOA_PIN2) | \
  579. PIN_ODR_HIGH(GPIOA_PIN3) | \
  580. PIN_ODR_HIGH(GPIOA_PIN4) | \
  581. PIN_ODR_HIGH(GPIOA_PIN5) | \
  582. PIN_ODR_HIGH(GPIOA_PIN6) | \
  583. PIN_ODR_HIGH(GPIOA_PIN7) | \
  584. PIN_ODR_HIGH(GPIOA_PIN8) | \
  585. PIN_ODR_HIGH(GPIOA_PIN9) | \
  586. PIN_ODR_HIGH(GPIOA_PIN10) | \
  587. PIN_ODR_HIGH(GPIOA_PIN11) | \
  588. PIN_ODR_HIGH(GPIOA_PIN12) | \
  589. PIN_ODR_HIGH(GPIOA_PIN13) | \
  590. PIN_ODR_HIGH(GPIOA_PIN14) | \
  591. PIN_ODR_HIGH(GPIOA_PIN15))
  592. #define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \
  593. PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
  594. PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
  595. PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
  596. PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
  597. PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
  598. PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
  599. PIN_AFIO_AF(GPIOA_PIN7, 0U))
  600. #define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
  601. PIN_AFIO_AF(GPIOA_PIN9, 7U) | \
  602. PIN_AFIO_AF(GPIOA_PIN10, 7U) | \
  603. PIN_AFIO_AF(GPIOA_PIN11, 10U) | \
  604. PIN_AFIO_AF(GPIOA_PIN12, 10U) | \
  605. PIN_AFIO_AF(GPIOA_PIN13, 0U) | \
  606. PIN_AFIO_AF(GPIOA_PIN14, 0U) | \
  607. PIN_AFIO_AF(GPIOA_PIN15, 0U))
  608. /*
  609. * GPIOB setup:
  610. *
  611. * PB0 - PIN0 (input pullup).
  612. * PB1 - PIN1 (input pullup).
  613. * PB2 - PIN2 (input pullup).
  614. * PB3 - SPI1_SCK (alternate 5).
  615. * PB4 - SPI1_MISO (alternate 5).
  616. * PB5 - SPI1_MOSI (alternate 5).
  617. * PB6 - I2C1_SCL (output od, alternate 4).
  618. * PB7 - I2C1_SDA (output od, alternate 4).
  619. * PB8 - RELAY1 (output pushpull).
  620. * PB9 - RELAY2 (output pushpull).
  621. * PB10 - PIN10 (input pullup).
  622. * PB11 - PIN11 (input pullup).
  623. * PB12 - PIN12 (input pullup).
  624. * PB13 - PIN13 (input pullup).
  625. * PB14 - F_CS (output pushpull).
  626. * PB15 - PIN15 (input pullup).
  627. */
  628. #define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
  629. PIN_MODE_INPUT(GPIOB_PIN1) | \
  630. PIN_MODE_INPUT(GPIOB_PIN2) | \
  631. PIN_MODE_ALTERNATE(GPIOB_PIN3) | \
  632. PIN_MODE_ALTERNATE(GPIOB_PIN4) | \
  633. PIN_MODE_ALTERNATE(GPIOB_PIN5) | \
  634. PIN_MODE_ALTERNATE(GPIOB_PIN6) | \
  635. PIN_MODE_ALTERNATE(GPIOB_PIN7) | \
  636. PIN_MODE_OUTPUT(GPIOB_PIN8) | \
  637. PIN_MODE_OUTPUT(GPIOB_PIN9) | \
  638. PIN_MODE_INPUT(GPIOB_PIN10) | \
  639. PIN_MODE_INPUT(GPIOB_PIN11) | \
  640. PIN_MODE_INPUT(GPIOB_PIN12) | \
  641. PIN_MODE_INPUT(GPIOB_PIN13) | \
  642. PIN_MODE_OUTPUT(GPIOB_PIN14) | \
  643. PIN_MODE_INPUT(GPIOB_PIN15))
  644. #define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
  645. PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
  646. PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
  647. PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
  648. PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
  649. PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
  650. PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \
  651. PIN_OTYPE_OPENDRAIN(GPIOB_PIN7) | \
  652. PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
  653. PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
  654. PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
  655. PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
  656. PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
  657. PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
  658. PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
  659. PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
  660. #define VAL_GPIOB_OSPEEDR (PIN_OSPEED_HIGH(GPIOB_PIN0) | \
  661. PIN_OSPEED_HIGH(GPIOB_PIN1) | \
  662. PIN_OSPEED_HIGH(GPIOB_PIN2) | \
  663. PIN_OSPEED_HIGH(GPIOB_PIN3) | \
  664. PIN_OSPEED_HIGH(GPIOB_PIN4) | \
  665. PIN_OSPEED_HIGH(GPIOB_PIN5) | \
  666. PIN_OSPEED_HIGH(GPIOB_PIN6) | \
  667. PIN_OSPEED_HIGH(GPIOB_PIN7) | \
  668. PIN_OSPEED_HIGH(GPIOB_PIN8) | \
  669. PIN_OSPEED_HIGH(GPIOB_PIN9) | \
  670. PIN_OSPEED_HIGH(GPIOB_PIN10) | \
  671. PIN_OSPEED_HIGH(GPIOB_PIN11) | \
  672. PIN_OSPEED_HIGH(GPIOB_PIN12) | \
  673. PIN_OSPEED_HIGH(GPIOB_PIN13) | \
  674. PIN_OSPEED_HIGH(GPIOB_PIN14) | \
  675. PIN_OSPEED_HIGH(GPIOB_PIN15))
  676. #define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
  677. PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
  678. PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
  679. PIN_PUPDR_FLOATING(GPIOB_PIN3) | \
  680. PIN_PUPDR_FLOATING(GPIOB_PIN4) | \
  681. PIN_PUPDR_FLOATING(GPIOB_PIN5) | \
  682. PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
  683. PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
  684. PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
  685. PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
  686. PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
  687. PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
  688. PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
  689. PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
  690. PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
  691. PIN_PUPDR_PULLUP(GPIOB_PIN15))
  692. #define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
  693. PIN_ODR_HIGH(GPIOB_PIN1) | \
  694. PIN_ODR_HIGH(GPIOB_PIN2) | \
  695. PIN_ODR_HIGH(GPIOB_PIN3) | \
  696. PIN_ODR_HIGH(GPIOB_PIN4) | \
  697. PIN_ODR_HIGH(GPIOB_PIN5) | \
  698. PIN_ODR_HIGH(GPIOB_PIN6) | \
  699. PIN_ODR_HIGH(GPIOB_PIN7) | \
  700. PIN_ODR_HIGH(GPIOB_PIN8) | \
  701. PIN_ODR_HIGH(GPIOB_PIN9) | \
  702. PIN_ODR_HIGH(GPIOB_PIN10) | \
  703. PIN_ODR_HIGH(GPIOB_PIN11) | \
  704. PIN_ODR_HIGH(GPIOB_PIN12) | \
  705. PIN_ODR_HIGH(GPIOB_PIN13) | \
  706. PIN_ODR_HIGH(GPIOB_PIN14) | \
  707. PIN_ODR_HIGH(GPIOB_PIN15))
  708. #define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
  709. PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
  710. PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
  711. PIN_AFIO_AF(GPIOB_PIN3, 5U) | \
  712. PIN_AFIO_AF(GPIOB_PIN4, 5U) | \
  713. PIN_AFIO_AF(GPIOB_PIN5, 5U) | \
  714. PIN_AFIO_AF(GPIOB_PIN6, 4U) | \
  715. PIN_AFIO_AF(GPIOB_PIN7, 4U))
  716. #define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
  717. PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
  718. PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
  719. PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
  720. PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
  721. PIN_AFIO_AF(GPIOB_PIN13, 0U) | \
  722. PIN_AFIO_AF(GPIOB_PIN14, 0U) | \
  723. PIN_AFIO_AF(GPIOB_PIN15, 0U))
  724. /*
  725. * GPIOC setup:
  726. *
  727. * PC0 - PIN0 (input pullup).
  728. * PC1 - PIN1 (input pullup).
  729. * PC2 - PIN2 (input pullup).
  730. * PC3 - PIN3 (input pullup).
  731. * PC4 - PIN4 (input pullup).
  732. * PC5 - PIN5 (input pullup).
  733. * PC6 - PIN6 (input pullup).
  734. * PC7 - PIN7 (input pullup).
  735. * PC8 - SDIO_D0 (alternate 12).
  736. * PC9 - SDIO_D1 (alternate 12).
  737. * PC10 - SDIO_D2 (alternate 12).
  738. * PC11 - SDIO_D3 (alternate 12).
  739. * PC12 - SDIO_SCK (alternate 12).
  740. * PC13 - PIN13 (input pullup).
  741. * PC14 - OSC32_IN (input float).
  742. * PC15 - OSC32_OUT (input float).
  743. */
  744. #define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
  745. PIN_MODE_INPUT(GPIOC_PIN1) | \
  746. PIN_MODE_INPUT(GPIOC_PIN2) | \
  747. PIN_MODE_INPUT(GPIOC_PIN3) | \
  748. PIN_MODE_INPUT(GPIOC_PIN4) | \
  749. PIN_MODE_INPUT(GPIOC_PIN5) | \
  750. PIN_MODE_INPUT(GPIOC_PIN6) | \
  751. PIN_MODE_INPUT(GPIOC_PIN7) | \
  752. PIN_MODE_ALTERNATE(GPIOC_PIN8) | \
  753. PIN_MODE_ALTERNATE(GPIOC_PIN9) | \
  754. PIN_MODE_ALTERNATE(GPIOC_PIN10) | \
  755. PIN_MODE_ALTERNATE(GPIOC_PIN11) | \
  756. PIN_MODE_ALTERNATE(GPIOC_PIN12) | \
  757. PIN_MODE_INPUT(GPIOC_PIN13) | \
  758. PIN_MODE_INPUT(GPIOC_PIN14) | \
  759. PIN_MODE_INPUT(GPIOC_PIN15))
  760. #define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
  761. PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
  762. PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
  763. PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
  764. PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
  765. PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
  766. PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
  767. PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
  768. PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
  769. PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
  770. PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
  771. PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
  772. PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
  773. PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
  774. PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
  775. PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
  776. #define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \
  777. PIN_OSPEED_HIGH(GPIOC_PIN1) | \
  778. PIN_OSPEED_HIGH(GPIOC_PIN2) | \
  779. PIN_OSPEED_HIGH(GPIOC_PIN3) | \
  780. PIN_OSPEED_HIGH(GPIOC_PIN4) | \
  781. PIN_OSPEED_HIGH(GPIOC_PIN5) | \
  782. PIN_OSPEED_HIGH(GPIOC_PIN6) | \
  783. PIN_OSPEED_HIGH(GPIOC_PIN7) | \
  784. PIN_OSPEED_HIGH(GPIOC_PIN8) | \
  785. PIN_OSPEED_HIGH(GPIOC_PIN9) | \
  786. PIN_OSPEED_HIGH(GPIOC_PIN10) | \
  787. PIN_OSPEED_HIGH(GPIOC_PIN11) | \
  788. PIN_OSPEED_HIGH(GPIOC_PIN12) | \
  789. PIN_OSPEED_HIGH(GPIOC_PIN13) | \
  790. PIN_OSPEED_HIGH(GPIOC_PIN14) | \
  791. PIN_OSPEED_HIGH(GPIOC_PIN15))
  792. #define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
  793. PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
  794. PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
  795. PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
  796. PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
  797. PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
  798. PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
  799. PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
  800. PIN_PUPDR_FLOATING(GPIOC_PIN8) | \
  801. PIN_PUPDR_FLOATING(GPIOC_PIN9) | \
  802. PIN_PUPDR_FLOATING(GPIOC_PIN10) | \
  803. PIN_PUPDR_FLOATING(GPIOC_PIN11) | \
  804. PIN_PUPDR_FLOATING(GPIOC_PIN12) | \
  805. PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
  806. PIN_PUPDR_FLOATING(GPIOC_PIN14) | \
  807. PIN_PUPDR_FLOATING(GPIOC_PIN15))
  808. #define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
  809. PIN_ODR_HIGH(GPIOC_PIN1) | \
  810. PIN_ODR_HIGH(GPIOC_PIN2) | \
  811. PIN_ODR_HIGH(GPIOC_PIN3) | \
  812. PIN_ODR_HIGH(GPIOC_PIN4) | \
  813. PIN_ODR_HIGH(GPIOC_PIN5) | \
  814. PIN_ODR_HIGH(GPIOC_PIN6) | \
  815. PIN_ODR_HIGH(GPIOC_PIN7) | \
  816. PIN_ODR_HIGH(GPIOC_PIN8) | \
  817. PIN_ODR_HIGH(GPIOC_PIN9) | \
  818. PIN_ODR_HIGH(GPIOC_PIN10) | \
  819. PIN_ODR_HIGH(GPIOC_PIN11) | \
  820. PIN_ODR_HIGH(GPIOC_PIN12) | \
  821. PIN_ODR_HIGH(GPIOC_PIN13) | \
  822. PIN_ODR_HIGH(GPIOC_PIN14) | \
  823. PIN_ODR_HIGH(GPIOC_PIN15))
  824. #define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \
  825. PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
  826. PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
  827. PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
  828. PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
  829. PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
  830. PIN_AFIO_AF(GPIOC_PIN6, 0U) | \
  831. PIN_AFIO_AF(GPIOC_PIN7, 0U))
  832. #define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 12U) | \
  833. PIN_AFIO_AF(GPIOC_PIN9, 12U) | \
  834. PIN_AFIO_AF(GPIOC_PIN10, 12U) | \
  835. PIN_AFIO_AF(GPIOC_PIN11, 12U) | \
  836. PIN_AFIO_AF(GPIOC_PIN12, 12U) | \
  837. PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
  838. PIN_AFIO_AF(GPIOC_PIN14, 0U) | \
  839. PIN_AFIO_AF(GPIOC_PIN15, 0U))
  840. /*
  841. * GPIOD setup:
  842. *
  843. * PD0 - FSMC_D2 (alternate 12).
  844. * PD1 - FSMC_D3 (alternate 12).
  845. * PD2 - SDIO_CMD (alternate 12).
  846. * PD3 - PIN3 (input pullup).
  847. * PD4 - FSMC_NOE (alternate 12).
  848. * PD5 - FSMC_NWE (alternate 12).
  849. * PD6 - PIN6 (input pullup).
  850. * PD7 - PIN7 (input pullup).
  851. * PD8 - FSMC_D13 (alternate 12).
  852. * PD9 - FSMC_D14 (alternate 12).
  853. * PD10 - FSMC_D15 (alternate 12).
  854. * PD11 - FSMC_A16 (alternate 12).
  855. * PD12 - FSMC_A17 (alternate 12).
  856. * PD13 - FSMC_A18 (alternate 12).
  857. * PD14 - FSMC_D0 (alternate 12).
  858. * PD15 - FSMC_D1 (alternate 12).
  859. */
  860. #define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(GPIOD_PIN0) | \
  861. PIN_MODE_ALTERNATE(GPIOD_PIN1) | \
  862. PIN_MODE_ALTERNATE(GPIOD_PIN2) | \
  863. PIN_MODE_INPUT(GPIOD_PIN3) | \
  864. PIN_MODE_ALTERNATE(GPIOD_PIN4) | \
  865. PIN_MODE_ALTERNATE(GPIOD_PIN5) | \
  866. PIN_MODE_INPUT(GPIOD_PIN6) | \
  867. PIN_MODE_INPUT(GPIOD_PIN7) | \
  868. PIN_MODE_ALTERNATE(GPIOD_PIN8) | \
  869. PIN_MODE_ALTERNATE(GPIOD_PIN9) | \
  870. PIN_MODE_ALTERNATE(GPIOD_PIN10) | \
  871. PIN_MODE_ALTERNATE(GPIOD_PIN11) | \
  872. PIN_MODE_ALTERNATE(GPIOD_PIN12) | \
  873. PIN_MODE_ALTERNATE(GPIOD_PIN13) | \
  874. PIN_MODE_ALTERNATE(GPIOD_PIN14) | \
  875. PIN_MODE_ALTERNATE(GPIOD_PIN15))
  876. #define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
  877. PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
  878. PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
  879. PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
  880. PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
  881. PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
  882. PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
  883. PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
  884. PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
  885. PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
  886. PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
  887. PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
  888. PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
  889. PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
  890. PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
  891. PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
  892. #define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \
  893. PIN_OSPEED_HIGH(GPIOD_PIN1) | \
  894. PIN_OSPEED_HIGH(GPIOD_PIN2) | \
  895. PIN_OSPEED_HIGH(GPIOD_PIN3) | \
  896. PIN_OSPEED_HIGH(GPIOD_PIN4) | \
  897. PIN_OSPEED_HIGH(GPIOD_PIN5) | \
  898. PIN_OSPEED_HIGH(GPIOD_PIN6) | \
  899. PIN_OSPEED_HIGH(GPIOD_PIN7) | \
  900. PIN_OSPEED_HIGH(GPIOD_PIN8) | \
  901. PIN_OSPEED_HIGH(GPIOD_PIN9) | \
  902. PIN_OSPEED_HIGH(GPIOD_PIN10) | \
  903. PIN_OSPEED_HIGH(GPIOD_PIN11) | \
  904. PIN_OSPEED_HIGH(GPIOD_PIN12) | \
  905. PIN_OSPEED_HIGH(GPIOD_PIN13) | \
  906. PIN_OSPEED_HIGH(GPIOD_PIN14) | \
  907. PIN_OSPEED_HIGH(GPIOD_PIN15))
  908. #define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING(GPIOD_PIN0) | \
  909. PIN_PUPDR_FLOATING(GPIOD_PIN1) | \
  910. PIN_PUPDR_FLOATING(GPIOD_PIN2) | \
  911. PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
  912. PIN_PUPDR_FLOATING(GPIOD_PIN4) | \
  913. PIN_PUPDR_FLOATING(GPIOD_PIN5) | \
  914. PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
  915. PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
  916. PIN_PUPDR_FLOATING(GPIOD_PIN8) | \
  917. PIN_PUPDR_FLOATING(GPIOD_PIN9) | \
  918. PIN_PUPDR_FLOATING(GPIOD_PIN10) | \
  919. PIN_PUPDR_FLOATING(GPIOD_PIN11) | \
  920. PIN_PUPDR_FLOATING(GPIOD_PIN12) | \
  921. PIN_PUPDR_FLOATING(GPIOD_PIN13) | \
  922. PIN_PUPDR_FLOATING(GPIOD_PIN14) | \
  923. PIN_PUPDR_FLOATING(GPIOD_PIN15))
  924. #define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
  925. PIN_ODR_HIGH(GPIOD_PIN1) | \
  926. PIN_ODR_HIGH(GPIOD_PIN2) | \
  927. PIN_ODR_HIGH(GPIOD_PIN3) | \
  928. PIN_ODR_HIGH(GPIOD_PIN4) | \
  929. PIN_ODR_HIGH(GPIOD_PIN5) | \
  930. PIN_ODR_HIGH(GPIOD_PIN6) | \
  931. PIN_ODR_HIGH(GPIOD_PIN7) | \
  932. PIN_ODR_HIGH(GPIOD_PIN8) | \
  933. PIN_ODR_HIGH(GPIOD_PIN9) | \
  934. PIN_ODR_HIGH(GPIOD_PIN10) | \
  935. PIN_ODR_HIGH(GPIOD_PIN11) | \
  936. PIN_ODR_HIGH(GPIOD_PIN12) | \
  937. PIN_ODR_HIGH(GPIOD_PIN13) | \
  938. PIN_ODR_HIGH(GPIOD_PIN14) | \
  939. PIN_ODR_HIGH(GPIOD_PIN15))
  940. #define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 12U) | \
  941. PIN_AFIO_AF(GPIOD_PIN1, 12U) | \
  942. PIN_AFIO_AF(GPIOD_PIN2, 12U) | \
  943. PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
  944. PIN_AFIO_AF(GPIOD_PIN4, 12U) | \
  945. PIN_AFIO_AF(GPIOD_PIN5, 12U) | \
  946. PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
  947. PIN_AFIO_AF(GPIOD_PIN7, 0U))
  948. #define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 12U) | \
  949. PIN_AFIO_AF(GPIOD_PIN9, 12U) | \
  950. PIN_AFIO_AF(GPIOD_PIN10, 12U) | \
  951. PIN_AFIO_AF(GPIOD_PIN11, 12U) | \
  952. PIN_AFIO_AF(GPIOD_PIN12, 12U) | \
  953. PIN_AFIO_AF(GPIOD_PIN13, 12U) | \
  954. PIN_AFIO_AF(GPIOD_PIN14, 12U) | \
  955. PIN_AFIO_AF(GPIOD_PIN15, 12U))
  956. /*
  957. * GPIOE setup:
  958. *
  959. * PE0 - FSMC_NBL0 (alternate 12).
  960. * PE1 - FSMC_NBL1 (alternate 12).
  961. * PE2 - PIN2 (input floating).
  962. * PE3 - KEY1 (input pullup).
  963. * PE4 - KEY0 (input pullup).
  964. * PE5 - PIN5 (input floating).
  965. * PE6 - PIN6 (input floating).
  966. * PE7 - FSMC_D4 (alternate 12).
  967. * PE8 - FSMC_D5 (alternate 12).
  968. * PE9 - FSMC_D6 (alternate 12).
  969. * PE10 - FSMC_D7 (alternate 12).
  970. * PE11 - FSMC_D8 (alternate 12).
  971. * PE12 - FSMC_D9 (alternate 12).
  972. * PE13 - FSMC_D10 (alternate 12).
  973. * PE14 - FSMC_D11 (alternate 12).
  974. * PE15 - FSMC_D12 (alternate 12).
  975. */
  976. #define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(GPIOE_PIN0) | \
  977. PIN_MODE_ALTERNATE(GPIOE_PIN1) | \
  978. PIN_MODE_INPUT(GPIOE_PIN2) | \
  979. PIN_MODE_INPUT(GPIOE_PIN3) | \
  980. PIN_MODE_INPUT(GPIOE_PIN4) | \
  981. PIN_MODE_INPUT(GPIOE_PIN5) | \
  982. PIN_MODE_INPUT(GPIOE_PIN6) | \
  983. PIN_MODE_ALTERNATE(GPIOE_PIN7) | \
  984. PIN_MODE_ALTERNATE(GPIOE_PIN8) | \
  985. PIN_MODE_ALTERNATE(GPIOE_PIN9) | \
  986. PIN_MODE_ALTERNATE(GPIOE_PIN10) | \
  987. PIN_MODE_ALTERNATE(GPIOE_PIN11) | \
  988. PIN_MODE_ALTERNATE(GPIOE_PIN12) | \
  989. PIN_MODE_ALTERNATE(GPIOE_PIN13) | \
  990. PIN_MODE_ALTERNATE(GPIOE_PIN14) | \
  991. PIN_MODE_ALTERNATE(GPIOE_PIN15))
  992. #define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
  993. PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
  994. PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
  995. PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
  996. PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
  997. PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
  998. PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
  999. PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
  1000. PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
  1001. PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
  1002. PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
  1003. PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
  1004. PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
  1005. PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
  1006. PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
  1007. PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
  1008. #define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \
  1009. PIN_OSPEED_HIGH(GPIOE_PIN1) | \
  1010. PIN_OSPEED_HIGH(GPIOE_PIN2) | \
  1011. PIN_OSPEED_HIGH(GPIOE_PIN3) | \
  1012. PIN_OSPEED_HIGH(GPIOE_PIN4) | \
  1013. PIN_OSPEED_HIGH(GPIOE_PIN5) | \
  1014. PIN_OSPEED_HIGH(GPIOE_PIN6) | \
  1015. PIN_OSPEED_HIGH(GPIOE_PIN7) | \
  1016. PIN_OSPEED_HIGH(GPIOE_PIN8) | \
  1017. PIN_OSPEED_HIGH(GPIOE_PIN9) | \
  1018. PIN_OSPEED_HIGH(GPIOE_PIN10) | \
  1019. PIN_OSPEED_HIGH(GPIOE_PIN11) | \
  1020. PIN_OSPEED_HIGH(GPIOE_PIN12) | \
  1021. PIN_OSPEED_HIGH(GPIOE_PIN13) | \
  1022. PIN_OSPEED_HIGH(GPIOE_PIN14) | \
  1023. PIN_OSPEED_HIGH(GPIOE_PIN15))
  1024. #define VAL_GPIOE_PUPDR (PIN_PUPDR_FLOATING(GPIOE_PIN0) | \
  1025. PIN_PUPDR_FLOATING(GPIOE_PIN1) | \
  1026. PIN_PUPDR_FLOATING(GPIOE_PIN2) | \
  1027. PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
  1028. PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
  1029. PIN_PUPDR_FLOATING(GPIOE_PIN5) | \
  1030. PIN_PUPDR_FLOATING(GPIOE_PIN6) | \
  1031. PIN_PUPDR_FLOATING(GPIOE_PIN7) | \
  1032. PIN_PUPDR_FLOATING(GPIOE_PIN8) | \
  1033. PIN_PUPDR_FLOATING(GPIOE_PIN9) | \
  1034. PIN_PUPDR_FLOATING(GPIOE_PIN10) | \
  1035. PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
  1036. PIN_PUPDR_FLOATING(GPIOE_PIN12) | \
  1037. PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
  1038. PIN_PUPDR_FLOATING(GPIOE_PIN14) | \
  1039. PIN_PUPDR_FLOATING(GPIOE_PIN15))
  1040. #define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
  1041. PIN_ODR_HIGH(GPIOE_PIN1) | \
  1042. PIN_ODR_HIGH(GPIOE_PIN2) | \
  1043. PIN_ODR_HIGH(GPIOE_PIN3) | \
  1044. PIN_ODR_HIGH(GPIOE_PIN4) | \
  1045. PIN_ODR_HIGH(GPIOE_PIN5) | \
  1046. PIN_ODR_HIGH(GPIOE_PIN6) | \
  1047. PIN_ODR_HIGH(GPIOE_PIN7) | \
  1048. PIN_ODR_HIGH(GPIOE_PIN8) | \
  1049. PIN_ODR_HIGH(GPIOE_PIN9) | \
  1050. PIN_ODR_HIGH(GPIOE_PIN10) | \
  1051. PIN_ODR_HIGH(GPIOE_PIN11) | \
  1052. PIN_ODR_HIGH(GPIOE_PIN12) | \
  1053. PIN_ODR_HIGH(GPIOE_PIN13) | \
  1054. PIN_ODR_HIGH(GPIOE_PIN14) | \
  1055. PIN_ODR_HIGH(GPIOE_PIN15))
  1056. #define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 12U) | \
  1057. PIN_AFIO_AF(GPIOE_PIN1, 12U) | \
  1058. PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
  1059. PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
  1060. PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
  1061. PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
  1062. PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
  1063. PIN_AFIO_AF(GPIOE_PIN7, 12U))
  1064. #define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 12U) | \
  1065. PIN_AFIO_AF(GPIOE_PIN9, 12U) | \
  1066. PIN_AFIO_AF(GPIOE_PIN10, 12U) | \
  1067. PIN_AFIO_AF(GPIOE_PIN11, 12U) | \
  1068. PIN_AFIO_AF(GPIOE_PIN12, 12U) | \
  1069. PIN_AFIO_AF(GPIOE_PIN13, 12U) | \
  1070. PIN_AFIO_AF(GPIOE_PIN14, 12U) | \
  1071. PIN_AFIO_AF(GPIOE_PIN15, 12U))
  1072. /*
  1073. * GPIOF setup:
  1074. *
  1075. * PF0 - FSMC_A0 (alternate 12).
  1076. * PF1 - FSMC_A1 (alternate 12).
  1077. * PF2 - FSMC_A2 (alternate 12).
  1078. * PF3 - FSMC_A3 (alternate 12).
  1079. * PF4 - FSMC_A4 (alternate 12).
  1080. * PF5 - FSMC_A5 (alternate 12).
  1081. * PF6 - PIN6 (input floating).
  1082. * PF7 - PIN7 (input floating).
  1083. * PF8 - PIN8 (input floating).
  1084. * PF9 - LED0 (output pushpull).
  1085. * PF10 - LED1 (output pushpull).
  1086. * PF11 - PIN11 (input floating).
  1087. * PF12 - FSMC_A6 (alternate 12).
  1088. * PF13 - FSMC_A7 (alternate 12).
  1089. * PF14 - FSMC_A8 (alternate 12).
  1090. * PF15 - FSMC_A9 (alternate 12).
  1091. */
  1092. #define VAL_GPIOF_MODER (PIN_MODE_ALTERNATE(GPIOF_PIN0) | \
  1093. PIN_MODE_ALTERNATE(GPIOF_PIN1) | \
  1094. PIN_MODE_ALTERNATE(GPIOF_PIN2) | \
  1095. PIN_MODE_ALTERNATE(GPIOF_PIN3) | \
  1096. PIN_MODE_ALTERNATE(GPIOF_PIN4) | \
  1097. PIN_MODE_ALTERNATE(GPIOF_PIN5) | \
  1098. PIN_MODE_INPUT(GPIOF_PIN6) | \
  1099. PIN_MODE_INPUT(GPIOF_PIN7) | \
  1100. PIN_MODE_INPUT(GPIOF_PIN8) | \
  1101. PIN_MODE_OUTPUT(GPIOF_PIN9) | \
  1102. PIN_MODE_OUTPUT(GPIOF_PIN10) | \
  1103. PIN_MODE_INPUT(GPIOF_PIN11) | \
  1104. PIN_MODE_ALTERNATE(GPIOF_PIN12) | \
  1105. PIN_MODE_ALTERNATE(GPIOF_PIN13) | \
  1106. PIN_MODE_ALTERNATE(GPIOF_PIN14) | \
  1107. PIN_MODE_ALTERNATE(GPIOF_PIN15))
  1108. #define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \
  1109. PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \
  1110. PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
  1111. PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
  1112. PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
  1113. PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
  1114. PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
  1115. PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
  1116. PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
  1117. PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
  1118. PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
  1119. PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
  1120. PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
  1121. PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
  1122. PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
  1123. PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
  1124. #define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_PIN0) | \
  1125. PIN_OSPEED_HIGH(GPIOF_PIN1) | \
  1126. PIN_OSPEED_HIGH(GPIOF_PIN2) | \
  1127. PIN_OSPEED_HIGH(GPIOF_PIN3) | \
  1128. PIN_OSPEED_HIGH(GPIOF_PIN4) | \
  1129. PIN_OSPEED_HIGH(GPIOF_PIN5) | \
  1130. PIN_OSPEED_HIGH(GPIOF_PIN6) | \
  1131. PIN_OSPEED_HIGH(GPIOF_PIN7) | \
  1132. PIN_OSPEED_HIGH(GPIOF_PIN8) | \
  1133. PIN_OSPEED_HIGH(GPIOF_PIN9) | \
  1134. PIN_OSPEED_HIGH(GPIOF_PIN10) | \
  1135. PIN_OSPEED_HIGH(GPIOF_PIN11) | \
  1136. PIN_OSPEED_HIGH(GPIOF_PIN12) | \
  1137. PIN_OSPEED_HIGH(GPIOF_PIN13) | \
  1138. PIN_OSPEED_HIGH(GPIOF_PIN14) | \
  1139. PIN_OSPEED_HIGH(GPIOF_PIN15))
  1140. #define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_PIN0) | \
  1141. PIN_PUPDR_FLOATING(GPIOF_PIN1) | \
  1142. PIN_PUPDR_FLOATING(GPIOF_PIN2) | \
  1143. PIN_PUPDR_FLOATING(GPIOF_PIN3) | \
  1144. PIN_PUPDR_FLOATING(GPIOF_PIN4) | \
  1145. PIN_PUPDR_FLOATING(GPIOF_PIN5) | \
  1146. PIN_PUPDR_FLOATING(GPIOF_PIN6) | \
  1147. PIN_PUPDR_FLOATING(GPIOF_PIN7) | \
  1148. PIN_PUPDR_FLOATING(GPIOF_PIN8) | \
  1149. PIN_PUPDR_FLOATING(GPIOF_PIN9) | \
  1150. PIN_PUPDR_FLOATING(GPIOF_PIN10) | \
  1151. PIN_PUPDR_FLOATING(GPIOF_PIN11) | \
  1152. PIN_PUPDR_FLOATING(GPIOF_PIN12) | \
  1153. PIN_PUPDR_FLOATING(GPIOF_PIN13) | \
  1154. PIN_PUPDR_FLOATING(GPIOF_PIN14) | \
  1155. PIN_PUPDR_FLOATING(GPIOF_PIN15))
  1156. #define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \
  1157. PIN_ODR_HIGH(GPIOF_PIN1) | \
  1158. PIN_ODR_HIGH(GPIOF_PIN2) | \
  1159. PIN_ODR_HIGH(GPIOF_PIN3) | \
  1160. PIN_ODR_HIGH(GPIOF_PIN4) | \
  1161. PIN_ODR_HIGH(GPIOF_PIN5) | \
  1162. PIN_ODR_HIGH(GPIOF_PIN6) | \
  1163. PIN_ODR_HIGH(GPIOF_PIN7) | \
  1164. PIN_ODR_HIGH(GPIOF_PIN8) | \
  1165. PIN_ODR_HIGH(GPIOF_PIN9) | \
  1166. PIN_ODR_HIGH(GPIOF_PIN10) | \
  1167. PIN_ODR_HIGH(GPIOF_PIN11) | \
  1168. PIN_ODR_HIGH(GPIOF_PIN12) | \
  1169. PIN_ODR_HIGH(GPIOF_PIN13) | \
  1170. PIN_ODR_HIGH(GPIOF_PIN14) | \
  1171. PIN_ODR_HIGH(GPIOF_PIN15))
  1172. #define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 12U) | \
  1173. PIN_AFIO_AF(GPIOF_PIN1, 12U) | \
  1174. PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
  1175. PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
  1176. PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
  1177. PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
  1178. PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
  1179. PIN_AFIO_AF(GPIOF_PIN7, 0U))
  1180. #define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
  1181. PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
  1182. PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
  1183. PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
  1184. PIN_AFIO_AF(GPIOF_PIN12, 12U) | \
  1185. PIN_AFIO_AF(GPIOF_PIN13, 12U) | \
  1186. PIN_AFIO_AF(GPIOF_PIN14, 12U) | \
  1187. PIN_AFIO_AF(GPIOF_PIN15, 12U))
  1188. /*
  1189. * GPIOG setup:
  1190. *
  1191. * PG0 - FSMC_A10 (alternate 12).
  1192. * PG1 - FSMC_A11 (alternate 12).
  1193. * PG2 - FSMC_A12 (alternate 12).
  1194. * PG3 - FSMC_A13 (alternate 12).
  1195. * PG4 - FSMC_A14 (alternate 12).
  1196. * PG5 - FSMC_A15 (alternate 12).
  1197. * PG6 - NRF_CE (output pushpull).
  1198. * PG7 - NRF_CS (output pushpull).
  1199. * PG8 - NRF_IRQ (input pullup).
  1200. * PG9 - PIN9 (input floating).
  1201. * PG10 - FSMC_NE3 (alternate 12).
  1202. * PG11 - PIN11 (input floating).
  1203. * PG12 - FSMC_NE4 (alternate 12).
  1204. * PG13 - PIN13 (input floating).
  1205. * PG14 - PIN14 (input floating).
  1206. * PG15 - PIN15 (input floating).
  1207. */
  1208. #define VAL_GPIOG_MODER (PIN_MODE_ALTERNATE(GPIOG_PIN0) | \
  1209. PIN_MODE_ALTERNATE(GPIOG_PIN1) | \
  1210. PIN_MODE_ALTERNATE(GPIOG_PIN2) | \
  1211. PIN_MODE_ALTERNATE(GPIOG_PIN3) | \
  1212. PIN_MODE_ALTERNATE(GPIOG_PIN4) | \
  1213. PIN_MODE_ALTERNATE(GPIOG_PIN5) | \
  1214. PIN_MODE_OUTPUT(GPIOG_PIN6) | \
  1215. PIN_MODE_OUTPUT(GPIOG_PIN7) | \
  1216. PIN_MODE_INPUT(GPIOG_PIN8) | \
  1217. PIN_MODE_INPUT(GPIOG_PIN9) | \
  1218. PIN_MODE_ALTERNATE(GPIOG_PIN10) | \
  1219. PIN_MODE_INPUT(GPIOG_PIN11) | \
  1220. PIN_MODE_ALTERNATE(GPIOG_PIN12) | \
  1221. PIN_MODE_INPUT(GPIOG_PIN13) | \
  1222. PIN_MODE_INPUT(GPIOG_PIN14) | \
  1223. PIN_MODE_INPUT(GPIOG_PIN15))
  1224. #define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
  1225. PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
  1226. PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
  1227. PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
  1228. PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
  1229. PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
  1230. PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
  1231. PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
  1232. PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
  1233. PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
  1234. PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
  1235. PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
  1236. PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
  1237. PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
  1238. PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
  1239. PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
  1240. #define VAL_GPIOG_OSPEEDR (PIN_OSPEED_HIGH(GPIOG_PIN0) | \
  1241. PIN_OSPEED_HIGH(GPIOG_PIN1) | \
  1242. PIN_OSPEED_HIGH(GPIOG_PIN2) | \
  1243. PIN_OSPEED_HIGH(GPIOG_PIN3) | \
  1244. PIN_OSPEED_HIGH(GPIOG_PIN4) | \
  1245. PIN_OSPEED_HIGH(GPIOG_PIN5) | \
  1246. PIN_OSPEED_HIGH(GPIOG_PIN6) | \
  1247. PIN_OSPEED_HIGH(GPIOG_PIN7) | \
  1248. PIN_OSPEED_HIGH(GPIOG_PIN8) | \
  1249. PIN_OSPEED_HIGH(GPIOG_PIN9) | \
  1250. PIN_OSPEED_HIGH(GPIOG_PIN10) | \
  1251. PIN_OSPEED_HIGH(GPIOG_PIN11) | \
  1252. PIN_OSPEED_HIGH(GPIOG_PIN12) | \
  1253. PIN_OSPEED_HIGH(GPIOG_PIN13) | \
  1254. PIN_OSPEED_HIGH(GPIOG_PIN14) | \
  1255. PIN_OSPEED_HIGH(GPIOG_PIN15))
  1256. #define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING(GPIOG_PIN0) | \
  1257. PIN_PUPDR_FLOATING(GPIOG_PIN1) | \
  1258. PIN_PUPDR_FLOATING(GPIOG_PIN2) | \
  1259. PIN_PUPDR_FLOATING(GPIOG_PIN3) | \
  1260. PIN_PUPDR_FLOATING(GPIOG_PIN4) | \
  1261. PIN_PUPDR_FLOATING(GPIOG_PIN5) | \
  1262. PIN_PUPDR_FLOATING(GPIOG_PIN6) | \
  1263. PIN_PUPDR_FLOATING(GPIOG_PIN7) | \
  1264. PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
  1265. PIN_PUPDR_FLOATING(GPIOG_PIN9) | \
  1266. PIN_PUPDR_FLOATING(GPIOG_PIN10) | \
  1267. PIN_PUPDR_FLOATING(GPIOG_PIN11) | \
  1268. PIN_PUPDR_FLOATING(GPIOG_PIN12) | \
  1269. PIN_PUPDR_FLOATING(GPIOG_PIN13) | \
  1270. PIN_PUPDR_FLOATING(GPIOG_PIN14) | \
  1271. PIN_PUPDR_FLOATING(GPIOG_PIN15))
  1272. #define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
  1273. PIN_ODR_HIGH(GPIOG_PIN1) | \
  1274. PIN_ODR_HIGH(GPIOG_PIN2) | \
  1275. PIN_ODR_HIGH(GPIOG_PIN3) | \
  1276. PIN_ODR_HIGH(GPIOG_PIN4) | \
  1277. PIN_ODR_HIGH(GPIOG_PIN5) | \
  1278. PIN_ODR_HIGH(GPIOG_PIN6) | \
  1279. PIN_ODR_HIGH(GPIOG_PIN7) | \
  1280. PIN_ODR_HIGH(GPIOG_PIN8) | \
  1281. PIN_ODR_HIGH(GPIOG_PIN9) | \
  1282. PIN_ODR_HIGH(GPIOG_PIN10) | \
  1283. PIN_ODR_HIGH(GPIOG_PIN11) | \
  1284. PIN_ODR_HIGH(GPIOG_PIN12) | \
  1285. PIN_ODR_HIGH(GPIOG_PIN13) | \
  1286. PIN_ODR_HIGH(GPIOG_PIN14) | \
  1287. PIN_ODR_HIGH(GPIOG_PIN15))
  1288. #define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 12U) | \
  1289. PIN_AFIO_AF(GPIOG_PIN1, 12U) | \
  1290. PIN_AFIO_AF(GPIOG_PIN2, 12U) | \
  1291. PIN_AFIO_AF(GPIOG_PIN3, 12U) | \
  1292. PIN_AFIO_AF(GPIOG_PIN4, 12U) | \
  1293. PIN_AFIO_AF(GPIOG_PIN5, 12U) | \
  1294. PIN_AFIO_AF(GPIOG_PIN6, 0U) | \
  1295. PIN_AFIO_AF(GPIOG_PIN7, 0U))
  1296. #define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0U) | \
  1297. PIN_AFIO_AF(GPIOG_PIN9, 0U) | \
  1298. PIN_AFIO_AF(GPIOG_PIN10, 12U) | \
  1299. PIN_AFIO_AF(GPIOG_PIN11, 0U) | \
  1300. PIN_AFIO_AF(GPIOG_PIN12, 12U) | \
  1301. PIN_AFIO_AF(GPIOG_PIN13, 0U) | \
  1302. PIN_AFIO_AF(GPIOG_PIN14, 0U) | \
  1303. PIN_AFIO_AF(GPIOG_PIN15, 0U))
  1304. /*
  1305. * GPIOH setup:
  1306. *
  1307. * PH0 - OSC_IN (input floating).
  1308. * PH1 - OSC_OUT (input floating).
  1309. * PH2 - none (input pullup).
  1310. * PH3 - none (input pullup).
  1311. * PH4 - none (input pullup).
  1312. * PH5 - none (input pullup).
  1313. * PH6 - none (input pullup).
  1314. * PH7 - none (input pullup).
  1315. * PH8 - none (input pullup).
  1316. * PH9 - none (input pullup).
  1317. * PH10 - none (input pullup).
  1318. * PH11 - none (input pullup).
  1319. * PH12 - none (input pullup).
  1320. * PH13 - none (input pullup).
  1321. * PH14 - none (input pullup).
  1322. * PH15 - none (input pullup).
  1323. */
  1324. #define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \
  1325. PIN_MODE_INPUT(GPIOH_PIN1) | \
  1326. PIN_MODE_INPUT(GPIOH_PIN2) | \
  1327. PIN_MODE_INPUT(GPIOH_PIN3) | \
  1328. PIN_MODE_INPUT(GPIOH_PIN4) | \
  1329. PIN_MODE_INPUT(GPIOH_PIN5) | \
  1330. PIN_MODE_INPUT(GPIOH_PIN6) | \
  1331. PIN_MODE_INPUT(GPIOH_PIN7) | \
  1332. PIN_MODE_INPUT(GPIOH_PIN8) | \
  1333. PIN_MODE_INPUT(GPIOH_PIN9) | \
  1334. PIN_MODE_INPUT(GPIOH_PIN10) | \
  1335. PIN_MODE_INPUT(GPIOH_PIN11) | \
  1336. PIN_MODE_INPUT(GPIOH_PIN12) | \
  1337. PIN_MODE_INPUT(GPIOH_PIN13) | \
  1338. PIN_MODE_INPUT(GPIOH_PIN14) | \
  1339. PIN_MODE_INPUT(GPIOH_PIN15))
  1340. #define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
  1341. PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
  1342. PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
  1343. PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
  1344. PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
  1345. PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
  1346. PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
  1347. PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
  1348. PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
  1349. PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
  1350. PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
  1351. PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
  1352. PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
  1353. PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
  1354. PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
  1355. PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
  1356. #define VAL_GPIOH_OSPEEDR (PIN_OSPEED_HIGH(GPIOH_PIN0) | \
  1357. PIN_OSPEED_HIGH(GPIOH_PIN1) | \
  1358. PIN_OSPEED_HIGH(GPIOH_PIN2) | \
  1359. PIN_OSPEED_HIGH(GPIOH_PIN3) | \
  1360. PIN_OSPEED_HIGH(GPIOH_PIN4) | \
  1361. PIN_OSPEED_HIGH(GPIOH_PIN5) | \
  1362. PIN_OSPEED_HIGH(GPIOH_PIN6) | \
  1363. PIN_OSPEED_HIGH(GPIOH_PIN7) | \
  1364. PIN_OSPEED_HIGH(GPIOH_PIN8) | \
  1365. PIN_OSPEED_HIGH(GPIOH_PIN9) | \
  1366. PIN_OSPEED_HIGH(GPIOH_PIN10) | \
  1367. PIN_OSPEED_HIGH(GPIOH_PIN11) | \
  1368. PIN_OSPEED_HIGH(GPIOH_PIN12) | \
  1369. PIN_OSPEED_HIGH(GPIOH_PIN13) | \
  1370. PIN_OSPEED_HIGH(GPIOH_PIN14) | \
  1371. PIN_OSPEED_HIGH(GPIOH_PIN15))
  1372. #define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING(GPIOH_PIN0) | \
  1373. PIN_PUPDR_FLOATING(GPIOH_PIN1) | \
  1374. PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
  1375. PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
  1376. PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
  1377. PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
  1378. PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
  1379. PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
  1380. PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
  1381. PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
  1382. PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
  1383. PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
  1384. PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
  1385. PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
  1386. PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
  1387. PIN_PUPDR_PULLUP(GPIOH_PIN15))
  1388. #define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
  1389. PIN_ODR_HIGH(GPIOH_PIN1) | \
  1390. PIN_ODR_HIGH(GPIOH_PIN2) | \
  1391. PIN_ODR_HIGH(GPIOH_PIN3) | \
  1392. PIN_ODR_HIGH(GPIOH_PIN4) | \
  1393. PIN_ODR_HIGH(GPIOH_PIN5) | \
  1394. PIN_ODR_HIGH(GPIOH_PIN6) | \
  1395. PIN_ODR_HIGH(GPIOH_PIN7) | \
  1396. PIN_ODR_HIGH(GPIOH_PIN8) | \
  1397. PIN_ODR_HIGH(GPIOH_PIN9) | \
  1398. PIN_ODR_HIGH(GPIOH_PIN10) | \
  1399. PIN_ODR_HIGH(GPIOH_PIN11) | \
  1400. PIN_ODR_HIGH(GPIOH_PIN12) | \
  1401. PIN_ODR_HIGH(GPIOH_PIN13) | \
  1402. PIN_ODR_HIGH(GPIOH_PIN14) | \
  1403. PIN_ODR_HIGH(GPIOH_PIN15))
  1404. #define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0U) | \
  1405. PIN_AFIO_AF(GPIOH_PIN1, 0U) | \
  1406. PIN_AFIO_AF(GPIOH_PIN2, 0U) | \
  1407. PIN_AFIO_AF(GPIOH_PIN3, 0U) | \
  1408. PIN_AFIO_AF(GPIOH_PIN4, 0U) | \
  1409. PIN_AFIO_AF(GPIOH_PIN5, 0U) | \
  1410. PIN_AFIO_AF(GPIOH_PIN6, 0U) | \
  1411. PIN_AFIO_AF(GPIOH_PIN7, 0U))
  1412. #define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0U) | \
  1413. PIN_AFIO_AF(GPIOH_PIN9, 0U) | \
  1414. PIN_AFIO_AF(GPIOH_PIN10, 0U) | \
  1415. PIN_AFIO_AF(GPIOH_PIN11, 0U) | \
  1416. PIN_AFIO_AF(GPIOH_PIN12, 0U) | \
  1417. PIN_AFIO_AF(GPIOH_PIN13, 0U) | \
  1418. PIN_AFIO_AF(GPIOH_PIN14, 0U) | \
  1419. PIN_AFIO_AF(GPIOH_PIN15, 0U))
  1420. /*===========================================================================*/
  1421. /* External declarations. */
  1422. /*===========================================================================*/
  1423. #if !defined(_FROM_ASM_)
  1424. #ifdef __cplusplus
  1425. extern "C" {
  1426. #endif
  1427. void boardInit(void);
  1428. #ifdef __cplusplus
  1429. }
  1430. #endif
  1431. #endif /* _FROM_ASM_ */
  1432. #endif /* BOARD_H */