Skip to main content

AsyncAccess

Trait AsyncAccess 

Source
pub trait AsyncAccess {
    type BusError;

    // Required methods
    async fn read_word(&mut self, reg: u8) -> Result<u16, Self::BusError>;
    async fn write_word(
        &mut self,
        reg: u8,
        word: u16,
    ) -> Result<(), Self::BusError>;
    async fn read_words(
        &mut self,
        reg: u8,
        words: &mut [u16],
    ) -> Result<(), Self::BusError>;
}
Expand description

Low-level async register access contract used by the async driver.

This trait is public so the driver can remain transport-agnostic, but most users will rely on the built-in I2C and SPI implementations.

Required Associated Types§

Source

type BusError

Underlying bus error type returned by the transport.

Required Methods§

Source

async fn read_word(&mut self, reg: u8) -> Result<u16, Self::BusError>

Read a single 16-bit register payload from the BMI323.

Source

async fn write_word(&mut self, reg: u8, word: u16) -> Result<(), Self::BusError>

Write a single 16-bit register payload to the BMI323.

Source

async fn read_words( &mut self, reg: u8, words: &mut [u16], ) -> Result<(), Self::BusError>

Read multiple consecutive 16-bit register payloads starting at reg.

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§