[−][src]Struct esp32_hal::serial::Serial
Serial abstraction
Implementations
impl<UART: Instance, TX: OutputPin, RX: InputPin, CTS: InputPin, RTS: OutputPin> Serial<UART, TX, RX, CTS, RTS>
[src]
pub fn new(
uart: UART,
pins: Pins<TX, RX, CTS, RTS>,
config: Config,
clock_control: ClockControlConfig
) -> Result<Self, Error>
[src]
uart: UART,
pins: Pins<TX, RX, CTS, RTS>,
config: Config,
clock_control: ClockControlConfig
) -> Result<Self, Error>
Create a new serial driver
pub fn change_stop_bits(&mut self, stop_bits: StopBits) -> &mut Self
[src]
Change the number of stop bits
pub fn change_data_bits(&mut self, data_bits: DataBits) -> &mut Self
[src]
Change the number of data bits
pub fn change_parity(&mut self, parity: Parity) -> &mut Self
[src]
Change the type of parity checking
pub fn change_baudrate<T: Into<Hertz> + Copy>(
&mut self,
baudrate: T
) -> Result<&mut Self, Error>
[src]
&mut self,
baudrate: T
) -> Result<&mut Self, Error>
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.
pub fn change_baudrate_force_clock<T: Into<Hertz> + Copy>(
&mut self,
baudrate: T,
use_apb_frequency: bool
) -> Result<&mut Self, Error>
[src]
&mut self,
baudrate: T,
use_apb_frequency: bool
) -> Result<&mut Self, Error>
Change the baudrate choosing the reference or APB clock manually
pub fn is_clock_apb(&self) -> bool
[src]
Returns if the reference or APB clock is used
pub fn baudrate(&self) -> Hertz
[src]
Returns the current baudrate
pub fn listen(&mut self, _event: Event)
[src]
Starts listening for an interrupt event
pub fn unlisten(&mut self, _event: Event)
[src]
Stop listening for an interrupt event
pub fn is_rx_idle(&self) -> bool
[src]
Return true if the receiver is idle
pub fn is_tx_idle(&self) -> bool
[src]
Return true if the transmitter is idle
pub fn split(self) -> (Tx<UART>, Rx<UART>)
[src]
Split the serial driver in separate TX and RX drivers
pub fn release(self) -> (UART, Pins<TX, RX, CTS, RTS>)
[src]
Release the UART and GPIO resources
pub fn reset_rx_fifo(&mut self)
[src]
pub fn reset_tx_fifo(&self)
[src]
Trait Implementations
impl<UART: Instance, TX: OutputPin, RX: InputPin, CTS: InputPin, RTS: OutputPin> Read<u8> for Serial<UART, TX, RX, CTS, RTS>
[src]
impl<UART: Instance, TX: OutputPin, RX: InputPin, CTS: InputPin, RTS: OutputPin> Write<u8> for Serial<UART, TX, RX, CTS, RTS>
[src]
type Error = Infallible
Write error
fn flush(&mut self) -> Result<(), Self::Error>
[src]
fn write(&mut self, byte: u8) -> Result<(), Self::Error>
[src]
impl<UART: Instance, TX: OutputPin, RX: InputPin, CTS: InputPin, RTS: OutputPin> Write for Serial<UART, TX, RX, CTS, RTS>
[src]
Auto Trait Implementations
impl<UART, TX, RX, CTS, RTS> Send for Serial<UART, TX, RX, CTS, RTS> where
CTS: Send,
RTS: Send,
RX: Send,
TX: Send,
UART: Send,
CTS: Send,
RTS: Send,
RX: Send,
TX: Send,
UART: Send,
impl<UART, TX, RX, CTS, RTS> Sync for Serial<UART, TX, RX, CTS, RTS> where
CTS: Sync,
RTS: Sync,
RX: Sync,
TX: Sync,
UART: Sync,
CTS: Sync,
RTS: Sync,
RX: Sync,
TX: Sync,
UART: Sync,
impl<UART, TX, RX, CTS, RTS> Unpin for Serial<UART, TX, RX, CTS, RTS> where
CTS: Unpin,
RTS: Unpin,
RX: Unpin,
TX: Unpin,
UART: Unpin,
CTS: Unpin,
RTS: Unpin,
RX: Unpin,
TX: Unpin,
UART: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,