Trait driver_common::BaseDriverOps
source · pub trait BaseDriverOps: Send + Sync {
// Required methods
fn device_name(&self) -> &str;
fn device_type(&self) -> DeviceType;
// Provided methods
fn get_irq_num(&self) -> Option<usize> { ... }
fn ack_interrupt(&mut self) -> bool { ... }
}
Expand description
Common operations that require all device drivers to implement.
Required Methods§
sourcefn device_name(&self) -> &str
fn device_name(&self) -> &str
The name of the device.
sourcefn device_type(&self) -> DeviceType
fn device_type(&self) -> DeviceType
The type of the device.
Provided Methods§
sourcefn get_irq_num(&self) -> Option<usize>
fn get_irq_num(&self) -> Option<usize>
Get the interrupt number. Only interrupt drivers need to implement this function.
sourcefn ack_interrupt(&mut self) -> bool
fn ack_interrupt(&mut self) -> bool
Ack the interrupt. Only interrupt drivers need to implement this function.