Skip to content

Commit 57a03a5

Browse files
committed
spi unmacro
1 parent 4093bd8 commit 57a03a5

File tree

4 files changed

+723
-841
lines changed

4 files changed

+723
-841
lines changed

examples/spi-dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn main() -> ! {
7070
info!("");
7171

7272
// Initialise the SPI peripheral.
73-
let spi: spi::Spi<_, _, u8> = dp.SPI2.spi(
73+
let spi = dp.SPI2.spi::<_, u8>(
7474
(sck, miso, mosi),
7575
spi::MODE_0,
7676
1.MHz(),

examples/spi_hardware_cs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ fn main() -> ! {
4444
// GPIOA in the RCC register.
4545
let gpioa = dp.GPIOA.split(ccdr.peripheral.GPIOA);
4646

47-
let sck = gpioa.pa5.into_alternate::<5>();
48-
let miso = gpioa.pa6.into_alternate();
49-
let mosi = gpioa.pa7.into_alternate();
47+
let sck = gpioa.pa5;
48+
let miso = gpioa.pa6;
49+
let mosi = gpioa.pa7;
5050
// Because we want to use the hardware chip select, we need to provide that too
51-
let hcs = gpioa.pa4.into_alternate();
51+
let hcs = gpioa.pa4;
5252

5353
info!("");
5454
info!("stm32h7xx-hal example - SPI");

src/gpio/alt.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,8 +2435,8 @@ pub mod spi1 {
24352435
PD7<5>,
24362436
],
24372437
<Nss> for [
2438-
PA15<5>,
24392438
PA4<5>,
2439+
PA15<5>,
24402440
PG10<5>,
24412441
],
24422442
}
@@ -2446,8 +2446,8 @@ pub mod spi2 {
24462446
use super::*;
24472447
pin! {
24482448
<Sck> for no:NoPin, [
2449-
PA12<5>,
24502449
PA9<5>,
2450+
PA12<5>,
24512451
PB10<5>,
24522452
PB13<5>,
24532453
PD3<5>,
@@ -2458,7 +2458,7 @@ pub mod spi2 {
24582458
<Miso> for no:NoPin, [
24592459
PB14<5>,
24602460

2461-
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
2461+
// #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] TODO: check
24622462
PC2<5>,
24632463
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
24642464
PI2<5>,
@@ -2467,15 +2467,15 @@ pub mod spi2 {
24672467
PB15<5>,
24682468
PC1<5>,
24692469

2470-
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
2470+
// #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] TODO: check
24712471
PC3<5>,
24722472
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
24732473
PI3<5>,
24742474
],
24752475
<Nss> for [
24762476
PA11<5>,
2477-
PB12<5>,
24782477
PB4<7>,
2478+
PB12<5>,
24792479
PB9<5>,
24802480

24812481
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]

0 commit comments

Comments
 (0)