Struct esp32_hal::spi::SPI [−][src]
pub struct SPI<INSTANCE: Instance, SCLK: OutputPin, SDO: OutputPin, SDI: InputPin + OutputPin = Gpio1<Input<Floating>>, CS: OutputPin = Gpio2<Output<PushPull>>> { /* fields omitted */ }
Expand description
SPI abstraction
Implementations
Create new instance of SPI controller for SPI1
SPI1 can only use fixed pin for SCLK, SDO and SDI as they are shared with SPI0.
Change the SPI baudrate
Change the bit order
Change the data mode
Trait Implementations
impl<T: U8orU16orU32, INSTANCE: Instance, SCLK: OutputPin, SDO: OutputPin, SDI: InputPin + OutputPin, CS: OutputPin> FullDuplex<T> for SPI<INSTANCE, SCLK, SDO, SDI, CS>
impl<T: U8orU16orU32, INSTANCE: Instance, SCLK: OutputPin, SDO: OutputPin, SDI: InputPin + OutputPin, CS: OutputPin> FullDuplex<T> for SPI<INSTANCE, SCLK, SDO, SDI, CS>
Full-duplex implementation for writing/reading via SPI
Note: these functions do not lock the frequency of the APB bus, so transactions may be at lower frequency if APB bus is not locked in caller.
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u16>,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u16>,
Sends words
to the slave, ignoring all the incoming words
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u32>,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u32>,
Sends words
to the slave, ignoring all the incoming words
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
fn write_iter<WI>(&mut self, words: WI) -> Result<(), Self::Error> where
WI: IntoIterator<Item = u8>,
Sends words
to the slave, ignoring all the incoming words