stm32_registry.h 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  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. * @file STM32F1xx/stm32_registry.h
  15. * @brief STM32F1xx capabilities registry.
  16. *
  17. * @addtogroup HAL
  18. * @{
  19. */
  20. #ifndef STM32_REGISTRY_H
  21. #define STM32_REGISTRY_H
  22. #if defined(STM32F100xB)
  23. #define STM32F10X_MD_VL
  24. #elif defined(STM32F100xE)
  25. #define STM32F10X_HD_VL
  26. #elif defined(STM32F101x6) || defined(STM32F102x6) || defined(STM32F103x6)
  27. #define STM32F10X_LD
  28. #elif defined(STM32F101xB) || defined(STM32F102xB) || defined(STM32F103xB)
  29. #define STM32F10X_MD
  30. #elif defined(STM32F101xE) || defined(STM32F103xE)
  31. #define STM32F10X_HD
  32. #elif defined(STM32F101xG) || defined(STM32F103xG)
  33. #define STM32F10X_XL
  34. #elif defined(STM32F105xC) || defined(STM32F107xC)
  35. #define STM32F10X_CL
  36. #else
  37. #error "unsupported or unrecognized STM32F1xx member"
  38. #endif
  39. /*===========================================================================*/
  40. /* Platform capabilities. */
  41. /*===========================================================================*/
  42. #if defined(STM32F10X_MD_VL) || defined(__DOXYGEN__)
  43. /**
  44. * @name STM32F100 MD capabilities
  45. * @{
  46. */
  47. /* ADC attributes.*/
  48. #define STM32_HAS_ADC1 TRUE
  49. #define STM32_HAS_ADC2 FALSE
  50. #define STM32_HAS_ADC3 FALSE
  51. #define STM32_HAS_ADC4 FALSE
  52. #define STM32_HAS_SDADC1 FALSE
  53. #define STM32_HAS_SDADC2 FALSE
  54. #define STM32_HAS_SDADC3 FALSE
  55. /* CAN attributes.*/
  56. #define STM32_HAS_CAN1 FALSE
  57. #define STM32_HAS_CAN2 FALSE
  58. #define STM32_HAS_CAN3 FALSE
  59. #define STM32_CAN_MAX_FILTERS 0
  60. /* DAC attributes.*/
  61. #define STM32_HAS_DAC1_CH1 TRUE
  62. #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  63. #define STM32_HAS_DAC1_CH2 TRUE
  64. #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  65. #define STM32_HAS_DAC2_CH1 FALSE
  66. #define STM32_HAS_DAC2_CH2 FALSE
  67. /* DMA attributes.*/
  68. #define STM32_ADVANCED_DMA FALSE
  69. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  70. #define STM32_DMA_SUPPORTS_CSELR FALSE
  71. #define STM32_DMA1_NUM_CHANNELS 7
  72. #define STM32_DMA1_CH1_HANDLER Vector6C
  73. #define STM32_DMA1_CH2_HANDLER Vector70
  74. #define STM32_DMA1_CH3_HANDLER Vector74
  75. #define STM32_DMA1_CH4_HANDLER Vector78
  76. #define STM32_DMA1_CH5_HANDLER Vector7C
  77. #define STM32_DMA1_CH6_HANDLER Vector80
  78. #define STM32_DMA1_CH7_HANDLER Vector84
  79. #define STM32_DMA1_CH1_NUMBER 11
  80. #define STM32_DMA1_CH2_NUMBER 12
  81. #define STM32_DMA1_CH3_NUMBER 13
  82. #define STM32_DMA1_CH4_NUMBER 14
  83. #define STM32_DMA1_CH5_NUMBER 15
  84. #define STM32_DMA1_CH6_NUMBER 16
  85. #define STM32_DMA1_CH7_NUMBER 17
  86. #define STM32_DMA2_NUM_CHANNELS 0
  87. /* ETH attributes.*/
  88. #define STM32_HAS_ETH FALSE
  89. /* EXTI attributes.*/
  90. #define STM32_EXTI_NUM_LINES 19
  91. #define STM32_EXTI_IMR_MASK 0x00000000U
  92. /* GPIO attributes.*/
  93. #define STM32_HAS_GPIOA TRUE
  94. #define STM32_HAS_GPIOB TRUE
  95. #define STM32_HAS_GPIOC TRUE
  96. #define STM32_HAS_GPIOD TRUE
  97. #define STM32_HAS_GPIOE TRUE
  98. #define STM32_HAS_GPIOF FALSE
  99. #define STM32_HAS_GPIOG FALSE
  100. #define STM32_HAS_GPIOH FALSE
  101. #define STM32_HAS_GPIOI FALSE
  102. #define STM32_HAS_GPIOJ FALSE
  103. #define STM32_HAS_GPIOK FALSE
  104. /* I2C attributes.*/
  105. #define STM32_HAS_I2C1 TRUE
  106. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  107. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  108. #define STM32_HAS_I2C2 TRUE
  109. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  110. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  111. #define STM32_HAS_I2C3 FALSE
  112. #define STM32_HAS_I2C4 FALSE
  113. /* QUADSPI attributes.*/
  114. #define STM32_HAS_QUADSPI1 FALSE
  115. /* RTC attributes.*/
  116. #define STM32_HAS_RTC TRUE
  117. #define STM32_RTC_HAS_SUBSECONDS TRUE
  118. #define STM32_RTC_IS_CALENDAR FALSE
  119. /* SDIO attributes.*/
  120. #define STM32_HAS_SDIO FALSE
  121. /* SPI attributes.*/
  122. #define STM32_HAS_SPI1 TRUE
  123. #define STM32_SPI1_SUPPORTS_I2S FALSE
  124. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  125. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  126. #define STM32_HAS_SPI2 TRUE
  127. #define STM32_SPI2_SUPPORTS_I2S FALSE
  128. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  129. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  130. #define STM32_HAS_SPI3 FALSE
  131. #define STM32_HAS_SPI4 FALSE
  132. #define STM32_HAS_SPI5 FALSE
  133. #define STM32_HAS_SPI6 FALSE
  134. /* TIM attributes.*/
  135. #define STM32_TIM_MAX_CHANNELS 4
  136. #define STM32_HAS_TIM1 TRUE
  137. #define STM32_TIM1_IS_32BITS FALSE
  138. #define STM32_TIM1_CHANNELS 4
  139. #define STM32_HAS_TIM2 TRUE
  140. #define STM32_TIM2_IS_32BITS FALSE
  141. #define STM32_TIM2_CHANNELS 4
  142. #define STM32_HAS_TIM3 TRUE
  143. #define STM32_TIM3_IS_32BITS FALSE
  144. #define STM32_TIM3_CHANNELS 4
  145. #define STM32_HAS_TIM4 TRUE
  146. #define STM32_TIM4_IS_32BITS FALSE
  147. #define STM32_TIM4_CHANNELS 4
  148. #define STM32_HAS_TIM6 TRUE
  149. #define STM32_TIM6_IS_32BITS FALSE
  150. #define STM32_TIM6_CHANNELS 0
  151. #define STM32_HAS_TIM7 TRUE
  152. #define STM32_TIM7_IS_32BITS FALSE
  153. #define STM32_TIM7_CHANNELS 0
  154. #define STM32_HAS_TIM15 TRUE
  155. #define STM32_TIM15_IS_32BITS FALSE
  156. #define STM32_TIM15_CHANNELS 2
  157. #define STM32_HAS_TIM16 TRUE
  158. #define STM32_TIM16_IS_32BITS FALSE
  159. #define STM32_TIM16_CHANNELS 1
  160. #define STM32_HAS_TIM17 TRUE
  161. #define STM32_TIM17_IS_32BITS FALSE
  162. #define STM32_TIM17_CHANNELS 1
  163. #define STM32_HAS_TIM5 FALSE
  164. #define STM32_HAS_TIM8 FALSE
  165. #define STM32_HAS_TIM9 FALSE
  166. #define STM32_HAS_TIM10 FALSE
  167. #define STM32_HAS_TIM11 FALSE
  168. #define STM32_HAS_TIM12 FALSE
  169. #define STM32_HAS_TIM13 FALSE
  170. #define STM32_HAS_TIM14 FALSE
  171. #define STM32_HAS_TIM18 FALSE
  172. #define STM32_HAS_TIM19 FALSE
  173. #define STM32_HAS_TIM20 FALSE
  174. #define STM32_HAS_TIM21 FALSE
  175. #define STM32_HAS_TIM22 FALSE
  176. /* USART attributes.*/
  177. #define STM32_HAS_USART1 TRUE
  178. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  179. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  180. #define STM32_HAS_USART2 TRUE
  181. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  182. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  183. #define STM32_HAS_USART3 TRUE
  184. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  185. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  186. #define STM32_HAS_UART4 FALSE
  187. #define STM32_HAS_UART5 FALSE
  188. #define STM32_HAS_USART6 FALSE
  189. #define STM32_HAS_UART7 FALSE
  190. #define STM32_HAS_UART8 FALSE
  191. #define STM32_HAS_LPUART1 FALSE
  192. /* USB attributes.*/
  193. #define STM32_HAS_USB FALSE
  194. #define STM32_HAS_OTG1 FALSE
  195. #define STM32_HAS_OTG2 FALSE
  196. /* IWDG attributes.*/
  197. #define STM32_HAS_IWDG TRUE
  198. #define STM32_IWDG_IS_WINDOWED FALSE
  199. /* LTDC attributes.*/
  200. #define STM32_HAS_LTDC FALSE
  201. /* DMA2D attributes.*/
  202. #define STM32_HAS_DMA2D FALSE
  203. /* FSMC attributes.*/
  204. #define STM32_HAS_FSMC FALSE
  205. /* CRC attributes.*/
  206. #define STM32_HAS_CRC TRUE
  207. #define STM32_CRC_PROGRAMMABLE FALSE
  208. /** @} */
  209. #endif /* defined(STM32F10X_MD_VL) */
  210. #if defined(STM32F10X_LD) || defined(__DOXYGEN__)
  211. /**
  212. * @name STM32F103 LD capabilities
  213. * @{
  214. */
  215. /* ADC attributes.*/
  216. #define STM32_HAS_ADC1 TRUE
  217. #define STM32_HAS_ADC2 TRUE
  218. #define STM32_HAS_ADC3 FALSE
  219. #define STM32_HAS_ADC4 FALSE
  220. #define STM32_HAS_SDADC1 FALSE
  221. #define STM32_HAS_SDADC2 FALSE
  222. #define STM32_HAS_SDADC3 FALSE
  223. /* CAN attributes.*/
  224. #define STM32_HAS_CAN1 TRUE
  225. #define STM32_HAS_CAN2 FALSE
  226. #define STM32_HAS_CAN3 FALSE
  227. #define STM32_CAN_MAX_FILTERS 14
  228. /* DAC attributes.*/
  229. #define STM32_HAS_DAC1_CH1 FALSE
  230. #define STM32_HAS_DAC1_CH2 FALSE
  231. #define STM32_HAS_DAC2_CH1 FALSE
  232. #define STM32_HAS_DAC2_CH2 FALSE
  233. /* DMA attributes.*/
  234. #define STM32_ADVANCED_DMA FALSE
  235. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  236. #define STM32_DMA_SUPPORTS_CSELR FALSE
  237. #define STM32_DMA1_NUM_CHANNELS 7
  238. #define STM32_DMA1_CH1_HANDLER Vector6C
  239. #define STM32_DMA1_CH2_HANDLER Vector70
  240. #define STM32_DMA1_CH3_HANDLER Vector74
  241. #define STM32_DMA1_CH4_HANDLER Vector78
  242. #define STM32_DMA1_CH5_HANDLER Vector7C
  243. #define STM32_DMA1_CH6_HANDLER Vector80
  244. #define STM32_DMA1_CH7_HANDLER Vector84
  245. #define STM32_DMA1_CH1_NUMBER 11
  246. #define STM32_DMA1_CH2_NUMBER 12
  247. #define STM32_DMA1_CH3_NUMBER 13
  248. #define STM32_DMA1_CH4_NUMBER 14
  249. #define STM32_DMA1_CH5_NUMBER 15
  250. #define STM32_DMA1_CH6_NUMBER 16
  251. #define STM32_DMA1_CH7_NUMBER 17
  252. #define STM32_DMA2_NUM_CHANNELS 0
  253. /* ETH attributes.*/
  254. #define STM32_HAS_ETH FALSE
  255. /* EXTI attributes.*/
  256. #define STM32_EXTI_NUM_LINES 19
  257. #define STM32_EXTI_IMR_MASK 0x00000000U
  258. /* GPIO attributes.*/
  259. #define STM32_HAS_GPIOA TRUE
  260. #define STM32_HAS_GPIOB TRUE
  261. #define STM32_HAS_GPIOC TRUE
  262. #define STM32_HAS_GPIOD TRUE
  263. #define STM32_HAS_GPIOE FALSE
  264. #define STM32_HAS_GPIOF FALSE
  265. #define STM32_HAS_GPIOG FALSE
  266. #define STM32_HAS_GPIOH FALSE
  267. #define STM32_HAS_GPIOI FALSE
  268. #define STM32_HAS_GPIOJ FALSE
  269. #define STM32_HAS_GPIOK FALSE
  270. /* I2C attributes.*/
  271. #define STM32_HAS_I2C1 TRUE
  272. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  273. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  274. #define STM32_HAS_I2C2 FALSE
  275. #define STM32_HAS_I2C3 FALSE
  276. #define STM32_HAS_I2C4 FALSE
  277. /* QUADSPI attributes.*/
  278. #define STM32_HAS_QUADSPI1 FALSE
  279. /* RTC attributes.*/
  280. #define STM32_HAS_RTC TRUE
  281. #define STM32_RTC_HAS_SUBSECONDS TRUE
  282. #define STM32_RTC_IS_CALENDAR FALSE
  283. /* SDIO attributes.*/
  284. #define STM32_HAS_SDIO FALSE
  285. /* SPI attributes.*/
  286. #define STM32_HAS_SPI1 TRUE
  287. #define STM32_SPI1_SUPPORTS_I2S FALSE
  288. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  289. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  290. #define STM32_HAS_SPI2 FALSE
  291. #define STM32_HAS_SPI3 FALSE
  292. #define STM32_HAS_SPI4 FALSE
  293. #define STM32_HAS_SPI5 FALSE
  294. #define STM32_HAS_SPI6 FALSE
  295. /* TIM attributes.*/
  296. #define STM32_TIM_MAX_CHANNELS 4
  297. #define STM32_HAS_TIM1 TRUE
  298. #define STM32_TIM1_IS_32BITS FALSE
  299. #define STM32_TIM1_CHANNELS 4
  300. #define STM32_HAS_TIM2 TRUE
  301. #define STM32_TIM2_IS_32BITS FALSE
  302. #define STM32_TIM2_CHANNELS 4
  303. #define STM32_HAS_TIM3 TRUE
  304. #define STM32_TIM3_IS_32BITS FALSE
  305. #define STM32_TIM3_CHANNELS 4
  306. #define STM32_HAS_TIM4 FALSE
  307. #define STM32_HAS_TIM5 FALSE
  308. #define STM32_HAS_TIM6 FALSE
  309. #define STM32_HAS_TIM7 FALSE
  310. #define STM32_HAS_TIM8 FALSE
  311. #define STM32_HAS_TIM9 FALSE
  312. #define STM32_HAS_TIM10 FALSE
  313. #define STM32_HAS_TIM11 FALSE
  314. #define STM32_HAS_TIM12 FALSE
  315. #define STM32_HAS_TIM13 FALSE
  316. #define STM32_HAS_TIM14 FALSE
  317. #define STM32_HAS_TIM15 FALSE
  318. #define STM32_HAS_TIM16 FALSE
  319. #define STM32_HAS_TIM17 FALSE
  320. #define STM32_HAS_TIM18 FALSE
  321. #define STM32_HAS_TIM19 FALSE
  322. #define STM32_HAS_TIM20 FALSE
  323. #define STM32_HAS_TIM21 FALSE
  324. #define STM32_HAS_TIM22 FALSE
  325. /* USART attributes.*/
  326. #define STM32_HAS_USART1 TRUE
  327. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  328. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  329. #define STM32_HAS_USART2 TRUE
  330. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  331. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  332. #define STM32_HAS_USART3 FALSE
  333. #define STM32_HAS_UART4 FALSE
  334. #define STM32_HAS_UART5 FALSE
  335. #define STM32_HAS_USART6 FALSE
  336. #define STM32_HAS_UART7 FALSE
  337. #define STM32_HAS_UART8 FALSE
  338. #define STM32_HAS_LPUART1 FALSE
  339. /* USB attributes.*/
  340. #define STM32_HAS_USB FALSE
  341. #define STM32_HAS_OTG1 FALSE
  342. #define STM32_HAS_OTG2 FALSE
  343. /* IWDG attributes.*/
  344. #define STM32_HAS_IWDG TRUE
  345. #define STM32_IWDG_IS_WINDOWED FALSE
  346. /* LTDC attributes.*/
  347. #define STM32_HAS_LTDC FALSE
  348. /* DMA2D attributes.*/
  349. #define STM32_HAS_DMA2D FALSE
  350. /* FSMC attributes.*/
  351. #define STM32_HAS_FSMC FALSE
  352. /* CRC attributes.*/
  353. #define STM32_HAS_CRC TRUE
  354. #define STM32_CRC_PROGRAMMABLE FALSE
  355. /** @} */
  356. #endif /* defined(STM32F10X_LD) */
  357. #if defined(STM32F10X_MD) || defined(__DOXYGEN__)
  358. /**
  359. * @name STM32F103 MD capabilities
  360. * @{
  361. */
  362. /* ADC attributes.*/
  363. #define STM32_HAS_ADC1 TRUE
  364. #define STM32_HAS_ADC2 TRUE
  365. #define STM32_HAS_ADC3 FALSE
  366. #define STM32_HAS_ADC4 FALSE
  367. #define STM32_HAS_SDADC1 FALSE
  368. #define STM32_HAS_SDADC2 FALSE
  369. #define STM32_HAS_SDADC3 FALSE
  370. /* CAN attributes.*/
  371. #define STM32_HAS_CAN1 TRUE
  372. #define STM32_HAS_CAN2 FALSE
  373. #define STM32_HAS_CAN3 FALSE
  374. #define STM32_CAN_MAX_FILTERS 14
  375. /* DAC attributes.*/
  376. #define STM32_HAS_DAC1_CH1 FALSE
  377. #define STM32_HAS_DAC1_CH2 FALSE
  378. #define STM32_HAS_DAC2_CH1 FALSE
  379. #define STM32_HAS_DAC2_CH2 FALSE
  380. /* DMA attributes.*/
  381. #define STM32_ADVANCED_DMA FALSE
  382. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  383. #define STM32_DMA_SUPPORTS_CSELR FALSE
  384. #define STM32_DMA1_NUM_CHANNELS 7
  385. #define STM32_DMA1_CH1_HANDLER Vector6C
  386. #define STM32_DMA1_CH2_HANDLER Vector70
  387. #define STM32_DMA1_CH3_HANDLER Vector74
  388. #define STM32_DMA1_CH4_HANDLER Vector78
  389. #define STM32_DMA1_CH5_HANDLER Vector7C
  390. #define STM32_DMA1_CH6_HANDLER Vector80
  391. #define STM32_DMA1_CH7_HANDLER Vector84
  392. #define STM32_DMA1_CH1_NUMBER 11
  393. #define STM32_DMA1_CH2_NUMBER 12
  394. #define STM32_DMA1_CH3_NUMBER 13
  395. #define STM32_DMA1_CH4_NUMBER 14
  396. #define STM32_DMA1_CH5_NUMBER 15
  397. #define STM32_DMA1_CH6_NUMBER 16
  398. #define STM32_DMA1_CH7_NUMBER 17
  399. #define STM32_DMA2_NUM_CHANNELS 0
  400. /* ETH attributes.*/
  401. #define STM32_HAS_ETH FALSE
  402. /* EXTI attributes.*/
  403. #define STM32_EXTI_NUM_LINES 19
  404. #define STM32_EXTI_IMR_MASK 0x00000000U
  405. /* GPIO attributes.*/
  406. #define STM32_HAS_GPIOA TRUE
  407. #define STM32_HAS_GPIOB TRUE
  408. #define STM32_HAS_GPIOC TRUE
  409. #define STM32_HAS_GPIOD TRUE
  410. #define STM32_HAS_GPIOE TRUE
  411. #define STM32_HAS_GPIOF FALSE
  412. #define STM32_HAS_GPIOG FALSE
  413. #define STM32_HAS_GPIOH FALSE
  414. #define STM32_HAS_GPIOI FALSE
  415. #define STM32_HAS_GPIOJ FALSE
  416. #define STM32_HAS_GPIOK FALSE
  417. /* I2C attributes.*/
  418. #define STM32_HAS_I2C1 TRUE
  419. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  420. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  421. #define STM32_HAS_I2C2 TRUE
  422. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  423. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  424. #define STM32_HAS_I2C3 FALSE
  425. #define STM32_HAS_I2C4 FALSE
  426. /* QUADSPI attributes.*/
  427. #define STM32_HAS_QUADSPI1 FALSE
  428. /* RTC attributes.*/
  429. #define STM32_HAS_RTC TRUE
  430. #define STM32_RTC_HAS_SUBSECONDS TRUE
  431. #define STM32_RTC_IS_CALENDAR FALSE
  432. /* SDIO attributes.*/
  433. #define STM32_HAS_SDIO FALSE
  434. /* SPI attributes.*/
  435. #define STM32_HAS_SPI1 TRUE
  436. #define STM32_SPI1_SUPPORTS_I2S FALSE
  437. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  438. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  439. #define STM32_HAS_SPI2 TRUE
  440. #define STM32_SPI2_SUPPORTS_I2S FALSE
  441. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  442. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  443. #define STM32_HAS_SPI3 FALSE
  444. #define STM32_HAS_SPI4 FALSE
  445. #define STM32_HAS_SPI5 FALSE
  446. #define STM32_HAS_SPI6 FALSE
  447. /* TIM attributes.*/
  448. #define STM32_TIM_MAX_CHANNELS 4
  449. #define STM32_HAS_TIM1 TRUE
  450. #define STM32_TIM1_IS_32BITS FALSE
  451. #define STM32_TIM1_CHANNELS 4
  452. #define STM32_HAS_TIM2 TRUE
  453. #define STM32_TIM2_IS_32BITS FALSE
  454. #define STM32_TIM2_CHANNELS 4
  455. #define STM32_HAS_TIM3 TRUE
  456. #define STM32_TIM3_IS_32BITS FALSE
  457. #define STM32_TIM3_CHANNELS 4
  458. #define STM32_HAS_TIM4 TRUE
  459. #define STM32_TIM4_IS_32BITS FALSE
  460. #define STM32_TIM4_CHANNELS 4
  461. #define STM32_HAS_TIM5 FALSE
  462. #define STM32_HAS_TIM6 FALSE
  463. #define STM32_HAS_TIM7 FALSE
  464. #define STM32_HAS_TIM8 FALSE
  465. #define STM32_HAS_TIM9 FALSE
  466. #define STM32_HAS_TIM10 FALSE
  467. #define STM32_HAS_TIM11 FALSE
  468. #define STM32_HAS_TIM12 FALSE
  469. #define STM32_HAS_TIM13 FALSE
  470. #define STM32_HAS_TIM14 FALSE
  471. #define STM32_HAS_TIM15 FALSE
  472. #define STM32_HAS_TIM16 FALSE
  473. #define STM32_HAS_TIM17 FALSE
  474. #define STM32_HAS_TIM18 FALSE
  475. #define STM32_HAS_TIM19 FALSE
  476. #define STM32_HAS_TIM20 FALSE
  477. #define STM32_HAS_TIM21 FALSE
  478. #define STM32_HAS_TIM22 FALSE
  479. /* USART attributes.*/
  480. #define STM32_HAS_USART1 TRUE
  481. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  482. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  483. #define STM32_HAS_USART2 TRUE
  484. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  485. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  486. #define STM32_HAS_USART3 TRUE
  487. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  488. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  489. #define STM32_HAS_UART4 FALSE
  490. #define STM32_HAS_UART5 FALSE
  491. #define STM32_HAS_USART6 FALSE
  492. #define STM32_HAS_UART7 FALSE
  493. #define STM32_HAS_UART8 FALSE
  494. #define STM32_HAS_LPUART1 FALSE
  495. /* USB attributes.*/
  496. #define STM32_HAS_USB TRUE
  497. #define STM32_USB_ACCESS_SCHEME_2x16 FALSE
  498. #define STM32_USB_PMA_SIZE 512
  499. #define STM32_USB_HAS_BCDR FALSE
  500. #define STM32_HAS_OTG1 FALSE
  501. #define STM32_HAS_OTG2 FALSE
  502. /* IWDG attributes.*/
  503. #define STM32_HAS_IWDG TRUE
  504. #define STM32_IWDG_IS_WINDOWED FALSE
  505. /* LTDC attributes.*/
  506. #define STM32_HAS_LTDC FALSE
  507. /* DMA2D attributes.*/
  508. #define STM32_HAS_DMA2D FALSE
  509. /* FSMC attributes.*/
  510. #define STM32_HAS_FSMC FALSE
  511. /* CRC attributes.*/
  512. #define STM32_HAS_CRC TRUE
  513. #define STM32_CRC_PROGRAMMABLE FALSE
  514. /** @} */
  515. #endif /* defined(STM32F10X_MD) */
  516. #if defined(STM32F10X_HD) || defined(__DOXYGEN__)
  517. /**
  518. * @name STM32F103 HD capabilities
  519. * @{
  520. */
  521. /* ADC attributes.*/
  522. #define STM32_HAS_ADC1 TRUE
  523. #define STM32_HAS_ADC2 TRUE
  524. #define STM32_HAS_ADC3 TRUE
  525. #define STM32_HAS_ADC4 FALSE
  526. #define STM32_HAS_SDADC1 FALSE
  527. #define STM32_HAS_SDADC2 FALSE
  528. #define STM32_HAS_SDADC3 FALSE
  529. /* CAN attributes.*/
  530. #define STM32_HAS_CAN1 TRUE
  531. #define STM32_HAS_CAN2 FALSE
  532. #define STM32_HAS_CAN3 FALSE
  533. #define STM32_CAN_MAX_FILTERS 14
  534. /* DAC attributes.*/
  535. #define STM32_HAS_DAC1_CH1 TRUE
  536. #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  537. #define STM32_HAS_DAC1_CH2 TRUE
  538. #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
  539. #define STM32_HAS_DAC2_CH1 FALSE
  540. #define STM32_HAS_DAC2_CH2 FALSE
  541. /* DMA attributes.*/
  542. #define STM32_ADVANCED_DMA FALSE
  543. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  544. #define STM32_DMA_SUPPORTS_CSELR FALSE
  545. #define STM32_DMA1_NUM_CHANNELS 7
  546. #define STM32_DMA1_CH1_HANDLER Vector6C
  547. #define STM32_DMA1_CH2_HANDLER Vector70
  548. #define STM32_DMA1_CH3_HANDLER Vector74
  549. #define STM32_DMA1_CH4_HANDLER Vector78
  550. #define STM32_DMA1_CH5_HANDLER Vector7C
  551. #define STM32_DMA1_CH6_HANDLER Vector80
  552. #define STM32_DMA1_CH7_HANDLER Vector84
  553. #define STM32_DMA1_CH1_NUMBER 11
  554. #define STM32_DMA1_CH2_NUMBER 12
  555. #define STM32_DMA1_CH3_NUMBER 13
  556. #define STM32_DMA1_CH4_NUMBER 14
  557. #define STM32_DMA1_CH5_NUMBER 15
  558. #define STM32_DMA1_CH6_NUMBER 16
  559. #define STM32_DMA1_CH7_NUMBER 17
  560. #define STM32_DMA2_NUM_CHANNELS 5
  561. #define STM32_DMA2_CH1_HANDLER Vector120
  562. #define STM32_DMA2_CH2_HANDLER Vector124
  563. #define STM32_DMA2_CH3_HANDLER Vector128
  564. #define STM32_DMA2_CH45_HANDLER Vector12C
  565. #define STM32_DMA2_CH1_NUMBER 56
  566. #define STM32_DMA2_CH2_NUMBER 57
  567. #define STM32_DMA2_CH3_NUMBER 58
  568. #define STM32_DMA2_CH45_NUMBER 59
  569. #define STM32_DMA2_CH4_NUMBER STM32_DMA2_CH45_NUMBER
  570. #define STM32_DMA2_CH5_NUMBER STM32_DMA2_CH45_NUMBER
  571. #define DMA2_CH4_CMASK 0x00000C00U
  572. #define DMA2_CH5_CMASK 0x00000C00U
  573. /* ETH attributes.*/
  574. #define STM32_HAS_ETH FALSE
  575. /* EXTI attributes.*/
  576. #define STM32_EXTI_NUM_LINES 19
  577. #define STM32_EXTI_IMR_MASK 0x00000000U
  578. /* GPIO attributes.*/
  579. #define STM32_HAS_GPIOA TRUE
  580. #define STM32_HAS_GPIOB TRUE
  581. #define STM32_HAS_GPIOC TRUE
  582. #define STM32_HAS_GPIOD TRUE
  583. #define STM32_HAS_GPIOE TRUE
  584. #define STM32_HAS_GPIOF TRUE
  585. #define STM32_HAS_GPIOG TRUE
  586. #define STM32_HAS_GPIOH FALSE
  587. #define STM32_HAS_GPIOI FALSE
  588. #define STM32_HAS_GPIOJ FALSE
  589. #define STM32_HAS_GPIOK FALSE
  590. /* I2C attributes.*/
  591. #define STM32_HAS_I2C1 TRUE
  592. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  593. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  594. #define STM32_HAS_I2C2 TRUE
  595. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  596. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  597. #define STM32_HAS_I2C3 FALSE
  598. #define STM32_HAS_I2C4 FALSE
  599. /* QUADSPI attributes.*/
  600. #define STM32_HAS_QUADSPI1 FALSE
  601. /* RTC attributes.*/
  602. #define STM32_HAS_RTC TRUE
  603. #define STM32_RTC_HAS_SUBSECONDS TRUE
  604. #define STM32_RTC_IS_CALENDAR FALSE
  605. /* SDIO attributes.*/
  606. #define STM32_HAS_SDIO TRUE
  607. #define STM32_SDC_SDIO_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
  608. /* SPI attributes.*/
  609. #define STM32_HAS_SPI1 TRUE
  610. #define STM32_SPI1_SUPPORTS_I2S FALSE
  611. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  612. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  613. #define STM32_HAS_SPI2 TRUE
  614. #define STM32_SPI2_SUPPORTS_I2S TRUE
  615. #define STM32_SPI2_I2S_FULLDUPLEX FALSE
  616. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  617. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  618. #define STM32_HAS_SPI3 TRUE
  619. #define STM32_SPI3_SUPPORTS_I2S TRUE
  620. #define STM32_SPI3_I2S_FULLDUPLEX FALSE
  621. #define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
  622. #define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
  623. #define STM32_HAS_SPI4 FALSE
  624. #define STM32_HAS_SPI5 FALSE
  625. #define STM32_HAS_SPI6 FALSE
  626. /* TIM attributes.*/
  627. #define STM32_TIM_MAX_CHANNELS 4
  628. #define STM32_HAS_TIM1 TRUE
  629. #define STM32_TIM1_IS_32BITS FALSE
  630. #define STM32_TIM1_CHANNELS 4
  631. #define STM32_HAS_TIM2 TRUE
  632. #define STM32_TIM2_IS_32BITS FALSE
  633. #define STM32_TIM2_CHANNELS 4
  634. #define STM32_HAS_TIM3 TRUE
  635. #define STM32_TIM3_IS_32BITS FALSE
  636. #define STM32_TIM3_CHANNELS 4
  637. #define STM32_HAS_TIM4 TRUE
  638. #define STM32_TIM4_IS_32BITS FALSE
  639. #define STM32_TIM4_CHANNELS 4
  640. #define STM32_HAS_TIM5 TRUE
  641. #define STM32_TIM5_IS_32BITS FALSE
  642. #define STM32_TIM5_CHANNELS 4
  643. #define STM32_HAS_TIM6 TRUE
  644. #define STM32_TIM6_IS_32BITS FALSE
  645. #define STM32_TIM6_CHANNELS 0
  646. #define STM32_HAS_TIM7 TRUE
  647. #define STM32_TIM7_IS_32BITS FALSE
  648. #define STM32_TIM7_CHANNELS 0
  649. #define STM32_HAS_TIM8 TRUE
  650. #define STM32_TIM8_IS_32BITS FALSE
  651. #define STM32_TIM8_CHANNELS 4
  652. #define STM32_HAS_TIM9 FALSE
  653. #define STM32_HAS_TIM10 FALSE
  654. #define STM32_HAS_TIM11 FALSE
  655. #define STM32_HAS_TIM12 FALSE
  656. #define STM32_HAS_TIM13 FALSE
  657. #define STM32_HAS_TIM14 FALSE
  658. #define STM32_HAS_TIM15 FALSE
  659. #define STM32_HAS_TIM16 FALSE
  660. #define STM32_HAS_TIM17 FALSE
  661. #define STM32_HAS_TIM18 FALSE
  662. #define STM32_HAS_TIM19 FALSE
  663. #define STM32_HAS_TIM20 FALSE
  664. #define STM32_HAS_TIM21 FALSE
  665. #define STM32_HAS_TIM22 FALSE
  666. /* USART attributes.*/
  667. #define STM32_HAS_USART1 TRUE
  668. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  669. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  670. #define STM32_HAS_USART2 TRUE
  671. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  672. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  673. #define STM32_HAS_USART3 TRUE
  674. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  675. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  676. #define STM32_HAS_UART4 TRUE
  677. #define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  678. #define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
  679. #define STM32_HAS_UART5 FALSE
  680. #define STM32_HAS_USART6 FALSE
  681. #define STM32_HAS_UART7 FALSE
  682. #define STM32_HAS_UART8 FALSE
  683. #define STM32_HAS_LPUART1 FALSE
  684. /* USB attributes.*/
  685. #define STM32_HAS_USB TRUE
  686. #define STM32_USB_ACCESS_SCHEME_2x16 FALSE
  687. #define STM32_USB_PMA_SIZE 512
  688. #define STM32_USB_HAS_BCDR FALSE
  689. #define STM32_HAS_OTG1 FALSE
  690. #define STM32_HAS_OTG2 FALSE
  691. /* IWDG attributes.*/
  692. #define STM32_HAS_IWDG TRUE
  693. #define STM32_IWDG_IS_WINDOWED FALSE
  694. /* LTDC attributes.*/
  695. #define STM32_HAS_LTDC FALSE
  696. /* DMA2D attributes.*/
  697. #define STM32_HAS_DMA2D FALSE
  698. /* FSMC attributes.*/
  699. #define STM32_HAS_FSMC TRUE
  700. #define STM32_FSMC_IS_FMC FALSE
  701. #define STM32_FSMC_HANDLER Vector100
  702. #define STM32_FSMC_NUMBER 48
  703. /* CRC attributes.*/
  704. #define STM32_HAS_CRC TRUE
  705. #define STM32_CRC_PROGRAMMABLE FALSE
  706. /** @} */
  707. #endif /* defined(STM32F10X_HD) */
  708. #if defined(STM32F10X_XL) || defined(__DOXYGEN__)
  709. /**
  710. * @name STM32F103 XL capabilities
  711. * @{
  712. */
  713. /* ADC attributes.*/
  714. #define STM32_HAS_ADC1 TRUE
  715. #define STM32_HAS_ADC2 TRUE
  716. #define STM32_HAS_ADC3 TRUE
  717. #define STM32_HAS_ADC4 FALSE
  718. #define STM32_HAS_SDADC1 FALSE
  719. #define STM32_HAS_SDADC2 FALSE
  720. #define STM32_HAS_SDADC3 FALSE
  721. /* CAN attributes.*/
  722. #define STM32_HAS_CAN1 TRUE
  723. #define STM32_HAS_CAN2 FALSE
  724. #define STM32_HAS_CAN3 FALSE
  725. #define STM32_CAN_MAX_FILTERS 14
  726. /* DAC attributes.*/
  727. #define STM32_HAS_DAC1_CH1 TRUE
  728. #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  729. #define STM32_HAS_DAC1_CH2 TRUE
  730. #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
  731. #define STM32_HAS_DAC2_CH1 FALSE
  732. #define STM32_HAS_DAC2_CH2 FALSE
  733. /* DMA attributes.*/
  734. #define STM32_ADVANCED_DMA FALSE
  735. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  736. #define STM32_DMA_SUPPORTS_CSELR FALSE
  737. #define STM32_DMA1_NUM_CHANNELS 7
  738. #define STM32_DMA1_CH1_HANDLER Vector6C
  739. #define STM32_DMA1_CH2_HANDLER Vector70
  740. #define STM32_DMA1_CH3_HANDLER Vector74
  741. #define STM32_DMA1_CH4_HANDLER Vector78
  742. #define STM32_DMA1_CH5_HANDLER Vector7C
  743. #define STM32_DMA1_CH6_HANDLER Vector80
  744. #define STM32_DMA1_CH7_HANDLER Vector84
  745. #define STM32_DMA1_CH1_NUMBER 11
  746. #define STM32_DMA1_CH2_NUMBER 12
  747. #define STM32_DMA1_CH3_NUMBER 13
  748. #define STM32_DMA1_CH4_NUMBER 14
  749. #define STM32_DMA1_CH5_NUMBER 15
  750. #define STM32_DMA1_CH6_NUMBER 16
  751. #define STM32_DMA1_CH7_NUMBER 17
  752. #define STM32_DMA2_NUM_CHANNELS 5
  753. #define STM32_DMA2_CH1_HANDLER Vector120
  754. #define STM32_DMA2_CH2_HANDLER Vector124
  755. #define STM32_DMA2_CH3_HANDLER Vector128
  756. #define STM32_DMA2_CH4_HANDLER Vector12C
  757. #define STM32_DMA2_CH5_HANDLER Vector130
  758. #define STM32_DMA2_CH1_NUMBER 56
  759. #define STM32_DMA2_CH2_NUMBER 57
  760. #define STM32_DMA2_CH3_NUMBER 58
  761. #define STM32_DMA2_CH4_NUMBER 59
  762. #define STM32_DMA2_CH5_NUMBER 60
  763. /* ETH attributes.*/
  764. #define STM32_HAS_ETH FALSE
  765. /* EXTI attributes.*/
  766. #define STM32_EXTI_NUM_LINES 19
  767. #define STM32_EXTI_IMR_MASK 0x00000000U
  768. /* GPIO attributes.*/
  769. #define STM32_HAS_GPIOA TRUE
  770. #define STM32_HAS_GPIOB TRUE
  771. #define STM32_HAS_GPIOC TRUE
  772. #define STM32_HAS_GPIOD TRUE
  773. #define STM32_HAS_GPIOE TRUE
  774. #define STM32_HAS_GPIOF TRUE
  775. #define STM32_HAS_GPIOG TRUE
  776. #define STM32_HAS_GPIOH FALSE
  777. #define STM32_HAS_GPIOI FALSE
  778. #define STM32_HAS_GPIOJ FALSE
  779. #define STM32_HAS_GPIOK FALSE
  780. /* I2C attributes.*/
  781. #define STM32_HAS_I2C1 TRUE
  782. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  783. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  784. #define STM32_HAS_I2C2 TRUE
  785. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  786. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  787. #define STM32_HAS_I2C3 FALSE
  788. #define STM32_HAS_I2C4 FALSE
  789. /* QUADSPI attributes.*/
  790. #define STM32_HAS_QUADSPI1 FALSE
  791. /* RTC attributes.*/
  792. #define STM32_HAS_RTC TRUE
  793. #define STM32_RTC_HAS_SUBSECONDS TRUE
  794. #define STM32_RTC_IS_CALENDAR FALSE
  795. /* SDIO attributes.*/
  796. #define STM32_HAS_SDIO TRUE
  797. #define STM32_SDC_SDIO_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
  798. /* SPI attributes.*/
  799. #define STM32_HAS_SPI1 TRUE
  800. #define STM32_SPI1_SUPPORTS_I2S FALSE
  801. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  802. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  803. #define STM32_HAS_SPI2 TRUE
  804. #define STM32_SPI2_SUPPORTS_I2S TRUE
  805. #define STM32_SPI2_I2S_FULLDUPLEX FALSE
  806. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  807. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  808. #define STM32_HAS_SPI3 TRUE
  809. #define STM32_SPI3_SUPPORTS_I2S TRUE
  810. #define STM32_SPI3_I2S_FULLDUPLEX FALSE
  811. #define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
  812. #define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
  813. #define STM32_HAS_SPI4 FALSE
  814. #define STM32_HAS_SPI5 FALSE
  815. #define STM32_HAS_SPI6 FALSE
  816. /* TIM attributes.*/
  817. #define STM32_TIM_MAX_CHANNELS 4
  818. #define STM32_HAS_TIM1 TRUE
  819. #define STM32_TIM1_IS_32BITS FALSE
  820. #define STM32_TIM1_CHANNELS 4
  821. #define STM32_HAS_TIM2 TRUE
  822. #define STM32_TIM2_IS_32BITS FALSE
  823. #define STM32_TIM2_CHANNELS 4
  824. #define STM32_HAS_TIM3 TRUE
  825. #define STM32_TIM3_IS_32BITS FALSE
  826. #define STM32_TIM3_CHANNELS 4
  827. #define STM32_HAS_TIM4 TRUE
  828. #define STM32_TIM4_IS_32BITS FALSE
  829. #define STM32_TIM4_CHANNELS 4
  830. #define STM32_HAS_TIM5 TRUE
  831. #define STM32_TIM5_IS_32BITS FALSE
  832. #define STM32_TIM5_CHANNELS 4
  833. #define STM32_HAS_TIM6 TRUE
  834. #define STM32_TIM6_IS_32BITS FALSE
  835. #define STM32_TIM6_CHANNELS 0
  836. #define STM32_HAS_TIM7 TRUE
  837. #define STM32_TIM7_IS_32BITS FALSE
  838. #define STM32_TIM7_CHANNELS 0
  839. #define STM32_HAS_TIM8 TRUE
  840. #define STM32_TIM8_IS_32BITS FALSE
  841. #define STM32_TIM8_CHANNELS 4
  842. #define STM32_HAS_TIM9 TRUE
  843. #define STM32_TIM9_IS_32BITS FALSE
  844. #define STM32_TIM9_CHANNELS 2
  845. #define STM32_HAS_TIM10 TRUE
  846. #define STM32_TIM10_IS_32BITS FALSE
  847. #define STM32_TIM10_CHANNELS 1
  848. #define STM32_HAS_TIM11 TRUE
  849. #define STM32_TIM11_IS_32BITS FALSE
  850. #define STM32_TIM11_CHANNELS 1
  851. #define STM32_HAS_TIM12 TRUE
  852. #define STM32_TIM12_IS_32BITS FALSE
  853. #define STM32_TIM12_CHANNELS 2
  854. #define STM32_HAS_TIM13 TRUE
  855. #define STM32_TIM13_IS_32BITS FALSE
  856. #define STM32_TIM13_CHANNELS 1
  857. #define STM32_HAS_TIM14 TRUE
  858. #define STM32_TIM14_IS_32BITS FALSE
  859. #define STM32_TIM14_CHANNELS 1
  860. #define STM32_HAS_TIM15 FALSE
  861. #define STM32_HAS_TIM16 FALSE
  862. #define STM32_HAS_TIM17 FALSE
  863. #define STM32_HAS_TIM18 FALSE
  864. #define STM32_HAS_TIM19 FALSE
  865. #define STM32_HAS_TIM20 FALSE
  866. #define STM32_HAS_TIM21 FALSE
  867. #define STM32_HAS_TIM22 FALSE
  868. /* USART attributes.*/
  869. #define STM32_HAS_USART1 TRUE
  870. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  871. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  872. #define STM32_HAS_USART2 TRUE
  873. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  874. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  875. #define STM32_HAS_USART3 TRUE
  876. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  877. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  878. #define STM32_HAS_UART4 TRUE
  879. #define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  880. #define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
  881. #define STM32_HAS_UART5 FALSE
  882. #define STM32_HAS_USART6 FALSE
  883. #define STM32_HAS_UART7 FALSE
  884. #define STM32_HAS_UART8 FALSE
  885. #define STM32_HAS_LPUART1 FALSE
  886. /* USB attributes.*/
  887. #define STM32_HAS_USB TRUE
  888. #define STM32_USB_ACCESS_SCHEME_2x16 FALSE
  889. #define STM32_USB_PMA_SIZE 512
  890. #define STM32_USB_HAS_BCDR FALSE
  891. #define STM32_HAS_OTG1 FALSE
  892. #define STM32_HAS_OTG2 FALSE
  893. /* IWDG attributes.*/
  894. #define STM32_HAS_IWDG TRUE
  895. #define STM32_IWDG_IS_WINDOWED FALSE
  896. /* LTDC attributes.*/
  897. #define STM32_HAS_LTDC FALSE
  898. /* DMA2D attributes.*/
  899. #define STM32_HAS_DMA2D FALSE
  900. /* FSMC attributes.*/
  901. #define STM32_HAS_FSMC TRUE
  902. #define STM32_FSMC_IS_FMC FALSE
  903. #define STM32_FSMC_HANDLER Vector100
  904. #define STM32_FSMC_NUMBER 48
  905. /* CRC attributes.*/
  906. #define STM32_HAS_CRC TRUE
  907. #define STM32_CRC_PROGRAMMABLE FALSE
  908. /** @} */
  909. #endif /* defined(STM32F10X_XL) */
  910. #if defined(STM32F10X_CL) || defined(__DOXYGEN__)
  911. /**
  912. * @name STM32F105/F107 CL capabilities
  913. * @{
  914. */
  915. /* ADC attributes.*/
  916. #define STM32_HAS_ADC1 TRUE
  917. #define STM32_HAS_ADC2 TRUE
  918. #define STM32_HAS_ADC3 FALSE
  919. #define STM32_HAS_ADC4 FALSE
  920. #define STM32_HAS_SDADC1 FALSE
  921. #define STM32_HAS_SDADC2 FALSE
  922. #define STM32_HAS_SDADC3 FALSE
  923. /* CAN attributes.*/
  924. #define STM32_HAS_CAN1 TRUE
  925. #define STM32_HAS_CAN2 TRUE
  926. #define STM32_HAS_CAN3 FALSE
  927. #define STM32_CAN_MAX_FILTERS 28
  928. /* DAC attributes.*/
  929. #define STM32_HAS_DAC1_CH1 TRUE
  930. #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  931. #define STM32_HAS_DAC1_CH2 TRUE
  932. #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
  933. #define STM32_HAS_DAC2_CH1 FALSE
  934. #define STM32_HAS_DAC2_CH2 FALSE
  935. /* DMA attributes.*/
  936. #define STM32_ADVANCED_DMA FALSE
  937. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  938. #define STM32_DMA_SUPPORTS_CSELR FALSE
  939. #define STM32_DMA1_NUM_CHANNELS 7
  940. #define STM32_DMA1_CH1_HANDLER Vector6C
  941. #define STM32_DMA1_CH2_HANDLER Vector70
  942. #define STM32_DMA1_CH3_HANDLER Vector74
  943. #define STM32_DMA1_CH4_HANDLER Vector78
  944. #define STM32_DMA1_CH5_HANDLER Vector7C
  945. #define STM32_DMA1_CH6_HANDLER Vector80
  946. #define STM32_DMA1_CH7_HANDLER Vector84
  947. #define STM32_DMA1_CH1_NUMBER 11
  948. #define STM32_DMA1_CH2_NUMBER 12
  949. #define STM32_DMA1_CH3_NUMBER 13
  950. #define STM32_DMA1_CH4_NUMBER 14
  951. #define STM32_DMA1_CH5_NUMBER 15
  952. #define STM32_DMA1_CH6_NUMBER 16
  953. #define STM32_DMA1_CH7_NUMBER 17
  954. #define STM32_DMA2_NUM_CHANNELS 5
  955. #define STM32_DMA2_CH1_HANDLER Vector120
  956. #define STM32_DMA2_CH2_HANDLER Vector124
  957. #define STM32_DMA2_CH3_HANDLER Vector128
  958. #define STM32_DMA2_CH4_HANDLER Vector12C
  959. #define STM32_DMA2_CH5_HANDLER Vector130
  960. #define STM32_DMA2_CH1_NUMBER 56
  961. #define STM32_DMA2_CH2_NUMBER 57
  962. #define STM32_DMA2_CH3_NUMBER 58
  963. #define STM32_DMA2_CH4_NUMBER 59
  964. #define STM32_DMA2_CH5_NUMBER 60
  965. /* ETH attributes.*/
  966. #define STM32_HAS_ETH TRUE
  967. #define STM32_ETH_HANDLER Vector134
  968. #define STM32_ETH_NUMBER 61
  969. /* EXTI attributes.*/
  970. #define STM32_EXTI_NUM_LINES 20
  971. #define STM32_EXTI_IMR_MASK 0x00000000U
  972. /* GPIO attributes.*/
  973. #define STM32_HAS_GPIOA TRUE
  974. #define STM32_HAS_GPIOB TRUE
  975. #define STM32_HAS_GPIOC TRUE
  976. #define STM32_HAS_GPIOD TRUE
  977. #define STM32_HAS_GPIOE TRUE
  978. #define STM32_HAS_GPIOF FALSE
  979. #define STM32_HAS_GPIOG FALSE
  980. #define STM32_HAS_GPIOH FALSE
  981. #define STM32_HAS_GPIOI FALSE
  982. #define STM32_HAS_GPIOJ FALSE
  983. #define STM32_HAS_GPIOK FALSE
  984. /* I2C attributes.*/
  985. #define STM32_HAS_I2C1 TRUE
  986. #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  987. #define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  988. #define STM32_HAS_I2C2 TRUE
  989. #define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  990. #define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  991. #define STM32_HAS_I2C3 FALSE
  992. #define STM32_HAS_I2C4 FALSE
  993. /* QUADSPI attributes.*/
  994. #define STM32_HAS_QUADSPI1 FALSE
  995. /* RTC attributes.*/
  996. #define STM32_HAS_RTC TRUE
  997. #define STM32_RTC_HAS_SUBSECONDS TRUE
  998. #define STM32_RTC_IS_CALENDAR FALSE
  999. /* SDIO attributes.*/
  1000. #define STM32_HAS_SDIO FALSE
  1001. /* SPI attributes.*/
  1002. #define STM32_HAS_SPI1 TRUE
  1003. #define STM32_SPI1_SUPPORTS_I2S FALSE
  1004. #define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  1005. #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  1006. #define STM32_HAS_SPI2 TRUE
  1007. #define STM32_SPI2_SUPPORTS_I2S TRUE
  1008. #define STM32_SPI2_I2S_FULLDUPLEX FALSE
  1009. #define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  1010. #define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  1011. #define STM32_HAS_SPI3 TRUE
  1012. #define STM32_SPI3_SUPPORTS_I2S TRUE
  1013. #define STM32_SPI3_I2S_FULLDUPLEX FALSE
  1014. #define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
  1015. #define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
  1016. #define STM32_HAS_SPI4 FALSE
  1017. #define STM32_HAS_SPI5 FALSE
  1018. #define STM32_HAS_SPI6 FALSE
  1019. /* TIM attributes.*/
  1020. #define STM32_TIM_MAX_CHANNELS 4
  1021. #define STM32_HAS_TIM1 TRUE
  1022. #define STM32_TIM1_IS_32BITS FALSE
  1023. #define STM32_TIM1_CHANNELS 4
  1024. #define STM32_HAS_TIM2 TRUE
  1025. #define STM32_TIM2_IS_32BITS FALSE
  1026. #define STM32_TIM2_CHANNELS 4
  1027. #define STM32_HAS_TIM3 TRUE
  1028. #define STM32_TIM3_IS_32BITS FALSE
  1029. #define STM32_TIM3_CHANNELS 4
  1030. #define STM32_HAS_TIM4 TRUE
  1031. #define STM32_TIM4_IS_32BITS FALSE
  1032. #define STM32_TIM4_CHANNELS 4
  1033. #define STM32_HAS_TIM5 TRUE
  1034. #define STM32_TIM5_IS_32BITS FALSE
  1035. #define STM32_TIM5_CHANNELS 4
  1036. #define STM32_HAS_TIM6 TRUE
  1037. #define STM32_TIM6_IS_32BITS FALSE
  1038. #define STM32_TIM6_CHANNELS 0
  1039. #define STM32_HAS_TIM7 TRUE
  1040. #define STM32_TIM7_IS_32BITS FALSE
  1041. #define STM32_TIM7_CHANNELS 0
  1042. #define STM32_HAS_TIM8 FALSE
  1043. #define STM32_HAS_TIM9 FALSE
  1044. #define STM32_HAS_TIM10 FALSE
  1045. #define STM32_HAS_TIM11 FALSE
  1046. #define STM32_HAS_TIM12 FALSE
  1047. #define STM32_HAS_TIM13 FALSE
  1048. #define STM32_HAS_TIM14 FALSE
  1049. #define STM32_HAS_TIM15 FALSE
  1050. #define STM32_HAS_TIM16 FALSE
  1051. #define STM32_HAS_TIM17 FALSE
  1052. #define STM32_HAS_TIM18 FALSE
  1053. #define STM32_HAS_TIM19 FALSE
  1054. #define STM32_HAS_TIM20 FALSE
  1055. #define STM32_HAS_TIM21 FALSE
  1056. #define STM32_HAS_TIM22 FALSE
  1057. /* USART attributes.*/
  1058. #define STM32_HAS_USART1 TRUE
  1059. #define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
  1060. #define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
  1061. #define STM32_HAS_USART2 TRUE
  1062. #define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
  1063. #define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
  1064. #define STM32_HAS_USART3 TRUE
  1065. #define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
  1066. #define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
  1067. #define STM32_HAS_UART4 TRUE
  1068. #define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
  1069. #define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
  1070. #define STM32_HAS_UART5 TRUE
  1071. #define STM32_HAS_USART6 FALSE
  1072. #define STM32_HAS_UART7 FALSE
  1073. #define STM32_HAS_UART8 FALSE
  1074. #define STM32_HAS_LPUART1 FALSE
  1075. /* USB attributes.*/
  1076. #define STM32_OTG_STEPPING 1
  1077. #define STM32_HAS_OTG1 TRUE
  1078. #define STM32_OTG1_ENDPOINTS 3
  1079. #define STM32_HAS_OTG2 FALSE
  1080. #define STM32_HAS_USB FALSE
  1081. /* IWDG attributes.*/
  1082. #define STM32_HAS_IWDG TRUE
  1083. #define STM32_IWDG_IS_WINDOWED FALSE
  1084. /* LTDC attributes.*/
  1085. #define STM32_HAS_LTDC FALSE
  1086. /* DMA2D attributes.*/
  1087. #define STM32_HAS_DMA2D FALSE
  1088. /* FSMC attributes.*/
  1089. #define STM32_HAS_FSMC FALSE
  1090. /* CRC attributes.*/
  1091. #define STM32_HAS_CRC TRUE
  1092. #define STM32_CRC_PROGRAMMABLE FALSE
  1093. /** @} */
  1094. #endif /* defined(STM32F10X_CL) */
  1095. #endif /* STM32_REGISTRY_H */
  1096. /** @} */