embassy-net-esp-hosted

Crates

git

Versions

default

Flavors

HdSpi

Trait HdSpi 

Source
pub trait HdSpi {
    // Required methods
    async fn read(&mut self, command: HdCommand, addr: u32, buf: &mut [u8]);
    async fn write(&mut self, command: HdCommand, addr: u32, buf: &[u8]);
}
Expand description

Trait for a half-duplex SPI interface.

The device must be configured to use the same number of data lines as the hosted firmware.

Required Methods§

Source

async fn read(&mut self, command: HdCommand, addr: u32, buf: &mut [u8])

Read data from the SPI device using the given command and address.

esp-hosted requires 8 dummy bits to be inserted between the address and the data.

Source

async fn write(&mut self, command: HdCommand, addr: u32, buf: &[u8])

Write data to the SPI device using the given command and address.

esp-hosted requires 8 dummy bits to be inserted between the address and the data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§