pub trait PioManager {
type D: DevicePio;
// Required methods
fn pio_device(&self, addr: PioAddress) -> Option<(&PioRange, &Self::D)>;
fn pio_read(&self, addr: PioAddress, data: &mut [u8]) -> Result<(), Error>;
fn pio_write(&self, addr: PioAddress, data: &[u8]) -> Result<(), Error>;
fn register_pio(
&mut self,
range: PioRange,
device: Self::D,
) -> Result<(), Error>;
fn deregister_pio(
&mut self,
addr: PioAddress,
) -> Option<(PioRange, Self::D)>;
}
Expand description
Represents an object that provides PIO manager operations.
Required Associated Types§
Required Methods§
Sourcefn pio_device(&self, addr: PioAddress) -> Option<(&PioRange, &Self::D)>
fn pio_device(&self, addr: PioAddress) -> Option<(&PioRange, &Self::D)>
Return a reference to the device registered at addr
, together with the associated
range, if available.
Sourcefn pio_read(&self, addr: PioAddress, data: &mut [u8]) -> Result<(), Error>
fn pio_read(&self, addr: PioAddress, data: &mut [u8]) -> Result<(), Error>
Dispatch a read operation to the device registered at addr
.
Sourcefn pio_write(&self, addr: PioAddress, data: &[u8]) -> Result<(), Error>
fn pio_write(&self, addr: PioAddress, data: &[u8]) -> Result<(), Error>
Dispatch a write operation to the device registered at addr
.
Sourcefn register_pio(
&mut self,
range: PioRange,
device: Self::D,
) -> Result<(), Error>
fn register_pio( &mut self, range: PioRange, device: Self::D, ) -> Result<(), Error>
Register the provided device with the specified range.
Sourcefn deregister_pio(&mut self, addr: PioAddress) -> Option<(PioRange, Self::D)>
fn deregister_pio(&mut self, addr: PioAddress) -> Option<(PioRange, Self::D)>
Deregister the device currently registered at addr
together with the
associated range.