Skip to main content

AsyncRegisterInterface

Trait AsyncRegisterInterface 

Source
pub trait AsyncRegisterInterface: RegisterInterfaceBase {
    // Required methods
    async fn write_register(
        &mut self,
        address: Self::AddressType,
        data: &mut [u8],
        _metadata: &FieldsetMetadata,
    ) -> Result<(), Self::Error>;
    async fn read_register(
        &mut self,
        address: Self::AddressType,
        data: &mut [u8],
        _metadata: &FieldsetMetadata,
    ) -> Result<(), Self::Error>;
}
Expand description

A trait to represent the interface to the device.

This is called to asynchronously write to and read from registers.

Required Methods§

Source

async fn write_register( &mut self, address: Self::AddressType, data: &mut [u8], _metadata: &FieldsetMetadata, ) -> Result<(), Self::Error>

Write the given data to the register located at the given address

Source

async fn read_register( &mut self, address: Self::AddressType, data: &mut [u8], _metadata: &FieldsetMetadata, ) -> Result<(), Self::Error>

Read the register located at the given address to the given data slice

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: AsyncRegisterInterface> AsyncRegisterInterface for &mut T

Source§

fn write_register( &mut self, address: Self::AddressType, data: &mut [u8], metadata: &FieldsetMetadata, ) -> impl Future<Output = Result<(), Self::Error>>

Source§

fn read_register( &mut self, address: Self::AddressType, data: &mut [u8], metadata: &FieldsetMetadata, ) -> impl Future<Output = Result<(), Self::Error>>

Implementors§