Trait esp_ward::SpiInstance

pub trait SpiInstance {
Show 26 methods // Required methods fn register_block(&self) -> &RegisterBlock; fn sclk_signal(&self) -> OutputSignal; fn mosi_signal(&self) -> OutputSignal; fn miso_signal(&self) -> InputSignal; fn cs_signal(&self) -> OutputSignal; fn enable_peripheral(&self); fn spi_num(&self) -> u8; // Provided methods fn init(&mut self) { ... } fn init_spi_data_mode( &mut self, cmd_mode: SpiDataMode, address_mode: SpiDataMode, data_mode: SpiDataMode ) { ... } fn setup(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>) { ... } fn set_data_mode(&mut self, data_mode: SpiMode) -> &mut Self { ... } fn ch_bus_freq(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>) { ... } fn read_byte(&mut self) -> Result<u8, Error<Error>> { ... } fn write_byte(&mut self, word: u8) -> Result<(), Error<Error>> { ... } fn write_bytes(&mut self, words: &[u8]) -> Result<(), Error> { ... } fn read_bytes(&mut self, words: &mut [u8]) -> Result<(), Error> { ... } fn read_bytes_from_fifo(&mut self, words: &mut [u8]) -> Result<(), Error> { ... } fn busy(&self) -> bool { ... } fn flush(&mut self) -> Result<(), Error> { ... } fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Error> { ... } fn start_operation(&self) { ... } fn init_half_duplex( &mut self, is_write: bool, command_state: bool, address_state: bool, dummy_idle: bool, dummy_state: bool, no_mosi_miso: bool ) { ... } fn write_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &[u8] ) -> Result<(), Error> { ... } fn read_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &mut [u8] ) -> Result<(), Error> { ... } fn update(&self) { ... } fn configure_datalen(&self, len: u32) { ... }
}

Required Methods§

fn register_block(&self) -> &RegisterBlock

fn sclk_signal(&self) -> OutputSignal

fn mosi_signal(&self) -> OutputSignal

fn miso_signal(&self) -> InputSignal

fn cs_signal(&self) -> OutputSignal

fn enable_peripheral(&self)

fn spi_num(&self) -> u8

Provided Methods§

fn init(&mut self)

Initialize for full-duplex 1 bit mode

fn init_spi_data_mode( &mut self, cmd_mode: SpiDataMode, address_mode: SpiDataMode, data_mode: SpiDataMode )

fn setup(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>)

fn set_data_mode(&mut self, data_mode: SpiMode) -> &mut Self

fn ch_bus_freq(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>)

fn read_byte(&mut self) -> Result<u8, Error<Error>>

fn write_byte(&mut self, word: u8) -> Result<(), Error<Error>>

fn write_bytes(&mut self, words: &[u8]) -> Result<(), Error>

Write bytes to SPI.

Copies the content of words in chunks of 64 bytes into the SPI transmission FIFO. If words is longer than 64 bytes, multiple sequential transfers are performed. This function will return before all bytes of the last chunk to transmit have been sent to the wire. If you must ensure that the whole messages was written correctly, use Self::flush.

fn read_bytes(&mut self, words: &mut [u8]) -> Result<(), Error>

Read bytes from SPI.

Sends out a stuffing byte for every byte to read. This function doesn’t perform flushing. If you want to read the response to something you have written before, consider using Self::transfer instead.

fn read_bytes_from_fifo(&mut self, words: &mut [u8]) -> Result<(), Error>

Read received bytes from SPI FIFO.

Copies the contents of the SPI receive FIFO into words. This function doesn’t perform flushing. If you want to read the response to something you have written before, consider using Self::transfer instead.

fn busy(&self) -> bool

fn flush(&mut self) -> Result<(), Error>

fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Error>

fn start_operation(&self)

fn init_half_duplex( &mut self, is_write: bool, command_state: bool, address_state: bool, dummy_idle: bool, dummy_state: bool, no_mosi_miso: bool )

fn write_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &[u8] ) -> Result<(), Error>

fn read_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &mut [u8] ) -> Result<(), Error>

fn update(&self)

fn configure_datalen(&self, len: u32)

Object Safety§

This trait is not object safe.

Implementors§

§

impl Instance for SPI2