Skip to content

Commit

Permalink
rp: add constructor for tx-only blocking UART
Browse files Browse the repository at this point in the history
  • Loading branch information
shilga committed Sep 16, 2024
1 parent a23f56b commit 313e76a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions embassy-rp/src/uart/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ impl<'d, T: Instance, M: Mode> UartTx<'d, T, M> {
}

impl<'d, T: Instance> UartTx<'d, T, Blocking> {
/// Create a new UART TX instance for blocking mode operations.
pub fn new_blocking(
_uart: impl Peripheral<P = T> + 'd,
tx: impl Peripheral<P = impl TxPin<T>> + 'd,
config: Config,
) -> Self {
into_ref!(tx);
Uart::<T, Blocking>::init(Some(tx.map_into()), None, None, None, config);
Self::new_inner(None)
}

/// Convert this uart TX instance into a buffered uart using the provided
/// irq and transmit buffer.
pub fn into_buffered(
Expand Down

0 comments on commit 313e76a

Please sign in to comment.