11use super :: super :: { bus, bus_enable, bus_lpenable, bus_reset} ;
22use super :: * ;
33
4- #[ cfg( feature = "quadspi" ) ]
5- bus ! {
6- QUADSPI => ( AHB3 , 1 , qspien, , qspirst) ,
7- }
8-
9- bus ! {
10- CRC => ( AHB1 , 12 , crcen, crclpen, crcrst) ,
11- DMA1 => ( AHB1 , 21 , dma1en, dma1lpen, dma1rst) ,
12- DMA2 => ( AHB1 , 22 , dma2en, dma2lpen, dma2rst) ,
13- }
14-
15- bus ! {
16- GPIOA => ( AHB1 , 0 , gpioaen, gpioalpen, gpioarst) ,
17- GPIOB => ( AHB1 , 1 , gpioben, gpioblpen, gpiobrst) ,
18- }
19- #[ cfg( feature = "gpioc" ) ]
20- bus ! { GPIOC => ( AHB1 , 2 , gpiocen, gpioclpen, gpiocrst) , }
21- #[ cfg( feature = "gpiod" ) ]
22- bus ! { GPIOD => ( AHB1 , 3 , gpioden, gpiodlpen, gpiodrst) , }
23- #[ cfg( feature = "gpioe" ) ]
24- bus ! { GPIOE => ( AHB1 , 4 , gpioeen, gpioelpen, gpioerst) , }
25- #[ cfg( feature = "gpiof" ) ]
26- bus ! { GPIOF => ( AHB1 , 5 , gpiofen, gpioflpen, gpiofrst) , }
27- #[ cfg( feature = "gpiog" ) ]
28- bus ! { GPIOG => ( AHB1 , 6 , gpiogen, gpioglpen, gpiogrst) , }
29- #[ cfg( feature = "gpioh" ) ]
30- bus ! { GPIOH => ( AHB1 , 7 , gpiohen, gpiohlpen, gpiohrst) , }
31- #[ cfg( feature = "gpioi" ) ]
32- bus ! { GPIOI => ( AHB1 , 8 , gpioien, gpioilpen, gpioirst) , }
33- #[ cfg( feature = "gpioj" ) ]
34- bus ! { GPIOJ => ( AHB1 , 9 , gpiojen, gpiojlpen, gpiojrst) , }
35- #[ cfg( feature = "gpiok" ) ]
36- bus ! { GPIOK => ( AHB1 , 10 , gpioken, gpioklpen, gpiokrst) , }
37-
38- #[ cfg( feature = "rng" ) ]
39- bus ! { RNG => ( AHB2 , 6 , rngen, rnglpen, rngrst) , }
40-
41- #[ cfg( feature = "otg-fs" ) ]
42- bus ! { OTG_FS_GLOBAL => ( AHB2 , 7 , otgfsen, otgfslpen, otgfsrst) , }
43-
44- #[ cfg( feature = "otg-hs" ) ]
45- bus ! { OTG_HS_GLOBAL => ( AHB1 , 29 , otghsen, otghslpen, otghsrst) , }
46-
47- #[ cfg( feature = "fmc" ) ]
48- bus ! { FMC => ( AHB3 , 0 , fmcen, fmclpen, fmcrst) , }
49-
50- #[ cfg( feature = "fsmc" ) ]
51- #[ cfg( feature = "svd-f427" ) ]
52- bus ! { FSMC => ( AHB3 , 0 , fmcen, fmclpen, fmcrst) , }
53-
54- #[ cfg( feature = "fsmc" ) ]
55- #[ cfg( not( feature = "svd-f427" ) ) ]
56- bus ! { FSMC => ( AHB3 , 0 , fsmcen, fsmclpen, fsmcrst) , }
57-
58- bus ! { PWR => ( APB1 , 28 , pwren, pwrlpen, pwrrst) , }
59-
60- bus ! {
61- SPI1 => ( APB2 , 12 , spi1en, spi1lpen, spi1rst) ,
62- SPI2 => ( APB1 , 14 , spi2en, spi2lpen, spi2rst) ,
63- }
64- #[ cfg( feature = "spi3" ) ]
65- bus ! {
66- SPI3 => ( APB1 , 15 , spi3en, spi3lpen, spi3rst) ,
67- }
4+ bus ! { PWR => ( APB1 , 28 , pwren, pwrlpen, pwrrst) , }
685
6+ #[ cfg( feature = "spi1" ) ]
7+ bus ! { SPI1 => ( APB2 , 12 , spi1en, spi1lpen, spi1rst) , }
698#[ cfg( feature = "spi4" ) ]
70- bus ! {
71- SPI4 => ( APB2 , 13 , spi4en, spi4lpen, spi4rst) ,
72- }
9+ bus ! { SPI4 => ( APB2 , 13 , spi4en, spi4lpen, spi4rst) , }
7310
7411#[ cfg( feature = "spi5" ) ]
75- bus ! {
76- SPI5 => ( APB2 , 20 , spi5en, spi5lpen, spi5rst) ,
77- }
12+ bus ! { SPI5 => ( APB2 , 20 , spi5en, spi5lpen, spi5rst) , }
7813
7914#[ cfg( feature = "spi6" ) ]
80- bus ! {
81- SPI6 => ( APB2 , 21 , spi6en, spi6lpen, spi6rst) ,
82- }
15+ bus ! { SPI6 => ( APB2 , 21 , spi6en, spi6lpen, spi6rst) , }
8316
8417bus ! {
8518 I2C1 => ( APB1 , 21 , i2c1en, i2c1lpen, i2c1rst) ,
8619 I2C2 => ( APB1 , 22 , i2c2en, i2c2lpen, i2c2rst) ,
8720}
8821#[ cfg( feature = "i2c3" ) ]
89- bus ! {
90- I2C3 => ( APB1 , 23 , i2c3en, i2c3lpen, i2c3rst) ,
91- }
22+ bus ! { I2C3 => ( APB1 , 23 , i2c3en, i2c3lpen, i2c3rst) , }
9223#[ cfg( feature = "fmpi2c1" ) ]
9324#[ cfg( not( feature = "svd-f412" ) ) ]
9425bus ! {
@@ -102,19 +33,8 @@ bus! {
10233
10334bus ! {
10435 USART1 => ( APB2 , 4 , usart1en, usart1lpen, usart1rst) ,
105- USART2 => ( APB1 , 17 , usart2en, usart2lpen, usart2rst) ,
10636 USART6 => ( APB2 , 5 , usart6en, usart6lpen, usart6rst) ,
10737}
108- #[ cfg( feature = "usart3" ) ]
109- bus ! {
110- USART3 => ( APB1 , 18 , usart3en, usart3lpen, usart3rst) ,
111- }
112-
113- #[ cfg( any( feature = "uart4" , feature = "uart5" ) ) ]
114- bus ! {
115- UART4 => ( APB1 , 19 , uart4en, uart4lpen, uart4rst) ,
116- UART5 => ( APB1 , 20 , uart5en, uart5lpen, uart5rst) ,
117- }
11838
11939#[ cfg( any( feature = "uart7" , feature = "uart8" ) ) ]
12040bus ! {
@@ -139,37 +59,21 @@ bus! {
13959}
14060
14161#[ cfg( feature = "dac" ) ]
142- bus ! {
143- DAC => ( APB1 , 29 , dacen, daclpen, dacrst) ,
144- }
62+ bus ! { DAC => ( APB1 , 29 , dacen, daclpen, dacrst) , }
14563
14664bus ! {
14765 SYSCFG => ( APB2 , 14 , syscfgen, syscfglpen, syscfgrst) ,
14866}
14967
150- bus ! {
151- ADC1 => ( APB2 , 8 , adc1en, adc1lpen, adcrst) ,
152- }
68+ bus ! { ADC1 => ( APB2 , 8 , adc1en, adc1lpen, adcrst) , }
15369
15470#[ cfg( feature = "adc2" ) ]
155- impl RccBus for crate :: pac:: ADC2 {
156- type Bus = APB2 ;
157- }
158- #[ cfg( feature = "adc2" ) ]
159- bus_enable ! ( ADC2 => 9 , adc2en) ;
160- #[ cfg( feature = "adc2" ) ]
161- bus_lpenable ! ( ADC2 => 9 , adc2lpen) ;
71+ bus ! { ADC2 => ( APB2 , 9 , adc2en, adc2lpen, ) , }
16272#[ cfg( feature = "adc2" ) ]
16373bus_reset ! ( ADC2 => 8 , adcrst) ;
16474
16575#[ cfg( feature = "adc3" ) ]
166- impl RccBus for crate :: pac:: ADC3 {
167- type Bus = APB2 ;
168- }
169- #[ cfg( feature = "adc3" ) ]
170- bus_enable ! ( ADC3 => 10 , adc3en) ;
171- #[ cfg( feature = "adc3" ) ]
172- bus_lpenable ! ( ADC3 => 10 , adc3lpen) ;
76+ bus ! { ADC3 => ( APB2 , 10 , adc3en, adc3lpen, ) , }
17377#[ cfg( feature = "adc3" ) ]
17478bus_reset ! ( ADC3 => 8 , adcrst) ;
17579
@@ -200,61 +104,21 @@ bus! {
200104
201105bus ! {
202106 TIM1 => ( APB2 , 0 , tim1en, tim1lpen, tim1rst) ,
203- TIM5 => ( APB1 , 3 , tim5en, tim5lpen, tim5rst) ,
204107 TIM9 => ( APB2 , 16 , tim9en, tim9lpen, tim9rst) ,
205108 TIM11 => ( APB2 , 18 , tim11en, tim11lpen, tim11rst) ,
206109}
207110
208- #[ cfg( any(
209- feature = "gpio-f401" ,
210- feature = "gpio-f417" ,
211- feature = "gpio-f411" ,
212- feature = "gpio-f412" ,
213- feature = "gpio-f413" ,
214- feature = "gpio-f427" ,
215- feature = "gpio-f446" ,
216- feature = "gpio-f469" ,
217- ) ) ]
218- bus ! {
219- TIM2 => ( APB1 , 0 , tim2en, tim2lpen, tim2rst) ,
220- TIM3 => ( APB1 , 1 , tim3en, tim3lpen, tim3rst) ,
221- TIM4 => ( APB1 , 2 , tim4en, tim4lpen, tim4rst) ,
222- TIM10 => ( APB2 , 17 , tim10en, tim10lpen, tim10rst) ,
223- }
111+ #[ cfg( feature = "tim10" ) ]
112+ bus ! { TIM10 => ( APB2 , 17 , tim10en, tim10lpen, tim10rst) , }
224113
225- #[ cfg( feature = "tim6" ) ]
226- bus ! {
227- TIM6 => ( APB1 , 4 , tim6en, tim6lpen, tim6rst) ,
228- }
229- #[ cfg( feature = "tim7" ) ]
230- bus ! {
231- TIM7 => ( APB1 , 5 , tim7en, tim7lpen, tim7rst) ,
232- }
233114#[ cfg( feature = "tim8" ) ]
234115bus ! {
235116 TIM8 => ( APB2 , 1 , tim8en, tim8lpen, tim8rst) ,
236117}
237- #[ cfg( feature = "tim12" ) ]
238- bus ! {
239- TIM12 => ( APB1 , 6 , tim12en, tim12lpen, tim12rst) ,
240- }
241- #[ cfg( feature = "tim13" ) ]
242- bus ! {
243- TIM13 => ( APB1 , 7 , tim13en, tim13lpen, tim13rst) ,
244- }
245- #[ cfg( feature = "tim14" ) ]
246- bus ! {
247- TIM14 => ( APB1 , 8 , tim14en, tim14lpen, tim14rst) ,
248- }
249-
250118#[ cfg( feature = "ltdc" ) ]
251119bus ! {
252120 LTDC => ( APB2 , 26 , ltdcen, ltdclpen, ltdcrst) ,
253121}
254- #[ cfg( feature = "dma2d" ) ]
255- bus ! {
256- DMA2D => ( AHB1 , 23 , dma2den, dma2dlpen, dma2drst) ,
257- }
258122#[ cfg( feature = "dsihost" ) ]
259123bus ! {
260124 DSI => ( APB2 , 27 , dsien, dsilpen, dsirst) ,
0 commit comments