stm32_registry.h 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820
  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 STM32L0xx/stm32_registry.h
  15. * @brief STM32L0xx 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 STM32L0xx 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 20
  40. #define STM32_RTC_COMMON_HANDLER Vector48
  41. #define STM32_RTC_COMMON_NUMBER 2
  42. #define STM32_RTC_ALARM_EXTI 17
  43. #define STM32_RTC_TAMP_STAMP_EXTI 19
  44. #define STM32_RTC_WKUP_EXTI 20
  45. #define STM32_RTC_IRQ_ENABLE() \
  46. nvicEnableVector(STM32_RTC_COMMON_NUMBER, STM32_IRQ_EXTI17_20_PRIORITY)
  47. /*===========================================================================*/
  48. /* STM32L011xx. */
  49. /*===========================================================================*/
  50. #if defined(STM32L011xx) || defined(__DOXYGEN__)
  51. /* ADC attributes.*/
  52. #define STM32_HAS_ADC1 TRUE
  53. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  54. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  55. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  56. #define STM32_ADC1_HANDLER Vector70
  57. #define STM32_ADC1_NUMBER 12
  58. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  59. STM32_DMA_STREAM_ID_MSK(1, 2))
  60. #define STM32_ADC1_DMA_CHN 0x00000000
  61. #define STM32_HAS_ADC2 FALSE
  62. #define STM32_HAS_ADC3 FALSE
  63. #define STM32_HAS_ADC4 FALSE
  64. /* CAN attributes.*/
  65. #define STM32_HAS_CAN1 FALSE
  66. #define STM32_HAS_CAN2 FALSE
  67. #define STM32_HAS_CAN3 FALSE
  68. /* DAC attributes.*/
  69. #define STM32_HAS_DAC1_CH1 FALSE
  70. #define STM32_HAS_DAC1_CH2 FALSE
  71. #define STM32_HAS_DAC2_CH1 FALSE
  72. #define STM32_HAS_DAC2_CH2 FALSE
  73. /* DMA attributes.*/
  74. #define STM32_ADVANCED_DMA TRUE
  75. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  76. #define STM32_DMA_SUPPORTS_CSELR TRUE
  77. #define STM32_DMA1_NUM_CHANNELS 5
  78. #define STM32_DMA2_NUM_CHANNELS 0
  79. #define STM32_DMA1_CH1_HANDLER Vector64
  80. #define STM32_DMA1_CH23_HANDLER Vector68
  81. #define STM32_DMA1_CH4567_HANDLER Vector6C
  82. #define STM32_DMA1_CH1_NUMBER 9
  83. #define STM32_DMA1_CH23_NUMBER 10
  84. #define STM32_DMA1_CH4567_NUMBER 11
  85. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  86. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  87. #define DMA1_CH2_CMASK 0x00000006U
  88. #define DMA1_CH3_CMASK 0x00000006U
  89. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  90. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  91. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  92. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  93. #define DMA1_CH4_CMASK 0x00000078U
  94. #define DMA1_CH5_CMASK 0x00000078U
  95. #define DMA1_CH6_CMASK 0x00000078U
  96. #define DMA1_CH7_CMASK 0x00000078U
  97. /* ETH attributes.*/
  98. #define STM32_HAS_ETH FALSE
  99. /* EXTI attributes.*/
  100. #define STM32_EXTI_NUM_LINES 23
  101. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  102. #define STM32_EXTI_LINE01_HANDLER Vector54
  103. #define STM32_EXTI_LINE23_HANDLER Vector58
  104. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  105. #define STM32_EXTI_LINE16_HANDLER Vector44
  106. #define STM32_EXTI_LINE171920_HANDLER Vector48
  107. #define STM32_EXTI_LINE2122_HANDLER Vector70
  108. #define STM32_EXTI_LINE01_NUMBER 5
  109. #define STM32_EXTI_LINE23_NUMBER 6
  110. #define STM32_EXTI_LINE4_15_NUMBER 7
  111. #define STM32_EXTI_LINE16_NUMBER 1
  112. #define STM32_EXTI_LINE171920_NUMBER 2
  113. #define STM32_EXTI_LINE2122_NUMBER 12
  114. /* GPIO attributes.*/
  115. #define STM32_HAS_GPIOA TRUE
  116. #define STM32_HAS_GPIOB TRUE
  117. #define STM32_HAS_GPIOC TRUE
  118. #define STM32_HAS_GPIOD FALSE
  119. #define STM32_HAS_GPIOE FALSE
  120. #define STM32_HAS_GPIOF FALSE
  121. #define STM32_HAS_GPIOG FALSE
  122. #define STM32_HAS_GPIOH FALSE
  123. #define STM32_HAS_GPIOI FALSE
  124. #define STM32_HAS_GPIOJ FALSE
  125. #define STM32_HAS_GPIOK FALSE
  126. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  127. RCC_IOPENR_GPIOBEN | \
  128. RCC_IOPENR_GPIOCEN)
  129. /* I2C attributes.*/
  130. #define STM32_HAS_I2C1 TRUE
  131. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  132. #define STM32_I2C1_GLOBAL_NUMBER 23
  133. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  134. STM32_DMA_STREAM_ID_MSK(1, 7))
  135. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  136. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  137. STM32_DMA_STREAM_ID_MSK(1, 6))
  138. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  139. #define STM32_HAS_I2C2 FALSE
  140. #define STM32_HAS_I2C3 FALSE
  141. #define STM32_HAS_I2C4 FALSE
  142. /* QUADSPI attributes.*/
  143. #define STM32_HAS_QUADSPI1 FALSE
  144. /* SDIO attributes.*/
  145. #define STM32_HAS_SDIO FALSE
  146. /* SPI attributes.*/
  147. #define STM32_HAS_SPI1 TRUE
  148. #define STM32_SPI1_SUPPORTS_I2S FALSE
  149. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  150. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  151. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  152. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  153. #define STM32_HAS_SPI2 FALSE
  154. #define STM32_HAS_SPI3 FALSE
  155. #define STM32_HAS_SPI4 FALSE
  156. #define STM32_HAS_SPI5 FALSE
  157. #define STM32_HAS_SPI6 FALSE
  158. /* TIM attributes.*/
  159. #define STM32_TIM_MAX_CHANNELS 4
  160. #define STM32_HAS_TIM2 TRUE
  161. #define STM32_TIM2_IS_32BITS FALSE
  162. #define STM32_TIM2_CHANNELS 4
  163. #define STM32_TIM2_HANDLER Vector7C
  164. #define STM32_TIM2_NUMBER 15
  165. #define STM32_HAS_TIM21 TRUE
  166. #define STM32_TIM21_IS_32BITS FALSE
  167. #define STM32_TIM21_CHANNELS 2
  168. #define STM32_TIM21_HANDLER Vector90
  169. #define STM32_TIM21_NUMBER 20
  170. #define STM32_HAS_TIM1 FALSE
  171. #define STM32_HAS_TIM3 FALSE
  172. #define STM32_HAS_TIM4 FALSE
  173. #define STM32_HAS_TIM5 FALSE
  174. #define STM32_HAS_TIM6 FALSE
  175. #define STM32_HAS_TIM7 FALSE
  176. #define STM32_HAS_TIM8 FALSE
  177. #define STM32_HAS_TIM9 FALSE
  178. #define STM32_HAS_TIM10 FALSE
  179. #define STM32_HAS_TIM11 FALSE
  180. #define STM32_HAS_TIM12 FALSE
  181. #define STM32_HAS_TIM13 FALSE
  182. #define STM32_HAS_TIM14 FALSE
  183. #define STM32_HAS_TIM15 FALSE
  184. #define STM32_HAS_TIM16 FALSE
  185. #define STM32_HAS_TIM17 FALSE
  186. #define STM32_HAS_TIM18 FALSE
  187. #define STM32_HAS_TIM19 FALSE
  188. #define STM32_HAS_TIM20 FALSE
  189. #define STM32_HAS_TIM22 FALSE
  190. /* USART attributes.*/
  191. #define STM32_HAS_USART2 TRUE
  192. #define STM32_USART2_HANDLER VectorB0
  193. #define STM32_USART2_NUMBER 28
  194. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  195. STM32_DMA_STREAM_ID_MSK(1, 6))
  196. #define STM32_USART2_RX_DMA_CHN 0x00440000
  197. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  198. STM32_DMA_STREAM_ID_MSK(1, 7))
  199. #define STM32_USART2_TX_DMA_CHN 0x04004000
  200. #define STM32_HAS_LPUART1 TRUE
  201. #define STM32_LPUART1_HANDLER VectorB4
  202. #define STM32_LPUART1_NUMBER 29
  203. #define STM32_HAS_USART1 FALSE
  204. #define STM32_HAS_USART3 FALSE
  205. #define STM32_HAS_UART4 FALSE
  206. #define STM32_HAS_UART5 FALSE
  207. #define STM32_HAS_USART6 FALSE
  208. #define STM32_HAS_UART7 FALSE
  209. #define STM32_HAS_UART8 FALSE
  210. /* USB attributes.*/
  211. #define STM32_HAS_USB FALSE
  212. #define STM32_HAS_OTG1 FALSE
  213. #define STM32_HAS_OTG2 FALSE
  214. /* IWDG attributes.*/
  215. #define STM32_HAS_IWDG TRUE
  216. #define STM32_IWDG_IS_WINDOWED TRUE
  217. /* LTDC attributes.*/
  218. #define STM32_HAS_LTDC FALSE
  219. /* DMA2D attributes.*/
  220. #define STM32_HAS_DMA2D FALSE
  221. /* FSMC attributes.*/
  222. #define STM32_HAS_FSMC FALSE
  223. /* CRC attributes.*/
  224. #define STM32_HAS_CRC TRUE
  225. #define STM32_CRC_PROGRAMMABLE TRUE
  226. /*===========================================================================*/
  227. /* STM32L031xx. */
  228. /*===========================================================================*/
  229. #elif defined(STM32L031xx)
  230. /* ADC attributes.*/
  231. #define STM32_HAS_ADC1 TRUE
  232. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  233. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  234. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  235. #define STM32_ADC1_HANDLER Vector70
  236. #define STM32_ADC1_NUMBER 12
  237. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  238. STM32_DMA_STREAM_ID_MSK(1, 2))
  239. #define STM32_ADC1_DMA_CHN 0x00000000
  240. #define STM32_HAS_ADC2 FALSE
  241. #define STM32_HAS_ADC3 FALSE
  242. #define STM32_HAS_ADC4 FALSE
  243. /* CAN attributes.*/
  244. #define STM32_HAS_CAN1 FALSE
  245. #define STM32_HAS_CAN2 FALSE
  246. #define STM32_HAS_CAN3 FALSE
  247. /* DAC attributes.*/
  248. #define STM32_HAS_DAC1_CH1 FALSE
  249. #define STM32_HAS_DAC1_CH2 FALSE
  250. #define STM32_HAS_DAC2_CH1 FALSE
  251. #define STM32_HAS_DAC2_CH2 FALSE
  252. /* DMA attributes.*/
  253. #define STM32_ADVANCED_DMA TRUE
  254. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  255. #define STM32_DMA_SUPPORTS_CSELR TRUE
  256. #define STM32_DMA1_NUM_CHANNELS 7
  257. #define STM32_DMA2_NUM_CHANNELS 0
  258. #define STM32_DMA1_CH1_HANDLER Vector64
  259. #define STM32_DMA1_CH23_HANDLER Vector68
  260. #define STM32_DMA1_CH4567_HANDLER Vector6C
  261. #define STM32_DMA1_CH1_NUMBER 9
  262. #define STM32_DMA1_CH23_NUMBER 10
  263. #define STM32_DMA1_CH4567_NUMBER 11
  264. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  265. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  266. #define DMA1_CH2_CMASK 0x00000006U
  267. #define DMA1_CH3_CMASK 0x00000006U
  268. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  269. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  270. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  271. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  272. #define DMA1_CH4_CMASK 0x00000078U
  273. #define DMA1_CH5_CMASK 0x00000078U
  274. #define DMA1_CH6_CMASK 0x00000078U
  275. #define DMA1_CH7_CMASK 0x00000078U
  276. /* ETH attributes.*/
  277. #define STM32_HAS_ETH FALSE
  278. /* EXTI attributes.*/
  279. #define STM32_EXTI_NUM_LINES 23
  280. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  281. #define STM32_EXTI_LINE01_HANDLER Vector54
  282. #define STM32_EXTI_LINE23_HANDLER Vector58
  283. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  284. #define STM32_EXTI_LINE16_HANDLER Vector44
  285. #define STM32_EXTI_LINE171920_HANDLER Vector48
  286. #define STM32_EXTI_LINE2122_HANDLER Vector70
  287. #define STM32_EXTI_LINE01_NUMBER 5
  288. #define STM32_EXTI_LINE23_NUMBER 6
  289. #define STM32_EXTI_LINE4_15_NUMBER 7
  290. #define STM32_EXTI_LINE16_NUMBER 1
  291. #define STM32_EXTI_LINE171920_NUMBER 2
  292. #define STM32_EXTI_LINE2122_NUMBER 12
  293. /* GPIO attributes.*/
  294. #define STM32_HAS_GPIOA TRUE
  295. #define STM32_HAS_GPIOB TRUE
  296. #define STM32_HAS_GPIOC TRUE
  297. #define STM32_HAS_GPIOD FALSE
  298. #define STM32_HAS_GPIOE FALSE
  299. #define STM32_HAS_GPIOF FALSE
  300. #define STM32_HAS_GPIOG FALSE
  301. #define STM32_HAS_GPIOH TRUE
  302. #define STM32_HAS_GPIOI FALSE
  303. #define STM32_HAS_GPIOJ FALSE
  304. #define STM32_HAS_GPIOK FALSE
  305. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  306. RCC_IOPENR_GPIOBEN | \
  307. RCC_IOPENR_GPIOCEN | \
  308. RCC_IOPENR_GPIOHEN)
  309. /* I2C attributes.*/
  310. #define STM32_HAS_I2C1 TRUE
  311. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  312. #define STM32_I2C1_GLOBAL_NUMBER 23
  313. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  314. STM32_DMA_STREAM_ID_MSK(1, 7))
  315. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  316. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  317. STM32_DMA_STREAM_ID_MSK(1, 6))
  318. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  319. #define STM32_HAS_I2C2 FALSE
  320. #define STM32_HAS_I2C3 FALSE
  321. #define STM32_HAS_I2C4 FALSE
  322. /* SDIO attributes.*/
  323. #define STM32_HAS_SDIO FALSE
  324. /* SPI attributes.*/
  325. #define STM32_HAS_SPI1 TRUE
  326. #define STM32_SPI1_SUPPORTS_I2S FALSE
  327. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  328. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  329. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  330. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  331. #define STM32_HAS_SPI2 FALSE
  332. #define STM32_HAS_SPI3 FALSE
  333. #define STM32_HAS_SPI4 FALSE
  334. #define STM32_HAS_SPI5 FALSE
  335. #define STM32_HAS_SPI6 FALSE
  336. /* TIM attributes.*/
  337. #define STM32_TIM_MAX_CHANNELS 4
  338. #define STM32_HAS_TIM2 TRUE
  339. #define STM32_TIM2_IS_32BITS FALSE
  340. #define STM32_TIM2_CHANNELS 4
  341. #define STM32_TIM2_HANDLER Vector7C
  342. #define STM32_TIM2_NUMBER 15
  343. #define STM32_HAS_TIM21 TRUE
  344. #define STM32_TIM21_IS_32BITS FALSE
  345. #define STM32_TIM21_CHANNELS 2
  346. #define STM32_TIM21_HANDLER Vector90
  347. #define STM32_TIM21_NUMBER 20
  348. #define STM32_HAS_TIM22 TRUE
  349. #define STM32_TIM22_IS_32BITS FALSE
  350. #define STM32_TIM22_CHANNELS 2
  351. #define STM32_TIM22_HANDLER Vector98
  352. #define STM32_TIM22_NUMBER 22
  353. #define STM32_HAS_TIM1 FALSE
  354. #define STM32_HAS_TIM3 FALSE
  355. #define STM32_HAS_TIM4 FALSE
  356. #define STM32_HAS_TIM5 FALSE
  357. #define STM32_HAS_TIM6 FALSE
  358. #define STM32_HAS_TIM7 FALSE
  359. #define STM32_HAS_TIM8 FALSE
  360. #define STM32_HAS_TIM9 FALSE
  361. #define STM32_HAS_TIM10 FALSE
  362. #define STM32_HAS_TIM11 FALSE
  363. #define STM32_HAS_TIM12 FALSE
  364. #define STM32_HAS_TIM13 FALSE
  365. #define STM32_HAS_TIM14 FALSE
  366. #define STM32_HAS_TIM15 FALSE
  367. #define STM32_HAS_TIM16 FALSE
  368. #define STM32_HAS_TIM17 FALSE
  369. #define STM32_HAS_TIM18 FALSE
  370. #define STM32_HAS_TIM19 FALSE
  371. #define STM32_HAS_TIM20 FALSE
  372. /* USART attributes.*/
  373. #define STM32_HAS_USART2 TRUE
  374. #define STM32_USART2_HANDLER VectorB0
  375. #define STM32_USART2_NUMBER 28
  376. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  377. STM32_DMA_STREAM_ID_MSK(1, 6))
  378. #define STM32_USART2_RX_DMA_CHN 0x00440000
  379. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  380. STM32_DMA_STREAM_ID_MSK(1, 7))
  381. #define STM32_USART2_TX_DMA_CHN 0x04004000
  382. #define STM32_HAS_LPUART1 TRUE
  383. #define STM32_LPUART1_HANDLER VectorB4
  384. #define STM32_LPUART1_NUMBER 29
  385. #define STM32_HAS_USART1 FALSE
  386. #define STM32_HAS_USART3 FALSE
  387. #define STM32_HAS_UART4 FALSE
  388. #define STM32_HAS_UART5 FALSE
  389. #define STM32_HAS_USART6 FALSE
  390. #define STM32_HAS_UART7 FALSE
  391. #define STM32_HAS_UART8 FALSE
  392. /* USB attributes.*/
  393. #define STM32_HAS_USB FALSE
  394. #define STM32_HAS_OTG1 FALSE
  395. #define STM32_HAS_OTG2 FALSE
  396. /* IWDG attributes.*/
  397. #define STM32_HAS_IWDG TRUE
  398. #define STM32_IWDG_IS_WINDOWED TRUE
  399. /* LTDC attributes.*/
  400. #define STM32_HAS_LTDC FALSE
  401. /* DMA2D attributes.*/
  402. #define STM32_HAS_DMA2D FALSE
  403. /* FSMC attributes.*/
  404. #define STM32_HAS_FSMC FALSE
  405. /* CRC attributes.*/
  406. #define STM32_HAS_CRC TRUE
  407. #define STM32_CRC_PROGRAMMABLE TRUE
  408. /*===========================================================================*/
  409. /* STM32L051xx, STM32L061xx. */
  410. /*===========================================================================*/
  411. #elif defined(STM32L051xx) || defined(STM32L061xx)
  412. /* ADC attributes.*/
  413. #define STM32_HAS_ADC1 TRUE
  414. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  415. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  416. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  417. #define STM32_ADC1_HANDLER Vector70
  418. #define STM32_ADC1_NUMBER 12
  419. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  420. STM32_DMA_STREAM_ID_MSK(1, 2))
  421. #define STM32_ADC1_DMA_CHN 0x00000000
  422. #define STM32_HAS_ADC2 FALSE
  423. #define STM32_HAS_ADC3 FALSE
  424. #define STM32_HAS_ADC4 FALSE
  425. /* CAN attributes.*/
  426. #define STM32_HAS_CAN1 FALSE
  427. #define STM32_HAS_CAN2 FALSE
  428. #define STM32_HAS_CAN3 FALSE
  429. /* DAC attributes.*/
  430. #define STM32_HAS_DAC1_CH1 FALSE
  431. #define STM32_HAS_DAC1_CH2 FALSE
  432. #define STM32_HAS_DAC2_CH1 FALSE
  433. #define STM32_HAS_DAC2_CH2 FALSE
  434. /* DMA attributes.*/
  435. #define STM32_ADVANCED_DMA TRUE
  436. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  437. #define STM32_DMA_SUPPORTS_CSELR TRUE
  438. #define STM32_DMA1_NUM_CHANNELS 7
  439. #define STM32_DMA2_NUM_CHANNELS 0
  440. #define STM32_DMA1_CH1_HANDLER Vector64
  441. #define STM32_DMA1_CH23_HANDLER Vector68
  442. #define STM32_DMA1_CH4567_HANDLER Vector6C
  443. #define STM32_DMA1_CH1_NUMBER 9
  444. #define STM32_DMA1_CH23_NUMBER 10
  445. #define STM32_DMA1_CH4567_NUMBER 11
  446. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  447. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  448. #define DMA1_CH2_CMASK 0x00000006U
  449. #define DMA1_CH3_CMASK 0x00000006U
  450. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  451. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  452. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  453. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  454. #define DMA1_CH4_CMASK 0x00000078U
  455. #define DMA1_CH5_CMASK 0x00000078U
  456. #define DMA1_CH6_CMASK 0x00000078U
  457. #define DMA1_CH7_CMASK 0x00000078U
  458. /* ETH attributes.*/
  459. #define STM32_HAS_ETH FALSE
  460. /* EXTI attributes.*/
  461. #define STM32_EXTI_NUM_LINES 23
  462. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  463. #define STM32_EXTI_LINE01_HANDLER Vector54
  464. #define STM32_EXTI_LINE23_HANDLER Vector58
  465. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  466. #define STM32_EXTI_LINE16_HANDLER Vector44
  467. #define STM32_EXTI_LINE171920_HANDLER Vector48
  468. #define STM32_EXTI_LINE2122_HANDLER Vector70
  469. #define STM32_EXTI_LINE01_NUMBER 5
  470. #define STM32_EXTI_LINE23_NUMBER 6
  471. #define STM32_EXTI_LINE4_15_NUMBER 7
  472. #define STM32_EXTI_LINE16_NUMBER 1
  473. #define STM32_EXTI_LINE171920_NUMBER 2
  474. #define STM32_EXTI_LINE2122_NUMBER 12
  475. /* GPIO attributes.*/
  476. #define STM32_HAS_GPIOA TRUE
  477. #define STM32_HAS_GPIOB TRUE
  478. #define STM32_HAS_GPIOC TRUE
  479. #define STM32_HAS_GPIOD TRUE
  480. #define STM32_HAS_GPIOE FALSE
  481. #define STM32_HAS_GPIOF FALSE
  482. #define STM32_HAS_GPIOG FALSE
  483. #define STM32_HAS_GPIOH TRUE
  484. #define STM32_HAS_GPIOI FALSE
  485. #define STM32_HAS_GPIOJ FALSE
  486. #define STM32_HAS_GPIOK FALSE
  487. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  488. RCC_IOPENR_GPIOBEN | \
  489. RCC_IOPENR_GPIOCEN | \
  490. RCC_IOPENR_GPIODEN | \
  491. RCC_IOPENR_GPIOHEN)
  492. /* I2C attributes.*/
  493. #define STM32_HAS_I2C1 TRUE
  494. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  495. #define STM32_I2C1_GLOBAL_NUMBER 23
  496. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  497. STM32_DMA_STREAM_ID_MSK(1, 7))
  498. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  499. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  500. STM32_DMA_STREAM_ID_MSK(1, 6))
  501. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  502. #define STM32_HAS_I2C2 TRUE
  503. #define STM32_I2C2_GLOBAL_HANDLER VectorA0
  504. #define STM32_I2C2_GLOBAL_NUMBER 24
  505. #define STM32_I2C2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  506. #define STM32_I2C2_RX_DMA_CHN 0x00070000
  507. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  508. #define STM32_I2C2_TX_DMA_CHN 0x00007000
  509. #define STM32_HAS_I2C3 FALSE
  510. #define STM32_HAS_I2C4 FALSE
  511. /* SDIO attributes.*/
  512. #define STM32_HAS_SDIO FALSE
  513. /* SPI attributes.*/
  514. #define STM32_HAS_SPI1 TRUE
  515. #define STM32_SPI1_SUPPORTS_I2S FALSE
  516. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  517. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  518. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  519. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  520. #define STM32_HAS_SPI2 TRUE
  521. #define STM32_SPI2_SUPPORTS_I2S TRUE
  522. #define STM32_SPI2_I2S_FULLDUPLEX FALSE
  523. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  524. STM32_DMA_STREAM_ID_MSK(1, 6))
  525. #define STM32_SPI2_RX_DMA_CHN 0x00202000
  526. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  527. STM32_DMA_STREAM_ID_MSK(1, 7))
  528. #define STM32_SPI2_TX_DMA_CHN 0x02020000
  529. #define STM32_HAS_SPI3 FALSE
  530. #define STM32_HAS_SPI4 FALSE
  531. #define STM32_HAS_SPI5 FALSE
  532. #define STM32_HAS_SPI6 FALSE
  533. /* TIM attributes.*/
  534. #define STM32_TIM_MAX_CHANNELS 4
  535. #define STM32_HAS_TIM2 TRUE
  536. #define STM32_TIM2_IS_32BITS FALSE
  537. #define STM32_TIM2_CHANNELS 4
  538. #define STM32_TIM2_HANDLER Vector7C
  539. #define STM32_TIM2_NUMBER 15
  540. #define STM32_HAS_TIM6 TRUE
  541. #define STM32_TIM6_IS_32BITS FALSE
  542. #define STM32_TIM6_CHANNELS 0
  543. #define STM32_TIM6_HANDLER Vector84
  544. #define STM32_TIM6_NUMBER 17
  545. #define STM32_HAS_TIM21 TRUE
  546. #define STM32_TIM21_IS_32BITS FALSE
  547. #define STM32_TIM21_CHANNELS 2
  548. #define STM32_TIM21_HANDLER Vector90
  549. #define STM32_TIM21_NUMBER 20
  550. #define STM32_HAS_TIM22 TRUE
  551. #define STM32_TIM22_IS_32BITS FALSE
  552. #define STM32_TIM22_CHANNELS 2
  553. #define STM32_TIM22_HANDLER Vector98
  554. #define STM32_TIM22_NUMBER 22
  555. #define STM32_HAS_TIM1 FALSE
  556. #define STM32_HAS_TIM3 FALSE
  557. #define STM32_HAS_TIM4 FALSE
  558. #define STM32_HAS_TIM5 FALSE
  559. #define STM32_HAS_TIM7 FALSE
  560. #define STM32_HAS_TIM8 FALSE
  561. #define STM32_HAS_TIM9 FALSE
  562. #define STM32_HAS_TIM10 FALSE
  563. #define STM32_HAS_TIM11 FALSE
  564. #define STM32_HAS_TIM12 FALSE
  565. #define STM32_HAS_TIM13 FALSE
  566. #define STM32_HAS_TIM14 FALSE
  567. #define STM32_HAS_TIM15 FALSE
  568. #define STM32_HAS_TIM16 FALSE
  569. #define STM32_HAS_TIM17 FALSE
  570. #define STM32_HAS_TIM18 FALSE
  571. #define STM32_HAS_TIM19 FALSE
  572. #define STM32_HAS_TIM20 FALSE
  573. /* USART attributes.*/
  574. #define STM32_HAS_USART1 TRUE
  575. #define STM32_USART1_HANDLER VectorAC
  576. #define STM32_USART1_NUMBER 27
  577. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  578. STM32_DMA_STREAM_ID_MSK(1, 5))
  579. #define STM32_USART1_RX_DMA_CHN 0x00030300
  580. #define STM32_USART1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  581. STM32_DMA_STREAM_ID_MSK(1, 4))
  582. #define STM32_USART1_TX_DMA_CHN 0x00003030
  583. #define STM32_HAS_USART2 TRUE
  584. #define STM32_USART2_HANDLER VectorB0
  585. #define STM32_USART2_NUMBER 28
  586. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  587. STM32_DMA_STREAM_ID_MSK(1, 6))
  588. #define STM32_USART2_RX_DMA_CHN 0x00440000
  589. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  590. STM32_DMA_STREAM_ID_MSK(1, 7))
  591. #define STM32_USART2_TX_DMA_CHN 0x04004000
  592. #define STM32_HAS_LPUART1 TRUE
  593. #define STM32_LPUART1_HANDLER VectorB4
  594. #define STM32_LPUART1_NUMBER 29
  595. #define STM32_HAS_USART3 FALSE
  596. #define STM32_HAS_UART4 FALSE
  597. #define STM32_HAS_UART5 FALSE
  598. #define STM32_HAS_USART6 FALSE
  599. #define STM32_HAS_UART7 FALSE
  600. #define STM32_HAS_UART8 FALSE
  601. /* USB attributes.*/
  602. #define STM32_HAS_USB FALSE
  603. #define STM32_HAS_OTG1 FALSE
  604. #define STM32_HAS_OTG2 FALSE
  605. /* IWDG attributes.*/
  606. #define STM32_HAS_IWDG TRUE
  607. #define STM32_IWDG_IS_WINDOWED TRUE
  608. /* LTDC attributes.*/
  609. #define STM32_HAS_LTDC FALSE
  610. /* DMA2D attributes.*/
  611. #define STM32_HAS_DMA2D FALSE
  612. /* FSMC attributes.*/
  613. #define STM32_HAS_FSMC FALSE
  614. /* CRC attributes.*/
  615. #define STM32_HAS_CRC TRUE
  616. #define STM32_CRC_PROGRAMMABLE TRUE
  617. /*===========================================================================*/
  618. /* STM32L052xx, STM32L062xx. */
  619. /*===========================================================================*/
  620. #elif defined(STM32L052xx) || defined(STM32L062xx)
  621. /* ADC attributes.*/
  622. #define STM32_HAS_ADC1 TRUE
  623. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  624. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  625. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  626. #define STM32_ADC1_HANDLER Vector70
  627. #define STM32_ADC1_NUMBER 12
  628. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  629. STM32_DMA_STREAM_ID_MSK(1, 2))
  630. #define STM32_ADC1_DMA_CHN 0x00000000
  631. #define STM32_HAS_ADC2 FALSE
  632. #define STM32_HAS_ADC3 FALSE
  633. #define STM32_HAS_ADC4 FALSE
  634. /* CAN attributes.*/
  635. #define STM32_HAS_CAN1 FALSE
  636. #define STM32_HAS_CAN2 FALSE
  637. #define STM32_HAS_CAN3 FALSE
  638. /* DAC attributes.*/
  639. #define STM32_HAS_DAC1_CH1 TRUE
  640. #define STM32_DAC1_CH1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  641. #define STM32_DAC1_CH1_DMA_CHN 0x00000090
  642. #define STM32_HAS_DAC1_CH2 FALSE
  643. #define STM32_HAS_DAC2_CH1 FALSE
  644. #define STM32_HAS_DAC2_CH2 FALSE
  645. /* DMA attributes.*/
  646. #define STM32_ADVANCED_DMA TRUE
  647. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  648. #define STM32_DMA_SUPPORTS_CSELR TRUE
  649. #define STM32_DMA1_NUM_CHANNELS 7
  650. #define STM32_DMA2_NUM_CHANNELS 0
  651. #define STM32_DMA1_CH1_HANDLER Vector64
  652. #define STM32_DMA1_CH23_HANDLER Vector68
  653. #define STM32_DMA1_CH4567_HANDLER Vector6C
  654. #define STM32_DMA1_CH1_NUMBER 9
  655. #define STM32_DMA1_CH23_NUMBER 10
  656. #define STM32_DMA1_CH4567_NUMBER 11
  657. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  658. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  659. #define DMA1_CH2_CMASK 0x00000006U
  660. #define DMA1_CH3_CMASK 0x00000006U
  661. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  662. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  663. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  664. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  665. #define DMA1_CH4_CMASK 0x00000078U
  666. #define DMA1_CH5_CMASK 0x00000078U
  667. #define DMA1_CH6_CMASK 0x00000078U
  668. #define DMA1_CH7_CMASK 0x00000078U
  669. /* ETH attributes.*/
  670. #define STM32_HAS_ETH FALSE
  671. /* EXTI attributes.*/
  672. #define STM32_EXTI_NUM_LINES 23
  673. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  674. #define STM32_EXTI_LINE01_HANDLER Vector54
  675. #define STM32_EXTI_LINE23_HANDLER Vector58
  676. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  677. #define STM32_EXTI_LINE16_HANDLER Vector44
  678. #define STM32_EXTI_LINE171920_HANDLER Vector48
  679. #define STM32_EXTI_LINE2122_HANDLER Vector70
  680. #define STM32_EXTI_LINE01_NUMBER 5
  681. #define STM32_EXTI_LINE23_NUMBER 6
  682. #define STM32_EXTI_LINE4_15_NUMBER 7
  683. #define STM32_EXTI_LINE16_NUMBER 1
  684. #define STM32_EXTI_LINE171920_NUMBER 2
  685. #define STM32_EXTI_LINE2122_NUMBER 12
  686. /* GPIO attributes.*/
  687. #define STM32_HAS_GPIOA TRUE
  688. #define STM32_HAS_GPIOB TRUE
  689. #define STM32_HAS_GPIOC TRUE
  690. #define STM32_HAS_GPIOD TRUE
  691. #define STM32_HAS_GPIOE FALSE
  692. #define STM32_HAS_GPIOF FALSE
  693. #define STM32_HAS_GPIOG FALSE
  694. #define STM32_HAS_GPIOH TRUE
  695. #define STM32_HAS_GPIOI FALSE
  696. #define STM32_HAS_GPIOJ FALSE
  697. #define STM32_HAS_GPIOK FALSE
  698. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  699. RCC_IOPENR_GPIOBEN | \
  700. RCC_IOPENR_GPIOCEN | \
  701. RCC_IOPENR_GPIODEN | \
  702. RCC_IOPENR_GPIOHEN)
  703. /* I2C attributes.*/
  704. #define STM32_HAS_I2C1 TRUE
  705. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  706. #define STM32_I2C1_GLOBAL_NUMBER 23
  707. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  708. STM32_DMA_STREAM_ID_MSK(1, 7))
  709. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  710. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  711. STM32_DMA_STREAM_ID_MSK(1, 6))
  712. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  713. #define STM32_HAS_I2C2 TRUE
  714. #define STM32_I2C2_GLOBAL_HANDLER VectorA0
  715. #define STM32_I2C2_GLOBAL_NUMBER 24
  716. #define STM32_I2C2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  717. #define STM32_I2C2_RX_DMA_CHN 0x00070000
  718. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  719. #define STM32_I2C2_TX_DMA_CHN 0x00007000
  720. #define STM32_HAS_I2C3 FALSE
  721. /* SDIO attributes.*/
  722. #define STM32_HAS_SDIO FALSE
  723. /* SPI attributes.*/
  724. #define STM32_HAS_SPI1 TRUE
  725. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  726. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  727. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  728. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  729. #define STM32_HAS_SPI2 TRUE
  730. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  731. STM32_DMA_STREAM_ID_MSK(1, 6))
  732. #define STM32_SPI2_RX_DMA_CHN 0x00202000
  733. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  734. STM32_DMA_STREAM_ID_MSK(1, 7))
  735. #define STM32_SPI2_TX_DMA_CHN 0x02020000
  736. #define STM32_HAS_SPI3 FALSE
  737. #define STM32_HAS_SPI4 FALSE
  738. #define STM32_HAS_SPI5 FALSE
  739. #define STM32_HAS_SPI6 FALSE
  740. /* TIM attributes.*/
  741. #define STM32_TIM_MAX_CHANNELS 4
  742. #define STM32_HAS_TIM2 TRUE
  743. #define STM32_TIM2_IS_32BITS FALSE
  744. #define STM32_TIM2_CHANNELS 4
  745. #define STM32_TIM2_HANDLER Vector7C
  746. #define STM32_TIM2_NUMBER 15
  747. #define STM32_HAS_TIM6 TRUE
  748. #define STM32_TIM6_IS_32BITS FALSE
  749. #define STM32_TIM6_CHANNELS 0
  750. #define STM32_TIM6_HANDLER Vector84
  751. #define STM32_TIM6_NUMBER 17
  752. #define STM32_HAS_TIM21 TRUE
  753. #define STM32_TIM21_IS_32BITS FALSE
  754. #define STM32_TIM21_CHANNELS 2
  755. #define STM32_TIM21_HANDLER Vector90
  756. #define STM32_TIM21_NUMBER 20
  757. #define STM32_HAS_TIM22 TRUE
  758. #define STM32_TIM22_IS_32BITS FALSE
  759. #define STM32_TIM22_CHANNELS 2
  760. #define STM32_TIM22_HANDLER Vector98
  761. #define STM32_TIM22_NUMBER 22
  762. #define STM32_HAS_TIM1 FALSE
  763. #define STM32_HAS_TIM3 FALSE
  764. #define STM32_HAS_TIM4 FALSE
  765. #define STM32_HAS_TIM5 FALSE
  766. #define STM32_HAS_TIM7 FALSE
  767. #define STM32_HAS_TIM8 FALSE
  768. #define STM32_HAS_TIM9 FALSE
  769. #define STM32_HAS_TIM10 FALSE
  770. #define STM32_HAS_TIM11 FALSE
  771. #define STM32_HAS_TIM12 FALSE
  772. #define STM32_HAS_TIM13 FALSE
  773. #define STM32_HAS_TIM14 FALSE
  774. #define STM32_HAS_TIM15 FALSE
  775. #define STM32_HAS_TIM16 FALSE
  776. #define STM32_HAS_TIM17 FALSE
  777. #define STM32_HAS_TIM18 FALSE
  778. #define STM32_HAS_TIM19 FALSE
  779. #define STM32_HAS_TIM20 FALSE
  780. /* USART attributes.*/
  781. #define STM32_HAS_USART1 TRUE
  782. #define STM32_USART1_HANDLER VectorAC
  783. #define STM32_USART1_NUMBER 27
  784. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  785. STM32_DMA_STREAM_ID_MSK(1, 5))
  786. #define STM32_USART1_RX_DMA_CHN 0x00030300
  787. #define STM32_USART1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  788. STM32_DMA_STREAM_ID_MSK(1, 4))
  789. #define STM32_USART1_TX_DMA_CHN 0x00003030
  790. #define STM32_HAS_USART2 TRUE
  791. #define STM32_USART2_HANDLER VectorB0
  792. #define STM32_USART2_NUMBER 28
  793. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  794. STM32_DMA_STREAM_ID_MSK(1, 6))
  795. #define STM32_USART2_RX_DMA_CHN 0x00440000
  796. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  797. STM32_DMA_STREAM_ID_MSK(1, 7))
  798. #define STM32_USART2_TX_DMA_CHN 0x04004000
  799. #define STM32_HAS_LPUART1 TRUE
  800. #define STM32_LPUART1_HANDLER VectorB4
  801. #define STM32_LPUART1_NUMBER 29
  802. #define STM32_HAS_USART3 FALSE
  803. #define STM32_HAS_UART4 FALSE
  804. #define STM32_HAS_UART5 FALSE
  805. #define STM32_HAS_USART6 FALSE
  806. #define STM32_HAS_UART7 FALSE
  807. #define STM32_HAS_UART8 FALSE
  808. /* USB attributes.*/
  809. #define STM32_HAS_USB TRUE
  810. #define STM32_USB_ACCESS_SCHEME_2x16 TRUE
  811. #define STM32_USB_PMA_SIZE 1024
  812. #define STM32_USB_HAS_BCDR TRUE
  813. #define STM32_USB1_LP_HANDLER VectorBC
  814. #define STM32_USB1_LP_NUMBER 31
  815. #define STM32_USB1_HP_HANDLER VectorBC
  816. #define STM32_USB1_HP_NUMBER 31
  817. #define STM32_HAS_OTG1 FALSE
  818. #define STM32_HAS_OTG2 FALSE
  819. /* IWDG attributes.*/
  820. #define STM32_HAS_IWDG TRUE
  821. #define STM32_IWDG_IS_WINDOWED TRUE
  822. /* LTDC attributes.*/
  823. #define STM32_HAS_LTDC FALSE
  824. /* DMA2D attributes.*/
  825. #define STM32_HAS_DMA2D FALSE
  826. /* FSMC attributes.*/
  827. #define STM32_HAS_FSMC FALSE
  828. /* CRC attributes.*/
  829. #define STM32_HAS_CRC TRUE
  830. #define STM32_CRC_PROGRAMMABLE TRUE
  831. /*===========================================================================*/
  832. /* STM32L053xx, STM32L063xx. */
  833. /*===========================================================================*/
  834. #elif defined(STM32L053xx) || defined(STM32L063xx)
  835. /* ADC attributes.*/
  836. #define STM32_HAS_ADC1 TRUE
  837. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  838. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  839. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  840. #define STM32_ADC1_HANDLER Vector70
  841. #define STM32_ADC1_NUMBER 12
  842. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  843. STM32_DMA_STREAM_ID_MSK(1, 2))
  844. #define STM32_ADC1_DMA_CHN 0x00000000
  845. #define STM32_HAS_ADC2 FALSE
  846. #define STM32_HAS_ADC3 FALSE
  847. #define STM32_HAS_ADC4 FALSE
  848. /* CAN attributes.*/
  849. #define STM32_HAS_CAN1 FALSE
  850. #define STM32_HAS_CAN2 FALSE
  851. #define STM32_HAS_CAN3 FALSE
  852. /* DAC attributes.*/
  853. #define STM32_HAS_DAC1_CH1 FALSE
  854. #define STM32_DAC1_CH1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  855. #define STM32_DAC1_CH1_DMA_CHN 0x00000090
  856. #define STM32_HAS_DAC1_CH2 FALSE
  857. #define STM32_HAS_DAC2_CH1 FALSE
  858. #define STM32_HAS_DAC2_CH2 FALSE
  859. /* DMA attributes.*/
  860. #define STM32_ADVANCED_DMA TRUE
  861. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  862. #define STM32_DMA_SUPPORTS_CSELR TRUE
  863. #define STM32_DMA1_NUM_CHANNELS 7
  864. #define STM32_DMA2_NUM_CHANNELS 0
  865. #define STM32_DMA1_CH1_HANDLER Vector64
  866. #define STM32_DMA1_CH23_HANDLER Vector68
  867. #define STM32_DMA1_CH4567_HANDLER Vector6C
  868. #define STM32_DMA1_CH1_NUMBER 9
  869. #define STM32_DMA1_CH23_NUMBER 10
  870. #define STM32_DMA1_CH4567_NUMBER 11
  871. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  872. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  873. #define DMA1_CH2_CMASK 0x00000006U
  874. #define DMA1_CH3_CMASK 0x00000006U
  875. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  876. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  877. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  878. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  879. #define DMA1_CH4_CMASK 0x00000078U
  880. #define DMA1_CH5_CMASK 0x00000078U
  881. #define DMA1_CH6_CMASK 0x00000078U
  882. #define DMA1_CH7_CMASK 0x00000078U
  883. /* ETH attributes.*/
  884. #define STM32_HAS_ETH FALSE
  885. /* EXTI attributes.*/
  886. #define STM32_EXTI_NUM_LINES 23
  887. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  888. #define STM32_EXTI_LINE01_HANDLER Vector54
  889. #define STM32_EXTI_LINE23_HANDLER Vector58
  890. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  891. #define STM32_EXTI_LINE16_HANDLER Vector44
  892. #define STM32_EXTI_LINE171920_HANDLER Vector48
  893. #define STM32_EXTI_LINE2122_HANDLER Vector70
  894. #define STM32_EXTI_LINE01_NUMBER 5
  895. #define STM32_EXTI_LINE23_NUMBER 6
  896. #define STM32_EXTI_LINE4_15_NUMBER 7
  897. #define STM32_EXTI_LINE16_NUMBER 1
  898. #define STM32_EXTI_LINE171920_NUMBER 2
  899. #define STM32_EXTI_LINE2122_NUMBER 12
  900. /* GPIO attributes.*/
  901. #define STM32_HAS_GPIOA TRUE
  902. #define STM32_HAS_GPIOB TRUE
  903. #define STM32_HAS_GPIOC TRUE
  904. #define STM32_HAS_GPIOD TRUE
  905. #define STM32_HAS_GPIOE FALSE
  906. #define STM32_HAS_GPIOF FALSE
  907. #define STM32_HAS_GPIOG FALSE
  908. #define STM32_HAS_GPIOH TRUE
  909. #define STM32_HAS_GPIOI FALSE
  910. #define STM32_HAS_GPIOJ FALSE
  911. #define STM32_HAS_GPIOK FALSE
  912. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  913. RCC_IOPENR_GPIOBEN | \
  914. RCC_IOPENR_GPIOCEN | \
  915. RCC_IOPENR_GPIODEN | \
  916. RCC_IOPENR_GPIOHEN)
  917. /* I2C attributes.*/
  918. #define STM32_HAS_I2C1 TRUE
  919. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  920. #define STM32_I2C1_GLOBAL_NUMBER 23
  921. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  922. STM32_DMA_STREAM_ID_MSK(1, 7))
  923. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  924. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  925. STM32_DMA_STREAM_ID_MSK(1, 6))
  926. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  927. #define STM32_HAS_I2C2 TRUE
  928. #define STM32_I2C2_GLOBAL_HANDLER VectorA0
  929. #define STM32_I2C2_GLOBAL_NUMBER 24
  930. #define STM32_I2C2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  931. #define STM32_I2C2_RX_DMA_CHN 0x00070000
  932. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  933. #define STM32_I2C2_TX_DMA_CHN 0x00007000
  934. #define STM32_HAS_I2C3 FALSE
  935. /* SDIO attributes.*/
  936. #define STM32_HAS_SDIO FALSE
  937. /* SPI attributes.*/
  938. #define STM32_HAS_SPI1 TRUE
  939. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  940. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  941. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  942. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  943. #define STM32_HAS_SPI2 TRUE
  944. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  945. STM32_DMA_STREAM_ID_MSK(1, 6))
  946. #define STM32_SPI2_RX_DMA_CHN 0x00202000
  947. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  948. STM32_DMA_STREAM_ID_MSK(1, 7))
  949. #define STM32_SPI2_TX_DMA_CHN 0x02020000
  950. #define STM32_HAS_SPI3 FALSE
  951. #define STM32_HAS_SPI4 FALSE
  952. #define STM32_HAS_SPI5 FALSE
  953. #define STM32_HAS_SPI6 FALSE
  954. /* TIM attributes.*/
  955. #define STM32_TIM_MAX_CHANNELS 4
  956. #define STM32_HAS_TIM2 TRUE
  957. #define STM32_TIM2_IS_32BITS FALSE
  958. #define STM32_TIM2_CHANNELS 4
  959. #define STM32_TIM2_HANDLER Vector7C
  960. #define STM32_TIM2_NUMBER 15
  961. #define STM32_HAS_TIM6 TRUE
  962. #define STM32_TIM6_IS_32BITS FALSE
  963. #define STM32_TIM6_CHANNELS 0
  964. #define STM32_TIM6_HANDLER Vector84
  965. #define STM32_TIM6_NUMBER 17
  966. #define STM32_HAS_TIM21 TRUE
  967. #define STM32_TIM21_IS_32BITS FALSE
  968. #define STM32_TIM21_CHANNELS 2
  969. #define STM32_TIM21_HANDLER Vector90
  970. #define STM32_TIM21_NUMBER 20
  971. #define STM32_HAS_TIM22 TRUE
  972. #define STM32_TIM22_IS_32BITS FALSE
  973. #define STM32_TIM22_CHANNELS 2
  974. #define STM32_TIM22_HANDLER Vector98
  975. #define STM32_TIM22_NUMBER 22
  976. #define STM32_HAS_TIM1 FALSE
  977. #define STM32_HAS_TIM3 FALSE
  978. #define STM32_HAS_TIM4 FALSE
  979. #define STM32_HAS_TIM5 FALSE
  980. #define STM32_HAS_TIM7 FALSE
  981. #define STM32_HAS_TIM8 FALSE
  982. #define STM32_HAS_TIM9 FALSE
  983. #define STM32_HAS_TIM10 FALSE
  984. #define STM32_HAS_TIM11 FALSE
  985. #define STM32_HAS_TIM12 FALSE
  986. #define STM32_HAS_TIM13 FALSE
  987. #define STM32_HAS_TIM14 FALSE
  988. #define STM32_HAS_TIM15 FALSE
  989. #define STM32_HAS_TIM16 FALSE
  990. #define STM32_HAS_TIM17 FALSE
  991. #define STM32_HAS_TIM18 FALSE
  992. #define STM32_HAS_TIM19 FALSE
  993. #define STM32_HAS_TIM20 FALSE
  994. /* USART attributes.*/
  995. #define STM32_HAS_USART1 TRUE
  996. #define STM32_USART1_HANDLER VectorAC
  997. #define STM32_USART1_NUMBER 27
  998. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  999. STM32_DMA_STREAM_ID_MSK(1, 5))
  1000. #define STM32_USART1_RX_DMA_CHN 0x00030300
  1001. #define STM32_USART1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1002. STM32_DMA_STREAM_ID_MSK(1, 4))
  1003. #define STM32_USART1_TX_DMA_CHN 0x00003030
  1004. #define STM32_HAS_USART2 TRUE
  1005. #define STM32_USART2_HANDLER VectorB0
  1006. #define STM32_USART2_NUMBER 28
  1007. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1008. STM32_DMA_STREAM_ID_MSK(1, 6))
  1009. #define STM32_USART2_RX_DMA_CHN 0x00440000
  1010. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1011. STM32_DMA_STREAM_ID_MSK(1, 7))
  1012. #define STM32_USART2_TX_DMA_CHN 0x04004000
  1013. #define STM32_HAS_LPUART1 TRUE
  1014. #define STM32_LPUART1_HANDLER VectorB4
  1015. #define STM32_LPUART1_NUMBER 29
  1016. #define STM32_HAS_USART3 FALSE
  1017. #define STM32_HAS_UART4 FALSE
  1018. #define STM32_HAS_UART5 FALSE
  1019. #define STM32_HAS_USART6 FALSE
  1020. #define STM32_HAS_UART7 FALSE
  1021. #define STM32_HAS_UART8 FALSE
  1022. /* USB attributes.*/
  1023. #define STM32_HAS_USB TRUE
  1024. #define STM32_USB_ACCESS_SCHEME_2x16 TRUE
  1025. #define STM32_USB_PMA_SIZE 1024
  1026. #define STM32_USB_HAS_BCDR TRUE
  1027. #define STM32_USB1_LP_HANDLER VectorBC
  1028. #define STM32_USB1_LP_NUMBER 31
  1029. #define STM32_USB1_HP_HANDLER VectorBC
  1030. #define STM32_USB1_HP_NUMBER 31
  1031. #define STM32_HAS_OTG1 FALSE
  1032. #define STM32_HAS_OTG2 FALSE
  1033. /* IWDG attributes.*/
  1034. #define STM32_HAS_IWDG TRUE
  1035. #define STM32_IWDG_IS_WINDOWED TRUE
  1036. /* LTDC attributes.*/
  1037. #define STM32_HAS_LTDC FALSE
  1038. /* DMA2D attributes.*/
  1039. #define STM32_HAS_DMA2D FALSE
  1040. /* FSMC attributes.*/
  1041. #define STM32_HAS_FSMC FALSE
  1042. /* CRC attributes.*/
  1043. #define STM32_HAS_CRC TRUE
  1044. #define STM32_CRC_PROGRAMMABLE TRUE
  1045. /*===========================================================================*/
  1046. /* STM32L071xx. */
  1047. /*===========================================================================*/
  1048. #elif defined(STM32L071xx)
  1049. /* ADC attributes.*/
  1050. #define STM32_HAS_ADC1 TRUE
  1051. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  1052. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  1053. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  1054. #define STM32_ADC1_HANDLER Vector70
  1055. #define STM32_ADC1_NUMBER 12
  1056. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  1057. STM32_DMA_STREAM_ID_MSK(1, 2))
  1058. #define STM32_ADC1_DMA_CHN 0x00000000
  1059. #define STM32_HAS_ADC2 FALSE
  1060. #define STM32_HAS_ADC3 FALSE
  1061. #define STM32_HAS_ADC4 FALSE
  1062. /* CAN attributes.*/
  1063. #define STM32_HAS_CAN1 FALSE
  1064. #define STM32_HAS_CAN2 FALSE
  1065. #define STM32_HAS_CAN3 FALSE
  1066. /* DAC attributes.*/
  1067. #define STM32_HAS_DAC1_CH1 TRUE
  1068. #define STM32_DAC1_CH1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  1069. #define STM32_DAC1_CH1_DMA_CHN 0x00000090
  1070. #define STM32_HAS_DAC1_CH2 TRUE
  1071. #define STM32_DAC1_CH2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4))
  1072. #define STM32_DAC1_CH2_DMA_CHN 0x0000F000
  1073. #define STM32_HAS_DAC2_CH1 FALSE
  1074. #define STM32_HAS_DAC2_CH2 FALSE
  1075. /* DMA attributes.*/
  1076. #define STM32_ADVANCED_DMA TRUE
  1077. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  1078. #define STM32_DMA_SUPPORTS_CSELR TRUE
  1079. #define STM32_DMA1_NUM_CHANNELS 7
  1080. #define STM32_DMA2_NUM_CHANNELS 0
  1081. #define STM32_DMA1_CH1_HANDLER Vector64
  1082. #define STM32_DMA1_CH23_HANDLER Vector68
  1083. #define STM32_DMA1_CH4567_HANDLER Vector6C
  1084. #define STM32_DMA1_CH1_NUMBER 9
  1085. #define STM32_DMA1_CH23_NUMBER 10
  1086. #define STM32_DMA1_CH4567_NUMBER 11
  1087. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  1088. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  1089. #define DMA1_CH2_CMASK 0x00000006U
  1090. #define DMA1_CH3_CMASK 0x00000006U
  1091. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  1092. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  1093. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  1094. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  1095. #define DMA1_CH4_CMASK 0x00000078U
  1096. #define DMA1_CH5_CMASK 0x00000078U
  1097. #define DMA1_CH6_CMASK 0x00000078U
  1098. #define DMA1_CH7_CMASK 0x00000078U
  1099. /* ETH attributes.*/
  1100. #define STM32_HAS_ETH FALSE
  1101. /* EXTI attributes.*/
  1102. #define STM32_EXTI_NUM_LINES 23
  1103. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  1104. #define STM32_EXTI_LINE01_HANDLER Vector54
  1105. #define STM32_EXTI_LINE23_HANDLER Vector58
  1106. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  1107. #define STM32_EXTI_LINE16_HANDLER Vector44
  1108. #define STM32_EXTI_LINE171920_HANDLER Vector48
  1109. #define STM32_EXTI_LINE2122_HANDLER Vector70
  1110. #define STM32_EXTI_LINE01_NUMBER 5
  1111. #define STM32_EXTI_LINE23_NUMBER 6
  1112. #define STM32_EXTI_LINE4_15_NUMBER 7
  1113. #define STM32_EXTI_LINE16_NUMBER 1
  1114. #define STM32_EXTI_LINE171920_NUMBER 2
  1115. #define STM32_EXTI_LINE2122_NUMBER 12
  1116. /* GPIO attributes.*/
  1117. #define STM32_HAS_GPIOA TRUE
  1118. #define STM32_HAS_GPIOB TRUE
  1119. #define STM32_HAS_GPIOC TRUE
  1120. #define STM32_HAS_GPIOD TRUE
  1121. #define STM32_HAS_GPIOE TRUE
  1122. #define STM32_HAS_GPIOF FALSE
  1123. #define STM32_HAS_GPIOG FALSE
  1124. #define STM32_HAS_GPIOH TRUE
  1125. #define STM32_HAS_GPIOI FALSE
  1126. #define STM32_HAS_GPIOJ FALSE
  1127. #define STM32_HAS_GPIOK FALSE
  1128. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  1129. RCC_IOPENR_GPIOBEN | \
  1130. RCC_IOPENR_GPIOCEN | \
  1131. RCC_IOPENR_GPIODEN | \
  1132. RCC_IOPENR_GPIOEEN | \
  1133. RCC_IOPENR_GPIOHEN)
  1134. /* I2C attributes.*/
  1135. #define STM32_HAS_I2C1 TRUE
  1136. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  1137. #define STM32_I2C1_GLOBAL_NUMBER 23
  1138. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1139. STM32_DMA_STREAM_ID_MSK(1, 7))
  1140. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  1141. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1142. STM32_DMA_STREAM_ID_MSK(1, 6))
  1143. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  1144. #define STM32_HAS_I2C2 TRUE
  1145. #define STM32_I2C2_GLOBAL_HANDLER VectorA0
  1146. #define STM32_I2C2_GLOBAL_NUMBER 24
  1147. #define STM32_I2C2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  1148. #define STM32_I2C2_RX_DMA_CHN 0x00070000
  1149. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  1150. #define STM32_I2C2_TX_DMA_CHN 0x00007000
  1151. #define STM32_HAS_I2C3 TRUE
  1152. #define STM32_I2C3_GLOBAL_HANDLER Vector94
  1153. #define STM32_I2C3_GLOBAL_NUMBER 21
  1154. #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1155. STM32_DMA_STREAM_ID_MSK(1, 5))
  1156. #define STM32_I2C3_RX_DMA_CHN 0x00E0E000
  1157. #define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1158. STM32_DMA_STREAM_ID_MSK(1, 6))
  1159. #define STM32_I2C3_TX_DMA_CHN 0x0E0E0000
  1160. /* SDIO attributes.*/
  1161. #define STM32_HAS_SDIO FALSE
  1162. /* SPI attributes.*/
  1163. #define STM32_HAS_SPI1 TRUE
  1164. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  1165. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  1166. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  1167. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  1168. #define STM32_HAS_SPI2 TRUE
  1169. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1170. STM32_DMA_STREAM_ID_MSK(1, 6))
  1171. #define STM32_SPI2_RX_DMA_CHN 0x00202000
  1172. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1173. STM32_DMA_STREAM_ID_MSK(1, 7))
  1174. #define STM32_SPI2_TX_DMA_CHN 0x02020000
  1175. #define STM32_HAS_SPI3 FALSE
  1176. #define STM32_HAS_SPI4 FALSE
  1177. #define STM32_HAS_SPI5 FALSE
  1178. #define STM32_HAS_SPI6 FALSE
  1179. /* TIM attributes.*/
  1180. #define STM32_TIM_MAX_CHANNELS 4
  1181. #define STM32_HAS_TIM2 TRUE
  1182. #define STM32_TIM2_IS_32BITS FALSE
  1183. #define STM32_TIM2_CHANNELS 4
  1184. #define STM32_TIM2_HANDLER Vector7C
  1185. #define STM32_TIM2_NUMBER 15
  1186. #define STM32_HAS_TIM3 TRUE
  1187. #define STM32_TIM3_IS_32BITS FALSE
  1188. #define STM32_TIM3_CHANNELS 4
  1189. #define STM32_TIM3_HANDLER Vector80
  1190. #define STM32_TIM3_NUMBER 16
  1191. #define STM32_HAS_TIM6 TRUE
  1192. #define STM32_TIM6_IS_32BITS FALSE
  1193. #define STM32_TIM6_CHANNELS 0
  1194. #define STM32_TIM6_HANDLER Vector84
  1195. #define STM32_TIM6_NUMBER 17
  1196. #define STM32_HAS_TIM7 TRUE
  1197. #define STM32_TIM7_IS_32BITS FALSE
  1198. #define STM32_TIM7_CHANNELS 0
  1199. #define STM32_TIM7_HANDLER Vector88
  1200. #define STM32_TIM7_NUMBER 18
  1201. #define STM32_HAS_TIM21 TRUE
  1202. #define STM32_TIM21_IS_32BITS FALSE
  1203. #define STM32_TIM21_CHANNELS 2
  1204. #define STM32_TIM21_HANDLER Vector90
  1205. #define STM32_TIM21_NUMBER 20
  1206. #define STM32_HAS_TIM22 TRUE
  1207. #define STM32_TIM22_IS_32BITS FALSE
  1208. #define STM32_TIM22_CHANNELS 2
  1209. #define STM32_TIM22_HANDLER Vector98
  1210. #define STM32_TIM22_NUMBER 22
  1211. #define STM32_HAS_TIM1 FALSE
  1212. #define STM32_HAS_TIM4 FALSE
  1213. #define STM32_HAS_TIM5 FALSE
  1214. #define STM32_HAS_TIM8 FALSE
  1215. #define STM32_HAS_TIM9 FALSE
  1216. #define STM32_HAS_TIM10 FALSE
  1217. #define STM32_HAS_TIM11 FALSE
  1218. #define STM32_HAS_TIM12 FALSE
  1219. #define STM32_HAS_TIM13 FALSE
  1220. #define STM32_HAS_TIM14 FALSE
  1221. #define STM32_HAS_TIM15 FALSE
  1222. #define STM32_HAS_TIM16 FALSE
  1223. #define STM32_HAS_TIM17 FALSE
  1224. #define STM32_HAS_TIM18 FALSE
  1225. #define STM32_HAS_TIM19 FALSE
  1226. #define STM32_HAS_TIM20 FALSE
  1227. /* USART attributes.*/
  1228. #define STM32_HAS_USART1 TRUE
  1229. #define STM32_USART1_HANDLER VectorAC
  1230. #define STM32_USART1_NUMBER 27
  1231. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1232. STM32_DMA_STREAM_ID_MSK(1, 5))
  1233. #define STM32_USART1_RX_DMA_CHN 0x00030300
  1234. #define STM32_USART1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1235. STM32_DMA_STREAM_ID_MSK(1, 4))
  1236. #define STM32_USART1_TX_DMA_CHN 0x00003030
  1237. #define STM32_HAS_USART2 TRUE
  1238. #define STM32_USART2_HANDLER VectorB0
  1239. #define STM32_USART2_NUMBER 28
  1240. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1241. STM32_DMA_STREAM_ID_MSK(1, 6))
  1242. #define STM32_USART2_RX_DMA_CHN 0x00440000
  1243. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1244. STM32_DMA_STREAM_ID_MSK(1, 7))
  1245. #define STM32_USART2_TX_DMA_CHN 0x04004000
  1246. #define STM32_USART3_8_HANDLER Vector78
  1247. #define STM32_USART3_8_NUMBER 14
  1248. #define STM32_HAS_UART4 TRUE
  1249. #define STM32_UART4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1250. STM32_DMA_STREAM_ID_MSK(1, 6))
  1251. #define STM32_UART4_RX_DMA_CHN 0x00C000C0
  1252. #define STM32_UART4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1253. STM32_DMA_STREAM_ID_MSK(1, 7))
  1254. #define STM32_UART4_TX_DMA_CHN 0x0C000C00
  1255. #define STM32_HAS_UART5 TRUE
  1256. #define STM32_UART5_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1257. STM32_DMA_STREAM_ID_MSK(1, 6))
  1258. #define STM32_UART5_RX_DMA_CHN 0x00D000D0
  1259. #define STM32_UART5_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1260. STM32_DMA_STREAM_ID_MSK(1, 7))
  1261. #define STM32_UART5_TX_DMA_CHN 0x0D000D00
  1262. #define STM32_HAS_LPUART1 TRUE
  1263. #define STM32_LPUART1_HANDLER VectorB4
  1264. #define STM32_LPUART1_NUMBER 29
  1265. #define STM32_HAS_USART3 FALSE
  1266. #define STM32_HAS_USART6 FALSE
  1267. #define STM32_HAS_UART7 FALSE
  1268. #define STM32_HAS_UART8 FALSE
  1269. /* USB attributes.*/
  1270. #define STM32_HAS_USB FALSE
  1271. #define STM32_USB_ACCESS_SCHEME_2x16 TRUE
  1272. #define STM32_USB_PMA_SIZE 1024
  1273. #define STM32_USB_HAS_BCDR TRUE
  1274. #define STM32_USB1_LP_HANDLER VectorBC
  1275. #define STM32_USB1_LP_NUMBER 31
  1276. #define STM32_USB1_HP_HANDLER VectorBC
  1277. #define STM32_USB1_HP_NUMBER 31
  1278. #define STM32_HAS_OTG1 FALSE
  1279. #define STM32_HAS_OTG2 FALSE
  1280. /* IWDG attributes.*/
  1281. #define STM32_HAS_IWDG TRUE
  1282. #define STM32_IWDG_IS_WINDOWED TRUE
  1283. /* LTDC attributes.*/
  1284. #define STM32_HAS_LTDC FALSE
  1285. /* DMA2D attributes.*/
  1286. #define STM32_HAS_DMA2D FALSE
  1287. /* FSMC attributes.*/
  1288. #define STM32_HAS_FSMC FALSE
  1289. /* CRC attributes.*/
  1290. #define STM32_HAS_CRC TRUE
  1291. #define STM32_CRC_PROGRAMMABLE TRUE
  1292. /*===========================================================================*/
  1293. /* STM32L072xx, STM32L073xx. */
  1294. /*===========================================================================*/
  1295. #elif defined(STM32L072xx) || defined(STM32L073xx)
  1296. /* ADC attributes.*/
  1297. #define STM32_HAS_ADC1 TRUE
  1298. #define STM32_ADC_SUPPORTS_PRESCALER TRUE
  1299. #define STM32_ADC_SUPPORTS_OVERSAMPLING TRUE
  1300. #define STM32_ADC1_IRQ_SHARED_WITH_EXTI TRUE
  1301. #define STM32_ADC1_HANDLER Vector70
  1302. #define STM32_ADC1_NUMBER 12
  1303. #define STM32_ADC1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 1) |\
  1304. STM32_DMA_STREAM_ID_MSK(1, 2))
  1305. #define STM32_ADC1_DMA_CHN 0x00000000
  1306. #define STM32_HAS_ADC2 FALSE
  1307. #define STM32_HAS_ADC3 FALSE
  1308. #define STM32_HAS_ADC4 FALSE
  1309. /* CAN attributes.*/
  1310. #define STM32_HAS_CAN1 FALSE
  1311. #define STM32_HAS_CAN2 FALSE
  1312. #define STM32_HAS_CAN3 FALSE
  1313. /* DAC attributes.*/
  1314. #define STM32_HAS_DAC1_CH1 TRUE
  1315. #define STM32_DAC1_CH1_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  1316. #define STM32_DAC1_CH1_DMA_CHN 0x00000090
  1317. #define STM32_HAS_DAC1_CH2 TRUE
  1318. #define STM32_DAC1_CH2_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4))
  1319. #define STM32_DAC1_CH2_DMA_CHN 0x0000F000
  1320. #define STM32_HAS_DAC2_CH1 FALSE
  1321. #define STM32_HAS_DAC2_CH2 FALSE
  1322. /* DMA attributes.*/
  1323. #define STM32_ADVANCED_DMA TRUE
  1324. #define STM32_DMA_SUPPORTS_DMAMUX FALSE
  1325. #define STM32_DMA_SUPPORTS_CSELR TRUE
  1326. #define STM32_DMA1_NUM_CHANNELS 7
  1327. #define STM32_DMA2_NUM_CHANNELS 0
  1328. #define STM32_DMA1_CH1_HANDLER Vector64
  1329. #define STM32_DMA1_CH23_HANDLER Vector68
  1330. #define STM32_DMA1_CH4567_HANDLER Vector6C
  1331. #define STM32_DMA1_CH1_NUMBER 9
  1332. #define STM32_DMA1_CH23_NUMBER 10
  1333. #define STM32_DMA1_CH4567_NUMBER 11
  1334. #define STM32_DMA1_CH2_NUMBER STM32_DMA1_CH23_NUMBER
  1335. #define STM32_DMA1_CH3_NUMBER STM32_DMA1_CH23_NUMBER
  1336. #define DMA1_CH2_CMASK 0x00000006U
  1337. #define DMA1_CH3_CMASK 0x00000006U
  1338. #define STM32_DMA1_CH4_NUMBER STM32_DMA1_CH4567_NUMBER
  1339. #define STM32_DMA1_CH5_NUMBER STM32_DMA1_CH4567_NUMBER
  1340. #define STM32_DMA1_CH6_NUMBER STM32_DMA1_CH4567_NUMBER
  1341. #define STM32_DMA1_CH7_NUMBER STM32_DMA1_CH4567_NUMBER
  1342. #define DMA1_CH4_CMASK 0x00000078U
  1343. #define DMA1_CH5_CMASK 0x00000078U
  1344. #define DMA1_CH6_CMASK 0x00000078U
  1345. #define DMA1_CH7_CMASK 0x00000078U
  1346. /* ETH attributes.*/
  1347. #define STM32_HAS_ETH FALSE
  1348. /* EXTI attributes.*/
  1349. #define STM32_EXTI_NUM_LINES 23
  1350. #define STM32_EXTI_IMR1_MASK 0xFF840000U
  1351. #define STM32_EXTI_LINE01_HANDLER Vector54
  1352. #define STM32_EXTI_LINE23_HANDLER Vector58
  1353. #define STM32_EXTI_LINE4_15_HANDLER Vector5C
  1354. #define STM32_EXTI_LINE16_HANDLER Vector44
  1355. #define STM32_EXTI_LINE171920_HANDLER Vector48
  1356. #define STM32_EXTI_LINE2122_HANDLER Vector70
  1357. #define STM32_EXTI_LINE01_NUMBER 5
  1358. #define STM32_EXTI_LINE23_NUMBER 6
  1359. #define STM32_EXTI_LINE4_15_NUMBER 7
  1360. #define STM32_EXTI_LINE16_NUMBER 1
  1361. #define STM32_EXTI_LINE171920_NUMBER 2
  1362. #define STM32_EXTI_LINE2122_NUMBER 12
  1363. /* GPIO attributes.*/
  1364. #define STM32_HAS_GPIOA TRUE
  1365. #define STM32_HAS_GPIOB TRUE
  1366. #define STM32_HAS_GPIOC TRUE
  1367. #define STM32_HAS_GPIOD TRUE
  1368. #define STM32_HAS_GPIOE TRUE
  1369. #define STM32_HAS_GPIOF FALSE
  1370. #define STM32_HAS_GPIOG FALSE
  1371. #define STM32_HAS_GPIOH TRUE
  1372. #define STM32_HAS_GPIOI FALSE
  1373. #define STM32_HAS_GPIOJ FALSE
  1374. #define STM32_HAS_GPIOK FALSE
  1375. #define STM32_GPIO_EN_MASK (RCC_IOPENR_GPIOAEN | \
  1376. RCC_IOPENR_GPIOBEN | \
  1377. RCC_IOPENR_GPIOCEN | \
  1378. RCC_IOPENR_GPIODEN | \
  1379. RCC_IOPENR_GPIOEEN | \
  1380. RCC_IOPENR_GPIOHEN)
  1381. /* I2C attributes.*/
  1382. #define STM32_HAS_I2C1 TRUE
  1383. #define STM32_I2C1_GLOBAL_HANDLER Vector9C
  1384. #define STM32_I2C1_GLOBAL_NUMBER 23
  1385. #define STM32_I2C1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1386. STM32_DMA_STREAM_ID_MSK(1, 7))
  1387. #define STM32_I2C1_RX_DMA_CHN 0x06000600
  1388. #define STM32_I2C1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1389. STM32_DMA_STREAM_ID_MSK(1, 6))
  1390. #define STM32_I2C1_TX_DMA_CHN 0x00600060
  1391. #define STM32_HAS_I2C2 TRUE
  1392. #define STM32_I2C2_GLOBAL_HANDLER VectorA0
  1393. #define STM32_I2C2_GLOBAL_NUMBER 24
  1394. #define STM32_I2C2_RX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 5)
  1395. #define STM32_I2C2_RX_DMA_CHN 0x00070000
  1396. #define STM32_I2C2_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 4)
  1397. #define STM32_I2C2_TX_DMA_CHN 0x00007000
  1398. #define STM32_HAS_I2C3 TRUE
  1399. #define STM32_I2C3_GLOBAL_HANDLER Vector94
  1400. #define STM32_I2C3_GLOBAL_NUMBER 21
  1401. #define STM32_I2C3_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1402. STM32_DMA_STREAM_ID_MSK(1, 5))
  1403. #define STM32_I2C3_RX_DMA_CHN 0x00E0E000
  1404. #define STM32_I2C3_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1405. STM32_DMA_STREAM_ID_MSK(1, 6))
  1406. #define STM32_I2C3_TX_DMA_CHN 0x0E0E0000
  1407. /* SDIO attributes.*/
  1408. #define STM32_HAS_SDIO FALSE
  1409. /* SPI attributes.*/
  1410. #define STM32_HAS_SPI1 TRUE
  1411. #define STM32_SPI1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2))
  1412. #define STM32_SPI1_RX_DMA_CHN 0x00000010
  1413. #define STM32_SPI1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3))
  1414. #define STM32_SPI1_TX_DMA_CHN 0x00000100
  1415. #define STM32_HAS_SPI2 TRUE
  1416. #define STM32_SPI2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1417. STM32_DMA_STREAM_ID_MSK(1, 6))
  1418. #define STM32_SPI2_RX_DMA_CHN 0x00202000
  1419. #define STM32_SPI2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1420. STM32_DMA_STREAM_ID_MSK(1, 7))
  1421. #define STM32_SPI2_TX_DMA_CHN 0x02020000
  1422. #define STM32_HAS_SPI3 FALSE
  1423. #define STM32_HAS_SPI4 FALSE
  1424. #define STM32_HAS_SPI5 FALSE
  1425. #define STM32_HAS_SPI6 FALSE
  1426. /* TIM attributes.*/
  1427. #define STM32_TIM_MAX_CHANNELS 4
  1428. #define STM32_HAS_TIM2 TRUE
  1429. #define STM32_TIM2_IS_32BITS FALSE
  1430. #define STM32_TIM2_CHANNELS 4
  1431. #define STM32_TIM2_HANDLER Vector7C
  1432. #define STM32_TIM2_NUMBER 15
  1433. #define STM32_HAS_TIM3 TRUE
  1434. #define STM32_TIM3_IS_32BITS FALSE
  1435. #define STM32_TIM3_CHANNELS 4
  1436. #define STM32_TIM3_HANDLER Vector80
  1437. #define STM32_TIM3_NUMBER 16
  1438. #define STM32_HAS_TIM6 TRUE
  1439. #define STM32_TIM6_IS_32BITS FALSE
  1440. #define STM32_TIM6_CHANNELS 0
  1441. #define STM32_TIM6_HANDLER Vector84
  1442. #define STM32_TIM6_NUMBER 17
  1443. #define STM32_HAS_TIM7 TRUE
  1444. #define STM32_TIM7_IS_32BITS FALSE
  1445. #define STM32_TIM7_CHANNELS 0
  1446. #define STM32_TIM7_HANDLER Vector88
  1447. #define STM32_TIM7_NUMBER 18
  1448. #define STM32_HAS_TIM21 TRUE
  1449. #define STM32_TIM21_IS_32BITS FALSE
  1450. #define STM32_TIM21_CHANNELS 2
  1451. #define STM32_TIM21_HANDLER Vector90
  1452. #define STM32_TIM21_NUMBER 20
  1453. #define STM32_HAS_TIM22 TRUE
  1454. #define STM32_TIM22_IS_32BITS FALSE
  1455. #define STM32_TIM22_CHANNELS 2
  1456. #define STM32_TIM22_HANDLER Vector98
  1457. #define STM32_TIM22_NUMBER 22
  1458. #define STM32_HAS_TIM1 FALSE
  1459. #define STM32_HAS_TIM4 FALSE
  1460. #define STM32_HAS_TIM5 FALSE
  1461. #define STM32_HAS_TIM8 FALSE
  1462. #define STM32_HAS_TIM9 FALSE
  1463. #define STM32_HAS_TIM10 FALSE
  1464. #define STM32_HAS_TIM11 FALSE
  1465. #define STM32_HAS_TIM12 FALSE
  1466. #define STM32_HAS_TIM13 FALSE
  1467. #define STM32_HAS_TIM14 FALSE
  1468. #define STM32_HAS_TIM15 FALSE
  1469. #define STM32_HAS_TIM16 FALSE
  1470. #define STM32_HAS_TIM17 FALSE
  1471. #define STM32_HAS_TIM18 FALSE
  1472. #define STM32_HAS_TIM19 FALSE
  1473. #define STM32_HAS_TIM20 FALSE
  1474. /* USART attributes.*/
  1475. #define STM32_HAS_USART1 TRUE
  1476. #define STM32_USART1_HANDLER VectorAC
  1477. #define STM32_USART1_NUMBER 27
  1478. #define STM32_USART1_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1479. STM32_DMA_STREAM_ID_MSK(1, 5))
  1480. #define STM32_USART1_RX_DMA_CHN 0x00030300
  1481. #define STM32_USART1_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1482. STM32_DMA_STREAM_ID_MSK(1, 4))
  1483. #define STM32_USART1_TX_DMA_CHN 0x00003030
  1484. #define STM32_HAS_USART2 TRUE
  1485. #define STM32_USART2_HANDLER VectorB0
  1486. #define STM32_USART2_NUMBER 28
  1487. #define STM32_USART2_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 5) |\
  1488. STM32_DMA_STREAM_ID_MSK(1, 6))
  1489. #define STM32_USART2_RX_DMA_CHN 0x00440000
  1490. #define STM32_USART2_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 4) |\
  1491. STM32_DMA_STREAM_ID_MSK(1, 7))
  1492. #define STM32_USART2_TX_DMA_CHN 0x04004000
  1493. #define STM32_USART3_8_HANDLER Vector78
  1494. #define STM32_USART3_8_NUMBER 14
  1495. #define STM32_HAS_UART4 TRUE
  1496. #define STM32_UART4_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1497. STM32_DMA_STREAM_ID_MSK(1, 6))
  1498. #define STM32_UART4_RX_DMA_CHN 0x00C000C0
  1499. #define STM32_UART4_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1500. STM32_DMA_STREAM_ID_MSK(1, 7))
  1501. #define STM32_UART4_TX_DMA_CHN 0x0C000C00
  1502. #define STM32_HAS_UART5 TRUE
  1503. #define STM32_UART5_RX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 2) |\
  1504. STM32_DMA_STREAM_ID_MSK(1, 6))
  1505. #define STM32_UART5_RX_DMA_CHN 0x00D000D0
  1506. #define STM32_UART5_TX_DMA_MSK (STM32_DMA_STREAM_ID_MSK(1, 3) |\
  1507. STM32_DMA_STREAM_ID_MSK(1, 7))
  1508. #define STM32_UART5_TX_DMA_CHN 0x0D000D00
  1509. #define STM32_HAS_LPUART1 TRUE
  1510. #define STM32_LPUART1_HANDLER VectorB4
  1511. #define STM32_LPUART1_NUMBER 29
  1512. #define STM32_HAS_USART3 FALSE
  1513. #define STM32_HAS_USART6 FALSE
  1514. #define STM32_HAS_UART7 FALSE
  1515. #define STM32_HAS_UART8 FALSE
  1516. /* USB attributes.*/
  1517. #define STM32_HAS_USB TRUE
  1518. #define STM32_USB_ACCESS_SCHEME_2x16 TRUE
  1519. #define STM32_USB_PMA_SIZE 1024
  1520. #define STM32_USB_HAS_BCDR TRUE
  1521. #define STM32_USB1_LP_HANDLER VectorBC
  1522. #define STM32_USB1_LP_NUMBER 31
  1523. #define STM32_USB1_HP_HANDLER VectorBC
  1524. #define STM32_USB1_HP_NUMBER 31
  1525. #define STM32_HAS_OTG1 FALSE
  1526. #define STM32_HAS_OTG2 FALSE
  1527. /* IWDG attributes.*/
  1528. #define STM32_HAS_IWDG TRUE
  1529. #define STM32_IWDG_IS_WINDOWED TRUE
  1530. /* LTDC attributes.*/
  1531. #define STM32_HAS_LTDC FALSE
  1532. /* DMA2D attributes.*/
  1533. #define STM32_HAS_DMA2D FALSE
  1534. /* FSMC attributes.*/
  1535. #define STM32_HAS_FSMC FALSE
  1536. /* CRC attributes.*/
  1537. #define STM32_HAS_CRC TRUE
  1538. #define STM32_CRC_PROGRAMMABLE TRUE
  1539. #else
  1540. #error "STM32L0xx device not specified"
  1541. #endif
  1542. /** @} */
  1543. #endif /* STM32_REGISTRY_H */
  1544. /** @} */