diff options
Diffstat (limited to 'embassy-stm32')
| -rw-r--r-- | embassy-stm32/src/dac/mod.rs | 3 | ||||
| -rw-r--r-- | embassy-stm32/src/dac/v2.rs | 19 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/v2.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 1 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/v1.rs | 20 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/v2.rs | 16 | ||||
| -rw-r--r-- | embassy-stm32/src/spi/v2.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/spi/v3.rs | 9 |
8 files changed, 19 insertions, 55 deletions
diff --git a/embassy-stm32/src/dac/mod.rs b/embassy-stm32/src/dac/mod.rs index 46c485b35..0a15563ef 100644 --- a/embassy-stm32/src/dac/mod.rs +++ b/embassy-stm32/src/dac/mod.rs | |||
| @@ -7,8 +7,7 @@ use crate::peripherals; | |||
| 7 | pub use _version::*; | 7 | pub use _version::*; |
| 8 | 8 | ||
| 9 | pub(crate) mod sealed { | 9 | pub(crate) mod sealed { |
| 10 | use super::*; | 10 | use crate::gpio::OptionalPin; |
| 11 | use crate::gpio::{OptionalPin, Pin}; | ||
| 12 | 11 | ||
| 13 | pub trait Instance { | 12 | pub trait Instance { |
| 14 | fn regs() -> &'static crate::pac::dac::Dac; | 13 | fn regs() -> &'static crate::pac::dac::Dac; |
diff --git a/embassy-stm32/src/dac/v2.rs b/embassy-stm32/src/dac/v2.rs index 18ac0f86a..a7aad04f0 100644 --- a/embassy-stm32/src/dac/v2.rs +++ b/embassy-stm32/src/dac/v2.rs | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | use crate::dac::{DacPin, Instance}; | 1 | use crate::dac::{DacPin, Instance}; |
| 2 | use crate::gpio::Pin; | 2 | use crate::fmt::*; |
| 3 | use crate::gpio::{AnyPin, OptionalPin}; | 3 | use crate::gpio::AnyPin; |
| 4 | use crate::pac::dac; | 4 | use crate::pac::dac; |
| 5 | use core::marker::PhantomData; | 5 | use core::marker::PhantomData; |
| 6 | use embassy::util::Unborrow; | 6 | use embassy::util::Unborrow; |
| 7 | use embassy_extras::unborrow; | 7 | use embassy_extras::unborrow; |
| 8 | 8 | ||
| 9 | #[derive(Debug, defmt::Format)] | ||
| 9 | pub enum Error { | 10 | pub enum Error { |
| 10 | UnconfiguredChannel, | 11 | UnconfiguredChannel, |
| 11 | InvalidValue, | 12 | InvalidValue, |
| @@ -77,7 +78,6 @@ pub enum Value { | |||
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | pub struct Dac<'d, T: Instance> { | 80 | pub struct Dac<'d, T: Instance> { |
| 80 | //peri: T, | ||
| 81 | ch1: Option<AnyPin>, | 81 | ch1: Option<AnyPin>, |
| 82 | ch2: Option<AnyPin>, | 82 | ch2: Option<AnyPin>, |
| 83 | phantom: PhantomData<&'d mut T>, | 83 | phantom: PhantomData<&'d mut T>, |
| @@ -85,11 +85,10 @@ pub struct Dac<'d, T: Instance> { | |||
| 85 | 85 | ||
| 86 | impl<'d, T: Instance> Dac<'d, T> { | 86 | impl<'d, T: Instance> Dac<'d, T> { |
| 87 | pub fn new( | 87 | pub fn new( |
| 88 | peri: impl Unborrow<Target = T> + 'd, | 88 | _peri: impl Unborrow<Target = T> + 'd, |
| 89 | ch1: impl Unborrow<Target = impl DacPin<T, 1>>, | 89 | ch1: impl Unborrow<Target = impl DacPin<T, 1>>, |
| 90 | ch2: impl Unborrow<Target = impl DacPin<T, 2>>, | 90 | ch2: impl Unborrow<Target = impl DacPin<T, 2>>, |
| 91 | ) -> Self { | 91 | ) -> Self { |
| 92 | unborrow!(peri); | ||
| 93 | unborrow!(ch1, ch2); | 92 | unborrow!(ch1, ch2); |
| 94 | 93 | ||
| 95 | let ch1 = ch1.degrade_optional(); | 94 | let ch1 = ch1.degrade_optional(); |
| @@ -110,13 +109,11 @@ impl<'d, T: Instance> Dac<'d, T> { | |||
| 110 | } | 109 | } |
| 111 | } | 110 | } |
| 112 | 111 | ||
| 113 | let mut dac = Self { | 112 | Self { |
| 114 | ch1, | 113 | ch1, |
| 115 | ch2, | 114 | ch2, |
| 116 | phantom: PhantomData, | 115 | phantom: PhantomData, |
| 117 | }; | 116 | } |
| 118 | |||
| 119 | dac | ||
| 120 | } | 117 | } |
| 121 | 118 | ||
| 122 | pub fn enable_channel(&mut self, ch: Channel) -> Result<(), Error> { | 119 | pub fn enable_channel(&mut self, ch: Channel) -> Result<(), Error> { |
| @@ -181,7 +178,7 @@ impl<'d, T: Instance> Dac<'d, T> { | |||
| 181 | if self.ch1.is_none() { | 178 | if self.ch1.is_none() { |
| 182 | return Err(Error::UnconfiguredChannel); | 179 | return Err(Error::UnconfiguredChannel); |
| 183 | } | 180 | } |
| 184 | self.disable_channel(Channel::Ch1); | 181 | unwrap!(self.disable_channel(Channel::Ch1)); |
| 185 | unsafe { | 182 | unsafe { |
| 186 | T::regs().cr().modify(|reg| { | 183 | T::regs().cr().modify(|reg| { |
| 187 | reg.set_tsel1(trigger.tsel()); | 184 | reg.set_tsel1(trigger.tsel()); |
| @@ -194,7 +191,7 @@ impl<'d, T: Instance> Dac<'d, T> { | |||
| 194 | if self.ch2.is_none() { | 191 | if self.ch2.is_none() { |
| 195 | return Err(Error::UnconfiguredChannel); | 192 | return Err(Error::UnconfiguredChannel); |
| 196 | } | 193 | } |
| 197 | self.disable_channel(Channel::Ch2); | 194 | unwrap!(self.disable_channel(Channel::Ch2)); |
| 198 | unsafe { | 195 | unsafe { |
| 199 | T::regs().cr().modify(|reg| { | 196 | T::regs().cr().modify(|reg| { |
| 200 | reg.set_tsel2(trigger.tsel()); | 197 | reg.set_tsel2(trigger.tsel()); |
diff --git a/embassy-stm32/src/dma/v2.rs b/embassy-stm32/src/dma/v2.rs index ba13f8d4c..5b2505463 100644 --- a/embassy-stm32/src/dma/v2.rs +++ b/embassy-stm32/src/dma/v2.rs | |||
| @@ -35,6 +35,7 @@ impl State { | |||
| 35 | 35 | ||
| 36 | static STATE: State = State::new(); | 36 | static STATE: State = State::new(); |
| 37 | 37 | ||
| 38 | #[allow(unused)] // Used by usart/v1.rs which may or may not be enabled | ||
| 38 | pub(crate) async unsafe fn transfer_m2p( | 39 | pub(crate) async unsafe fn transfer_m2p( |
| 39 | ch: &mut impl Channel, | 40 | ch: &mut impl Channel, |
| 40 | ch_func: u8, | 41 | ch_func: u8, |
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 0f9414c53..c108a0a87 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -16,7 +16,6 @@ pub enum Error { | |||
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | pub(crate) mod sealed { | 18 | pub(crate) mod sealed { |
| 19 | use super::*; | ||
| 20 | use crate::gpio::Pin; | 19 | use crate::gpio::Pin; |
| 21 | 20 | ||
| 22 | pub trait Instance { | 21 | pub trait Instance { |
diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index ac9719638..91bc37db3 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs | |||
| @@ -1,5 +1,3 @@ | |||
| 1 | use crate::gpio::AnyPin; | ||
| 2 | use crate::gpio::Pin; | ||
| 3 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; | 1 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; |
| 4 | use crate::time::Hertz; | 2 | use crate::time::Hertz; |
| 5 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| @@ -10,24 +8,18 @@ use embedded_hal::blocking::i2c::Write; | |||
| 10 | use embedded_hal::blocking::i2c::WriteRead; | 8 | use embedded_hal::blocking::i2c::WriteRead; |
| 11 | 9 | ||
| 12 | use crate::pac::i2c; | 10 | use crate::pac::i2c; |
| 13 | use crate::pac::i2c::I2c as I2cTrait; | ||
| 14 | use core::cmp; | ||
| 15 | 11 | ||
| 16 | use crate::pac::gpio::vals::{Afr, Moder, Ot}; | 12 | use crate::pac::gpio::vals::{Afr, Moder, Ot}; |
| 17 | use crate::pac::gpio::Gpio; | 13 | use crate::pac::gpio::Gpio; |
| 18 | use core::ops::Deref; | ||
| 19 | 14 | ||
| 20 | pub struct I2c<'d, T: Instance> { | 15 | pub struct I2c<'d, T: Instance> { |
| 21 | //peri: T, | ||
| 22 | scl: AnyPin, | ||
| 23 | sda: AnyPin, | ||
| 24 | phantom: PhantomData<&'d mut T>, | 16 | phantom: PhantomData<&'d mut T>, |
| 25 | } | 17 | } |
| 26 | 18 | ||
| 27 | impl<'d, T: Instance> I2c<'d, T> { | 19 | impl<'d, T: Instance> I2c<'d, T> { |
| 28 | pub fn new<F>( | 20 | pub fn new<F>( |
| 29 | pclk: Hertz, | 21 | pclk: Hertz, |
| 30 | peri: impl Unborrow<Target = T> + 'd, | 22 | _peri: impl Unborrow<Target = T> + 'd, |
| 31 | scl: impl Unborrow<Target = impl SclPin<T>>, | 23 | scl: impl Unborrow<Target = impl SclPin<T>>, |
| 32 | sda: impl Unborrow<Target = impl SdaPin<T>>, | 24 | sda: impl Unborrow<Target = impl SdaPin<T>>, |
| 33 | freq: F, | 25 | freq: F, |
| @@ -35,7 +27,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 35 | where | 27 | where |
| 36 | F: Into<Hertz>, | 28 | F: Into<Hertz>, |
| 37 | { | 29 | { |
| 38 | unborrow!(peri); | ||
| 39 | unborrow!(scl, sda); | 30 | unborrow!(scl, sda); |
| 40 | 31 | ||
| 41 | unsafe { | 32 | unsafe { |
| @@ -66,9 +57,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 66 | }); | 57 | }); |
| 67 | } | 58 | } |
| 68 | 59 | ||
| 69 | let scl = scl.degrade(); | ||
| 70 | let sda = sda.degrade(); | ||
| 71 | |||
| 72 | unsafe { | 60 | unsafe { |
| 73 | T::regs().cr1().modify(|reg| { | 61 | T::regs().cr1().modify(|reg| { |
| 74 | reg.set_pe(true); | 62 | reg.set_pe(true); |
| @@ -76,8 +64,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 76 | } | 64 | } |
| 77 | 65 | ||
| 78 | Self { | 66 | Self { |
| 79 | scl, | ||
| 80 | sda, | ||
| 81 | phantom: PhantomData, | 67 | phantom: PhantomData, |
| 82 | } | 68 | } |
| 83 | } | 69 | } |
| @@ -261,7 +247,7 @@ impl<'d, T: Instance> Read for I2c<'d, T> { | |||
| 261 | *last = unsafe { self.recv_byte()? }; | 247 | *last = unsafe { self.recv_byte()? }; |
| 262 | 248 | ||
| 263 | // Wait for the STOP to be sent. | 249 | // Wait for the STOP to be sent. |
| 264 | while { unsafe { T::regs().cr1().read().stop() == i2c::vals::Stop::STOP } } {} | 250 | while unsafe { T::regs().cr1().read().stop() == i2c::vals::Stop::STOP } {} |
| 265 | 251 | ||
| 266 | // Fallthrough is success | 252 | // Fallthrough is success |
| 267 | Ok(()) | 253 | Ok(()) |
| @@ -282,7 +268,7 @@ impl<'d, T: Instance> Write for I2c<'d, T> { | |||
| 282 | .cr1() | 268 | .cr1() |
| 283 | .modify(|reg| reg.set_stop(i2c::vals::Stop::STOP)); | 269 | .modify(|reg| reg.set_stop(i2c::vals::Stop::STOP)); |
| 284 | // Wait for STOP condition to transmit. | 270 | // Wait for STOP condition to transmit. |
| 285 | while { unsafe { T::regs().cr1().read().stop() == i2c::vals::Stop::STOP } } {} | 271 | while T::regs().cr1().read().stop() == i2c::vals::Stop::STOP {} |
| 286 | }; | 272 | }; |
| 287 | 273 | ||
| 288 | // Fallthrough is success | 274 | // Fallthrough is success |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 80d8fc0c7..03ad29f13 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -6,26 +6,20 @@ use embedded_hal::blocking::i2c::Read; | |||
| 6 | use embedded_hal::blocking::i2c::Write; | 6 | use embedded_hal::blocking::i2c::Write; |
| 7 | use embedded_hal::blocking::i2c::WriteRead; | 7 | use embedded_hal::blocking::i2c::WriteRead; |
| 8 | 8 | ||
| 9 | use crate::gpio::AnyPin; | ||
| 10 | use crate::gpio::Pin; | ||
| 11 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; | 9 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; |
| 12 | use crate::pac::gpio::vals::{Afr, Moder, Ot}; | 10 | use crate::pac::gpio::vals::{Afr, Moder, Ot}; |
| 13 | use crate::pac::gpio::Gpio; | 11 | use crate::pac::gpio::Gpio; |
| 14 | use crate::pac::i2c; | 12 | use crate::pac::i2c; |
| 15 | use crate::pac::i2c::I2c as I2cTrait; | ||
| 16 | use crate::time::Hertz; | 13 | use crate::time::Hertz; |
| 17 | 14 | ||
| 18 | pub struct I2c<'d, T: Instance> { | 15 | pub struct I2c<'d, T: Instance> { |
| 19 | //peri: T, | ||
| 20 | scl: AnyPin, | ||
| 21 | sda: AnyPin, | ||
| 22 | phantom: PhantomData<&'d mut T>, | 16 | phantom: PhantomData<&'d mut T>, |
| 23 | } | 17 | } |
| 24 | 18 | ||
| 25 | impl<'d, T: Instance> I2c<'d, T> { | 19 | impl<'d, T: Instance> I2c<'d, T> { |
| 26 | pub fn new<F>( | 20 | pub fn new<F>( |
| 27 | pclk: Hertz, | 21 | pclk: Hertz, |
| 28 | peri: impl Unborrow<Target = T> + 'd, | 22 | _peri: impl Unborrow<Target = T> + 'd, |
| 29 | scl: impl Unborrow<Target = impl SclPin<T>>, | 23 | scl: impl Unborrow<Target = impl SclPin<T>>, |
| 30 | sda: impl Unborrow<Target = impl SdaPin<T>>, | 24 | sda: impl Unborrow<Target = impl SdaPin<T>>, |
| 31 | freq: F, | 25 | freq: F, |
| @@ -33,7 +27,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 33 | where | 27 | where |
| 34 | F: Into<Hertz>, | 28 | F: Into<Hertz>, |
| 35 | { | 29 | { |
| 36 | unborrow!(peri); | ||
| 37 | unborrow!(scl, sda); | 30 | unborrow!(scl, sda); |
| 38 | 31 | ||
| 39 | unsafe { | 32 | unsafe { |
| @@ -60,9 +53,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 60 | }); | 53 | }); |
| 61 | } | 54 | } |
| 62 | 55 | ||
| 63 | let scl = scl.degrade(); | ||
| 64 | let sda = sda.degrade(); | ||
| 65 | |||
| 66 | unsafe { | 56 | unsafe { |
| 67 | T::regs().cr1().modify(|reg| { | 57 | T::regs().cr1().modify(|reg| { |
| 68 | reg.set_pe(true); | 58 | reg.set_pe(true); |
| @@ -70,8 +60,6 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 70 | } | 60 | } |
| 71 | 61 | ||
| 72 | Self { | 62 | Self { |
| 73 | scl, | ||
| 74 | sda, | ||
| 75 | phantom: PhantomData, | 63 | phantom: PhantomData, |
| 76 | } | 64 | } |
| 77 | } | 65 | } |
| @@ -110,7 +98,7 @@ impl<'d, T: Instance> I2c<'d, T> { | |||
| 110 | w.set_rd_wrn(i2c::vals::RdWrn::READ); | 98 | w.set_rd_wrn(i2c::vals::RdWrn::READ); |
| 111 | w.set_nbytes(length as u8); | 99 | w.set_nbytes(length as u8); |
| 112 | w.set_start(i2c::vals::Start::START); | 100 | w.set_start(i2c::vals::Start::START); |
| 113 | w.set_autoend(i2c::vals::Autoend::AUTOMATIC); | 101 | w.set_autoend(stop.autoend()); |
| 114 | }); | 102 | }); |
| 115 | } | 103 | } |
| 116 | } | 104 | } |
diff --git a/embassy-stm32/src/spi/v2.rs b/embassy-stm32/src/spi/v2.rs index 1c10ab1b5..46fe817ea 100644 --- a/embassy-stm32/src/spi/v2.rs +++ b/embassy-stm32/src/spi/v2.rs | |||
| @@ -29,7 +29,6 @@ impl WordSize { | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | pub struct Spi<'d, T: Instance> { | 31 | pub struct Spi<'d, T: Instance> { |
| 32 | //peri: T, | ||
| 33 | sck: AnyPin, | 32 | sck: AnyPin, |
| 34 | mosi: AnyPin, | 33 | mosi: AnyPin, |
| 35 | miso: AnyPin, | 34 | miso: AnyPin, |
| @@ -39,7 +38,7 @@ pub struct Spi<'d, T: Instance> { | |||
| 39 | impl<'d, T: Instance> Spi<'d, T> { | 38 | impl<'d, T: Instance> Spi<'d, T> { |
| 40 | pub fn new<F>( | 39 | pub fn new<F>( |
| 41 | pclk: Hertz, | 40 | pclk: Hertz, |
| 42 | peri: impl Unborrow<Target = T> + 'd, | 41 | _peri: impl Unborrow<Target = T> + 'd, |
| 43 | sck: impl Unborrow<Target = impl SckPin<T>>, | 42 | sck: impl Unborrow<Target = impl SckPin<T>>, |
| 44 | mosi: impl Unborrow<Target = impl MosiPin<T>>, | 43 | mosi: impl Unborrow<Target = impl MosiPin<T>>, |
| 45 | miso: impl Unborrow<Target = impl MisoPin<T>>, | 44 | miso: impl Unborrow<Target = impl MisoPin<T>>, |
| @@ -49,7 +48,6 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 49 | where | 48 | where |
| 50 | F: Into<Hertz>, | 49 | F: Into<Hertz>, |
| 51 | { | 50 | { |
| 52 | unborrow!(peri); | ||
| 53 | unborrow!(sck, mosi, miso); | 51 | unborrow!(sck, mosi, miso); |
| 54 | 52 | ||
| 55 | unsafe { | 53 | unsafe { |
| @@ -95,7 +93,6 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 95 | } | 93 | } |
| 96 | 94 | ||
| 97 | Self { | 95 | Self { |
| 98 | //peri, | ||
| 99 | sck, | 96 | sck, |
| 100 | mosi, | 97 | mosi, |
| 101 | miso, | 98 | miso, |
diff --git a/embassy-stm32/src/spi/v3.rs b/embassy-stm32/src/spi/v3.rs index c3f66430c..da4686b9c 100644 --- a/embassy-stm32/src/spi/v3.rs +++ b/embassy-stm32/src/spi/v3.rs | |||
| @@ -20,7 +20,7 @@ impl WordSize { | |||
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | fn frxth(&self) -> spi::vals::Fthlv { | 23 | fn _frxth(&self) -> spi::vals::Fthlv { |
| 24 | match self { | 24 | match self { |
| 25 | WordSize::EightBit => spi::vals::Fthlv::ONEFRAME, | 25 | WordSize::EightBit => spi::vals::Fthlv::ONEFRAME, |
| 26 | WordSize::SixteenBit => spi::vals::Fthlv::ONEFRAME, | 26 | WordSize::SixteenBit => spi::vals::Fthlv::ONEFRAME, |
| @@ -29,7 +29,6 @@ impl WordSize { | |||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | pub struct Spi<'d, T: Instance> { | 31 | pub struct Spi<'d, T: Instance> { |
| 32 | //peri: T, | ||
| 33 | sck: AnyPin, | 32 | sck: AnyPin, |
| 34 | mosi: AnyPin, | 33 | mosi: AnyPin, |
| 35 | miso: AnyPin, | 34 | miso: AnyPin, |
| @@ -39,7 +38,7 @@ pub struct Spi<'d, T: Instance> { | |||
| 39 | impl<'d, T: Instance> Spi<'d, T> { | 38 | impl<'d, T: Instance> Spi<'d, T> { |
| 40 | pub fn new<F>( | 39 | pub fn new<F>( |
| 41 | pclk: Hertz, | 40 | pclk: Hertz, |
| 42 | peri: impl Unborrow<Target = T> + 'd, | 41 | _peri: impl Unborrow<Target = T> + 'd, |
| 43 | sck: impl Unborrow<Target = impl SckPin<T>>, | 42 | sck: impl Unborrow<Target = impl SckPin<T>>, |
| 44 | mosi: impl Unborrow<Target = impl MosiPin<T>>, | 43 | mosi: impl Unborrow<Target = impl MosiPin<T>>, |
| 45 | miso: impl Unborrow<Target = impl MisoPin<T>>, | 44 | miso: impl Unborrow<Target = impl MisoPin<T>>, |
| @@ -49,7 +48,6 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 49 | where | 48 | where |
| 50 | F: Into<Hertz>, | 49 | F: Into<Hertz>, |
| 51 | { | 50 | { |
| 52 | unborrow!(peri); | ||
| 53 | unborrow!(sck, mosi, miso); | 51 | unborrow!(sck, mosi, miso); |
| 54 | 52 | ||
| 55 | unsafe { | 53 | unsafe { |
| @@ -110,7 +108,6 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 110 | } | 108 | } |
| 111 | 109 | ||
| 112 | Self { | 110 | Self { |
| 113 | //peri, | ||
| 114 | sck, | 111 | sck, |
| 115 | mosi, | 112 | mosi, |
| 116 | miso, | 113 | miso, |
| @@ -218,7 +215,7 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u8> for Spi<'d, T> { | |||
| 218 | Self::set_word_size(WordSize::EightBit); | 215 | Self::set_word_size(WordSize::EightBit); |
| 219 | let regs = T::regs(); | 216 | let regs = T::regs(); |
| 220 | 217 | ||
| 221 | for (i, word) in words.iter_mut().enumerate() { | 218 | for word in words.iter_mut() { |
| 222 | unsafe { | 219 | unsafe { |
| 223 | regs.cr1().modify(|reg| { | 220 | regs.cr1().modify(|reg| { |
| 224 | reg.set_ssi(false); | 221 | reg.set_ssi(false); |
