Skip to content

Commit bec8a16

Browse files
committed
ff
1 parent c79b688 commit bec8a16

File tree

6 files changed

+177
-220
lines changed

6 files changed

+177
-220
lines changed

Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ gpio-f411 = [
264264
"tim9",
265265
"tim10",
266266
"tim11",
267-
"spi3",
268-
"spi4",
269-
"spi5",
270267
"usart1",
271268
"usart2",
272269
"usart6",
@@ -329,7 +326,6 @@ gpio-f413 = [
329326
"gpiof",
330327
"gpiog",
331328
"gpioh",
332-
"aes",
333329
"can1",
334330
"can2",
335331
"can3",
@@ -703,6 +699,7 @@ gpio-f72x = [
703699
"adc2",
704700
"adc3",
705701
"can1",
702+
"dac",
706703
"fmc",
707704
"gpioc",
708705
"gpiod",
@@ -759,9 +756,11 @@ gpio-f72x = [
759756
gpio-f746 = [
760757
"adc2",
761758
"adc3",
759+
"dac",
762760
"dma2d",
763761
"can1",
764762
"can2",
763+
"cec",
765764
"cryp",
766765
"dcmi",
767766
"eth",
@@ -827,9 +826,11 @@ gpio-f746 = [
827826
gpio-f76x = [
828827
"adc2",
829828
"adc3",
829+
"dac",
830830
"dma2d",
831831
"can1",
832832
"can2",
833+
"cec",
833834
"cryp",
834835
"dcmi",
835836
"eth",
@@ -960,6 +961,7 @@ aes = []
960961
can1 = []
961962
can2 = []
962963
can3 = []
964+
cec = []
963965
cryp = []
964966
cm4 = []
965967
crs1 = []

src/rcc/enable.rs

Lines changed: 171 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,26 @@ bus! { ETHERNET_MAC => (AHB1, 25, ethmacen, ethmaclpen, ethmacrst),}
3838
#[cfg(feature = "otg-hs")]
3939
bus! { OTG_HS_GLOBAL => (AHB1, 29, otghsen, otghslpen, otghsrst),}
4040

41+
#[cfg(feature = "dcmi")]
42+
bus! { DCMI => (AHB2, 0, dcmien, dcmilpen, dcmirst),}
43+
44+
#[cfg(feature = "jpeg")]
45+
bus! { JPEG => (AHB2, 1, jpegen, jpeglpen,),}
46+
47+
#[cfg(feature = "f4")]
48+
#[cfg(feature = "aes")]
49+
bus! { AES => (AHB2, 4, crypen, , cryprst),}
50+
51+
#[cfg(not(feature = "f4"))]
52+
#[cfg(feature = "aes")]
53+
bus! { AES => (AHB2, 4, aesen, aeslpen, aesrst),}
54+
55+
#[cfg(feature = "cryp")]
56+
bus! { CRYP => (AHB2, 4, crypen, cryplpen, cryprst),}
57+
58+
#[cfg(feature = "hash")]
59+
bus! { HASH => (AHB2, 5, hashen, hashlpen,),}
60+
4161
#[cfg(feature = "rng")]
4262
bus! { RNG => (AHB2, 6, rngen, rnglpen, rngrst),}
4363

@@ -56,9 +76,7 @@ bus! { FSMC => (AHB3, 0, fmcen, fmclpen, fmcrst),}
5676
bus! { FSMC => (AHB3, 0, fsmcen, fsmclpen, fsmcrst),}
5777

5878
#[cfg(feature = "quadspi")]
59-
bus! {
60-
QUADSPI => (AHB3, 1, qspien, , qspirst),
61-
}
79+
bus! { QUADSPI => (AHB3, 1, qspien, , qspirst),}
6280

6381
#[cfg(feature = "tim2")]
6482
bus! { TIM2 => (APB1, 0, tim2en, tim2lpen, tim2rst),}
@@ -93,6 +111,9 @@ bus! { SPI2 => (APB1, 14, spi2en, spi2lpen, spi2rst),}
93111
#[cfg(feature = "spi3")]
94112
bus! { SPI3 => (APB1, 15, spi3en, spi3lpen, spi3rst),}
95113

114+
#[cfg(feature = "spdifrx")]
115+
bus! { SPDIFRX => (APB1, 16, spdifrxen, spdifrxlpen, spdifrxrst),}
116+
96117
#[cfg(feature = "usart2")]
97118
bus! { USART2 => (APB1, 17, usart2en, usart2lpen, usart2rst),}
98119
#[cfg(feature = "usart3")]
@@ -102,3 +123,150 @@ bus! { USART3 => (APB1, 18, usart3en, usart3lpen, usart3rst),}
102123
bus! { UART4 => (APB1, 19, uart4en, uart4lpen, uart4rst),}
103124
#[cfg(feature = "uart5")]
104125
bus! { UART5 => (APB1, 20, uart5en, uart5lpen, uart5rst),}
126+
127+
bus! { I2C1 => (APB1, 21, i2c1en, i2c1lpen, i2c1rst),}
128+
#[cfg(feature = "i2c2")]
129+
bus! { I2C2 => (APB1, 22, i2c2en, i2c2lpen, i2c2rst),}
130+
#[cfg(feature = "i2c3")]
131+
bus! { I2C3 => (APB1, 23, i2c3en, i2c3lpen, i2c3rst),}
132+
#[cfg(feature = "i2c4")]
133+
bus! { I2C4 => (APB1, 24, i2c4en, i2c4lpen, i2c4rst),}
134+
#[cfg(feature = "fmpi2c1")]
135+
#[cfg(not(feature = "svd-f412"))]
136+
bus! { FMPI2C1 => (APB1, 24, fmpi2c1en, fmpi2c1lpen, fmpi2c1rst),}
137+
#[cfg(feature = "fmpi2c1")]
138+
#[cfg(feature = "svd-f412")]
139+
bus! { FMPI2C1 => (APB1, 24, i2c4en, i2c4lpen, i2c4rst),}
140+
141+
#[cfg(feature = "can1")]
142+
bus! { CAN1 => (APB1, 25, can1en, can1lpen, can1rst),}
143+
#[cfg(feature = "can2")]
144+
bus! { CAN2 => (APB1, 26, can2en, can2lpen, can2rst),}
145+
146+
#[cfg(feature = "f4")]
147+
#[cfg(feature = "can3")]
148+
bus! { CAN3 => (APB1, 27, can3en, can3lpen, can3rst),}
149+
150+
#[cfg(feature = "f7")]
151+
#[cfg(feature = "can3")]
152+
bus! { CAN3 => (APB1, 13, can3en, can3lpen, can3rst),}
153+
154+
#[cfg(feature = "f4")]
155+
#[cfg(feature = "cec")]
156+
bus! { HDMP_CEC => (APB1, 27, cecen, ceclpen, cecrst),}
157+
158+
#[cfg(feature = "f7")]
159+
#[cfg(feature = "cec")]
160+
bus! { CEC => (APB1, 27, cecen, ceclpen, cecrst),}
161+
162+
bus! { PWR => (APB1, 28, pwren, pwrlpen, pwrrst),}
163+
164+
#[cfg(feature = "dac")]
165+
bus! { DAC => (APB1, 29, dacen, daclpen, dacrst),}
166+
167+
#[cfg(feature = "uart7")]
168+
bus! {UART7 => (APB1, 30, uart7en, uart7lpen, uart7rst),}
169+
#[cfg(feature = "uart8")]
170+
bus! {UART8 => (APB1, 31, uart8en, uart8lpen, uart8rst),}
171+
172+
#[cfg(feature = "tim1")]
173+
bus! { TIM1 => (APB2, 0, tim1en, tim1lpen, tim1rst),}
174+
#[cfg(feature = "tim8")]
175+
bus! {TIM8 => (APB2, 1, tim8en, tim8lpen, tim8rst),}
176+
177+
#[cfg(feature = "usart1")]
178+
bus! { USART1 => (APB2, 4, usart1en, usart1lpen, usart1rst),}
179+
#[cfg(feature = "usart6")]
180+
bus! { USART6 => (APB2, 5, usart6en, usart6lpen, usart6rst),}
181+
#[cfg(feature = "uart9")]
182+
bus! { UART9 => (APB2, 6, uart9en, uart9lpen, uart9rst),}
183+
#[cfg(feature = "uart10")]
184+
bus! { UART10 => (APB2, 7, uart10en, uart10lpen, uart10rst),}
185+
186+
#[cfg(feature = "sdmmc2")]
187+
bus! { SDMMC2 => (APB2, 7, sdmmc2en, sdmmc2lpen, sdmmc2rst),}
188+
189+
bus! { ADC1 => (APB2, 8, adc1en, adc1lpen, adcrst),}
190+
191+
#[cfg(feature = "adc2")]
192+
bus! { ADC2 => (APB2, 9, adc2en, adc2lpen, ),}
193+
#[cfg(feature = "adc2")]
194+
bus_reset!(ADC2 => 8, adcrst);
195+
196+
#[cfg(feature = "adc3")]
197+
bus! { ADC3 => (APB2, 10, adc3en, adc3lpen, ),}
198+
#[cfg(feature = "adc3")]
199+
bus_reset!(ADC3 => 8, adcrst);
200+
201+
#[cfg(feature = "sdio")]
202+
bus! { SDIO => (APB2, 11, sdioen, sdiolpen, sdiorst),}
203+
#[cfg(feature = "sdmmc1")]
204+
bus! { SDMMC1 => (APB2, 11, sdmmc1en, sdmmc1lpen, sdmmc1rst),}
205+
206+
#[cfg(feature = "spi1")]
207+
bus! { SPI1 => (APB2, 12, spi1en, spi1lpen, spi1rst),}
208+
#[cfg(feature = "spi4")]
209+
bus! { SPI4 => (APB2, 13, spi4en, spi4lpen, spi4rst),}
210+
211+
#[cfg(feature = "sys")]
212+
bus! { SYSCFG => (APB2, 14, syscfgen, syscfglpen, syscfgrst),}
213+
214+
#[cfg(feature = "tim9")]
215+
bus! {TIM9 => (APB2, 16, tim9en, tim9lpen, tim9rst),}
216+
#[cfg(feature = "tim10")]
217+
bus! { TIM10 => (APB2, 17, tim10en, tim10lpen, tim10rst),}
218+
#[cfg(feature = "tim11")]
219+
bus! { TIM11 => (APB2, 18, tim11en, tim11lpen, tim11rst),}
220+
221+
#[cfg(feature = "spi5")]
222+
bus! { SPI5 => (APB2, 20, spi5en, spi5lpen, spi5rst),}
223+
#[cfg(feature = "spi6")]
224+
bus! { SPI6 => (APB2, 21, spi6en, spi6lpen, spi6rst),}
225+
226+
#[cfg(any(
227+
feature = "gpio-f413",
228+
feature = "gpio-f469",
229+
feature = "stm32f429",
230+
feature = "stm32f439"
231+
))]
232+
#[cfg(feature = "sai1")]
233+
bus! {
234+
SAI => (APB2, 22, sai1en, sai1lpen, sai1rst),
235+
}
236+
237+
#[cfg(not(any(
238+
feature = "gpio-f413",
239+
feature = "gpio-f469",
240+
feature = "stm32f429",
241+
feature = "stm32f439"
242+
)))]
243+
#[cfg(feature = "sai1")]
244+
bus! {
245+
SAI1 => (APB2, 22, sai1en, sai1lpen, sai1rst),
246+
}
247+
248+
#[cfg(feature = "sai2")]
249+
bus! {
250+
SAI2 => (APB2, 23, sai2en, sai2lpen, sai2rst),}
251+
252+
#[cfg(feature = "f4")]
253+
#[cfg(feature = "dfsdm1")]
254+
bus! { DFSDM => (APB2, 24, dfsdmen, dfsdmlpen, dfsdmrst),}
255+
#[cfg(feature = "f4")]
256+
#[cfg(feature = "dfsdm2")]
257+
bus! { DFSDM => (APB2, 25, dfsdmen, dfsdmlpen, dfsdmrst),}
258+
259+
#[cfg(feature = "ltdc")]
260+
bus! { LTDC => (APB2, 26, ltdcen, ltdclpen, ltdcrst),}
261+
262+
#[cfg(feature = "dsihost")]
263+
bus! { DSI => (APB2, 27, dsien, dsilpen, dsirst),}
264+
265+
#[cfg(feature = "f7")]
266+
#[cfg(feature = "dfsdm1")]
267+
bus! { DFSDM => (APB2, 29, dfsdm1en, dfsdm1lpen, dfsdm1rst),}
268+
269+
#[cfg(feature = "mdios")]
270+
bus! { MDIOS => (APB2, 30, mdioen, mdiolpen, mdiorst),}
271+
#[cfg(feature = "svd-f730")]
272+
bus! { USBPHYC => (APB2, 31, usbphycen,, usbphycrst),}

src/rcc/f4/enable.rs

Lines changed: 0 additions & 125 deletions
This file was deleted.

src/rcc/f4/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use fugit::RateExtU32;
99

1010
mod pll;
1111

12-
mod enable;
13-
1412
bus_struct! {
1513
APB1 => (APB1ENR, apb1enr, APB1LPENR, apb1lpenr, APB1RSTR, apb1rstr, "Advanced Peripheral Bus 1 (APB1) registers"),
1614
APB2 => (APB2ENR, apb2enr, APB2LPENR, apb2lpenr, APB2RSTR, apb2rstr, "Advanced Peripheral Bus 2 (APB2) registers"),

0 commit comments

Comments
 (0)