pub trait BusDriver: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn compatible(&self) -> &[&str];
fn init(&mut self, base: usize) -> Result<(), BusError>;
fn shutdown(&mut self) -> Result<(), BusError>;
fn read_reg(&self, offset: usize) -> Result<u32, BusError>;
fn write_reg(&mut self, offset: usize, value: u32) -> Result<(), BusError>;
// Provided methods
fn probe(&self) -> bool { ... }
fn suspend(&mut self) -> Result<(), BusError> { ... }
fn resume(&mut self) -> Result<(), BusError> { ... }
fn error_count(&self) -> u64 { ... }
fn children(&self) -> Vec<BusChild> { ... }
fn handle_irq(&mut self) -> bool { ... }
}Required Methods§
Sourcefn compatible(&self) -> &[&str]
fn compatible(&self) -> &[&str]
Performs the compatible operation.
Provided Methods§
Sourcefn probe(&self) -> bool
fn probe(&self) -> bool
Returns true if the driver believes the hardware is present.
The default returns true (assume present : let init() decide).
Override to false for software-backed buses (GPIO, SPI, …) that
cannot auto-detect their hardware without platform configuration.
Sourcefn error_count(&self) -> u64
fn error_count(&self) -> u64
Performs the error count operation.
Sourcefn handle_irq(&mut self) -> bool
fn handle_irq(&mut self) -> bool
Handles irq.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".