Skip to main content

PioManager

Trait PioManager 

Source
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§

Source

type D: DevicePio

Type of the objects that can be registered with this PioManager.

Required Methods§

Source

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.

Source

fn pio_read(&self, addr: PioAddress, data: &mut [u8]) -> Result<(), Error>

Dispatch a read operation to the device registered at addr.

Source

fn pio_write(&self, addr: PioAddress, data: &[u8]) -> Result<(), Error>

Dispatch a write operation to the device registered at addr.

Source

fn register_pio( &mut self, range: PioRange, device: Self::D, ) -> Result<(), Error>

Register the provided device with the specified range.

Source

fn deregister_pio(&mut self, addr: PioAddress) -> Option<(PioRange, Self::D)>

Deregister the device currently registered at addr together with the associated range.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> PioManager for T