RegisterInterface

Trait RegisterInterface 

Source
pub trait RegisterInterface<R, A>
where R: Register<Address = A>,
{ type Error; // Required methods async fn read_register(&mut self) -> Result<R, Self::Error>; async fn write_register(&mut self, register: &R) -> Result<(), Self::Error>; }
Expand description

Traits that define how to read and write the registers. Note that those functions should mostly just be implemented and not used since they are not bound by Read/Write/Edit permission.

Required Associated Types§

Source

type Error

The error type returned by the interface

Required Methods§

Source

async fn read_register(&mut self) -> Result<R, Self::Error>

Reads a register and returns it

Source

async fn write_register(&mut self, register: &R) -> Result<(), Self::Error>

Writes a register to the device

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§