Rebase on master
This commit is contained in:
commit
c871fe0848
76 changed files with 1899 additions and 469 deletions
tests
|
@ -18,10 +18,10 @@ cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
|
|||
cortex-m-rt = "0.7.0"
|
||||
embedded-hal = "0.2.6"
|
||||
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" }
|
||||
embedded-hal-async = { version = "=0.1.0-alpha.2" }
|
||||
embedded-hal-async = { version = "=0.1.0-alpha.3" }
|
||||
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
|
||||
futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
|
||||
embedded-io = { version = "0.3.0", features = ["async"] }
|
||||
embedded-io = { version = "0.3.1", features = ["async"] }
|
||||
embedded-storage = { version = "0.3" }
|
||||
|
||||
[profile.dev]
|
||||
|
|
|
@ -26,7 +26,7 @@ cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
|
|||
cortex-m-rt = "0.7.0"
|
||||
embedded-hal = "0.2.6"
|
||||
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.9" }
|
||||
embedded-hal-async = { version = "=0.1.0-alpha.2" }
|
||||
embedded-hal-async = { version = "=0.1.0-alpha.3" }
|
||||
panic-probe = { version = "0.3.0", features = ["print-defmt"] }
|
||||
|
||||
[profile.dev]
|
||||
|
|
|
@ -7,6 +7,7 @@ mod example_common;
|
|||
use defmt::assert_eq;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::dma::NoDma;
|
||||
use embassy_stm32::interrupt;
|
||||
use embassy_stm32::usart::{Config, Uart};
|
||||
use example_common::*;
|
||||
|
||||
|
@ -18,22 +19,22 @@ async fn main(_spawner: Spawner) {
|
|||
// Arduino pins D0 and D1
|
||||
// They're connected together with a 1K resistor.
|
||||
#[cfg(feature = "stm32f103c8")]
|
||||
let (tx, rx, usart) = (p.PA9, p.PA10, p.USART1);
|
||||
let (tx, rx, usart, irq) = (p.PA9, p.PA10, p.USART1, interrupt::take!(USART1));
|
||||
#[cfg(feature = "stm32g491re")]
|
||||
let (tx, rx, usart) = (p.PC4, p.PC5, p.USART1);
|
||||
let (tx, rx, usart, irq) = (p.PC4, p.PC5, p.USART1, interrupt::take!(USART1));
|
||||
#[cfg(feature = "stm32g071rb")]
|
||||
let (tx, rx, usart) = (p.PC4, p.PC5, p.USART1);
|
||||
let (tx, rx, usart, irq) = (p.PC4, p.PC5, p.USART1, interrupt::take!(USART1));
|
||||
#[cfg(feature = "stm32f429zi")]
|
||||
let (tx, rx, usart) = (p.PG14, p.PG9, p.USART6);
|
||||
let (tx, rx, usart, irq) = (p.PG14, p.PG9, p.USART6, interrupt::take!(USART6));
|
||||
#[cfg(feature = "stm32wb55rg")]
|
||||
let (tx, rx, usart) = (p.PA2, p.PA3, p.LPUART1);
|
||||
let (tx, rx, usart, irq) = (p.PA2, p.PA3, p.LPUART1, interrupt::take!(LPUART1));
|
||||
#[cfg(feature = "stm32h755zi")]
|
||||
let (tx, rx, usart) = (p.PB6, p.PB7, p.USART1);
|
||||
let (tx, rx, usart, irq) = (p.PB6, p.PB7, p.USART1, interrupt::take!(USART1));
|
||||
#[cfg(feature = "stm32u585ai")]
|
||||
let (tx, rx, usart) = (p.PD8, p.PD9, p.USART3);
|
||||
let (tx, rx, usart, irq) = (p.PD8, p.PD9, p.USART3, interrupt::take!(USART3));
|
||||
|
||||
let config = Config::default();
|
||||
let mut usart = Uart::new(usart, rx, tx, NoDma, NoDma, config);
|
||||
let mut usart = Uart::new(usart, rx, tx, irq, NoDma, NoDma, config);
|
||||
|
||||
// We can't send too many bytes, they have to fit in the FIFO.
|
||||
// This is because we aren't sending+receiving at the same time.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
mod example_common;
|
||||
use defmt::assert_eq;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::interrupt;
|
||||
use embassy_stm32::usart::{Config, Uart};
|
||||
use example_common::*;
|
||||
|
||||
|
@ -17,22 +18,53 @@ async fn main(_spawner: Spawner) {
|
|||
// Arduino pins D0 and D1
|
||||
// They're connected together with a 1K resistor.
|
||||
#[cfg(feature = "stm32f103c8")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PA9, p.PA10, p.USART1, p.DMA1_CH4, p.DMA1_CH5);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) = (
|
||||
p.PA9,
|
||||
p.PA10,
|
||||
p.USART1,
|
||||
interrupt::take!(USART1),
|
||||
p.DMA1_CH4,
|
||||
p.DMA1_CH5,
|
||||
);
|
||||
#[cfg(feature = "stm32g491re")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PC4, p.PC5, p.USART1, p.DMA1_CH1, p.DMA1_CH2);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) =
|
||||
(p.PC4, p.PC5, p.USART1, interrupt::take!(USART1), p.DMA1_CH1, p.DMA1_CH2);
|
||||
#[cfg(feature = "stm32g071rb")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PC4, p.PC5, p.USART1, p.DMA1_CH1, p.DMA1_CH2);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) =
|
||||
(p.PC4, p.PC5, p.USART1, interrupt::take!(USART1), p.DMA1_CH1, p.DMA1_CH2);
|
||||
#[cfg(feature = "stm32f429zi")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PG14, p.PG9, p.USART6, p.DMA2_CH6, p.DMA2_CH1);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) = (
|
||||
p.PG14,
|
||||
p.PG9,
|
||||
p.USART6,
|
||||
interrupt::take!(USART6),
|
||||
p.DMA2_CH6,
|
||||
p.DMA2_CH1,
|
||||
);
|
||||
#[cfg(feature = "stm32wb55rg")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PA2, p.PA3, p.LPUART1, p.DMA1_CH1, p.DMA1_CH2);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) = (
|
||||
p.PA2,
|
||||
p.PA3,
|
||||
p.LPUART1,
|
||||
interrupt::take!(LPUART1),
|
||||
p.DMA1_CH1,
|
||||
p.DMA1_CH2,
|
||||
);
|
||||
#[cfg(feature = "stm32h755zi")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PB6, p.PB7, p.USART1, p.DMA1_CH0, p.DMA1_CH1);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) =
|
||||
(p.PB6, p.PB7, p.USART1, interrupt::take!(USART1), p.DMA1_CH0, p.DMA1_CH1);
|
||||
#[cfg(feature = "stm32u585ai")]
|
||||
let (tx, rx, usart, tx_dma, rx_dma) = (p.PD8, p.PD9, p.USART3, p.GPDMA1_CH0, p.GPDMA1_CH1);
|
||||
let (tx, rx, usart, irq, tx_dma, rx_dma) = (
|
||||
p.PD8,
|
||||
p.PD9,
|
||||
p.USART3,
|
||||
interrupt::take!(USART3),
|
||||
p.GPDMA1_CH0,
|
||||
p.GPDMA1_CH1,
|
||||
);
|
||||
|
||||
let config = Config::default();
|
||||
let mut usart = Uart::new(usart, rx, tx, tx_dma, rx_dma, config);
|
||||
let mut usart = Uart::new(usart, rx, tx, irq, tx_dma, rx_dma, config);
|
||||
|
||||
// We can't send too many bytes, they have to fit in the FIFO.
|
||||
// This is because we aren't sending+receiving at the same time.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue