esp_idf_svc::hal::uart

Type Alias UartConfig

Source
pub type UartConfig = Config;

Aliased Type§

struct UartConfig {
Show 13 fields pub mode: Mode, 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,
}

Fields§

§mode: Mode§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

Source

pub const fn new() -> Config

Source

pub fn mode(self, mode: Mode) -> Config

Source

pub fn baudrate(self, baudrate: Hertz) -> Config

Source

pub fn parity_none(self) -> Config

Source

pub fn parity_even(self) -> Config

Source

pub fn parity_odd(self) -> Config

Source

pub fn data_bits(self, data_bits: DataBits) -> Config

Source

pub fn stop_bits(self, stop_bits: StopBits) -> Config

Source

pub fn flow_control(self, flow_control: FlowControl) -> Config

Source

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.

Source

pub fn source_clock(self, source_clock: SourceClock) -> Config

Source

pub fn tx_fifo_size(self, tx_fifo_size: usize) -> Config

Source

pub fn rx_fifo_size(self, rx_fifo_size: usize) -> Config

Source

pub fn queue_size(self, queue_size: usize) -> Config

Trait Implementations

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more