Interface

Trait Interface 

Source
pub trait Interface: DriverGeneric {
Show 16 methods // Required methods fn irq_handler(&mut self) -> Option<Box<dyn TIrqHandler>>; fn take_tx(&mut self) -> Option<Box<dyn TSender>>; fn take_rx(&mut self) -> Option<Box<dyn TReciever>>; fn base_addr(&self) -> usize; fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>; fn baudrate(&self) -> u32; fn data_bits(&self) -> DataBits; fn stop_bits(&self) -> StopBits; fn parity(&self) -> Parity; fn clock_freq(&self) -> Option<NonZero<u32>>; fn enable_loopback(&mut self); fn disable_loopback(&mut self); fn is_loopback_enabled(&self) -> bool; fn enable_interrupts(&mut self, mask: InterruptMask); fn disable_interrupts(&mut self, mask: InterruptMask); fn get_enabled_interrupts(&self) -> InterruptMask;
}

Required Methods§

Source

fn irq_handler(&mut self) -> Option<Box<dyn TIrqHandler>>

Source

fn take_tx(&mut self) -> Option<Box<dyn TSender>>

Source

fn take_rx(&mut self) -> Option<Box<dyn TReciever>>

Source

fn base_addr(&self) -> usize

Base address of the serial port

Source

fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>

Source

fn baudrate(&self) -> u32

Source

fn data_bits(&self) -> DataBits

Source

fn stop_bits(&self) -> StopBits

Source

fn parity(&self) -> Parity

Source

fn clock_freq(&self) -> Option<NonZero<u32>>

Source

fn enable_loopback(&mut self)

Source

fn disable_loopback(&mut self)

Source

fn is_loopback_enabled(&self) -> bool

Source

fn enable_interrupts(&mut self, mask: InterruptMask)

Source

fn disable_interrupts(&mut self, mask: InterruptMask)

Source

fn get_enabled_interrupts(&self) -> InterruptMask

Trait Implementations§

Source§

impl DriverGeneric for Box<dyn Interface>

Source§

fn open(&mut self) -> Result<(), KError>

Source§

fn close(&mut self) -> Result<(), KError>

Source§

fn raw_any(&self) -> Option<&(dyn Any + 'static)>

Subtype casting support, returns subtype as &dyn Any
Source§

fn raw_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>

Subtype casting support, returns subtype as &mut dyn Any

Implementors§

Source§

impl<T> Interface for SerialDyn<T>
where T: InterfaceRaw,