From a544726be4ef66574419e95ee508f2062e9a3da2 Mon Sep 17 00:00:00 2001 From: Anton Pöhl Date: Thu, 13 Mar 2025 11:05:10 +0100 Subject: Stm32 usart: remove HalfDuplexConfig The pin parameters of usart::Config are used instead. --- examples/stm32g0/src/bin/onewire_ds18b20.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/stm32g0/src/bin/onewire_ds18b20.rs b/examples/stm32g0/src/bin/onewire_ds18b20.rs index f85cc4ff8..75519bbf2 100644 --- a/examples/stm32g0/src/bin/onewire_ds18b20.rs +++ b/examples/stm32g0/src/bin/onewire_ds18b20.rs @@ -8,7 +8,7 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::mode::Async; use embassy_stm32::usart::{ - BufferedUartRx, BufferedUartTx, Config, ConfigError, HalfDuplexConfig, RingBufferedUartRx, UartTx, + BufferedUartRx, BufferedUartTx, Config, ConfigError, OutputConfig, RingBufferedUartRx, UartTx, }; use embassy_stm32::{bind_interrupts, peripherals, usart}; use embassy_time::{Duration, Timer}; @@ -21,16 +21,18 @@ fn create_onewire(p: embassy_stm32::Peripherals) -> OneWire usart::InterruptHandler; }); + let mut config = Config::default(); + config.tx_config = OutputConfig::OpenDrainExternal; + let usart = Uart::new_half_duplex( p.USART1, p.PA9, Irqs, p.DMA1_CH1, p.DMA1_CH2, - Config::default(), + config, // Enable readback so we can read sensor pulling data low while transmission is in progress usart::HalfDuplexReadback::Readback, - HalfDuplexConfig::OpenDrainExternal, ) .unwrap(); @@ -50,6 +52,8 @@ fn create_onewire(p: embassy_stm32::Peripherals) -> OneWire OneWire Date: Sun, 13 Apr 2025 20:26:26 +0200 Subject: Stm32 usart: better names for open drain pin modes --- examples/stm32g0/src/bin/onewire_ds18b20.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/stm32g0/src/bin/onewire_ds18b20.rs b/examples/stm32g0/src/bin/onewire_ds18b20.rs index 75519bbf2..62f8711a6 100644 --- a/examples/stm32g0/src/bin/onewire_ds18b20.rs +++ b/examples/stm32g0/src/bin/onewire_ds18b20.rs @@ -22,7 +22,7 @@ fn create_onewire(p: embassy_stm32::Peripherals) -> OneWire OneWire