stm32_registry.h 68 KB

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