Struct esp32_hal::serial::Serial[][src]

pub struct Serial<UART: Instance, TX: OutputPin, RX: InputPin, CTS: InputPin = Gpio19<Input<Floating>>, RTS: OutputPin = Gpio22<Output<PushPull>>> { /* fields omitted */ }
Expand description

Serial abstraction

Implementations

Create a new serial driver

Change the number of stop bits

Change the number of data bits

Change the type of parity checking

Change the baudrate.

Will automatically select the clock source. When possible the reference clock (1MHz) will be used, because this is constant when the clock source/frequency changes. However if one of the clock frequencies is below 10MHz or if the baudrate is above the reference clock or if the baudrate cannot be set within 1.5% then use the APB clock.

Change the baudrate choosing the reference or APB clock manually

Returns if the reference or APB clock is used

Returns the current baudrate

Starts listening for an interrupt event

Stop listening for an interrupt event

Return true if the receiver is idle

Return true if the transmitter is idle

Split the serial driver in separate TX and RX drivers

Release the UART and GPIO resources

Trait Implementations

Read error

Reads a single word from the serial interface

Writes a string slice into this writer, returning whether the write succeeded. Read more

Writes a char into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Write error

Ensures that none of the previously written words are still buffered

Writes a single word to the serial interface

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.