Register

Trait Register 

Source
pub trait Register:
    Clone
    + Send
    + Sync
    + Any
    + 'static {
Show 23 methods // Required methods fn write_byte(&mut self, byte: u8); fn read_byte(&self) -> Result<u8, RegisterTransferError>; 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) -> u32; fn open(&mut self); fn close(&mut self); fn enable_loopback(&mut self); fn disable_loopback(&mut self); fn is_loopback_enabled(&self) -> bool; fn set_irq_mask(&mut self, mask: InterruptMask); fn get_irq_mask(&self) -> InterruptMask; fn clean_interrupt_status(&mut self) -> InterruptMask; fn line_status(&self) -> LineStatus; fn read_reg(&self, offset: usize) -> u32; fn write_reg(&mut self, offset: usize, value: u32); fn get_base(&self) -> usize; fn set_base(&mut self, base: NonNull<u8>); // Provided methods fn read_buf( &mut self, buf: &mut [u8], ) -> Result<usize, RegisterTransferError> { ... } fn write_buf(&mut self, buf: &[u8]) -> usize { ... }
}

Required Methods§

Source

fn write_byte(&mut self, byte: u8)

Source

fn read_byte(&self) -> Result<u8, RegisterTransferError>

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) -> u32

Source

fn open(&mut self)

Source

fn close(&mut self)

Source

fn enable_loopback(&mut self)

启用回环模式

Source

fn disable_loopback(&mut self)

禁用回环模式

Source

fn is_loopback_enabled(&self) -> bool

检查回环模式是否启用

Source

fn set_irq_mask(&mut self, mask: InterruptMask)

设置中断使能掩码

Source

fn get_irq_mask(&self) -> InterruptMask

获取当前中断使能掩码

Source

fn clean_interrupt_status(&mut self) -> InterruptMask

获取并清除所有中断状态

Source

fn line_status(&self) -> LineStatus

获取线路状态

Source

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

直接读取寄存器

Source

fn write_reg(&mut self, offset: usize, value: u32)

直接写入寄存器

Source

fn get_base(&self) -> usize

Source

fn set_base(&mut self, base: NonNull<u8>)

Provided Methods§

Source

fn read_buf(&mut self, buf: &mut [u8]) -> Result<usize, RegisterTransferError>

Source

fn write_buf(&mut self, buf: &[u8]) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§