aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2022-10-25 15:49:53 -0400
committerBrian Cully <bjc@kublai.com>2022-10-25 15:49:53 -0400
commitc6e8f82fffa98283ebbae6e9cbcb028c7e72a0f5 (patch)
tree5b43f65bf76fb7da7d765adf9538e1acc35aefc9
parent32355266caaa855585c86a79fa74ef15feee311d (diff)
downloadluchie-c6e8f82fffa98283ebbae6e9cbcb028c7e72a0f5.tar.gz
luchie-c6e8f82fffa98283ebbae6e9cbcb028c7e72a0f5.zip
spi init: use mode 1 explicitly
-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,
);