Struct esp_idf_hal::uart::config::Config

source ·
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

source

pub const fn new() -> Config

source

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

source

pub fn parity_none(self) -> Self

source

pub fn parity_even(self) -> Self

source

pub fn parity_odd(self) -> Self

source

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

source

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

source

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

source

pub fn flow_control_rts_threshold(self, flow_control_rts_threshold: u8) -> Self

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

source

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

source

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

source

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

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

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

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.