Struct esp32c2_hal::Serial
source · pub struct Serial<T> { /* private fields */ }
Expand description
UART driver
Implementations
sourceimpl<T> Serial<T>where
T: Instance,
impl<T> Serial<T>where
T: Instance,
sourcepub fn new_with_config<P>(
uart: T,
config: Option<Config>,
pins: Option<P>,
clocks: &Clocks
) -> Serial<T>where
P: UartPins,
pub fn new_with_config<P>(
uart: T,
config: Option<Config>,
pins: Option<P>,
clocks: &Clocks
) -> Serial<T>where
P: UartPins,
Create a new UART instance with defaults
sourcepub fn set_at_cmd(&mut self, config: AtCmdConfig)
pub fn set_at_cmd(&mut self, config: AtCmdConfig)
Configures the AT-CMD detection settings.
sourcepub fn set_rx_fifo_full_threshold(&mut self, threshold: u16)
pub fn set_rx_fifo_full_threshold(&mut self, threshold: u16)
Configures the RX-FIFO threshold
sourcepub fn listen_at_cmd(&mut self)
pub fn listen_at_cmd(&mut self)
Listen for AT-CMD interrupts
sourcepub fn unlisten_at_cmd(&mut self)
pub fn unlisten_at_cmd(&mut self)
Stop listening for AT-CMD interrupts
sourcepub fn listen_tx_done(&mut self)
pub fn listen_tx_done(&mut self)
Listen for TX-DONE interrupts
sourcepub fn unlisten_tx_done(&mut self)
pub fn unlisten_tx_done(&mut self)
Stop listening for TX-DONE interrupts
sourcepub fn listen_rx_fifo_full(&mut self)
pub fn listen_rx_fifo_full(&mut self)
Listen for RX-FIFO-FULL interrupts
sourcepub fn unlisten_rx_fifo_full(&mut self)
pub fn unlisten_rx_fifo_full(&mut self)
Stop listening for RX-FIFO-FULL interrupts
sourcepub fn at_cmd_interrupt_set(&self) -> bool
pub fn at_cmd_interrupt_set(&self) -> bool
Checks if AT-CMD interrupt is set
sourcepub fn tx_done_interrupt_set(&self) -> bool
pub fn tx_done_interrupt_set(&self) -> bool
Checks if TX-DONE interrupt is set
sourcepub fn rx_fifo_full_interrupt_set(&self) -> bool
pub fn rx_fifo_full_interrupt_set(&self) -> bool
Checks if RX-FIFO-FULL interrupt is set
sourcepub fn reset_at_cmd_interrupt(&self)
pub fn reset_at_cmd_interrupt(&self)
Reset AT-CMD interrupt
sourcepub fn reset_tx_done_interrupt(&self)
pub fn reset_tx_done_interrupt(&self)
Reset TX-DONE interrupt
sourcepub fn reset_rx_fifo_full_interrupt(&self)
pub fn reset_rx_fifo_full_interrupt(&self)
Reset RX-FIFO-FULL interrupt
sourcepub fn change_stop_bits(&mut self, stop_bits: StopBits) -> &mut Serial<T>
pub fn change_stop_bits(&mut self, stop_bits: StopBits) -> &mut Serial<T>
Change the number of stop bits
Trait Implementations
sourceimpl<T> Write<u8> for Serial<T>where
T: Instance,
impl<T> Write<u8> for Serial<T>where
T: Instance,
Auto Trait Implementations
impl<T> RefUnwindSafe for Serial<T>where
T: RefUnwindSafe,
impl<T> Send for Serial<T>where
T: Send,
impl<T> Sync for Serial<T>where
T: Sync,
impl<T> Unpin for Serial<T>where
T: Unpin,
impl<T> UnwindSafe for Serial<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more