aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-09-16 20:51:12 +0000
committerGitHub <[email protected]>2024-09-16 20:51:12 +0000
commit74ad31466b13c47734412ce830eab65d6de5d364 (patch)
tree2d682f83c9c5237daecd50273110de5e0d40d8dd
parent6d89f2729ab7a6ee3dd78ccaef1b16677b5a9eee (diff)
parent313e76af043c8b2bb2b31f8cc0eba7578ea41357 (diff)
Merge pull request #3341 from shilga/tx-only-uart
rp: add constructor for tx-only blocking UART
-rw-r--r--embassy-rp/src/uart/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs
index aba4b792a..c94e5e185 100644
--- a/embassy-rp/src/uart/mod.rs
+++ b/embassy-rp/src/uart/mod.rs
@@ -224,6 +224,17 @@ impl<'d, T: Instance, M: Mode> UartTx<'d, T, M> {
224} 224}
225 225
226impl<'d, T: Instance> UartTx<'d, T, Blocking> { 226impl<'d, T: Instance> UartTx<'d, T, Blocking> {
227 /// Create a new UART TX instance for blocking mode operations.
228 pub fn new_blocking(
229 _uart: impl Peripheral<P = T> + 'd,
230 tx: impl Peripheral<P = impl TxPin<T>> + 'd,
231 config: Config,
232 ) -> Self {
233 into_ref!(tx);
234 Uart::<T, Blocking>::init(Some(tx.map_into()), None, None, None, config);
235 Self::new_inner(None)
236 }
237
227 /// Convert this uart TX instance into a buffered uart using the provided 238 /// Convert this uart TX instance into a buffered uart using the provided
228 /// irq and transmit buffer. 239 /// irq and transmit buffer.
229 pub fn into_buffered( 240 pub fn into_buffered(