Trait esp32c2_hal::spi::Instance

source ·
pub trait Instance {
Show 20 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,
        peripheral_clock_control: &mut PeripheralClockControl
    ); fn spi_num(&self) -> u8; fn init(&mut self) { ... } 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 flush(&mut self) -> Result<(), Error> { ... } fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Error> { ... } fn update(&self) { ... } fn configure_datalen(&self, len: u32) { ... }
}

Required Methods

Provided Methods

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 [flush].

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 [transfer] instead.

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 [transfer] instead.

Implementors