aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gomez <[email protected]>2025-03-19 20:44:16 -0700
committerMichael Gomez <[email protected]>2025-04-04 21:54:36 -0700
commitf1feedf19031d0c007628569add51ff89ae08447 (patch)
treeb9ecb4c4e809115a9e8cd8a7bc4cae293dbfc713
parenta44abaf7e4562fa5393087fd845bf0d02141325b (diff)
BufferedUart initialization
This change modifies UART initialization throughout Embassy to take pins before interrupts. Related to #1304.
-rw-r--r--embassy-nrf/CHANGELOG.md2
-rw-r--r--embassy-nrf/src/buffered_uarte.rs10
-rw-r--r--embassy-nrf/src/uarte.rs4
-rw-r--r--embassy-rp/CHANGELOG.md1
-rw-r--r--embassy-rp/src/uart/buffered.rs4
-rw-r--r--embassy-stm32/CHANGELOG.md5
-rw-r--r--embassy-stm32/src/usart/buffered.rs10
-rw-r--r--examples/nrf52840/src/bin/buffered_uart.rs2
-rw-r--r--examples/nrf52840/src/bin/uart.rs2
-rw-r--r--examples/nrf52840/src/bin/uart_idle.rs2
-rw-r--r--examples/nrf52840/src/bin/uart_split.rs2
-rw-r--r--examples/nrf5340/src/bin/uart.rs2
-rw-r--r--examples/nrf9151/ns/src/bin/uart.rs2
-rw-r--r--examples/nrf9160/src/bin/modem_tcp_client.rs2
-rw-r--r--examples/rp/src/bin/uart_buffered_split.rs2
-rw-r--r--examples/rp235x/src/bin/uart_buffered_split.rs2
-rw-r--r--examples/stm32f4/src/bin/usart_buffered.rs2
-rw-r--r--examples/stm32g0/src/bin/usart_buffered.rs2
-rw-r--r--examples/stm32l0/src/bin/usart_irq.rs2
-rw-r--r--tests/nrf/src/bin/buffered_uart.rs2
-rw-r--r--tests/nrf/src/bin/buffered_uart_full.rs2
-rw-r--r--tests/nrf/src/bin/buffered_uart_halves.rs2
-rw-r--r--tests/nrf/src/bin/uart_split.rs2
-rw-r--r--tests/rp/src/bin/uart_buffered.rs6
24 files changed, 40 insertions, 34 deletions
diff --git a/embassy-nrf/CHANGELOG.md b/embassy-nrf/CHANGELOG.md
index b77688148..ffa7997f7 100644
--- a/embassy-nrf/CHANGELOG.md
+++ b/embassy-nrf/CHANGELOG.md
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11 11
12- bugfix: nrf twim return errors in async\_wait instead of waiting indefinitely 12- bugfix: nrf twim return errors in async\_wait instead of waiting indefinitely
13- bugfix: fix missing setting input as disconnected. 13- bugfix: fix missing setting input as disconnected.
14- changed: Modify Uarte and BufferedUarte initialization to take pins before interrupts ([#3983](https://github.com/embassy-rs/embassy/pull/3983))
15
14 16
15## 0.3.0 - 2025-01-06 17## 0.3.0 - 2025-01-06
16 18
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs
index f939be004..29e126903 100644
--- a/embassy-nrf/src/buffered_uarte.rs
+++ b/embassy-nrf/src/buffered_uarte.rs
@@ -227,9 +227,9 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
227 ppi_ch1: Peri<'d, impl ConfigurableChannel>, 227 ppi_ch1: Peri<'d, impl ConfigurableChannel>,
228 ppi_ch2: Peri<'d, impl ConfigurableChannel>, 228 ppi_ch2: Peri<'d, impl ConfigurableChannel>,
229 ppi_group: Peri<'d, impl Group>, 229 ppi_group: Peri<'d, impl Group>,
230 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
231 rxd: Peri<'d, impl GpioPin>, 230 rxd: Peri<'d, impl GpioPin>,
232 txd: Peri<'d, impl GpioPin>, 231 txd: Peri<'d, impl GpioPin>,
232 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
233 config: Config, 233 config: Config,
234 rx_buffer: &'d mut [u8], 234 rx_buffer: &'d mut [u8],
235 tx_buffer: &'d mut [u8], 235 tx_buffer: &'d mut [u8],
@@ -262,11 +262,11 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
262 ppi_ch1: Peri<'d, impl ConfigurableChannel>, 262 ppi_ch1: Peri<'d, impl ConfigurableChannel>,
263 ppi_ch2: Peri<'d, impl ConfigurableChannel>, 263 ppi_ch2: Peri<'d, impl ConfigurableChannel>,
264 ppi_group: Peri<'d, impl Group>, 264 ppi_group: Peri<'d, impl Group>,
265 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
266 rxd: Peri<'d, impl GpioPin>, 265 rxd: Peri<'d, impl GpioPin>,
267 txd: Peri<'d, impl GpioPin>, 266 txd: Peri<'d, impl GpioPin>,
268 cts: Peri<'d, impl GpioPin>, 267 cts: Peri<'d, impl GpioPin>,
269 rts: Peri<'d, impl GpioPin>, 268 rts: Peri<'d, impl GpioPin>,
269 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
270 config: Config, 270 config: Config,
271 rx_buffer: &'d mut [u8], 271 rx_buffer: &'d mut [u8],
272 tx_buffer: &'d mut [u8], 272 tx_buffer: &'d mut [u8],
@@ -377,8 +377,8 @@ impl<'d, U: UarteInstance> BufferedUarteTx<'d, U> {
377 /// Create a new BufferedUarteTx without hardware flow control. 377 /// Create a new BufferedUarteTx without hardware flow control.
378 pub fn new( 378 pub fn new(
379 uarte: Peri<'d, U>, 379 uarte: Peri<'d, U>,
380 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
381 txd: Peri<'d, impl GpioPin>, 380 txd: Peri<'d, impl GpioPin>,
381 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
382 config: Config, 382 config: Config,
383 tx_buffer: &'d mut [u8], 383 tx_buffer: &'d mut [u8],
384 ) -> Self { 384 ) -> Self {
@@ -392,9 +392,9 @@ impl<'d, U: UarteInstance> BufferedUarteTx<'d, U> {
392 /// Panics if `rx_buffer.len()` is odd. 392 /// Panics if `rx_buffer.len()` is odd.
393 pub fn new_with_cts( 393 pub fn new_with_cts(
394 uarte: Peri<'d, U>, 394 uarte: Peri<'d, U>,
395 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
396 txd: Peri<'d, impl GpioPin>, 395 txd: Peri<'d, impl GpioPin>,
397 cts: Peri<'d, impl GpioPin>, 396 cts: Peri<'d, impl GpioPin>,
397 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
398 config: Config, 398 config: Config,
399 tx_buffer: &'d mut [u8], 399 tx_buffer: &'d mut [u8],
400 ) -> Self { 400 ) -> Self {
@@ -588,9 +588,9 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> {
588 ppi_ch1: Peri<'d, impl ConfigurableChannel>, 588 ppi_ch1: Peri<'d, impl ConfigurableChannel>,
589 ppi_ch2: Peri<'d, impl ConfigurableChannel>, 589 ppi_ch2: Peri<'d, impl ConfigurableChannel>,
590 ppi_group: Peri<'d, impl Group>, 590 ppi_group: Peri<'d, impl Group>,
591 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
592 rxd: Peri<'d, impl GpioPin>, 591 rxd: Peri<'d, impl GpioPin>,
593 rts: Peri<'d, impl GpioPin>, 592 rts: Peri<'d, impl GpioPin>,
593 _irq: impl interrupt::typelevel::Binding<U::Interrupt, InterruptHandler<U>> + 'd,
594 config: Config, 594 config: Config,
595 rx_buffer: &'d mut [u8], 595 rx_buffer: &'d mut [u8],
596 ) -> Self { 596 ) -> Self {
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index b44edfe84..f377df49e 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -155,9 +155,9 @@ impl<'d, T: Instance> Uarte<'d, T> {
155 /// Create a new UARTE without hardware flow control 155 /// Create a new UARTE without hardware flow control
156 pub fn new( 156 pub fn new(
157 uarte: Peri<'d, T>, 157 uarte: Peri<'d, T>,
158 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
159 rxd: Peri<'d, impl GpioPin>, 158 rxd: Peri<'d, impl GpioPin>,
160 txd: Peri<'d, impl GpioPin>, 159 txd: Peri<'d, impl GpioPin>,
160 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
161 config: Config, 161 config: Config,
162 ) -> Self { 162 ) -> Self {
163 Self::new_inner(uarte, rxd.into(), txd.into(), None, None, config) 163 Self::new_inner(uarte, rxd.into(), txd.into(), None, None, config)
@@ -166,11 +166,11 @@ impl<'d, T: Instance> Uarte<'d, T> {
166 /// Create a new UARTE with hardware flow control (RTS/CTS) 166 /// Create a new UARTE with hardware flow control (RTS/CTS)
167 pub fn new_with_rtscts( 167 pub fn new_with_rtscts(
168 uarte: Peri<'d, T>, 168 uarte: Peri<'d, T>,
169 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
170 rxd: Peri<'d, impl GpioPin>, 169 rxd: Peri<'d, impl GpioPin>,
171 txd: Peri<'d, impl GpioPin>, 170 txd: Peri<'d, impl GpioPin>,
172 cts: Peri<'d, impl GpioPin>, 171 cts: Peri<'d, impl GpioPin>,
173 rts: Peri<'d, impl GpioPin>, 172 rts: Peri<'d, impl GpioPin>,
173 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
174 config: Config, 174 config: Config,
175 ) -> Self { 175 ) -> Self {
176 Self::new_inner( 176 Self::new_inner(
diff --git a/embassy-rp/CHANGELOG.md b/embassy-rp/CHANGELOG.md
index 8ad3b0b76..7ac0a47cb 100644
--- a/embassy-rp/CHANGELOG.md
+++ b/embassy-rp/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16- rp235x: add ImageDef features. ([#3890](https://github.com/embassy-rs/embassy/pull/3890)) 16- rp235x: add ImageDef features. ([#3890](https://github.com/embassy-rs/embassy/pull/3890))
17- doc: Fix "the the" ([#3903](https://github.com/embassy-rs/embassy/pull/3903)) 17- doc: Fix "the the" ([#3903](https://github.com/embassy-rs/embassy/pull/3903))
18- pio: Add access to DMA engine byte swapping ([#3935](https://github.com/embassy-rs/embassy/pull/3935)) 18- pio: Add access to DMA engine byte swapping ([#3935](https://github.com/embassy-rs/embassy/pull/3935))
19- Modify BufferedUart initialization to take pins before interrupts ([#3983](https://github.com/embassy-rs/embassy/pull/3983))
19 20
20## 0.3.1 - 2025-02-06 21## 0.3.1 - 2025-02-06
21 22
diff --git a/embassy-rp/src/uart/buffered.rs b/embassy-rp/src/uart/buffered.rs
index 5b5159d22..da18138b5 100644
--- a/embassy-rp/src/uart/buffered.rs
+++ b/embassy-rp/src/uart/buffered.rs
@@ -91,9 +91,9 @@ impl<'d, T: Instance> BufferedUart<'d, T> {
91 /// Create a buffered UART instance. 91 /// Create a buffered UART instance.
92 pub fn new( 92 pub fn new(
93 _uart: Peri<'d, T>, 93 _uart: Peri<'d, T>,
94 irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
95 tx: Peri<'d, impl TxPin<T>>, 94 tx: Peri<'d, impl TxPin<T>>,
96 rx: Peri<'d, impl RxPin<T>>, 95 rx: Peri<'d, impl RxPin<T>>,
96 irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
97 tx_buffer: &'d mut [u8], 97 tx_buffer: &'d mut [u8],
98 rx_buffer: &'d mut [u8], 98 rx_buffer: &'d mut [u8],
99 config: Config, 99 config: Config,
@@ -110,11 +110,11 @@ impl<'d, T: Instance> BufferedUart<'d, T> {
110 /// Create a buffered UART instance with flow control. 110 /// Create a buffered UART instance with flow control.
111 pub fn new_with_rtscts( 111 pub fn new_with_rtscts(
112 _uart: Peri<'d, T>, 112 _uart: Peri<'d, T>,
113 irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
114 tx: Peri<'d, impl TxPin<T>>, 113 tx: Peri<'d, impl TxPin<T>>,
115 rx: Peri<'d, impl RxPin<T>>, 114 rx: Peri<'d, impl RxPin<T>>,
116 rts: Peri<'d, impl RtsPin<T>>, 115 rts: Peri<'d, impl RtsPin<T>>,
117 cts: Peri<'d, impl CtsPin<T>>, 116 cts: Peri<'d, impl CtsPin<T>>,
117 irq: impl Binding<T::Interrupt, BufferedInterruptHandler<T>>,
118 tx_buffer: &'d mut [u8], 118 tx_buffer: &'d mut [u8],
119 rx_buffer: &'d mut [u8], 119 rx_buffer: &'d mut [u8],
120 config: Config, 120 config: Config,
diff --git a/embassy-stm32/CHANGELOG.md b/embassy-stm32/CHANGELOG.md
index 10b0739fb..c50ab5294 100644
--- a/embassy-stm32/CHANGELOG.md
+++ b/embassy-stm32/CHANGELOG.md
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 7
8## Unreleased
9- Modify BufferedUart initialization to take pins before interrupts ([#3983](https://github.com/embassy-rs/embassy/pull/3983))
10
8## 0.2.0 - 2025-01-10 11## 0.2.0 - 2025-01-10
9 12
10Starting 2025 strong with a release packed with new, exciting good stuff! 🚀 13Starting 2025 strong with a release packed with new, exciting good stuff! 🚀
@@ -272,4 +275,4 @@ Misc:
272 275
273## 0.1.0 - 2024-01-12 276## 0.1.0 - 2024-01-12
274 277
275First release. \ No newline at end of file 278First release.
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs
index b1640b6dc..8a33a152c 100644
--- a/embassy-stm32/src/usart/buffered.rs
+++ b/embassy-stm32/src/usart/buffered.rs
@@ -208,11 +208,11 @@ impl<'d> BufferedUart<'d> {
208 /// Create a new bidirectional buffered UART driver 208 /// Create a new bidirectional buffered UART driver
209 pub fn new<T: Instance>( 209 pub fn new<T: Instance>(
210 peri: Peri<'d, T>, 210 peri: Peri<'d, T>,
211 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
212 rx: Peri<'d, impl RxPin<T>>, 211 rx: Peri<'d, impl RxPin<T>>,
213 tx: Peri<'d, impl TxPin<T>>, 212 tx: Peri<'d, impl TxPin<T>>,
214 tx_buffer: &'d mut [u8], 213 tx_buffer: &'d mut [u8],
215 rx_buffer: &'d mut [u8], 214 rx_buffer: &'d mut [u8],
215 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
216 config: Config, 216 config: Config,
217 ) -> Result<Self, ConfigError> { 217 ) -> Result<Self, ConfigError> {
218 Self::new_inner( 218 Self::new_inner(
@@ -231,11 +231,11 @@ impl<'d> BufferedUart<'d> {
231 /// Create a new bidirectional buffered UART driver with request-to-send and clear-to-send pins 231 /// Create a new bidirectional buffered UART driver with request-to-send and clear-to-send pins
232 pub fn new_with_rtscts<T: Instance>( 232 pub fn new_with_rtscts<T: Instance>(
233 peri: Peri<'d, T>, 233 peri: Peri<'d, T>,
234 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
235 rx: Peri<'d, impl RxPin<T>>, 234 rx: Peri<'d, impl RxPin<T>>,
236 tx: Peri<'d, impl TxPin<T>>, 235 tx: Peri<'d, impl TxPin<T>>,
237 rts: Peri<'d, impl RtsPin<T>>, 236 rts: Peri<'d, impl RtsPin<T>>,
238 cts: Peri<'d, impl CtsPin<T>>, 237 cts: Peri<'d, impl CtsPin<T>>,
238 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
239 tx_buffer: &'d mut [u8], 239 tx_buffer: &'d mut [u8],
240 rx_buffer: &'d mut [u8], 240 rx_buffer: &'d mut [u8],
241 config: Config, 241 config: Config,
@@ -256,10 +256,10 @@ impl<'d> BufferedUart<'d> {
256 /// Create a new bidirectional buffered UART driver with only the RTS pin as the DE pin 256 /// Create a new bidirectional buffered UART driver with only the RTS pin as the DE pin
257 pub fn new_with_rts_as_de<T: Instance>( 257 pub fn new_with_rts_as_de<T: Instance>(
258 peri: Peri<'d, T>, 258 peri: Peri<'d, T>,
259 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
260 rx: Peri<'d, impl RxPin<T>>, 259 rx: Peri<'d, impl RxPin<T>>,
261 tx: Peri<'d, impl TxPin<T>>, 260 tx: Peri<'d, impl TxPin<T>>,
262 rts: Peri<'d, impl RtsPin<T>>, 261 rts: Peri<'d, impl RtsPin<T>>,
262 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
263 tx_buffer: &'d mut [u8], 263 tx_buffer: &'d mut [u8],
264 rx_buffer: &'d mut [u8], 264 rx_buffer: &'d mut [u8],
265 config: Config, 265 config: Config,
@@ -280,10 +280,10 @@ impl<'d> BufferedUart<'d> {
280 /// Create a new bidirectional buffered UART driver with only the request-to-send pin 280 /// Create a new bidirectional buffered UART driver with only the request-to-send pin
281 pub fn new_with_rts<T: Instance>( 281 pub fn new_with_rts<T: Instance>(
282 peri: Peri<'d, T>, 282 peri: Peri<'d, T>,
283 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
284 rx: Peri<'d, impl RxPin<T>>, 283 rx: Peri<'d, impl RxPin<T>>,
285 tx: Peri<'d, impl TxPin<T>>, 284 tx: Peri<'d, impl TxPin<T>>,
286 rts: Peri<'d, impl RtsPin<T>>, 285 rts: Peri<'d, impl RtsPin<T>>,
286 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
287 tx_buffer: &'d mut [u8], 287 tx_buffer: &'d mut [u8],
288 rx_buffer: &'d mut [u8], 288 rx_buffer: &'d mut [u8],
289 config: Config, 289 config: Config,
@@ -305,10 +305,10 @@ impl<'d> BufferedUart<'d> {
305 #[cfg(not(any(usart_v1, usart_v2)))] 305 #[cfg(not(any(usart_v1, usart_v2)))]
306 pub fn new_with_de<T: Instance>( 306 pub fn new_with_de<T: Instance>(
307 peri: Peri<'d, T>, 307 peri: Peri<'d, T>,
308 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
309 rx: Peri<'d, impl RxPin<T>>, 308 rx: Peri<'d, impl RxPin<T>>,
310 tx: Peri<'d, impl TxPin<T>>, 309 tx: Peri<'d, impl TxPin<T>>,
311 de: Peri<'d, impl DePin<T>>, 310 de: Peri<'d, impl DePin<T>>,
311 _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd,
312 tx_buffer: &'d mut [u8], 312 tx_buffer: &'d mut [u8],
313 rx_buffer: &'d mut [u8], 313 rx_buffer: &'d mut [u8],
314 config: Config, 314 config: Config,
diff --git a/examples/nrf52840/src/bin/buffered_uart.rs b/examples/nrf52840/src/bin/buffered_uart.rs
index 77d017964..f0a066818 100644
--- a/examples/nrf52840/src/bin/buffered_uart.rs
+++ b/examples/nrf52840/src/bin/buffered_uart.rs
@@ -28,9 +28,9 @@ async fn main(_spawner: Spawner) {
28 p.PPI_CH0, 28 p.PPI_CH0,
29 p.PPI_CH1, 29 p.PPI_CH1,
30 p.PPI_GROUP0, 30 p.PPI_GROUP0,
31 Irqs,
32 p.P0_08, 31 p.P0_08,
33 p.P0_06, 32 p.P0_06,
33 Irqs,
34 config, 34 config,
35 &mut rx_buffer, 35 &mut rx_buffer,
36 &mut tx_buffer, 36 &mut tx_buffer,
diff --git a/examples/nrf52840/src/bin/uart.rs b/examples/nrf52840/src/bin/uart.rs
index 23154672f..f9f8d74ab 100644
--- a/examples/nrf52840/src/bin/uart.rs
+++ b/examples/nrf52840/src/bin/uart.rs
@@ -17,7 +17,7 @@ async fn main(_spawner: Spawner) {
17 config.parity = uarte::Parity::EXCLUDED; 17 config.parity = uarte::Parity::EXCLUDED;
18 config.baudrate = uarte::Baudrate::BAUD115200; 18 config.baudrate = uarte::Baudrate::BAUD115200;
19 19
20 let mut uart = uarte::Uarte::new(p.UARTE0, Irqs, p.P0_08, p.P0_06, config); 20 let mut uart = uarte::Uarte::new(p.UARTE0, p.P0_08, p.P0_06, Irqs, config);
21 21
22 info!("uarte initialized!"); 22 info!("uarte initialized!");
23 23
diff --git a/examples/nrf52840/src/bin/uart_idle.rs b/examples/nrf52840/src/bin/uart_idle.rs
index a42e84fa4..00e3ae904 100644
--- a/examples/nrf52840/src/bin/uart_idle.rs
+++ b/examples/nrf52840/src/bin/uart_idle.rs
@@ -18,7 +18,7 @@ async fn main(_spawner: Spawner) {
18 config.parity = uarte::Parity::EXCLUDED; 18 config.parity = uarte::Parity::EXCLUDED;
19 config.baudrate = uarte::Baudrate::BAUD115200; 19 config.baudrate = uarte::Baudrate::BAUD115200;
20 20
21 let uart = uarte::Uarte::new(p.UARTE0, Irqs, p.P0_08, p.P0_06, config); 21 let uart = uarte::Uarte::new(p.UARTE0, p.P0_08, p.P0_06, Irqs, config);
22 let (mut tx, mut rx) = uart.split_with_idle(p.TIMER0, p.PPI_CH0, p.PPI_CH1); 22 let (mut tx, mut rx) = uart.split_with_idle(p.TIMER0, p.PPI_CH0, p.PPI_CH1);
23 23
24 info!("uarte initialized!"); 24 info!("uarte initialized!");
diff --git a/examples/nrf52840/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs
index 94af4be86..46be8f636 100644
--- a/examples/nrf52840/src/bin/uart_split.rs
+++ b/examples/nrf52840/src/bin/uart_split.rs
@@ -23,7 +23,7 @@ async fn main(spawner: Spawner) {
23 config.parity = uarte::Parity::EXCLUDED; 23 config.parity = uarte::Parity::EXCLUDED;
24 config.baudrate = uarte::Baudrate::BAUD115200; 24 config.baudrate = uarte::Baudrate::BAUD115200;
25 25
26 let uart = uarte::Uarte::new(p.UARTE0, Irqs, p.P0_08, p.P0_06, config); 26 let uart = uarte::Uarte::new(p.UARTE0, p.P0_08, p.P0_06, Irqs, config);
27 let (mut tx, rx) = uart.split(); 27 let (mut tx, rx) = uart.split();
28 28
29 info!("uarte initialized!"); 29 info!("uarte initialized!");
diff --git a/examples/nrf5340/src/bin/uart.rs b/examples/nrf5340/src/bin/uart.rs
index 7b41d7463..7e8b8d418 100644
--- a/examples/nrf5340/src/bin/uart.rs
+++ b/examples/nrf5340/src/bin/uart.rs
@@ -18,7 +18,7 @@ async fn main(_spawner: Spawner) {
18 config.parity = uarte::Parity::EXCLUDED; 18 config.parity = uarte::Parity::EXCLUDED;
19 config.baudrate = uarte::Baudrate::BAUD115200; 19 config.baudrate = uarte::Baudrate::BAUD115200;
20 20
21 let mut uart = uarte::Uarte::new(p.SERIAL0, Irqs, p.P1_00, p.P1_01, config); 21 let mut uart = uarte::Uarte::new(p.SERIAL0, p.P1_00, p.P1_01, Irqs, config);
22 22
23 info!("uarte initialized!"); 23 info!("uarte initialized!");
24 24
diff --git a/examples/nrf9151/ns/src/bin/uart.rs b/examples/nrf9151/ns/src/bin/uart.rs
index 234ff35f2..6fd377978 100644
--- a/examples/nrf9151/ns/src/bin/uart.rs
+++ b/examples/nrf9151/ns/src/bin/uart.rs
@@ -17,7 +17,7 @@ async fn main(_spawner: Spawner) {
17 config.parity = uarte::Parity::EXCLUDED; 17 config.parity = uarte::Parity::EXCLUDED;
18 config.baudrate = uarte::Baudrate::BAUD115200; 18 config.baudrate = uarte::Baudrate::BAUD115200;
19 19
20 let mut uart = uarte::Uarte::new(p.SERIAL0, Irqs, p.P0_26, p.P0_27, config); 20 let mut uart = uarte::Uarte::new(p.SERIAL0, p.P0_26, p.P0_27, Irqs, config);
21 21
22 info!("uarte initialized!"); 22 info!("uarte initialized!");
23 23
diff --git a/examples/nrf9160/src/bin/modem_tcp_client.rs b/examples/nrf9160/src/bin/modem_tcp_client.rs
index 2ba964b1f..a36b14626 100644
--- a/examples/nrf9160/src/bin/modem_tcp_client.rs
+++ b/examples/nrf9160/src/bin/modem_tcp_client.rs
@@ -127,8 +127,8 @@ async fn main(spawner: Spawner) {
127 let uart = BufferedUarteTx::new( 127 let uart = BufferedUarteTx::new(
128 //let trace_uart = BufferedUarteTx::new( 128 //let trace_uart = BufferedUarteTx::new(
129 unsafe { peripherals::SERIAL0::steal() }, 129 unsafe { peripherals::SERIAL0::steal() },
130 Irqs,
131 unsafe { peripherals::P0_01::steal() }, 130 unsafe { peripherals::P0_01::steal() },
131 Irqs,
132 //unsafe { peripherals::P0_14::steal() }, 132 //unsafe { peripherals::P0_14::steal() },
133 config, 133 config,
134 unsafe { &mut *addr_of_mut!(TRACE_BUF) }, 134 unsafe { &mut *addr_of_mut!(TRACE_BUF) },
diff --git a/examples/rp/src/bin/uart_buffered_split.rs b/examples/rp/src/bin/uart_buffered_split.rs
index 468d2b61a..da7e94139 100644
--- a/examples/rp/src/bin/uart_buffered_split.rs
+++ b/examples/rp/src/bin/uart_buffered_split.rs
@@ -30,7 +30,7 @@ async fn main(spawner: Spawner) {
30 let tx_buf = &mut TX_BUF.init([0; 16])[..]; 30 let tx_buf = &mut TX_BUF.init([0; 16])[..];
31 static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new(); 31 static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new();
32 let rx_buf = &mut RX_BUF.init([0; 16])[..]; 32 let rx_buf = &mut RX_BUF.init([0; 16])[..];
33 let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default()); 33 let uart = BufferedUart::new(uart, tx_pin, rx_pin, Irqs, tx_buf, rx_buf, Config::default());
34 let (mut tx, rx) = uart.split(); 34 let (mut tx, rx) = uart.split();
35 35
36 unwrap!(spawner.spawn(reader(rx))); 36 unwrap!(spawner.spawn(reader(rx)));
diff --git a/examples/rp235x/src/bin/uart_buffered_split.rs b/examples/rp235x/src/bin/uart_buffered_split.rs
index 468d2b61a..da7e94139 100644
--- a/examples/rp235x/src/bin/uart_buffered_split.rs
+++ b/examples/rp235x/src/bin/uart_buffered_split.rs
@@ -30,7 +30,7 @@ async fn main(spawner: Spawner) {
30 let tx_buf = &mut TX_BUF.init([0; 16])[..]; 30 let tx_buf = &mut TX_BUF.init([0; 16])[..];
31 static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new(); 31 static RX_BUF: StaticCell<[u8; 16]> = StaticCell::new();
32 let rx_buf = &mut RX_BUF.init([0; 16])[..]; 32 let rx_buf = &mut RX_BUF.init([0; 16])[..];
33 let uart = BufferedUart::new(uart, Irqs, tx_pin, rx_pin, tx_buf, rx_buf, Config::default()); 33 let uart = BufferedUart::new(uart, tx_pin, rx_pin, Irqs, tx_buf, rx_buf, Config::default());
34 let (mut tx, rx) = uart.split(); 34 let (mut tx, rx) = uart.split();
35 35
36 unwrap!(spawner.spawn(reader(rx))); 36 unwrap!(spawner.spawn(reader(rx)));
diff --git a/examples/stm32f4/src/bin/usart_buffered.rs b/examples/stm32f4/src/bin/usart_buffered.rs
index c99807f11..3b6cdad8d 100644
--- a/examples/stm32f4/src/bin/usart_buffered.rs
+++ b/examples/stm32f4/src/bin/usart_buffered.rs
@@ -21,7 +21,7 @@ async fn main(_spawner: Spawner) {
21 21
22 let mut tx_buf = [0u8; 32]; 22 let mut tx_buf = [0u8; 32];
23 let mut rx_buf = [0u8; 32]; 23 let mut rx_buf = [0u8; 32];
24 let mut buf_usart = BufferedUart::new(p.USART3, Irqs, p.PD9, p.PD8, &mut tx_buf, &mut rx_buf, config).unwrap(); 24 let mut buf_usart = BufferedUart::new(p.USART3, p.PD9, p.PD8, &mut tx_buf, &mut rx_buf, Irqs, config).unwrap();
25 25
26 loop { 26 loop {
27 let buf = buf_usart.fill_buf().await.unwrap(); 27 let buf = buf_usart.fill_buf().await.unwrap();
diff --git a/examples/stm32g0/src/bin/usart_buffered.rs b/examples/stm32g0/src/bin/usart_buffered.rs
index c097a0c5a..6d9ec8cb4 100644
--- a/examples/stm32g0/src/bin/usart_buffered.rs
+++ b/examples/stm32g0/src/bin/usart_buffered.rs
@@ -21,7 +21,7 @@ async fn main(_spawner: Spawner) {
21 config.baudrate = 115200; 21 config.baudrate = 115200;
22 let mut tx_buf = [0u8; 256]; 22 let mut tx_buf = [0u8; 256];
23 let mut rx_buf = [0u8; 256]; 23 let mut rx_buf = [0u8; 256];
24 let mut usart = BufferedUart::new(p.USART1, Irqs, p.PB7, p.PB6, &mut tx_buf, &mut rx_buf, config).unwrap(); 24 let mut usart = BufferedUart::new(p.USART1, p.PB7, p.PB6, &mut tx_buf, &mut rx_buf, Irqs, config).unwrap();
25 25
26 usart.write_all(b"Hello Embassy World!\r\n").await.unwrap(); 26 usart.write_all(b"Hello Embassy World!\r\n").await.unwrap();
27 info!("wrote Hello, starting echo"); 27 info!("wrote Hello, starting echo");
diff --git a/examples/stm32l0/src/bin/usart_irq.rs b/examples/stm32l0/src/bin/usart_irq.rs
index 2c96a8bc2..a51ddbcbb 100644
--- a/examples/stm32l0/src/bin/usart_irq.rs
+++ b/examples/stm32l0/src/bin/usart_irq.rs
@@ -21,7 +21,7 @@ async fn main(_spawner: Spawner) {
21 config.baudrate = 9600; 21 config.baudrate = 9600;
22 let mut tx_buf = [0u8; 256]; 22 let mut tx_buf = [0u8; 256];
23 let mut rx_buf = [0u8; 256]; 23 let mut rx_buf = [0u8; 256];
24 let mut usart = BufferedUart::new(p.USART2, Irqs, p.PA3, p.PA2, &mut tx_buf, &mut rx_buf, config).unwrap(); 24 let mut usart = BufferedUart::new(p.USART2, p.PA3, p.PA2, &mut tx_buf, &mut rx_buf, Irqs, config).unwrap();
25 25
26 usart.write_all(b"Hello Embassy World!\r\n").await.unwrap(); 26 usart.write_all(b"Hello Embassy World!\r\n").await.unwrap();
27 info!("wrote Hello, starting echo"); 27 info!("wrote Hello, starting echo");
diff --git a/tests/nrf/src/bin/buffered_uart.rs b/tests/nrf/src/bin/buffered_uart.rs
index 2eecafb95..8c4827464 100644
--- a/tests/nrf/src/bin/buffered_uart.rs
+++ b/tests/nrf/src/bin/buffered_uart.rs
@@ -30,9 +30,9 @@ async fn main(_spawner: Spawner) {
30 p.PPI_CH0.reborrow(), 30 p.PPI_CH0.reborrow(),
31 p.PPI_CH1.reborrow(), 31 p.PPI_CH1.reborrow(),
32 p.PPI_GROUP0.reborrow(), 32 p.PPI_GROUP0.reborrow(),
33 irqs!(UART0_BUFFERED),
34 peri!(p, PIN_A).reborrow(), 33 peri!(p, PIN_A).reborrow(),
35 peri!(p, PIN_B).reborrow(), 34 peri!(p, PIN_B).reborrow(),
35 irqs!(UART0_BUFFERED),
36 config.clone(), 36 config.clone(),
37 &mut rx_buffer, 37 &mut rx_buffer,
38 &mut tx_buffer, 38 &mut tx_buffer,
diff --git a/tests/nrf/src/bin/buffered_uart_full.rs b/tests/nrf/src/bin/buffered_uart_full.rs
index 09353bbe8..e0f41b891 100644
--- a/tests/nrf/src/bin/buffered_uart_full.rs
+++ b/tests/nrf/src/bin/buffered_uart_full.rs
@@ -28,9 +28,9 @@ async fn main(_spawner: Spawner) {
28 p.PPI_CH0, 28 p.PPI_CH0,
29 p.PPI_CH1, 29 p.PPI_CH1,
30 p.PPI_GROUP0, 30 p.PPI_GROUP0,
31 irqs!(UART0_BUFFERED),
32 peri!(p, PIN_A), 31 peri!(p, PIN_A),
33 peri!(p, PIN_B), 32 peri!(p, PIN_B),
33 irqs!(UART0_BUFFERED),
34 config.clone(), 34 config.clone(),
35 &mut rx_buffer, 35 &mut rx_buffer,
36 &mut tx_buffer, 36 &mut tx_buffer,
diff --git a/tests/nrf/src/bin/buffered_uart_halves.rs b/tests/nrf/src/bin/buffered_uart_halves.rs
index adfba509d..e6debd76e 100644
--- a/tests/nrf/src/bin/buffered_uart_halves.rs
+++ b/tests/nrf/src/bin/buffered_uart_halves.rs
@@ -28,8 +28,8 @@ async fn main(_spawner: Spawner) {
28 28
29 let mut tx = BufferedUarteTx::new( 29 let mut tx = BufferedUarteTx::new(
30 peri!(p, UART1).reborrow(), 30 peri!(p, UART1).reborrow(),
31 irqs!(UART1_BUFFERED),
32 peri!(p, PIN_A).reborrow(), 31 peri!(p, PIN_A).reborrow(),
32 irqs!(UART1_BUFFERED),
33 config.clone(), 33 config.clone(),
34 &mut tx_buffer, 34 &mut tx_buffer,
35 ); 35 );
diff --git a/tests/nrf/src/bin/uart_split.rs b/tests/nrf/src/bin/uart_split.rs
index f24903297..8fe710068 100644
--- a/tests/nrf/src/bin/uart_split.rs
+++ b/tests/nrf/src/bin/uart_split.rs
@@ -22,9 +22,9 @@ async fn main(_spawner: Spawner) {
22 22
23 let uarte = Uarte::new( 23 let uarte = Uarte::new(
24 peri!(p, UART0).reborrow(), 24 peri!(p, UART0).reborrow(),
25 irqs!(UART0),
26 peri!(p, PIN_A).reborrow(), 25 peri!(p, PIN_A).reborrow(),
27 peri!(p, PIN_B).reborrow(), 26 peri!(p, PIN_B).reborrow(),
27 irqs!(UART0),
28 config.clone(), 28 config.clone(),
29 ); 29 );
30 let (mut tx, mut rx) = uarte.split(); 30 let (mut tx, mut rx) = uarte.split();
diff --git a/tests/rp/src/bin/uart_buffered.rs b/tests/rp/src/bin/uart_buffered.rs
index b270a60ce..d5f655e9b 100644
--- a/tests/rp/src/bin/uart_buffered.rs
+++ b/tests/rp/src/bin/uart_buffered.rs
@@ -75,9 +75,9 @@ async fn main(_spawner: Spawner) {
75 let rx_buf = &mut [0u8; 16]; 75 let rx_buf = &mut [0u8; 16];
76 let mut uart = BufferedUart::new( 76 let mut uart = BufferedUart::new(
77 uart.reborrow(), 77 uart.reborrow(),
78 Irqs,
79 tx.reborrow(), 78 tx.reborrow(),
80 rx.reborrow(), 79 rx.reborrow(),
80 Irqs,
81 tx_buf, 81 tx_buf,
82 rx_buf, 82 rx_buf,
83 config, 83 config,
@@ -103,9 +103,9 @@ async fn main(_spawner: Spawner) {
103 let rx_buf = &mut [0u8; 16]; 103 let rx_buf = &mut [0u8; 16];
104 let mut uart = BufferedUart::new( 104 let mut uart = BufferedUart::new(
105 uart.reborrow(), 105 uart.reborrow(),
106 Irqs,
107 tx.reborrow(), 106 tx.reborrow(),
108 rx.reborrow(), 107 rx.reborrow(),
108 Irqs,
109 tx_buf, 109 tx_buf,
110 rx_buf, 110 rx_buf,
111 config, 111 config,
@@ -146,9 +146,9 @@ async fn main(_spawner: Spawner) {
146 let rx_buf = &mut [0u8; 16]; 146 let rx_buf = &mut [0u8; 16];
147 let mut uart = BufferedUart::new( 147 let mut uart = BufferedUart::new(
148 uart.reborrow(), 148 uart.reborrow(),
149 Irqs,
150 tx.reborrow(), 149 tx.reborrow(),
151 rx.reborrow(), 150 rx.reborrow(),
151 Irqs,
152 tx_buf, 152 tx_buf,
153 rx_buf, 153 rx_buf,
154 config, 154 config,