aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/main.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index ce5f346..3c13e54 100755
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,7 @@ use cortex_m::{
interrupt,
};
use cortex_m_rt::entry;
-use embedded_hal::spi::{Mode, Phase, Polarity};
+use embedded_hal::spi;
use stm32f1xx_hal::{
pac,
prelude::*,
@@ -80,15 +80,11 @@ fn main() -> ! {
let miso_pin = gpioa.pa6;
let mosi_pin = gpioa.pa7.into_alternate_push_pull(&mut gpioa.crl);
let cs_pin = gpioa.pa4.into_push_pull_output(&mut gpioa.crl);
- let spi_mode = Mode {
- phase: Phase::CaptureOnSecondTransition,
- polarity: Polarity::IdleHigh,
- };
let mut spi = Spi::spi1(
dp.SPI1,
(sck_pin, miso_pin, mosi_pin),
&mut afio.mapr,
- spi_mode,
+ spi::MODE_1,
1.MHz(),
clocks,
);