From c6e8f82fffa98283ebbae6e9cbcb028c7e72a0f5 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 25 Oct 2022 15:49:53 -0400 Subject: spi init: use mode 1 explicitly --- src/main.rs | 8 ++------ 1 file 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, ); -- cgit v1.2.3