Skip to content

Commit 0ed1056

Browse files
committed
fix1
1 parent 1ee5d8f commit 0ed1056

File tree

8 files changed

+64
-59
lines changed

8 files changed

+64
-59
lines changed

.zed/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"allTargets": false,
1010
"targets": "thumbv7em-none-eabihf"
1111
}
12+
},
13+
"binary": {
14+
"path": "/home/burrbull/Programs/rust-analyzer-x86_64-unknown-linux-gnu",
15+
"args": []
1216
}
1317
}
1418
}

Cargo.toml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ stm32f732 = ["svd-f732"]
620620
stm32f733 = ["svd-f733"]
621621
stm32f745 = ["svd-f745"]
622622
stm32f746 = ["svd-f746"]
623+
stm32f750 = ["svd-f750"]
623624
stm32f756 = ["svd-f756"]
624625
stm32f765 = ["svd-f765"]
625626
stm32f767 = ["svd-f767"]
@@ -632,21 +633,21 @@ svd-f722 = ["f7", "stm32f7?/stm32f722", "gpio-f72x"]
632633
svd-f723 = ["f7", "stm32f7?/stm32f723", "gpio-f72x", "usb_hs_phy"]
633634
svd-f732 = ["f7", "stm32f7?/stm32f732", "gpio-f72x"]
634635
svd-f733 = ["f7", "stm32f7?/stm32f733", "gpio-f72x", "usb_hs_phy"]
635-
svd-f730 = ["f7", "stm32f7?/stm32f730", "gpio-f72x", "usb_hs_phy"]
636+
svd-f730 = ["f7", "stm32f7?/stm32f730", "gpio-f72x", "aes", "usb_hs_phy"]
636637
svd-f745 = ["f7", "stm32f7?/stm32f745", "gpio-f746"]
637638
svd-f746 = ["f7", "stm32f7?/stm32f746", "gpio-f746"]
639+
svd-f750 = ["f7", "stm32f7?/stm32f750", "gpio-f746"]
638640
svd-f756 = ["f7", "stm32f7?/stm32f756", "gpio-f746"]
639641
svd-f765 = ["f7", "stm32f7?/stm32f765", "gpio-f76x"]
640-
svd-f767 = ["f7", "stm32f7?/stm32f767", "gpio-f76x"]
641-
svd-f769 = ["f7", "stm32f7?/stm32f769", "gpio-f76x"]
642-
svd-f777 = ["f7", "stm32f7?/stm32f777", "gpio-f76x"]
643-
svd-f778 = ["f7", "stm32f7?/stm32f778", "gpio-f76x"]
644-
svd-f779 = ["f7", "stm32f7?/stm32f779", "gpio-f76x"]
642+
svd-f767 = ["f7", "stm32f7?/stm32f767", "gpio-f76x", "dsihost", "can3", "mdios"]
643+
svd-f769 = ["f7", "stm32f7?/stm32f769", "gpio-f76x", "dsihost", "can3", "mdios"]
644+
svd-f777 = ["f7", "stm32f7?/stm32f777", "gpio-f76x", "dsihost", "can3", "mdios"]
645+
svd-f778 = ["f7", "stm32f7?/stm32f778", "gpio-f76x", "dsihost", "can3", "mdios"]
646+
svd-f779 = ["f7", "stm32f7?/stm32f779", "gpio-f76x", "dsihost", "can3", "mdios"]
645647

646648
gpio-f72x = [
647649
"adc2",
648650
"adc3",
649-
"aes",
650651
"can1",
651652
"fmc",
652653
"gpioc",
@@ -770,10 +771,8 @@ gpio-f76x = [
770771
"can1",
771772
"can2",
772773
"cryp",
773-
"can3",
774774
"dcmi",
775775
"dfsdm1",
776-
"dsihost",
777776
"eth",
778777
"fmc",
779778
"gpioc",
@@ -795,7 +794,6 @@ gpio-f76x = [
795794
"i2s3",
796795
"lptim1",
797796
"ltdc",
798-
"mdios",
799797
"quadspi",
800798
"rtc",
801799
"sai1",

src/gpio/alt/f7.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub mod can2 {
5757
}
5858
}
5959

60-
#[cfg(feature = "gpio-f76x")]
60+
#[cfg(feature = "can3")]
6161
pub mod can3 {
6262
use super::*;
6363

@@ -391,7 +391,7 @@ pub mod dfsdm1 {
391391
}
392392
}
393393

394-
#[cfg(feature = "gpio-f76x")]
394+
#[cfg(feature = "dsihost")]
395395
pub mod dsihost {
396396
use super::*;
397397

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ pub use stm32f7::stm32f745 as pac;
8080
#[cfg(feature = "svd-f746")]
8181
pub use stm32f7::stm32f746 as pac;
8282

83+
#[cfg(feature = "svd-f750")]
84+
pub use stm32f7::stm32f750 as pac;
85+
8386
#[cfg(feature = "svd-f756")]
8487
pub use stm32f7::stm32f756 as pac;
8588

@@ -289,6 +292,7 @@ const fn max_u32(first: u32, second: u32) -> u32 {
289292
}
290293
}
291294

295+
#[cfg(feature = "f4")]
292296
const fn min_u32(first: u32, second: u32) -> u32 {
293297
if second < first {
294298
second

src/pacext.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub mod uart;
99
#[path = "./pacext/uart_v3.rs"]
1010
pub mod uart;
1111

12+
#[cfg(feature = "f4")]
1213
macro_rules! wrap_r {
1314
(pub trait $TrR:ident {
1415
$(fn $f:ident(&self $(, $n:ident: u8)?) -> $fr:path;)*
@@ -26,8 +27,10 @@ macro_rules! wrap_r {
2627
}
2728
};
2829
}
30+
#[cfg(feature = "f4")]
2931
pub(crate) use wrap_r;
3032

33+
#[cfg(feature = "f4")]
3134
macro_rules! wrap_w {
3235
(pub trait $TrR:ident {
3336
$(fn $f:ident(&mut self $(, $n:ident: u8)?) -> $fr:path;)*
@@ -46,6 +49,7 @@ macro_rules! wrap_w {
4649
}
4750
};
4851
}
52+
#[cfg(feature = "f4")]
4953
pub(crate) use wrap_w;
5054

5155
macro_rules! impl_reg {
@@ -60,6 +64,7 @@ macro_rules! impl_reg {
6064
}
6165
pub(crate) use impl_reg;
6266

67+
#[cfg(feature = "f4")]
6368
macro_rules! impl_read {
6469
($($f:ident $(: $n:ident)? -> $fty:path;)*) => {
6570
$(
@@ -70,8 +75,10 @@ macro_rules! impl_read {
7075
)*
7176
};
7277
}
78+
#[cfg(feature = "f4")]
7379
pub(crate) use impl_read;
7480

81+
#[cfg(feature = "f4")]
7582
macro_rules! impl_write {
7683
($($f:ident $(: $n:ident)? -> $fty:path;)*) => {
7784
$(
@@ -82,4 +89,5 @@ macro_rules! impl_write {
8289
)*
8390
};
8491
}
92+
#[cfg(feature = "f4")]
8593
pub(crate) use impl_write;

src/pacext/uart_v3.rs

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{sealed, Sealed};
1+
use crate::Sealed;
22

33
use super::*;
44
use crate::pac::usart1;
@@ -15,41 +15,23 @@ pub trait UartRB: Sealed {
1515
fn gtpr(&self) -> &usart1::GTPR;
1616
}
1717

18-
impl Sealed for usart1::RegisterBlock {}
19-
impl UartRB for usart1::RegisterBlock {
20-
fn cr1(&self) -> &usart1::CR1 {
21-
self.cr1()
22-
}
23-
24-
fn rdr(&self) -> &usart1::RDR {
25-
self.rdr()
26-
}
27-
28-
fn tdr(&self) -> &usart1::TDR {
29-
self.tdr()
30-
}
31-
32-
fn brr(&self) -> &usart1::BRR {
33-
self.brr()
34-
}
35-
36-
fn icr(&self) -> &usart1::ICR {
37-
self.icr()
38-
}
39-
40-
fn isr(&self) -> &usart1::ISR {
41-
self.isr()
42-
}
43-
44-
fn cr2(&self) -> &usart1::CR2 {
45-
self.cr2()
46-
}
47-
48-
fn cr3(&self) -> &usart1::CR3 {
49-
self.cr3()
50-
}
51-
52-
fn gtpr(&self) -> &usart1::GTPR {
53-
self.gtpr()
54-
}
18+
macro_rules! impl_ext {
19+
($(#[$attr:meta])* $uart:ident) => {
20+
impl Sealed for $uart::RegisterBlock {}
21+
impl UartRB for $uart::RegisterBlock {
22+
impl_reg! {
23+
cr1 -> &usart1::CR1;
24+
rdr -> &usart1::RDR;
25+
tdr -> &usart1::TDR;
26+
brr -> &usart1::BRR;
27+
icr -> &usart1::ICR;
28+
isr -> &usart1::ISR;
29+
cr2 -> &usart1::CR2;
30+
cr3 -> &usart1::CR3;
31+
gtpr -> &usart1::GTPR;
32+
}
33+
}
34+
};
5535
}
36+
37+
impl_ext!(usart1);

src/rcc/f7/enable.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ bus! {
154154
SAI2 => (APB2, sai2en, sai2lpen, sai2rst), // 23
155155
}
156156

157+
#[cfg(feature = "svd-f730")]
158+
bus! {
159+
AES => (AHB2, aesen, aeslpen, aesrst), // 4
160+
USBPHYC => (APB2, usbphycen,, usbphycrst), // 31
161+
}
162+
157163
#[cfg(any(
158164
feature = "svd-f730",
159165
feature = "svd-f722",
@@ -162,16 +168,13 @@ bus! {
162168
feature = "svd-f733",
163169
))]
164170
bus! {
165-
AES => (AHB2, aesen, aeslpen, aesrst), // 4
166-
167171
SDMMC2 => (APB2, sdmmc2en, sdmmc2lpen, sdmmc2rst), // 7
168-
USBPHYC => (APB2, usbphycen,, usbphycrst), // 31
169172
}
170173

171174
#[cfg(any(
172175
feature = "svd-f745",
173-
//feature = "svd-f750",
174176
feature = "svd-f746",
177+
feature = "svd-f750",
175178
feature = "svd-f756",
176179
feature = "svd-f765",
177180
feature = "svd-f767",
@@ -207,10 +210,20 @@ bus! {
207210
))]
208211
bus! {
209212
JPEG => (AHB2, jpegen, jpeglpen,), // 1
213+
}
210214

215+
#[cfg(feature = "can3")]
216+
bus! {
211217
CAN3 => (APB1, can3en, can3lpen, can3rst), // 13
218+
}
212219

220+
#[cfg(feature = "dsihost")]
221+
bus! {
213222
DSI => (APB2, dsien, dsilpen, dsirst), // 27
223+
}
224+
225+
#[cfg(feature = "mdios")]
226+
bus! {
214227
MDIOS => (APB2, mdioen, mdiolpen, mdiorst), // 30
215228
}
216229

src/spi.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,7 @@ macro_rules! spi {
264264
#[cfg(feature = "spi1")]
265265
spi! { pac::SPI1: Spi1, SpiSlave1 }
266266
#[cfg(feature = "spi2")]
267-
#[cfg(not(any(
268-
//feature = "svd-f750",
269-
feature = "svd-f746",
270-
feature = "svd-f756",
271-
)))]
267+
#[cfg(not(any(feature = "svd-f746", feature = "svd-f750", feature = "svd-f756",)))]
272268
spi! { pac::SPI2: Spi2, SpiSlave2 }
273269
#[cfg(feature = "spi3")]
274270
#[cfg(not(any(feature = "svd-f745", feature = "svd-f765")))]

0 commit comments

Comments
 (0)