stm32_registry.h 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  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 STM32F7xx/stm32_registry.h
  15. * @brief STM32F7xx capabilities registry.
  16. *
  17. * @addtogroup HAL
  18. * @{
  19. */
  20. #ifndef STM32_REGISTRY_H
  21. #define STM32_REGISTRY_H
  22. /*===========================================================================*/
  23. /* Platform capabilities. */
  24. /*===========================================================================*/
  25. /**
  26. * @name STM32F7xx capabilities
  27. * @{
  28. */
  29. /*===========================================================================*/
  30. /* Common. */
  31. /*===========================================================================*/
  32. /* RNG attributes.*/
  33. #define STM32_HAS_RNG1 TRUE
  34. /* RTC attributes.*/
  35. #define STM32_HAS_RTC TRUE
  36. #define STM32_RTC_HAS_SUBSECONDS TRUE
  37. #define STM32_RTC_HAS_PERIODIC_WAKEUPS TRUE
  38. #define STM32_RTC_NUM_ALARMS 2
  39. #define STM32_RTC_STORAGE_SIZE 128
  40. #define STM32_RTC_TAMP_STAMP_HANDLER Vector48
  41. #define STM32_RTC_WKUP_HANDLER Vector4C
  42. #define STM32_RTC_ALARM_HANDLER VectorE4
  43. #define STM32_RTC_TAMP_STAMP_NUMBER 2
  44. #define STM32_RTC_WKUP_NUMBER 3
  45. #define STM32_RTC_ALARM_NUMBER 41
  46. #define STM32_RTC_ALARM_EXTI 17
  47. #define STM32_RTC_TAMP_STAMP_EXTI 21
  48. #define STM32_RTC_WKUP_EXTI 22
  49. #define STM32_RTC_IRQ_ENABLE() do { \
  50. nvicEnableVector(STM32_RTC_TAMP_STAMP_NUMBER, STM32_IRQ_EXTI21_PRIORITY); \
  51. nvicEnableVector(STM32_RTC_WKUP_NUMBER, STM32_IRQ_EXTI22_PRIORITY); \
  52. nvicEnableVector(STM32_RTC_ALARM_NUMBER, STM32_IRQ_EXTI17_PRIORITY); \
  53. } while (false)
  54. #if defined(STM32F732xx) || defined(STM32F733xx) || defined(STM32F756xx) || \
  55. defined(STM32F777xx) || defined(STM32F779xx) || defined(__DOXYGEN__)
  56. #define STM32_HAS_HASH1 TRUE
  57. #define STM32_HAS_AES1 TRUE
  58. #define STM32_HASH1_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  59. #define STM32_HASH1_DMA_CHN 0x20000000
  60. #else /* Devices without cryp nor hash.*/
  61. #define STM32_HAS_HASH1 FALSE
  62. #define STM32_HAS_AES1 FALSE
  63. #endif
  64. /*===========================================================================*/
  65. /* STM32F722xx, STM32F723xx, STM32F732xx, STM32F733xx. */
  66. /*===========================================================================*/
  67. #if defined(STM32F722xx) || defined(STM32F723xx) || defined(STM32F732xx) || \
  68. defined(STM32F733xx) || defined(__DOXYGEN__)
  69. /* ADC attributes.*/
  70. #define STM32_ADC_HANDLER Vector88
  71. #define STM32_ADC_NUMBER 18
  72. #define STM32_HAS_ADC1 TRUE
  73. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  74. STM32_DMA_STREAM_ID_MSK(2, 4))
  75. #define STM32_ADC1_DMA_CHN 0x00000000
  76. #define STM32_HAS_ADC2 TRUE
  77. #define STM32_ADC2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  78. STM32_DMA_STREAM_ID_MSK(2, 3))
  79. #define STM32_ADC2_DMA_CHN 0x00001100
  80. #define STM32_HAS_ADC3 TRUE
  81. #define STM32_ADC3_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  82. STM32_DMA_STREAM_ID_MSK(2, 1))
  83. #define STM32_ADC3_DMA_CHN 0x00000022
  84. #define STM32_HAS_ADC4 FALSE
  85. #define STM32_HAS_SDADC1 FALSE
  86. #define STM32_HAS_SDADC2 FALSE
  87. #define STM32_HAS_SDADC3 FALSE
  88. /* CAN attributes.*/
  89. #define STM32_CAN_MAX_FILTERS 28
  90. #define STM32_HAS_CAN1 TRUE
  91. #define STM32_CAN1_TX_HANDLER Vector8C
  92. #define STM32_CAN1_RX0_HANDLER Vector90
  93. #define STM32_CAN1_RX1_HANDLER Vector94
  94. #define STM32_CAN1_SCE_HANDLER Vector98
  95. #define STM32_CAN1_TX_NUMBER 19
  96. #define STM32_CAN1_RX0_NUMBER 20
  97. #define STM32_CAN1_RX1_NUMBER 21
  98. #define STM32_CAN1_SCE_NUMBER 22
  99. #define STM32_HAS_CAN2 FALSE
  100. #define STM32_HAS_CAN3 FALSE
  101. /* DAC attributes.*/
  102. #define STM32_HAS_DAC1_CH1 TRUE
  103. #define STM32_DAC1_CH1_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  104. #define STM32_DAC1_CH1_DMA_CHN 0x00700000
  105. #define STM32_HAS_DAC1_CH2 TRUE
  106. #define STM32_DAC1_CH2_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  107. #define STM32_DAC1_CH2_DMA_CHN 0x07000000
  108. #define STM32_HAS_DAC2_CH1 FALSE
  109. #define STM32_HAS_DAC2_CH2 FALSE
  110. /* DMA attributes.*/
  111. #define STM32_ADVANCED_DMA TRUE
  112. #define STM32_DMA_CACHE_HANDLING TRUE
  113. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  114. #define STM32_HAS_DMA1 TRUE
  115. #define STM32_DMA1_CH0_HANDLER Vector6C
  116. #define STM32_DMA1_CH1_HANDLER Vector70
  117. #define STM32_DMA1_CH2_HANDLER Vector74
  118. #define STM32_DMA1_CH3_HANDLER Vector78
  119. #define STM32_DMA1_CH4_HANDLER Vector7C
  120. #define STM32_DMA1_CH5_HANDLER Vector80
  121. #define STM32_DMA1_CH6_HANDLER Vector84
  122. #define STM32_DMA1_CH7_HANDLER VectorFC
  123. #define STM32_DMA1_CH0_NUMBER 11
  124. #define STM32_DMA1_CH1_NUMBER 12
  125. #define STM32_DMA1_CH2_NUMBER 13
  126. #define STM32_DMA1_CH3_NUMBER 14
  127. #define STM32_DMA1_CH4_NUMBER 15
  128. #define STM32_DMA1_CH5_NUMBER 16
  129. #define STM32_DMA1_CH6_NUMBER 17
  130. #define STM32_DMA1_CH7_NUMBER 47
  131. #define STM32_HAS_DMA2 TRUE
  132. #define STM32_DMA2_CH0_HANDLER Vector120
  133. #define STM32_DMA2_CH1_HANDLER Vector124
  134. #define STM32_DMA2_CH2_HANDLER Vector128
  135. #define STM32_DMA2_CH3_HANDLER Vector12C
  136. #define STM32_DMA2_CH4_HANDLER Vector130
  137. #define STM32_DMA2_CH5_HANDLER Vector150
  138. #define STM32_DMA2_CH6_HANDLER Vector154
  139. #define STM32_DMA2_CH7_HANDLER Vector158
  140. #define STM32_DMA2_CH0_NUMBER 56
  141. #define STM32_DMA2_CH1_NUMBER 57
  142. #define STM32_DMA2_CH2_NUMBER 58
  143. #define STM32_DMA2_CH3_NUMBER 59
  144. #define STM32_DMA2_CH4_NUMBER 60
  145. #define STM32_DMA2_CH5_NUMBER 68
  146. #define STM32_DMA2_CH6_NUMBER 69
  147. #define STM32_DMA2_CH7_NUMBER 70
  148. /* ETH attributes.*/
  149. #define STM32_HAS_ETH FALSE
  150. /* EXTI attributes.*/
  151. #define STM32_EXTI_NUM_LINES 24
  152. #define STM32_EXTI_IMR1_MASK 0xFF000000
  153. /* GPIO attributes.*/
  154. #define STM32_HAS_GPIOA TRUE
  155. #define STM32_HAS_GPIOB TRUE
  156. #define STM32_HAS_GPIOC TRUE
  157. #define STM32_HAS_GPIOD TRUE
  158. #define STM32_HAS_GPIOE TRUE
  159. #define STM32_HAS_GPIOH TRUE
  160. #define STM32_HAS_GPIOF TRUE
  161. #define STM32_HAS_GPIOG TRUE
  162. #define STM32_HAS_GPIOI TRUE
  163. #define STM32_HAS_GPIOJ FALSE
  164. #define STM32_HAS_GPIOK FALSE
  165. #define STM32_GPIO_EN_MASK (RCC_AHB1ENR_GPIOAEN | \
  166. RCC_AHB1ENR_GPIOBEN | \
  167. RCC_AHB1ENR_GPIOCEN | \
  168. RCC_AHB1ENR_GPIODEN | \
  169. RCC_AHB1ENR_GPIOEEN | \
  170. RCC_AHB1ENR_GPIOFEN | \
  171. RCC_AHB1ENR_GPIOGEN | \
  172. RCC_AHB1ENR_GPIOHEN | \
  173. RCC_AHB1ENR_GPIOIEN)
  174. /* I2C attributes.*/
  175. #define STM32_HAS_I2C1 TRUE
  176. #define STM32_I2C1_EVENT_HANDLER VectorBC
  177. #define STM32_I2C1_ERROR_HANDLER VectorC0
  178. #define STM32_I2C1_EVENT_NUMBER 31
  179. #define STM32_I2C1_ERROR_NUMBER 32
  180. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  181. STM32_DMA_STREAM_ID_MSK(1, 5))
  182. #define STM32_I2C1_RX_DMA_CHN 0x00100001
  183. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 7) |\
  184. STM32_DMA_STREAM_ID_MSK(1, 6))
  185. #define STM32_I2C1_TX_DMA_CHN 0x11000000
  186. #define STM32_HAS_I2C2 TRUE
  187. #define STM32_I2C2_EVENT_HANDLER VectorC4
  188. #define STM32_I2C2_ERROR_HANDLER VectorC8
  189. #define STM32_I2C2_EVENT_NUMBER 33
  190. #define STM32_I2C2_ERROR_NUMBER 34
  191. #define STM32_I2C2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  192. STM32_DMA_STREAM_ID_MSK(1, 3))
  193. #define STM32_I2C2_RX_DMA_CHN 0x00007700
  194. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 7)
  195. #define STM32_I2C2_TX_DMA_CHN 0x70000000
  196. #define STM32_HAS_I2C3 TRUE
  197. #define STM32_I2C3_EVENT_HANDLER Vector160
  198. #define STM32_I2C3_ERROR_HANDLER Vector164
  199. #define STM32_I2C3_EVENT_NUMBER 72
  200. #define STM32_I2C3_ERROR_NUMBER 73
  201. #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  202. STM32_DMA_STREAM_ID_MSK(1, 2))
  203. #define STM32_I2C3_RX_DMA_CHN 0x00000300
  204. #define STM32_I2C3_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  205. #define STM32_I2C3_TX_DMA_CHN 0x00030000
  206. #define STM32_HAS_I2C4 FALSE
  207. /* QUADSPI attributes.*/
  208. #define STM32_HAS_QUADSPI1 TRUE
  209. #define STM32_QUADSPI1_HANDLER Vector1B0
  210. #define STM32_QUADSPI1_NUMBER 92
  211. #define STM32_QUADSPI1_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  212. #define STM32_QUADSPI1_DMA_CHN 0x30000000
  213. /* RTC attributes.*/
  214. #define STM32_HAS_RTC TRUE
  215. #define STM32_RTC_HAS_SUBSECONDS TRUE
  216. #define STM32_RTC_HAS_PERIODIC_WAKEUPS TRUE
  217. #define STM32_RTC_NUM_ALARMS 2
  218. #define STM32_RTC_HAS_INTERRUPTS FALSE
  219. /* SDMMC attributes.*/
  220. #define STM32_HAS_SDMMC1 TRUE
  221. #define STM32_SDMMC1_HANDLER Vector104
  222. #define STM32_SDMMC1_NUMBER 49
  223. #define STM32_SDC_SDMMC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  224. STM32_DMA_STREAM_ID_MSK(2, 6))
  225. #define STM32_SDC_SDMMC1_DMA_CHN 0x04004000
  226. #define STM32_HAS_SDMMC2 TRUE
  227. #define STM32_SDMMC2_HANDLER Vector1DC
  228. #define STM32_SDMMC2_NUMBER 103
  229. #define STM32_SDC_SDMMC2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  230. STM32_DMA_STREAM_ID_MSK(2, 5))
  231. #define STM32_SDC_SDMMC2_DMA_CHN 0x00B0000B
  232. /* SPI attributes.*/
  233. #define STM32_HAS_SPI1 TRUE
  234. #define STM32_SPI1_SUPPORTS_I2S TRUE
  235. #define STM32_SPI1_I2S_FULLDUPLEX TRUE
  236. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  237. STM32_DMA_STREAM_ID_MSK(2, 2))
  238. #define STM32_SPI1_RX_DMA_CHN 0x00000303
  239. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  240. STM32_DMA_STREAM_ID_MSK(2, 5))
  241. #define STM32_SPI1_TX_DMA_CHN 0x00303000
  242. #define STM32_HAS_SPI2 TRUE
  243. #define STM32_SPI2_SUPPORTS_I2S TRUE
  244. #define STM32_SPI2_I2S_FULLDUPLEX TRUE
  245. #define STM32_SPI2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 3)
  246. #define STM32_SPI2_RX_DMA_CHN 0x00000000
  247. #define STM32_SPI2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  248. #define STM32_SPI2_TX_DMA_CHN 0x00000000
  249. #define STM32_HAS_SPI3 TRUE
  250. #define STM32_SPI3_SUPPORTS_I2S TRUE
  251. #define STM32_SPI3_I2S_FULLDUPLEX TRUE
  252. #define STM32_SPI3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  253. STM32_DMA_STREAM_ID_MSK(1, 2))
  254. #define STM32_SPI3_RX_DMA_CHN 0x00000000
  255. #define STM32_SPI3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  256. STM32_DMA_STREAM_ID_MSK(1, 7))
  257. #define STM32_SPI3_TX_DMA_CHN 0x00000000
  258. #define STM32_HAS_SPI4 TRUE
  259. #define STM32_SPI4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  260. STM32_DMA_STREAM_ID_MSK(2, 3))
  261. #define STM32_SPI4_RX_DMA_CHN 0x00005004
  262. #define STM32_SPI4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  263. STM32_DMA_STREAM_ID_MSK(2, 4))
  264. #define STM32_SPI4_TX_DMA_CHN 0x00050040
  265. #define STM32_HAS_SPI5 TRUE
  266. #define STM32_SPI5_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) | \
  267. STM32_DMA_STREAM_ID_MSK(2, 5))
  268. #define STM32_SPI5_RX_DMA_CHN 0x00702000
  269. #define STM32_SPI5_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 4) | \
  270. STM32_DMA_STREAM_ID_MSK(2, 6))
  271. #define STM32_SPI5_TX_DMA_CHN 0x07020000
  272. #define STM32_HAS_SPI6 FALSE
  273. /* TIM attributes.*/
  274. #define STM32_TIM_MAX_CHANNELS 6
  275. #define STM32_HAS_TIM1 TRUE
  276. #define STM32_TIM1_IS_32BITS FALSE
  277. #define STM32_TIM1_CHANNELS 6
  278. #define STM32_TIM1_UP_HANDLER VectorA4
  279. #define STM32_TIM1_CC_HANDLER VectorAC
  280. #define STM32_TIM1_UP_NUMBER 25
  281. #define STM32_TIM1_CC_NUMBER 27
  282. #define STM32_HAS_TIM2 TRUE
  283. #define STM32_TIM2_IS_32BITS TRUE
  284. #define STM32_TIM2_CHANNELS 4
  285. #define STM32_TIM2_HANDLER VectorB0
  286. #define STM32_TIM2_NUMBER 28
  287. #define STM32_HAS_TIM3 TRUE
  288. #define STM32_TIM3_IS_32BITS FALSE
  289. #define STM32_TIM3_CHANNELS 4
  290. #define STM32_TIM3_HANDLER VectorB4
  291. #define STM32_TIM3_NUMBER 29
  292. #define STM32_HAS_TIM4 TRUE
  293. #define STM32_TIM4_IS_32BITS FALSE
  294. #define STM32_TIM4_CHANNELS 4
  295. #define STM32_TIM4_HANDLER VectorB8
  296. #define STM32_TIM4_NUMBER 30
  297. #define STM32_HAS_TIM5 TRUE
  298. #define STM32_TIM5_IS_32BITS TRUE
  299. #define STM32_TIM5_CHANNELS 4
  300. #define STM32_TIM5_HANDLER Vector108
  301. #define STM32_TIM5_NUMBER 50
  302. #define STM32_HAS_TIM6 TRUE
  303. #define STM32_TIM6_IS_32BITS FALSE
  304. #define STM32_TIM6_CHANNELS 0
  305. #define STM32_TIM6_HANDLER Vector118
  306. #define STM32_TIM6_NUMBER 54
  307. #define STM32_HAS_TIM7 TRUE
  308. #define STM32_TIM7_IS_32BITS FALSE
  309. #define STM32_TIM7_CHANNELS 0
  310. #define STM32_TIM7_HANDLER Vector11C
  311. #define STM32_TIM7_NUMBER 55
  312. #define STM32_HAS_TIM8 TRUE
  313. #define STM32_TIM8_IS_32BITS FALSE
  314. #define STM32_TIM8_CHANNELS 6
  315. #define STM32_TIM8_UP_HANDLER VectorF0
  316. #define STM32_TIM8_CC_HANDLER VectorF8
  317. #define STM32_TIM8_UP_NUMBER 44
  318. #define STM32_TIM8_CC_NUMBER 46
  319. #define STM32_HAS_TIM9 TRUE
  320. #define STM32_TIM9_IS_32BITS FALSE
  321. #define STM32_TIM9_CHANNELS 2
  322. #define STM32_TIM9_HANDLER VectorA0
  323. #define STM32_TIM9_NUMBER 24
  324. #define STM32_HAS_TIM10 TRUE
  325. #define STM32_TIM10_IS_32BITS FALSE
  326. #define STM32_TIM10_CHANNELS 1
  327. #define STM32_TIM10_HANDLER VectorA4 /* Note: same as STM32_TIM1_UP */
  328. #define STM32_TIM10_NUMBER 25 /* Note: same as STM32_TIM1_UP */
  329. #define STM32_HAS_TIM11 TRUE
  330. #define STM32_TIM11_IS_32BITS FALSE
  331. #define STM32_TIM11_CHANNELS 1
  332. #define STM32_TIM11_HANDLER VectorA8
  333. #define STM32_TIM11_NUMBER 26
  334. #define STM32_HAS_TIM12 TRUE
  335. #define STM32_TIM12_IS_32BITS FALSE
  336. #define STM32_TIM12_CHANNELS 2
  337. #define STM32_TIM12_HANDLER VectorEC
  338. #define STM32_TIM12_NUMBER 43
  339. #define STM32_HAS_TIM13 TRUE
  340. #define STM32_TIM13_IS_32BITS FALSE
  341. #define STM32_TIM13_CHANNELS 1
  342. #define STM32_TIM13_HANDLER VectorF0 /* Note: same as STM32_TIM8_UP */
  343. #define STM32_TIM13_NUMBER 44 /* Note: same as STM32_TIM8_UP */
  344. #define STM32_HAS_TIM14 TRUE
  345. #define STM32_TIM14_IS_32BITS FALSE
  346. #define STM32_TIM14_CHANNELS 1
  347. #define STM32_TIM14_HANDLER VectorF4
  348. #define STM32_TIM14_NUMBER 45
  349. #define STM32_HAS_TIM15 FALSE
  350. #define STM32_HAS_TIM16 FALSE
  351. #define STM32_HAS_TIM17 FALSE
  352. #define STM32_HAS_TIM18 FALSE
  353. #define STM32_HAS_TIM19 FALSE
  354. #define STM32_HAS_TIM20 FALSE
  355. #define STM32_HAS_TIM21 FALSE
  356. #define STM32_HAS_TIM22 FALSE
  357. /* USART attributes.*/
  358. #define STM32_HAS_USART1 TRUE
  359. #define STM32_USART1_HANDLER VectorD4
  360. #define STM32_USART1_NUMBER 37
  361. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  362. STM32_DMA_STREAM_ID_MSK(2, 5))
  363. #define STM32_USART1_RX_DMA_CHN 0x00400400
  364. #define STM32_USART1_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  365. #define STM32_USART1_TX_DMA_CHN 0x40000000
  366. #define STM32_HAS_USART2 TRUE
  367. #define STM32_USART2_HANDLER VectorD8
  368. #define STM32_USART2_NUMBER 38
  369. #define STM32_USART2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  370. #define STM32_USART2_RX_DMA_CHN 0x00400000
  371. #define STM32_USART2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  372. #define STM32_USART2_TX_DMA_CHN 0x04000000
  373. #define STM32_HAS_USART3 TRUE
  374. #define STM32_USART3_HANDLER VectorDC
  375. #define STM32_USART3_NUMBER 39
  376. #define STM32_USART3_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  377. #define STM32_USART3_RX_DMA_CHN 0x00000040
  378. #define STM32_USART3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  379. STM32_DMA_STREAM_ID_MSK(1, 4))
  380. #define STM32_USART3_TX_DMA_CHN 0x00074000
  381. #define STM32_HAS_UART4 TRUE
  382. #define STM32_UART4_HANDLER Vector110
  383. #define STM32_UART4_NUMBER 52
  384. #define STM32_UART4_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 2)
  385. #define STM32_UART4_RX_DMA_CHN 0x00000400
  386. #define STM32_UART4_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  387. #define STM32_UART4_TX_DMA_CHN 0x00040000
  388. #define STM32_HAS_UART5 TRUE
  389. #define STM32_UART5_HANDLER Vector114
  390. #define STM32_UART5_NUMBER 53
  391. #define STM32_UART5_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  392. #define STM32_UART5_RX_DMA_CHN 0x00000004
  393. #define STM32_UART5_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 7)
  394. #define STM32_UART5_TX_DMA_CHN 0x40000000
  395. #define STM32_HAS_USART6 TRUE
  396. #define STM32_USART6_HANDLER Vector15C
  397. #define STM32_USART6_NUMBER 71
  398. #define STM32_USART6_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  399. STM32_DMA_STREAM_ID_MSK(2, 2))
  400. #define STM32_USART6_RX_DMA_CHN 0x00000550
  401. #define STM32_USART6_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 6) |\
  402. STM32_DMA_STREAM_ID_MSK(2, 7))
  403. #define STM32_USART6_TX_DMA_CHN 0x55000000
  404. #define STM32_HAS_UART7 TRUE
  405. #define STM32_UART7_HANDLER Vector188
  406. #define STM32_UART7_NUMBER 82
  407. #define STM32_UART7_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 3)
  408. #define STM32_UART7_RX_DMA_CHN 0x00005000
  409. #define STM32_UART7_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  410. #define STM32_UART7_TX_DMA_CHN 0x00000050
  411. #define STM32_HAS_UART8 TRUE
  412. #define STM32_UART8_HANDLER Vector18C
  413. #define STM32_UART8_NUMBER 83
  414. #define STM32_UART8_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  415. #define STM32_UART8_RX_DMA_CHN 0x05000000
  416. #define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  417. #define STM32_UART8_TX_DMA_CHN 0x00000005
  418. #define STM32_HAS_LPUART1 FALSE
  419. /* USB attributes.*/
  420. #define STM32_OTG_STEPPING 2
  421. #define STM32_HAS_OTG1 TRUE
  422. #define STM32_OTG1_ENDPOINTS 5
  423. #define STM32_OTG1_HANDLER Vector14C
  424. #define STM32_OTG1_NUMBER 67
  425. #define STM32_HAS_OTG2 TRUE
  426. #define STM32_OTG2_ENDPOINTS 8
  427. #define STM32_OTG2_HANDLER Vector174
  428. #define STM32_OTG2_EP1OUT_HANDLER Vector168
  429. #define STM32_OTG2_EP1IN_HANDLER Vector16C
  430. #define STM32_OTG2_NUMBER 77
  431. #define STM32_OTG2_EP1OUT_NUMBER 74
  432. #define STM32_OTG2_EP1IN_NUMBER 75
  433. #define STM32_HAS_USB FALSE
  434. /* IWDG attributes.*/
  435. #define STM32_HAS_IWDG TRUE
  436. #define STM32_IWDG_IS_WINDOWED TRUE
  437. /* LTDC attributes.*/
  438. #define STM32_HAS_LTDC TRUE
  439. /* DMA2D attributes.*/
  440. #define STM32_HAS_DMA2D TRUE
  441. /* FSMC attributes.*/
  442. #define STM32_HAS_FSMC TRUE
  443. #define STM32_FSMC_IS_FMC TRUE
  444. #define STM32_FSMC_HANDLER Vector100
  445. #define STM32_FSMC_NUMBER 48
  446. /* LTDC attributes.*/
  447. /* DMA2D attributes.*/
  448. /* CRC attributes.*/
  449. #define STM32_HAS_CRC TRUE
  450. #define STM32_CRC_PROGRAMMABLE TRUE
  451. #endif /* defined(STM32F722xx) || defined(STM32F723xx) ||
  452. defined(STM32F732xx) || defined(STM32F733xx) */
  453. /*===========================================================================*/
  454. /* STM32F745xx, STM32F746xx, STM32F756xx. */
  455. /*===========================================================================*/
  456. #if defined(STM32F745xx) || defined(STM32F746xx) || defined(STM32F756xx) || \
  457. defined(__DOXYGEN__)
  458. /* ADC attributes.*/
  459. #define STM32_ADC_HANDLER Vector88
  460. #define STM32_ADC_NUMBER 18
  461. #define STM32_HAS_ADC1 TRUE
  462. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  463. STM32_DMA_STREAM_ID_MSK(2, 4))
  464. #define STM32_ADC1_DMA_CHN 0x00000000
  465. #define STM32_HAS_ADC2 TRUE
  466. #define STM32_ADC2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  467. STM32_DMA_STREAM_ID_MSK(2, 3))
  468. #define STM32_ADC2_DMA_CHN 0x00001100
  469. #define STM32_HAS_ADC3 TRUE
  470. #define STM32_ADC3_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  471. STM32_DMA_STREAM_ID_MSK(2, 1))
  472. #define STM32_ADC3_DMA_CHN 0x00000022
  473. #define STM32_HAS_ADC4 FALSE
  474. #define STM32_HAS_SDADC1 FALSE
  475. #define STM32_HAS_SDADC2 FALSE
  476. #define STM32_HAS_SDADC3 FALSE
  477. /* CAN attributes.*/
  478. #define STM32_CAN_MAX_FILTERS 28
  479. #define STM32_HAS_CAN1 TRUE
  480. #define STM32_CAN1_TX_HANDLER Vector8C
  481. #define STM32_CAN1_RX0_HANDLER Vector90
  482. #define STM32_CAN1_RX1_HANDLER Vector94
  483. #define STM32_CAN1_SCE_HANDLER Vector98
  484. #define STM32_CAN1_TX_NUMBER 19
  485. #define STM32_CAN1_RX0_NUMBER 20
  486. #define STM32_CAN1_RX1_NUMBER 21
  487. #define STM32_CAN1_SCE_NUMBER 22
  488. #define STM32_HAS_CAN2 TRUE
  489. #define STM32_CAN2_TX_HANDLER Vector13C
  490. #define STM32_CAN2_RX0_HANDLER Vector140
  491. #define STM32_CAN2_RX1_HANDLER Vector144
  492. #define STM32_CAN2_SCE_HANDLER Vector148
  493. #define STM32_CAN2_TX_NUMBER 63
  494. #define STM32_CAN2_RX0_NUMBER 64
  495. #define STM32_CAN2_RX1_NUMBER 65
  496. #define STM32_CAN2_SCE_NUMBER 66
  497. #define STM32_CAN3_MAX_FILTERS 14
  498. #define STM32_HAS_CAN3 TRUE
  499. #define STM32_CAN3_TX_HANDLER Vector1E0
  500. #define STM32_CAN3_RX0_HANDLER Vector1E4
  501. #define STM32_CAN3_RX1_HANDLER Vector1E8
  502. #define STM32_CAN3_SCE_HANDLER Vector1EC
  503. #define STM32_CAN3_TX_NUMBER 104
  504. #define STM32_CAN3_RX0_NUMBER 105
  505. #define STM32_CAN3_RX1_NUMBER 106
  506. #define STM32_CAN3_SCE_NUMBER 107
  507. /* DAC attributes.*/
  508. #define STM32_HAS_DAC1_CH1 TRUE
  509. #define STM32_DAC1_CH1_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  510. #define STM32_DAC1_CH1_DMA_CHN 0x00700000
  511. #define STM32_HAS_DAC1_CH2 TRUE
  512. #define STM32_DAC1_CH2_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  513. #define STM32_DAC1_CH2_DMA_CHN 0x07000000
  514. #define STM32_HAS_DAC2_CH1 FALSE
  515. #define STM32_HAS_DAC2_CH2 FALSE
  516. /* DMA attributes.*/
  517. #define STM32_ADVANCED_DMA TRUE
  518. #define STM32_DMA_CACHE_HANDLING TRUE
  519. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  520. #define STM32_HAS_DMA1 TRUE
  521. #define STM32_DMA1_CH0_HANDLER Vector6C
  522. #define STM32_DMA1_CH1_HANDLER Vector70
  523. #define STM32_DMA1_CH2_HANDLER Vector74
  524. #define STM32_DMA1_CH3_HANDLER Vector78
  525. #define STM32_DMA1_CH4_HANDLER Vector7C
  526. #define STM32_DMA1_CH5_HANDLER Vector80
  527. #define STM32_DMA1_CH6_HANDLER Vector84
  528. #define STM32_DMA1_CH7_HANDLER VectorFC
  529. #define STM32_DMA1_CH0_NUMBER 11
  530. #define STM32_DMA1_CH1_NUMBER 12
  531. #define STM32_DMA1_CH2_NUMBER 13
  532. #define STM32_DMA1_CH3_NUMBER 14
  533. #define STM32_DMA1_CH4_NUMBER 15
  534. #define STM32_DMA1_CH5_NUMBER 16
  535. #define STM32_DMA1_CH6_NUMBER 17
  536. #define STM32_DMA1_CH7_NUMBER 47
  537. #define STM32_HAS_DMA2 TRUE
  538. #define STM32_DMA2_CH0_HANDLER Vector120
  539. #define STM32_DMA2_CH1_HANDLER Vector124
  540. #define STM32_DMA2_CH2_HANDLER Vector128
  541. #define STM32_DMA2_CH3_HANDLER Vector12C
  542. #define STM32_DMA2_CH4_HANDLER Vector130
  543. #define STM32_DMA2_CH5_HANDLER Vector150
  544. #define STM32_DMA2_CH6_HANDLER Vector154
  545. #define STM32_DMA2_CH7_HANDLER Vector158
  546. #define STM32_DMA2_CH0_NUMBER 56
  547. #define STM32_DMA2_CH1_NUMBER 57
  548. #define STM32_DMA2_CH2_NUMBER 58
  549. #define STM32_DMA2_CH3_NUMBER 59
  550. #define STM32_DMA2_CH4_NUMBER 60
  551. #define STM32_DMA2_CH5_NUMBER 68
  552. #define STM32_DMA2_CH6_NUMBER 69
  553. #define STM32_DMA2_CH7_NUMBER 70
  554. /* ETH attributes.*/
  555. #define STM32_HAS_ETH TRUE
  556. #define STM32_ETH_HANDLER Vector134
  557. #define STM32_ETH_NUMBER 61
  558. /* EXTI attributes.*/
  559. #define STM32_EXTI_NUM_LINES 24
  560. #define STM32_EXTI_IMR1_MASK 0xFF000000
  561. /* GPIO attributes.*/
  562. #define STM32_HAS_GPIOA TRUE
  563. #define STM32_HAS_GPIOB TRUE
  564. #define STM32_HAS_GPIOC TRUE
  565. #define STM32_HAS_GPIOD TRUE
  566. #define STM32_HAS_GPIOE TRUE
  567. #define STM32_HAS_GPIOH TRUE
  568. #define STM32_HAS_GPIOF TRUE
  569. #define STM32_HAS_GPIOG TRUE
  570. #define STM32_HAS_GPIOI TRUE
  571. #define STM32_HAS_GPIOJ TRUE
  572. #define STM32_HAS_GPIOK TRUE
  573. #define STM32_GPIO_EN_MASK (RCC_AHB1ENR_GPIOAEN | \
  574. RCC_AHB1ENR_GPIOBEN | \
  575. RCC_AHB1ENR_GPIOCEN | \
  576. RCC_AHB1ENR_GPIODEN | \
  577. RCC_AHB1ENR_GPIOEEN | \
  578. RCC_AHB1ENR_GPIOFEN | \
  579. RCC_AHB1ENR_GPIOGEN | \
  580. RCC_AHB1ENR_GPIOHEN | \
  581. RCC_AHB1ENR_GPIOIEN | \
  582. RCC_AHB1ENR_GPIOJEN | \
  583. RCC_AHB1ENR_GPIOKEN)
  584. /* I2C attributes.*/
  585. #define STM32_HAS_I2C1 TRUE
  586. #define STM32_I2C1_EVENT_HANDLER VectorBC
  587. #define STM32_I2C1_ERROR_HANDLER VectorC0
  588. #define STM32_I2C1_EVENT_NUMBER 31
  589. #define STM32_I2C1_ERROR_NUMBER 32
  590. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  591. STM32_DMA_STREAM_ID_MSK(1, 5))
  592. #define STM32_I2C1_RX_DMA_CHN 0x00100001
  593. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 7) |\
  594. STM32_DMA_STREAM_ID_MSK(1, 6))
  595. #define STM32_I2C1_TX_DMA_CHN 0x11000000
  596. #define STM32_HAS_I2C2 TRUE
  597. #define STM32_I2C2_EVENT_HANDLER VectorC4
  598. #define STM32_I2C2_ERROR_HANDLER VectorC8
  599. #define STM32_I2C2_EVENT_NUMBER 33
  600. #define STM32_I2C2_ERROR_NUMBER 34
  601. #define STM32_I2C2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  602. STM32_DMA_STREAM_ID_MSK(1, 3))
  603. #define STM32_I2C2_RX_DMA_CHN 0x00007700
  604. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 7)
  605. #define STM32_I2C2_TX_DMA_CHN 0x70000000
  606. #define STM32_HAS_I2C3 TRUE
  607. #define STM32_I2C3_EVENT_HANDLER Vector160
  608. #define STM32_I2C3_ERROR_HANDLER Vector164
  609. #define STM32_I2C3_EVENT_NUMBER 72
  610. #define STM32_I2C3_ERROR_NUMBER 73
  611. #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  612. STM32_DMA_STREAM_ID_MSK(1, 2))
  613. #define STM32_I2C3_RX_DMA_CHN 0x00000300
  614. #define STM32_I2C3_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  615. #define STM32_I2C3_TX_DMA_CHN 0x00030000
  616. #define STM32_HAS_I2C4 TRUE
  617. #define STM32_I2C4_EVENT_HANDLER Vector1BC
  618. #define STM32_I2C4_ERROR_HANDLER Vector1C0
  619. #define STM32_I2C4_EVENT_NUMBER 95
  620. #define STM32_I2C4_ERROR_NUMBER 96
  621. #define STM32_I2C4_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 2)
  622. #define STM32_I2C4_RX_DMA_CHN 0x00000200
  623. #define STM32_I2C4_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  624. #define STM32_I2C4_TX_DMA_CHN 0x00200000
  625. /* QUADSPI attributes.*/
  626. #define STM32_HAS_QUADSPI1 TRUE
  627. #define STM32_QUADSPI1_HANDLER Vector1B0
  628. #define STM32_QUADSPI1_NUMBER 92
  629. #define STM32_QUADSPI1_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  630. #define STM32_QUADSPI1_DMA_CHN 0x30000000
  631. /* RTC attributes.*/
  632. #define STM32_HAS_RTC TRUE
  633. #define STM32_RTC_HAS_SUBSECONDS TRUE
  634. #define STM32_RTC_HAS_PERIODIC_WAKEUPS TRUE
  635. #define STM32_RTC_NUM_ALARMS 2
  636. #define STM32_RTC_HAS_INTERRUPTS FALSE
  637. /* SDMMC attributes.*/
  638. #define STM32_HAS_SDMMC1 TRUE
  639. #define STM32_SDMMC1_HANDLER Vector104
  640. #define STM32_SDMMC1_NUMBER 49
  641. #define STM32_SDC_SDMMC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  642. STM32_DMA_STREAM_ID_MSK(2, 6))
  643. #define STM32_SDC_SDMMC1_DMA_CHN 0x04004000
  644. #define STM32_HAS_SDMMC2 FALSE
  645. /* SPI attributes.*/
  646. #define STM32_HAS_SPI1 TRUE
  647. #define STM32_SPI1_SUPPORTS_I2S TRUE
  648. #define STM32_SPI1_I2S_FULLDUPLEX TRUE
  649. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  650. STM32_DMA_STREAM_ID_MSK(2, 2))
  651. #define STM32_SPI1_RX_DMA_CHN 0x00000303
  652. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  653. STM32_DMA_STREAM_ID_MSK(2, 5))
  654. #define STM32_SPI1_TX_DMA_CHN 0x00303000
  655. #define STM32_HAS_SPI2 TRUE
  656. #define STM32_SPI2_SUPPORTS_I2S TRUE
  657. #define STM32_SPI2_I2S_FULLDUPLEX TRUE
  658. #define STM32_SPI2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 3)
  659. #define STM32_SPI2_RX_DMA_CHN 0x00000000
  660. #define STM32_SPI2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  661. #define STM32_SPI2_TX_DMA_CHN 0x00000000
  662. #define STM32_HAS_SPI3 TRUE
  663. #define STM32_SPI3_SUPPORTS_I2S TRUE
  664. #define STM32_SPI3_I2S_FULLDUPLEX TRUE
  665. #define STM32_SPI3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  666. STM32_DMA_STREAM_ID_MSK(1, 2))
  667. #define STM32_SPI3_RX_DMA_CHN 0x00000000
  668. #define STM32_SPI3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  669. STM32_DMA_STREAM_ID_MSK(1, 7))
  670. #define STM32_SPI3_TX_DMA_CHN 0x00000000
  671. #define STM32_HAS_SPI4 TRUE
  672. #define STM32_SPI4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  673. STM32_DMA_STREAM_ID_MSK(2, 3))
  674. #define STM32_SPI4_RX_DMA_CHN 0x00005004
  675. #define STM32_SPI4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  676. STM32_DMA_STREAM_ID_MSK(2, 4))
  677. #define STM32_SPI4_TX_DMA_CHN 0x00050040
  678. #define STM32_HAS_SPI5 TRUE
  679. #define STM32_SPI5_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) | \
  680. STM32_DMA_STREAM_ID_MSK(2, 5))
  681. #define STM32_SPI5_RX_DMA_CHN 0x00702000
  682. #define STM32_SPI5_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 4) | \
  683. STM32_DMA_STREAM_ID_MSK(2, 6))
  684. #define STM32_SPI5_TX_DMA_CHN 0x07020000
  685. #define STM32_HAS_SPI6 TRUE
  686. #define STM32_SPI6_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 6))
  687. #define STM32_SPI6_RX_DMA_CHN 0x01000000
  688. #define STM32_SPI6_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 5))
  689. #define STM32_SPI6_TX_DMA_CHN 0x00100000
  690. /* TIM attributes.*/
  691. #define STM32_TIM_MAX_CHANNELS 6
  692. #define STM32_HAS_TIM1 TRUE
  693. #define STM32_TIM1_IS_32BITS FALSE
  694. #define STM32_TIM1_CHANNELS 6
  695. #define STM32_TIM1_UP_HANDLER VectorA4
  696. #define STM32_TIM1_CC_HANDLER VectorAC
  697. #define STM32_TIM1_UP_NUMBER 25
  698. #define STM32_TIM1_CC_NUMBER 27
  699. #define STM32_HAS_TIM2 TRUE
  700. #define STM32_TIM2_IS_32BITS TRUE
  701. #define STM32_TIM2_CHANNELS 4
  702. #define STM32_TIM2_HANDLER VectorB0
  703. #define STM32_TIM2_NUMBER 28
  704. #define STM32_HAS_TIM3 TRUE
  705. #define STM32_TIM3_IS_32BITS FALSE
  706. #define STM32_TIM3_CHANNELS 4
  707. #define STM32_TIM3_HANDLER VectorB4
  708. #define STM32_TIM3_NUMBER 29
  709. #define STM32_HAS_TIM4 TRUE
  710. #define STM32_TIM4_IS_32BITS FALSE
  711. #define STM32_TIM4_CHANNELS 4
  712. #define STM32_TIM4_HANDLER VectorB8
  713. #define STM32_TIM4_NUMBER 30
  714. #define STM32_HAS_TIM5 TRUE
  715. #define STM32_TIM5_IS_32BITS TRUE
  716. #define STM32_TIM5_CHANNELS 4
  717. #define STM32_TIM5_HANDLER Vector108
  718. #define STM32_TIM5_NUMBER 50
  719. #define STM32_HAS_TIM6 TRUE
  720. #define STM32_TIM6_IS_32BITS FALSE
  721. #define STM32_TIM6_CHANNELS 0
  722. #define STM32_TIM6_HANDLER Vector118
  723. #define STM32_TIM6_NUMBER 54
  724. #define STM32_HAS_TIM7 TRUE
  725. #define STM32_TIM7_IS_32BITS FALSE
  726. #define STM32_TIM7_CHANNELS 0
  727. #define STM32_TIM7_HANDLER Vector11C
  728. #define STM32_TIM7_NUMBER 55
  729. #define STM32_HAS_TIM8 TRUE
  730. #define STM32_TIM8_IS_32BITS FALSE
  731. #define STM32_TIM8_CHANNELS 6
  732. #define STM32_TIM8_UP_HANDLER VectorF0
  733. #define STM32_TIM8_CC_HANDLER VectorF8
  734. #define STM32_TIM8_UP_NUMBER 44
  735. #define STM32_TIM8_CC_NUMBER 46
  736. #define STM32_HAS_TIM9 TRUE
  737. #define STM32_TIM9_IS_32BITS FALSE
  738. #define STM32_TIM9_CHANNELS 2
  739. #define STM32_TIM9_HANDLER VectorA0
  740. #define STM32_TIM9_NUMBER 24
  741. #define STM32_HAS_TIM10 TRUE
  742. #define STM32_TIM10_IS_32BITS FALSE
  743. #define STM32_TIM10_CHANNELS 1
  744. #define STM32_TIM10_HANDLER VectorA4 /* Note: same as STM32_TIM1_UP */
  745. #define STM32_TIM10_NUMBER 25 /* Note: same as STM32_TIM1_UP */
  746. #define STM32_HAS_TIM11 TRUE
  747. #define STM32_TIM11_IS_32BITS FALSE
  748. #define STM32_TIM11_CHANNELS 1
  749. #define STM32_TIM11_HANDLER VectorA8
  750. #define STM32_TIM11_NUMBER 26
  751. #define STM32_HAS_TIM12 TRUE
  752. #define STM32_TIM12_IS_32BITS FALSE
  753. #define STM32_TIM12_CHANNELS 2
  754. #define STM32_TIM12_HANDLER VectorEC
  755. #define STM32_TIM12_NUMBER 43
  756. #define STM32_HAS_TIM13 TRUE
  757. #define STM32_TIM13_IS_32BITS FALSE
  758. #define STM32_TIM13_CHANNELS 1
  759. #define STM32_TIM13_HANDLER VectorF0 /* Note: same as STM32_TIM8_UP */
  760. #define STM32_TIM13_NUMBER 44 /* Note: same as STM32_TIM8_UP */
  761. #define STM32_HAS_TIM14 TRUE
  762. #define STM32_TIM14_IS_32BITS FALSE
  763. #define STM32_TIM14_CHANNELS 1
  764. #define STM32_TIM14_HANDLER VectorF4
  765. #define STM32_TIM14_NUMBER 45
  766. #define STM32_HAS_TIM15 FALSE
  767. #define STM32_HAS_TIM16 FALSE
  768. #define STM32_HAS_TIM17 FALSE
  769. #define STM32_HAS_TIM18 FALSE
  770. #define STM32_HAS_TIM19 FALSE
  771. #define STM32_HAS_TIM20 FALSE
  772. #define STM32_HAS_TIM21 FALSE
  773. #define STM32_HAS_TIM22 FALSE
  774. /* USART attributes.*/
  775. #define STM32_HAS_USART1 TRUE
  776. #define STM32_USART1_HANDLER VectorD4
  777. #define STM32_USART1_NUMBER 37
  778. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  779. STM32_DMA_STREAM_ID_MSK(2, 5))
  780. #define STM32_USART1_RX_DMA_CHN 0x00400400
  781. #define STM32_USART1_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  782. #define STM32_USART1_TX_DMA_CHN 0x40000000
  783. #define STM32_HAS_USART2 TRUE
  784. #define STM32_USART2_HANDLER VectorD8
  785. #define STM32_USART2_NUMBER 38
  786. #define STM32_USART2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  787. #define STM32_USART2_RX_DMA_CHN 0x00400000
  788. #define STM32_USART2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  789. #define STM32_USART2_TX_DMA_CHN 0x04000000
  790. #define STM32_HAS_USART3 TRUE
  791. #define STM32_USART3_HANDLER VectorDC
  792. #define STM32_USART3_NUMBER 39
  793. #define STM32_USART3_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  794. #define STM32_USART3_RX_DMA_CHN 0x00000040
  795. #define STM32_USART3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  796. STM32_DMA_STREAM_ID_MSK(1, 4))
  797. #define STM32_USART3_TX_DMA_CHN 0x00074000
  798. #define STM32_HAS_UART4 TRUE
  799. #define STM32_UART4_HANDLER Vector110
  800. #define STM32_UART4_NUMBER 52
  801. #define STM32_UART4_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 2)
  802. #define STM32_UART4_RX_DMA_CHN 0x00000400
  803. #define STM32_UART4_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  804. #define STM32_UART4_TX_DMA_CHN 0x00040000
  805. #define STM32_HAS_UART5 TRUE
  806. #define STM32_UART5_HANDLER Vector114
  807. #define STM32_UART5_NUMBER 53
  808. #define STM32_UART5_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  809. #define STM32_UART5_RX_DMA_CHN 0x00000004
  810. #define STM32_UART5_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 7)
  811. #define STM32_UART5_TX_DMA_CHN 0x40000000
  812. #define STM32_HAS_USART6 TRUE
  813. #define STM32_USART6_HANDLER Vector15C
  814. #define STM32_USART6_NUMBER 71
  815. #define STM32_USART6_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  816. STM32_DMA_STREAM_ID_MSK(2, 2))
  817. #define STM32_USART6_RX_DMA_CHN 0x00000550
  818. #define STM32_USART6_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 6) |\
  819. STM32_DMA_STREAM_ID_MSK(2, 7))
  820. #define STM32_USART6_TX_DMA_CHN 0x55000000
  821. #define STM32_HAS_UART7 TRUE
  822. #define STM32_UART7_HANDLER Vector188
  823. #define STM32_UART7_NUMBER 82
  824. #define STM32_UART7_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 3)
  825. #define STM32_UART7_RX_DMA_CHN 0x00005000
  826. #define STM32_UART7_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  827. #define STM32_UART7_TX_DMA_CHN 0x00000050
  828. #define STM32_HAS_UART8 TRUE
  829. #define STM32_UART8_HANDLER Vector18C
  830. #define STM32_UART8_NUMBER 83
  831. #define STM32_UART8_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  832. #define STM32_UART8_RX_DMA_CHN 0x05000000
  833. #define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  834. #define STM32_UART8_TX_DMA_CHN 0x00000005
  835. #define STM32_HAS_LPUART1 FALSE
  836. /* USB attributes.*/
  837. #define STM32_OTG_STEPPING 2
  838. #define STM32_HAS_OTG1 TRUE
  839. #define STM32_OTG1_ENDPOINTS 5
  840. #define STM32_OTG1_HANDLER Vector14C
  841. #define STM32_OTG1_NUMBER 67
  842. #define STM32_HAS_OTG2 TRUE
  843. #define STM32_OTG2_ENDPOINTS 8
  844. #define STM32_OTG2_HANDLER Vector174
  845. #define STM32_OTG2_EP1OUT_HANDLER Vector168
  846. #define STM32_OTG2_EP1IN_HANDLER Vector16C
  847. #define STM32_OTG2_NUMBER 77
  848. #define STM32_OTG2_EP1OUT_NUMBER 74
  849. #define STM32_OTG2_EP1IN_NUMBER 75
  850. #define STM32_HAS_USB FALSE
  851. /* IWDG attributes.*/
  852. #define STM32_HAS_IWDG TRUE
  853. #define STM32_IWDG_IS_WINDOWED TRUE
  854. /* LTDC attributes.*/
  855. #define STM32_HAS_LTDC TRUE
  856. /* DMA2D attributes.*/
  857. #define STM32_HAS_DMA2D TRUE
  858. /* FSMC attributes.*/
  859. #define STM32_HAS_FSMC TRUE
  860. #define STM32_FSMC_IS_FMC TRUE
  861. #define STM32_FSMC_HANDLER Vector100
  862. #define STM32_FSMC_NUMBER 48
  863. /* LTDC attributes.*/
  864. #define STM32_LTDC_EV_HANDLER Vector1A0
  865. #define STM32_LTDC_ER_HANDLER Vector1A4
  866. #define STM32_LTDC_EV_NUMBER 88
  867. #define STM32_LTDC_ER_NUMBER 89
  868. /* DMA2D attributes.*/
  869. #define STM32_DMA2D_HANDLER Vector1A8
  870. #define STM32_DMA2D_NUMBER 90
  871. /* CRC attributes.*/
  872. #define STM32_HAS_CRC TRUE
  873. #define STM32_CRC_PROGRAMMABLE FALSE
  874. #endif /* defined(STM32F745xx) || defined(STM32F746xx) || defined(STM32F756xx) */
  875. /*===========================================================================*/
  876. /* STM32F767xx, STM32F769xx, STM32F777xx, STM32F779xx. */
  877. /*===========================================================================*/
  878. #if defined(STM32F767xx) || defined(STM32F769xx) || \
  879. defined(STM32F777xx) || defined(STM32F779xx) || \
  880. defined(__DOXYGEN__)
  881. /* ADC attributes.*/
  882. #define STM32_ADC_HANDLER Vector88
  883. #define STM32_ADC_NUMBER 18
  884. #define STM32_HAS_ADC1 TRUE
  885. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  886. STM32_DMA_STREAM_ID_MSK(2, 4))
  887. #define STM32_ADC1_DMA_CHN 0x00000000
  888. #define STM32_HAS_ADC2 TRUE
  889. #define STM32_ADC2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  890. STM32_DMA_STREAM_ID_MSK(2, 3))
  891. #define STM32_ADC2_DMA_CHN 0x00001100
  892. #define STM32_HAS_ADC3 TRUE
  893. #define STM32_ADC3_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  894. STM32_DMA_STREAM_ID_MSK(2, 1))
  895. #define STM32_ADC3_DMA_CHN 0x00000022
  896. #define STM32_HAS_ADC4 FALSE
  897. #define STM32_HAS_SDADC1 FALSE
  898. #define STM32_HAS_SDADC2 FALSE
  899. #define STM32_HAS_SDADC3 FALSE
  900. /* CAN attributes.*/
  901. #define STM32_CAN_MAX_FILTERS 28
  902. #define STM32_HAS_CAN1 TRUE
  903. #define STM32_CAN1_TX_HANDLER Vector8C
  904. #define STM32_CAN1_RX0_HANDLER Vector90
  905. #define STM32_CAN1_RX1_HANDLER Vector94
  906. #define STM32_CAN1_SCE_HANDLER Vector98
  907. #define STM32_CAN1_TX_NUMBER 19
  908. #define STM32_CAN1_RX0_NUMBER 20
  909. #define STM32_CAN1_RX1_NUMBER 21
  910. #define STM32_CAN1_SCE_NUMBER 22
  911. #define STM32_HAS_CAN2 TRUE
  912. #define STM32_CAN2_TX_HANDLER Vector13C
  913. #define STM32_CAN2_RX0_HANDLER Vector140
  914. #define STM32_CAN2_RX1_HANDLER Vector144
  915. #define STM32_CAN2_SCE_HANDLER Vector148
  916. #define STM32_CAN2_TX_NUMBER 63
  917. #define STM32_CAN2_RX0_NUMBER 64
  918. #define STM32_CAN2_RX1_NUMBER 65
  919. #define STM32_CAN2_SCE_NUMBER 66
  920. #define STM32_CAN3_MAX_FILTERS 14
  921. #define STM32_HAS_CAN3 TRUE
  922. #define STM32_CAN3_TX_HANDLER Vector1E0
  923. #define STM32_CAN3_RX0_HANDLER Vector1E4
  924. #define STM32_CAN3_RX1_HANDLER Vector1E8
  925. #define STM32_CAN3_SCE_HANDLER Vector1EC
  926. #define STM32_CAN3_TX_NUMBER 104
  927. #define STM32_CAN3_RX0_NUMBER 105
  928. #define STM32_CAN3_RX1_NUMBER 106
  929. #define STM32_CAN3_SCE_NUMBER 107
  930. /* DAC attributes.*/
  931. #define STM32_HAS_DAC1_CH1 TRUE
  932. #define STM32_DAC1_CH1_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  933. #define STM32_DAC1_CH1_DMA_CHN 0x00700000
  934. #define STM32_HAS_DAC1_CH2 TRUE
  935. #define STM32_DAC1_CH2_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  936. #define STM32_DAC1_CH2_DMA_CHN 0x07000000
  937. #define STM32_HAS_DAC2_CH1 FALSE
  938. #define STM32_HAS_DAC2_CH2 FALSE
  939. /* DMA attributes.*/
  940. #define STM32_ADVANCED_DMA TRUE
  941. #define STM32_DMA_CACHE_HANDLING TRUE
  942. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  943. #define STM32_HAS_DMA1 TRUE
  944. #define STM32_DMA1_CH0_HANDLER Vector6C
  945. #define STM32_DMA1_CH1_HANDLER Vector70
  946. #define STM32_DMA1_CH2_HANDLER Vector74
  947. #define STM32_DMA1_CH3_HANDLER Vector78
  948. #define STM32_DMA1_CH4_HANDLER Vector7C
  949. #define STM32_DMA1_CH5_HANDLER Vector80
  950. #define STM32_DMA1_CH6_HANDLER Vector84
  951. #define STM32_DMA1_CH7_HANDLER VectorFC
  952. #define STM32_DMA1_CH0_NUMBER 11
  953. #define STM32_DMA1_CH1_NUMBER 12
  954. #define STM32_DMA1_CH2_NUMBER 13
  955. #define STM32_DMA1_CH3_NUMBER 14
  956. #define STM32_DMA1_CH4_NUMBER 15
  957. #define STM32_DMA1_CH5_NUMBER 16
  958. #define STM32_DMA1_CH6_NUMBER 17
  959. #define STM32_DMA1_CH7_NUMBER 47
  960. #define STM32_HAS_DMA2 TRUE
  961. #define STM32_DMA2_CH0_HANDLER Vector120
  962. #define STM32_DMA2_CH1_HANDLER Vector124
  963. #define STM32_DMA2_CH2_HANDLER Vector128
  964. #define STM32_DMA2_CH3_HANDLER Vector12C
  965. #define STM32_DMA2_CH4_HANDLER Vector130
  966. #define STM32_DMA2_CH5_HANDLER Vector150
  967. #define STM32_DMA2_CH6_HANDLER Vector154
  968. #define STM32_DMA2_CH7_HANDLER Vector158
  969. #define STM32_DMA2_CH0_NUMBER 56
  970. #define STM32_DMA2_CH1_NUMBER 57
  971. #define STM32_DMA2_CH2_NUMBER 58
  972. #define STM32_DMA2_CH3_NUMBER 59
  973. #define STM32_DMA2_CH4_NUMBER 60
  974. #define STM32_DMA2_CH5_NUMBER 68
  975. #define STM32_DMA2_CH6_NUMBER 69
  976. #define STM32_DMA2_CH7_NUMBER 70
  977. /* ETH attributes.*/
  978. #define STM32_HAS_ETH TRUE
  979. #define STM32_ETH_HANDLER Vector134
  980. #define STM32_ETH_NUMBER 61
  981. /* EXTI attributes.*/
  982. #define STM32_EXTI_NUM_LINES 24
  983. #define STM32_EXTI_IMR1_MASK 0xFF000000
  984. /* GPIO attributes.*/
  985. #define STM32_HAS_GPIOA TRUE
  986. #define STM32_HAS_GPIOB TRUE
  987. #define STM32_HAS_GPIOC TRUE
  988. #define STM32_HAS_GPIOD TRUE
  989. #define STM32_HAS_GPIOE TRUE
  990. #define STM32_HAS_GPIOH TRUE
  991. #define STM32_HAS_GPIOF TRUE
  992. #define STM32_HAS_GPIOG TRUE
  993. #define STM32_HAS_GPIOI TRUE
  994. #define STM32_HAS_GPIOJ TRUE
  995. #define STM32_HAS_GPIOK TRUE
  996. #define STM32_GPIO_EN_MASK (RCC_AHB1ENR_GPIOAEN | \
  997. RCC_AHB1ENR_GPIOBEN | \
  998. RCC_AHB1ENR_GPIOCEN | \
  999. RCC_AHB1ENR_GPIODEN | \
  1000. RCC_AHB1ENR_GPIOEEN | \
  1001. RCC_AHB1ENR_GPIOFEN | \
  1002. RCC_AHB1ENR_GPIOGEN | \
  1003. RCC_AHB1ENR_GPIOHEN | \
  1004. RCC_AHB1ENR_GPIOIEN | \
  1005. RCC_AHB1ENR_GPIOJEN | \
  1006. RCC_AHB1ENR_GPIOKEN)
  1007. /* I2C attributes.*/
  1008. #define STM32_HAS_I2C1 TRUE
  1009. #define STM32_I2C1_EVENT_HANDLER VectorBC
  1010. #define STM32_I2C1_ERROR_HANDLER VectorC0
  1011. #define STM32_I2C1_EVENT_NUMBER 31
  1012. #define STM32_I2C1_ERROR_NUMBER 32
  1013. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  1014. STM32_DMA_STREAM_ID_MSK(1, 5))
  1015. #define STM32_I2C1_RX_DMA_CHN 0x00100001
  1016. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 7) |\
  1017. STM32_DMA_STREAM_ID_MSK(1, 6))
  1018. #define STM32_I2C1_TX_DMA_CHN 0x11000000
  1019. #define STM32_HAS_I2C2 TRUE
  1020. #define STM32_I2C2_EVENT_HANDLER VectorC4
  1021. #define STM32_I2C2_ERROR_HANDLER VectorC8
  1022. #define STM32_I2C2_EVENT_NUMBER 33
  1023. #define STM32_I2C2_ERROR_NUMBER 34
  1024. #define STM32_I2C2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1025. STM32_DMA_STREAM_ID_MSK(1, 3))
  1026. #define STM32_I2C2_RX_DMA_CHN 0x00007700
  1027. #define STM32_I2C2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1028. STM32_DMA_STREAM_ID_MSK(1, 7))
  1029. #define STM32_I2C2_TX_DMA_CHN 0x70080000
  1030. #define STM32_HAS_I2C3 TRUE
  1031. #define STM32_I2C3_EVENT_HANDLER Vector160
  1032. #define STM32_I2C3_ERROR_HANDLER Vector164
  1033. #define STM32_I2C3_EVENT_NUMBER 72
  1034. #define STM32_I2C3_ERROR_NUMBER 73
  1035. #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  1036. STM32_DMA_STREAM_ID_MSK(1, 2))
  1037. #define STM32_I2C3_RX_DMA_CHN 0x00000310
  1038. #define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  1039. STM32_DMA_STREAM_ID_MSK(1, 4))
  1040. #define STM32_I2C3_TX_DMA_CHN 0x00030008
  1041. #define STM32_HAS_I2C4 TRUE
  1042. #define STM32_I2C4_EVENT_HANDLER Vector1BC
  1043. #define STM32_I2C4_ERROR_HANDLER Vector1C0
  1044. #define STM32_I2C4_EVENT_NUMBER 95
  1045. #define STM32_I2C4_ERROR_NUMBER 96
  1046. #define STM32_I2C4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  1047. STM32_DMA_STREAM_ID_MSK(1, 2))
  1048. #define STM32_I2C4_RX_DMA_CHN 0x00000280
  1049. #define STM32_I2C4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 6) |\
  1050. STM32_DMA_STREAM_ID_MSK(1, 5))
  1051. #define STM32_I2C4_TX_DMA_CHN 0x08200000
  1052. /* QUADSPI attributes.*/
  1053. #define STM32_HAS_QUADSPI1 TRUE
  1054. #define STM32_QUADSPI1_HANDLER Vector1B0
  1055. #define STM32_QUADSPI1_NUMBER 92
  1056. #define STM32_QUADSPI1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  1057. STM32_DMA_STREAM_ID_MSK(2, 7))
  1058. #define STM32_QUADSPI1_DMA_CHN 0x30000B00
  1059. /* RTC attributes.*/
  1060. #define STM32_HAS_RTC TRUE
  1061. #define STM32_RTC_HAS_SUBSECONDS TRUE
  1062. #define STM32_RTC_HAS_PERIODIC_WAKEUPS TRUE
  1063. #define STM32_RTC_NUM_ALARMS 2
  1064. #define STM32_RTC_HAS_INTERRUPTS FALSE
  1065. /* SDMMC attributes.*/
  1066. #define STM32_HAS_SDMMC1 TRUE
  1067. #define STM32_SDMMC1_HANDLER Vector104
  1068. #define STM32_SDMMC1_NUMBER 49
  1069. #define STM32_SDC_SDMMC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  1070. STM32_DMA_STREAM_ID_MSK(2, 6))
  1071. #define STM32_SDC_SDMMC1_DMA_CHN 0x04004000
  1072. #define STM32_HAS_SDMMC2 TRUE
  1073. #define STM32_SDMMC2_HANDLER Vector1DC
  1074. #define STM32_SDMMC2_NUMBER 103
  1075. #define STM32_SDC_SDMMC2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  1076. STM32_DMA_STREAM_ID_MSK(2, 5))
  1077. #define STM32_SDC_SDMMC2_DMA_CHN 0x00B0000B
  1078. /* SPI attributes.*/
  1079. #define STM32_HAS_SPI1 TRUE
  1080. #define STM32_SPI1_SUPPORTS_I2S TRUE
  1081. #define STM32_SPI1_I2S_FULLDUPLEX TRUE
  1082. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  1083. STM32_DMA_STREAM_ID_MSK(2, 2))
  1084. #define STM32_SPI1_RX_DMA_CHN 0x00000303
  1085. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3) |\
  1086. STM32_DMA_STREAM_ID_MSK(2, 5))
  1087. #define STM32_SPI1_TX_DMA_CHN 0x00303000
  1088. #define STM32_HAS_SPI2 TRUE
  1089. #define STM32_SPI2_SUPPORTS_I2S TRUE
  1090. #define STM32_SPI2_I2S_FULLDUPLEX TRUE
  1091. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  1092. STM32_DMA_STREAM_ID_MSK(1, 3))
  1093. #define STM32_SPI2_RX_DMA_CHN 0x00000090
  1094. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1095. STM32_DMA_STREAM_ID_MSK(1, 6))
  1096. #define STM32_SPI2_TX_DMA_CHN 0x09000000
  1097. #define STM32_HAS_SPI3 TRUE
  1098. #define STM32_SPI3_SUPPORTS_I2S TRUE
  1099. #define STM32_SPI3_I2S_FULLDUPLEX TRUE
  1100. #define STM32_SPI3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 0) |\
  1101. STM32_DMA_STREAM_ID_MSK(1, 2))
  1102. #define STM32_SPI3_RX_DMA_CHN 0x00000000
  1103. #define STM32_SPI3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1104. STM32_DMA_STREAM_ID_MSK(1, 7))
  1105. #define STM32_SPI3_TX_DMA_CHN 0x00000000
  1106. #define STM32_HAS_SPI4 TRUE
  1107. #define STM32_SPI4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 0) |\
  1108. STM32_DMA_STREAM_ID_MSK(2, 3))
  1109. #define STM32_SPI4_RX_DMA_CHN 0x00005004
  1110. #define STM32_SPI4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  1111. STM32_DMA_STREAM_ID_MSK(2, 2) |\
  1112. STM32_DMA_STREAM_ID_MSK(2, 4))
  1113. #define STM32_SPI4_TX_DMA_CHN 0x00050940
  1114. #define STM32_HAS_SPI5 TRUE
  1115. #define STM32_SPI5_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 3)|\
  1116. STM32_DMA_STREAM_ID_MSK(2, 5))
  1117. #define STM32_SPI5_RX_DMA_CHN 0x00902000
  1118. #define STM32_SPI5_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 4)|\
  1119. STM32_DMA_STREAM_ID_MSK(2, 6))
  1120. #define STM32_SPI5_TX_DMA_CHN 0x07020000
  1121. #define STM32_HAS_SPI6 TRUE
  1122. #define STM32_SPI6_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 6))
  1123. #define STM32_SPI6_RX_DMA_CHN 0x01000000
  1124. #define STM32_SPI6_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 5))
  1125. #define STM32_SPI6_TX_DMA_CHN 0x00100000
  1126. /* TIM attributes.*/
  1127. #define STM32_TIM_MAX_CHANNELS 6
  1128. #define STM32_HAS_TIM1 TRUE
  1129. #define STM32_TIM1_IS_32BITS FALSE
  1130. #define STM32_TIM1_CHANNELS 6
  1131. #define STM32_TIM1_UP_HANDLER VectorA4
  1132. #define STM32_TIM1_CC_HANDLER VectorAC
  1133. #define STM32_TIM1_UP_NUMBER 25
  1134. #define STM32_TIM1_CC_NUMBER 27
  1135. #define STM32_HAS_TIM2 TRUE
  1136. #define STM32_TIM2_IS_32BITS TRUE
  1137. #define STM32_TIM2_CHANNELS 4
  1138. #define STM32_TIM2_HANDLER VectorB0
  1139. #define STM32_TIM2_NUMBER 28
  1140. #define STM32_HAS_TIM3 TRUE
  1141. #define STM32_TIM3_IS_32BITS FALSE
  1142. #define STM32_TIM3_CHANNELS 4
  1143. #define STM32_TIM3_HANDLER VectorB4
  1144. #define STM32_TIM3_NUMBER 29
  1145. #define STM32_HAS_TIM4 TRUE
  1146. #define STM32_TIM4_IS_32BITS FALSE
  1147. #define STM32_TIM4_CHANNELS 4
  1148. #define STM32_TIM4_HANDLER VectorB8
  1149. #define STM32_TIM4_NUMBER 30
  1150. #define STM32_HAS_TIM5 TRUE
  1151. #define STM32_TIM5_IS_32BITS TRUE
  1152. #define STM32_TIM5_CHANNELS 4
  1153. #define STM32_TIM5_HANDLER Vector108
  1154. #define STM32_TIM5_NUMBER 50
  1155. #define STM32_HAS_TIM6 TRUE
  1156. #define STM32_TIM6_IS_32BITS FALSE
  1157. #define STM32_TIM6_CHANNELS 0
  1158. #define STM32_TIM6_HANDLER Vector118
  1159. #define STM32_TIM6_NUMBER 54
  1160. #define STM32_HAS_TIM7 TRUE
  1161. #define STM32_TIM7_IS_32BITS FALSE
  1162. #define STM32_TIM7_CHANNELS 0
  1163. #define STM32_TIM7_HANDLER Vector11C
  1164. #define STM32_TIM7_NUMBER 55
  1165. #define STM32_HAS_TIM8 TRUE
  1166. #define STM32_TIM8_IS_32BITS FALSE
  1167. #define STM32_TIM8_CHANNELS 6
  1168. #define STM32_TIM8_UP_HANDLER VectorF0
  1169. #define STM32_TIM8_CC_HANDLER VectorF8
  1170. #define STM32_TIM8_UP_NUMBER 44
  1171. #define STM32_TIM8_CC_NUMBER 46
  1172. #define STM32_HAS_TIM9 TRUE
  1173. #define STM32_TIM9_IS_32BITS FALSE
  1174. #define STM32_TIM9_CHANNELS 2
  1175. #define STM32_TIM9_HANDLER VectorA0
  1176. #define STM32_TIM9_NUMBER 24
  1177. #define STM32_HAS_TIM10 TRUE
  1178. #define STM32_TIM10_IS_32BITS FALSE
  1179. #define STM32_TIM10_CHANNELS 1
  1180. #define STM32_TIM10_HANDLER VectorA4 /* Note: same as STM32_TIM1_UP */
  1181. #define STM32_TIM10_NUMBER 25 /* Note: same as STM32_TIM1_UP */
  1182. #define STM32_HAS_TIM11 TRUE
  1183. #define STM32_TIM11_IS_32BITS FALSE
  1184. #define STM32_TIM11_CHANNELS 1
  1185. #define STM32_TIM11_HANDLER VectorA8
  1186. #define STM32_TIM11_NUMBER 26
  1187. #define STM32_HAS_TIM12 TRUE
  1188. #define STM32_TIM12_IS_32BITS FALSE
  1189. #define STM32_TIM12_CHANNELS 2
  1190. #define STM32_TIM12_HANDLER VectorEC
  1191. #define STM32_TIM12_NUMBER 43
  1192. #define STM32_HAS_TIM13 TRUE
  1193. #define STM32_TIM13_IS_32BITS FALSE
  1194. #define STM32_TIM13_CHANNELS 1
  1195. #define STM32_TIM13_HANDLER VectorF0 /* Note: same as STM32_TIM8_UP */
  1196. #define STM32_TIM13_NUMBER 44 /* Note: same as STM32_TIM8_UP */
  1197. #define STM32_HAS_TIM14 TRUE
  1198. #define STM32_TIM14_IS_32BITS FALSE
  1199. #define STM32_TIM14_CHANNELS 1
  1200. #define STM32_TIM14_HANDLER VectorF4
  1201. #define STM32_TIM14_NUMBER 45
  1202. #define STM32_HAS_TIM15 FALSE
  1203. #define STM32_HAS_TIM16 FALSE
  1204. #define STM32_HAS_TIM17 FALSE
  1205. #define STM32_HAS_TIM18 FALSE
  1206. #define STM32_HAS_TIM19 FALSE
  1207. #define STM32_HAS_TIM20 FALSE
  1208. #define STM32_HAS_TIM21 FALSE
  1209. #define STM32_HAS_TIM22 FALSE
  1210. /* USART attributes.*/
  1211. #define STM32_HAS_USART1 TRUE
  1212. #define STM32_USART1_HANDLER VectorD4
  1213. #define STM32_USART1_NUMBER 37
  1214. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 2) |\
  1215. STM32_DMA_STREAM_ID_MSK(2, 5))
  1216. #define STM32_USART1_RX_DMA_CHN 0x00400400
  1217. #define STM32_USART1_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 7)
  1218. #define STM32_USART1_TX_DMA_CHN 0x40000000
  1219. #define STM32_HAS_USART2 TRUE
  1220. #define STM32_USART2_HANDLER VectorD8
  1221. #define STM32_USART2_NUMBER 38
  1222. #define STM32_USART2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  1223. #define STM32_USART2_RX_DMA_CHN 0x00400000
  1224. #define STM32_USART2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  1225. #define STM32_USART2_TX_DMA_CHN 0x04000000
  1226. #define STM32_HAS_USART3 TRUE
  1227. #define STM32_USART3_HANDLER VectorDC
  1228. #define STM32_USART3_NUMBER 39
  1229. #define STM32_USART3_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  1230. #define STM32_USART3_RX_DMA_CHN 0x00000040
  1231. #define STM32_USART3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1232. STM32_DMA_STREAM_ID_MSK(1, 4))
  1233. #define STM32_USART3_TX_DMA_CHN 0x00074000
  1234. #define STM32_HAS_UART4 TRUE
  1235. #define STM32_UART4_HANDLER Vector110
  1236. #define STM32_UART4_NUMBER 52
  1237. #define STM32_UART4_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 2)
  1238. #define STM32_UART4_RX_DMA_CHN 0x00000400
  1239. #define STM32_UART4_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  1240. #define STM32_UART4_TX_DMA_CHN 0x00040000
  1241. #define STM32_HAS_UART5 TRUE
  1242. #define STM32_UART5_HANDLER Vector114
  1243. #define STM32_UART5_NUMBER 53
  1244. #define STM32_UART5_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  1245. #define STM32_UART5_RX_DMA_CHN 0x00000004
  1246. #define STM32_UART5_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 7)
  1247. #define STM32_UART5_TX_DMA_CHN 0x40000000
  1248. #define STM32_HAS_USART6 TRUE
  1249. #define STM32_USART6_HANDLER Vector15C
  1250. #define STM32_USART6_NUMBER 71
  1251. #define STM32_USART6_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 1) |\
  1252. STM32_DMA_STREAM_ID_MSK(2, 2))
  1253. #define STM32_USART6_RX_DMA_CHN 0x00000550
  1254. #define STM32_USART6_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(2, 6) |\
  1255. STM32_DMA_STREAM_ID_MSK(2, 7))
  1256. #define STM32_USART6_TX_DMA_CHN 0x55000000
  1257. #define STM32_HAS_UART7 TRUE
  1258. #define STM32_UART7_HANDLER Vector188
  1259. #define STM32_UART7_NUMBER 82
  1260. #define STM32_UART7_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 3)
  1261. #define STM32_UART7_RX_DMA_CHN 0x00005000
  1262. #define STM32_UART7_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 1)
  1263. #define STM32_UART7_TX_DMA_CHN 0x00000050
  1264. #define STM32_HAS_UART8 TRUE
  1265. #define STM32_UART8_HANDLER Vector18C
  1266. #define STM32_UART8_NUMBER 83
  1267. #define STM32_UART8_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 6)
  1268. #define STM32_UART8_RX_DMA_CHN 0x05000000
  1269. #define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
  1270. #define STM32_UART8_TX_DMA_CHN 0x00000005
  1271. #define STM32_HAS_LPUART1 FALSE
  1272. /* USB attributes.*/
  1273. #define STM32_OTG_STEPPING 2
  1274. #define STM32_HAS_OTG1 TRUE
  1275. #define STM32_OTG1_ENDPOINTS 5
  1276. #define STM32_OTG1_HANDLER Vector14C
  1277. #define STM32_OTG1_NUMBER 67
  1278. #define STM32_HAS_OTG2 TRUE
  1279. #define STM32_OTG2_ENDPOINTS 8
  1280. #define STM32_OTG2_HANDLER Vector174
  1281. #define STM32_OTG2_EP1OUT_HANDLER Vector168
  1282. #define STM32_OTG2_EP1IN_HANDLER Vector16C
  1283. #define STM32_OTG2_NUMBER 77
  1284. #define STM32_OTG2_EP1OUT_NUMBER 74
  1285. #define STM32_OTG2_EP1IN_NUMBER 75
  1286. #define STM32_HAS_USB FALSE
  1287. /* IWDG attributes.*/
  1288. #define STM32_HAS_IWDG TRUE
  1289. #define STM32_IWDG_IS_WINDOWED TRUE
  1290. /* LTDC attributes.*/
  1291. #define STM32_HAS_LTDC TRUE
  1292. /* DMA2D attributes.*/
  1293. #define STM32_HAS_DMA2D TRUE
  1294. /* FSMC attributes.*/
  1295. #define STM32_HAS_FSMC TRUE
  1296. #define STM32_FSMC_IS_FMC TRUE
  1297. #define STM32_FSMC_HANDLER Vector100
  1298. #define STM32_FSMC_NUMBER 48
  1299. /* LTDC attributes.*/
  1300. #define STM32_LTDC_EV_HANDLER Vector1A0
  1301. #define STM32_LTDC_ER_HANDLER Vector1A4
  1302. #define STM32_LTDC_EV_NUMBER 88
  1303. #define STM32_LTDC_ER_NUMBER 89
  1304. /* DMA2D attributes.*/
  1305. #define STM32_DMA2D_HANDLER Vector1A8
  1306. #define STM32_DMA2D_NUMBER 90
  1307. /* CRC attributes.*/
  1308. #define STM32_HAS_CRC TRUE
  1309. #define STM32_CRC_PROGRAMMABLE FALSE
  1310. #endif /* defined(STM32F767xx) || defined(STM32F769xx) ||
  1311. defined(STM32F777xx) || defined(STM32F779xx) */
  1312. /** @} */
  1313. #endif /* STM32_REGISTRY_H */
  1314. /** @} */