pub struct Config {
pub baudrate: Hertz,
pub data_bits: DataBits,
pub parity: Parity,
pub stop_bits: StopBits,
pub flow_control: FlowControl,
pub flow_control_rts_threshold: u8,
pub source_clock: SourceClock,
pub intr_flags: EnumSet<InterruptType>,
pub event_config: EventConfig,
pub rx_fifo_size: usize,
pub tx_fifo_size: usize,
pub queue_size: usize,
/* private fields */
}
Expand description
UART configuration
Fields§
§baudrate: Hertz
§data_bits: DataBits
§parity: Parity
§stop_bits: StopBits
§flow_control: FlowControl
§flow_control_rts_threshold: u8
§source_clock: SourceClock
§intr_flags: EnumSet<InterruptType>
Configures the flags to use for interrupt allocation, e.g. priority to use for the interrupt.
Note that you should not set Iram
here, because it will
be automatically set depending on the value of CONFIG_UART_ISR_IN_IRAM
.
event_config: EventConfig
Configures the interrupts the driver should enable.
rx_fifo_size: usize
The size of the software rx buffer. Must be bigger than the hardware FIFO.
tx_fifo_size: usize
The size of the software tx buffer. Must be bigger than the hardware FIFO or 0 to disable transmit buffering (note that this will make write operations block until data has been sent out).
queue_size: usize
Number of events that should fit into the event queue. Specify 0 to prevent the creation of an event queue.
Implementations§
source§impl Config
impl Config
pub const fn new() -> Config
pub fn baudrate(self, baudrate: Hertz) -> Config
pub fn parity_none(self) -> Config
pub fn parity_even(self) -> Config
pub fn parity_odd(self) -> Config
pub fn data_bits(self, data_bits: DataBits) -> Config
pub fn stop_bits(self, stop_bits: StopBits) -> Config
pub fn flow_control(self, flow_control: FlowControl) -> Config
sourcepub fn flow_control_rts_threshold(
self,
flow_control_rts_threshold: u8,
) -> Config
pub fn flow_control_rts_threshold( self, flow_control_rts_threshold: u8, ) -> Config
This setting only has effect if flow control is enabled.
It determines how many bytes must be received before RTS
line is asserted.
Notice that count starts from 0
which means that RTS
is asserted after every received byte.
pub fn source_clock(self, source_clock: SourceClock) -> Config
pub fn tx_fifo_size(self, tx_fifo_size: usize) -> Config
pub fn rx_fifo_size(self, rx_fifo_size: usize) -> Config
pub fn queue_size(self, queue_size: usize) -> Config
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)