Trait device_driver::ll::register::RegisterInterface [−][src]
pub trait RegisterInterface {
type Address;
type InterfaceError: Debug;
fn read_register(
&mut self,
address: Self::Address,
value: &mut [u8]
) -> Result<(), Self::InterfaceError>;
fn write_register(
&mut self,
address: Self::Address,
value: &[u8]
) -> Result<(), Self::InterfaceError>;
}Trait for reading and writing registers
Associated Types
type Address[src]
The type representation of the address
type InterfaceError: Debug[src]
The type representation of the errors the interface can give
Required methods
fn read_register(
&mut self,
address: Self::Address,
value: &mut [u8]
) -> Result<(), Self::InterfaceError>[src]
&mut self,
address: Self::Address,
value: &mut [u8]
) -> Result<(), Self::InterfaceError>
Reads the register at the given address and puts the data in the value parameter
fn write_register(
&mut self,
address: Self::Address,
value: &[u8]
) -> Result<(), Self::InterfaceError>[src]
&mut self,
address: Self::Address,
value: &[u8]
) -> Result<(), Self::InterfaceError>
Writes the value to the register at the given address