Skip to content

Commit

Permalink
spi unmacro
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Apr 17, 2023
1 parent 4093bd8 commit 57a03a5
Show file tree
Hide file tree
Showing 4 changed files with 723 additions and 841 deletions.
2 changes: 1 addition & 1 deletion examples/spi-dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn main() -> ! {
info!("");

// Initialise the SPI peripheral.
let spi: spi::Spi<_, _, u8> = dp.SPI2.spi(
let spi = dp.SPI2.spi::<_, u8>(
(sck, miso, mosi),
spi::MODE_0,
1.MHz(),
Expand Down
8 changes: 4 additions & 4 deletions examples/spi_hardware_cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ fn main() -> ! {
// GPIOA in the RCC register.
let gpioa = dp.GPIOA.split(ccdr.peripheral.GPIOA);

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

info!("");
info!("stm32h7xx-hal example - SPI");
Expand Down
10 changes: 5 additions & 5 deletions src/gpio/alt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2435,8 +2435,8 @@ pub mod spi1 {
PD7<5>,
],
<Nss> for [
PA15<5>,
PA4<5>,
PA15<5>,
PG10<5>,
],
}
Expand All @@ -2446,8 +2446,8 @@ pub mod spi2 {
use super::*;
pin! {
<Sck> for no:NoPin, [
PA12<5>,
PA9<5>,
PA12<5>,
PB10<5>,
PB13<5>,
PD3<5>,
Expand All @@ -2458,7 +2458,7 @@ pub mod spi2 {
<Miso> for no:NoPin, [
PB14<5>,

#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
// #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] TODO: check
PC2<5>,
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
PI2<5>,
Expand All @@ -2467,15 +2467,15 @@ pub mod spi2 {
PB15<5>,
PC1<5>,

#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
// #[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))] TODO: check
PC3<5>,
#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
PI3<5>,
],
<Nss> for [
PA11<5>,
PB12<5>,
PB4<7>,
PB12<5>,
PB9<5>,

#[cfg(any(feature = "gpio-h747", feature = "gpio-h7a2"))]
Expand Down
Loading

0 comments on commit 57a03a5

Please sign in to comment.