diff options
| author | Sebastian Quilitz <[email protected]> | 2024-09-16 12:26:00 +0200 |
|---|---|---|
| committer | Sebastian Quilitz <[email protected]> | 2024-09-16 12:27:17 +0200 |
| commit | 313e76af043c8b2bb2b31f8cc0eba7578ea41357 (patch) | |
| tree | 14e3bff6a94082661de4277e5e030317370b360b | |
| parent | a23f56b3ddc84a7e87e4b8750df26b91a2cb9637 (diff) | |
rp: add constructor for tx-only blocking UART
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 11 |
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 | ||
| 226 | impl<'d, T: Instance> UartTx<'d, T, Blocking> { | 226 | impl<'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( |
