Skip to main content

BusDriver

Trait BusDriver 

Source
pub trait BusDriver: Send + Sync {
Show 13 methods // Required methods fn name(&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 compatible(&self) -> &[&str] { ... } fn as_firewall(&self) -> Option<&dyn FirewallController> { ... } 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§

Source

fn name(&self) -> &str

Performs the name operation.

Source

fn init(&mut self, base: usize) -> Result<(), BusError>

Performs the init operation.

Source

fn shutdown(&mut self) -> Result<(), BusError>

Performs the shutdown operation.

Source

fn read_reg(&self, offset: usize) -> Result<u32, BusError>

Reads reg.

Source

fn write_reg(&mut self, offset: usize, value: u32) -> Result<(), BusError>

Writes reg.

Provided Methods§

Source

fn compatible(&self) -> &[&str]

Performs the compatible operation.

Source

fn as_firewall(&self) -> Option<&dyn FirewallController>

Returns the optional [FirewallController] capability, if any.

Drivers managing hardware isolation (STM32 ETZPC/RIFSC) override this to return Some(self), which makes the scheme server publish the /bus/<driver>/firewall/... paths. The default returns None: no firewall capability.

Source

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.

Source

fn suspend(&mut self) -> Result<(), BusError>

Performs the suspend operation.

Source

fn resume(&mut self) -> Result<(), BusError>

Performs the resume operation.

Source

fn error_count(&self) -> u64

Performs the error count operation.

Source

fn children(&self) -> Vec<BusChild>

Performs the children operation.

Source

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".

Implementors§