From 009e1896bfe457e1b15156a2624284b385a53e27 Mon Sep 17 00:00:00 2001 From: xoviat Date: Tue, 30 Mar 2021 10:05:52 -0500 Subject: [PATCH] stm32: consolidate crates --- .github/workflows/rust.yml | 12 +- .../.cargo/config | 0 embassy-stm32-examples/Cargo.toml | 54 +++ .../build.rs | 0 .../memory.x | 0 .../src/bin/can.rs | 2 +- .../src/bin/exti.rs | 4 +- .../src/bin/hello.rs | 0 .../src/bin/rtc_async.rs | 4 +- .../src/bin/serial.rs | 4 +- .../src/bin/usb_serial.rs | 2 +- .../src/example_common.rs | 0 embassy-stm32/Cargo.toml | 3 +- embassy-stm32/src/f4/mod.rs | 2 + .../src => embassy-stm32/src/f4}/qei.rs | 0 .../src => embassy-stm32/src/f4}/serial.rs | 0 embassy-stm32/src/lib.rs | 40 ++- embassy-stm32f4-examples/Cargo.toml | 55 --- embassy-stm32f4/Cargo.toml | 45 --- embassy-stm32f4/src/lib.rs | 317 ------------------ embassy-stm32l0/Cargo.toml | 28 -- embassy-stm32l0/src/lib.rs | 22 -- embassy/src/util/signal.rs | 2 +- 23 files changed, 111 insertions(+), 485 deletions(-) rename {embassy-stm32f4-examples => embassy-stm32-examples}/.cargo/config (100%) create mode 100644 embassy-stm32-examples/Cargo.toml rename {embassy-stm32f4-examples => embassy-stm32-examples}/build.rs (100%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/memory.x (100%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/can.rs (97%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/exti.rs (95%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/hello.rs (100%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/rtc_async.rs (94%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/serial.rs (97%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/bin/usb_serial.rs (98%) rename {embassy-stm32f4-examples => embassy-stm32-examples}/src/example_common.rs (100%) create mode 100644 embassy-stm32/src/f4/mod.rs rename {embassy-stm32f4/src => embassy-stm32/src/f4}/qei.rs (100%) rename {embassy-stm32f4/src => embassy-stm32/src/f4}/serial.rs (100%) delete mode 100644 embassy-stm32f4-examples/Cargo.toml delete mode 100644 embassy-stm32f4/Cargo.toml delete mode 100644 embassy-stm32f4/src/lib.rs delete mode 100644 embassy-stm32l0/Cargo.toml delete mode 100644 embassy-stm32l0/src/lib.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7b04a994..d7b427e0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -46,22 +46,22 @@ jobs: - package: embassy-nrf target: thumbv7em-none-eabi features: 52840,defmt - - package: embassy-stm32f4-examples + - package: embassy-stm32-examples target: thumbv7em-none-eabi features: stm32f405 - - package: embassy-stm32f4 + - package: embassy-stm32 target: thumbv7em-none-eabi features: stm32f405 - - package: embassy-stm32f4 + - package: embassy-stm32 target: thumbv7em-none-eabi features: stm32f446 - - package: embassy-stm32f4 + - package: embassy-stm32 target: thumbv7em-none-eabi features: stm32f405,defmt - - package: embassy-stm32l0 + - package: embassy-stm32 target: thumbv6m-none-eabi features: stm32l0x2 - - package: embassy-stm32l0 + - package: embassy-stm32 target: thumbv6m-none-eabi features: stm32l0x2,defmt - package: embassy-rp-examples diff --git a/embassy-stm32f4-examples/.cargo/config b/embassy-stm32-examples/.cargo/config similarity index 100% rename from embassy-stm32f4-examples/.cargo/config rename to embassy-stm32-examples/.cargo/config diff --git a/embassy-stm32-examples/Cargo.toml b/embassy-stm32-examples/Cargo.toml new file mode 100644 index 00000000..52446db3 --- /dev/null +++ b/embassy-stm32-examples/Cargo.toml @@ -0,0 +1,54 @@ +[package] +authors = ["Dario Nieuwenhuis "] +edition = "2018" +name = "embassy-stm32f4-examples" +version = "0.1.0" + +[features] +default = [ + "defmt-default", +] +defmt-default = [] +defmt-trace = [] +defmt-debug = [] +defmt-info = [] +defmt-warn = [] +defmt-error = [] + +stm32f401 = ["stm32f4xx-hal/stm32f401", "embassy-stm32/stm32f401"] +stm32f405 = ["stm32f4xx-hal/stm32f405", "embassy-stm32/stm32f405"] +stm32f407 = ["stm32f4xx-hal/stm32f407", "embassy-stm32/stm32f407"] +stm32f410 = ["stm32f4xx-hal/stm32f410", "embassy-stm32/stm32f410"] +stm32f411 = ["stm32f4xx-hal/stm32f411", "embassy-stm32/stm32f411"] +stm32f412 = ["stm32f4xx-hal/stm32f412", "embassy-stm32/stm32f412"] +stm32f413 = ["stm32f4xx-hal/stm32f413", "embassy-stm32/stm32f413"] +stm32f415 = ["stm32f4xx-hal/stm32f405", "embassy-stm32/stm32f405"] +stm32f417 = ["stm32f4xx-hal/stm32f407", "embassy-stm32/stm32f407"] +stm32f423 = ["stm32f4xx-hal/stm32f413", "embassy-stm32/stm32f413"] +stm32f427 = ["stm32f4xx-hal/stm32f427", "embassy-stm32/stm32f427"] +stm32f429 = ["stm32f4xx-hal/stm32f429", "embassy-stm32/stm32f429"] +stm32f437 = ["stm32f4xx-hal/stm32f427", "embassy-stm32/stm32f427"] +stm32f439 = ["stm32f4xx-hal/stm32f429", "embassy-stm32/stm32f429"] +stm32f446 = ["stm32f4xx-hal/stm32f446", "embassy-stm32/stm32f446"] +stm32f469 = ["stm32f4xx-hal/stm32f469", "embassy-stm32/stm32f469"] +stm32f479 = ["stm32f4xx-hal/stm32f469", "embassy-stm32/stm32f469"] + + +[dependencies] +embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } +embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } +embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" } +embassy-extras = {version = "0.1.0", path = "../embassy-extras" } + +defmt = "0.2.0" +defmt-rtt = "0.2.0" + +cortex-m = "0.7.1" +cortex-m-rt = "0.6.13" +embedded-hal = { version = "0.2.4" } +panic-probe = "0.1.0" +stm32f4xx-hal = { version = "0.8.3", features = ["rt", "usb_fs"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"} +futures = { version = "0.3.8", default-features = false, features = ["async-await"] } +rtt-target = { version = "0.3", features = ["cortex-m"] } +bxcan = "0.5.0" +usb-device = "0.2.7" diff --git a/embassy-stm32f4-examples/build.rs b/embassy-stm32-examples/build.rs similarity index 100% rename from embassy-stm32f4-examples/build.rs rename to embassy-stm32-examples/build.rs diff --git a/embassy-stm32f4-examples/memory.x b/embassy-stm32-examples/memory.x similarity index 100% rename from embassy-stm32f4-examples/memory.x rename to embassy-stm32-examples/memory.x diff --git a/embassy-stm32f4-examples/src/bin/can.rs b/embassy-stm32-examples/src/bin/can.rs similarity index 97% rename from embassy-stm32f4-examples/src/bin/can.rs rename to embassy-stm32-examples/src/bin/can.rs index c34c0a2a..4923d399 100644 --- a/embassy-stm32f4-examples/src/bin/can.rs +++ b/embassy-stm32-examples/src/bin/can.rs @@ -13,7 +13,7 @@ use bxcan::filter::Mask32; use cortex_m_rt::entry; use embassy::executor::Executor; use embassy::util::Forever; -use embassy_stm32f4::{can, interrupt}; +use embassy_stm32::{can, interrupt}; use stm32f4xx_hal::prelude::*; use stm32f4xx_hal::{can::Can, stm32}; diff --git a/embassy-stm32f4-examples/src/bin/exti.rs b/embassy-stm32-examples/src/bin/exti.rs similarity index 95% rename from embassy-stm32f4-examples/src/bin/exti.rs rename to embassy-stm32-examples/src/bin/exti.rs index 9879de40..6c08e689 100644 --- a/embassy-stm32f4-examples/src/bin/exti.rs +++ b/embassy-stm32-examples/src/bin/exti.rs @@ -13,8 +13,8 @@ use cortex_m_rt::entry; use embassy::executor::Executor; use embassy::traits::gpio::*; use embassy::util::Forever; -use embassy_stm32f4::exti::ExtiPin; -use embassy_stm32f4::interrupt; +use embassy_stm32::exti::ExtiPin; +use embassy_stm32::interrupt; use futures::pin_mut; use stm32f4xx_hal::prelude::*; use stm32f4xx_hal::stm32; diff --git a/embassy-stm32f4-examples/src/bin/hello.rs b/embassy-stm32-examples/src/bin/hello.rs similarity index 100% rename from embassy-stm32f4-examples/src/bin/hello.rs rename to embassy-stm32-examples/src/bin/hello.rs diff --git a/embassy-stm32f4-examples/src/bin/rtc_async.rs b/embassy-stm32-examples/src/bin/rtc_async.rs similarity index 94% rename from embassy-stm32f4-examples/src/bin/rtc_async.rs rename to embassy-stm32-examples/src/bin/rtc_async.rs index f2757294..ea54a2a9 100644 --- a/embassy-stm32f4-examples/src/bin/rtc_async.rs +++ b/embassy-stm32-examples/src/bin/rtc_async.rs @@ -12,8 +12,8 @@ use defmt::panic; use embassy; use embassy::executor::Spawner; use embassy::time::{Duration, Timer}; -use embassy_stm32f4; -use embassy_stm32f4::hal; +use embassy_stm32; +use embassy_stm32::hal; #[embassy::task] async fn run1() { diff --git a/embassy-stm32f4-examples/src/bin/serial.rs b/embassy-stm32-examples/src/bin/serial.rs similarity index 97% rename from embassy-stm32f4-examples/src/bin/serial.rs rename to embassy-stm32-examples/src/bin/serial.rs index 1717cadb..c10f74a3 100644 --- a/embassy-stm32f4-examples/src/bin/serial.rs +++ b/embassy-stm32-examples/src/bin/serial.rs @@ -14,8 +14,8 @@ use cortex_m_rt::entry; use embassy::executor::{Executor, Spawner}; use embassy::traits::uart::{Read, Write}; use embassy::util::Forever; -use embassy_stm32f4::interrupt; -use embassy_stm32f4::serial; +use embassy_stm32::interrupt; +use embassy_stm32::serial; use futures::pin_mut; use stm32f4xx_hal::dma::StreamsTuple; use stm32f4xx_hal::prelude::*; diff --git a/embassy-stm32f4-examples/src/bin/usb_serial.rs b/embassy-stm32-examples/src/bin/usb_serial.rs similarity index 98% rename from embassy-stm32f4-examples/src/bin/usb_serial.rs rename to embassy-stm32-examples/src/bin/usb_serial.rs index 669d187d..7e95f122 100644 --- a/embassy-stm32f4-examples/src/bin/usb_serial.rs +++ b/embassy-stm32-examples/src/bin/usb_serial.rs @@ -17,7 +17,7 @@ use embassy::time::{Duration, Timer}; use embassy::util::Forever; use embassy_extras::usb::usb_serial::UsbSerial; use embassy_extras::usb::Usb; -use embassy_stm32f4::{interrupt, pac, rtc}; +use embassy_stm32::{interrupt, pac, rtc}; use futures::future::{select, Either}; use futures::pin_mut; use stm32f4xx_hal::otg_fs::{UsbBus, USB}; diff --git a/embassy-stm32f4-examples/src/example_common.rs b/embassy-stm32-examples/src/example_common.rs similarity index 100% rename from embassy-stm32f4-examples/src/example_common.rs rename to embassy-stm32-examples/src/example_common.rs diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 28d9e7fe..237eaa01 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -47,4 +47,5 @@ embedded-dma = { version = "0.1.2" } bxcan = "0.5.0" nb = "*" stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git", optional = true } -stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true } \ No newline at end of file +stm32l0xx-hal = { version = "0.7.0", features = ["rt"], optional = true } +futures = { version = "0.3.5", default-features = false, features = ["async-await"] } \ No newline at end of file diff --git a/embassy-stm32/src/f4/mod.rs b/embassy-stm32/src/f4/mod.rs new file mode 100644 index 00000000..a80d640d --- /dev/null +++ b/embassy-stm32/src/f4/mod.rs @@ -0,0 +1,2 @@ +pub mod qei; +pub mod serial; diff --git a/embassy-stm32f4/src/qei.rs b/embassy-stm32/src/f4/qei.rs similarity index 100% rename from embassy-stm32f4/src/qei.rs rename to embassy-stm32/src/f4/qei.rs diff --git a/embassy-stm32f4/src/serial.rs b/embassy-stm32/src/f4/serial.rs similarity index 100% rename from embassy-stm32f4/src/serial.rs rename to embassy-stm32/src/f4/serial.rs diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 3cef287c..a60c3192 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -25,6 +25,25 @@ feature = "stm32f469", feature = "stm32f479", ))] +mod f4; + +#[cfg(any( + feature = "stm32f401", + feature = "stm32f405", + feature = "stm32f407", + feature = "stm32f412", + feature = "stm32f413", + feature = "stm32f415", + feature = "stm32f417", + feature = "stm32f423", + feature = "stm32f427", + feature = "stm32f429", + feature = "stm32f437", + feature = "stm32f439", + feature = "stm32f446", + feature = "stm32f469", + feature = "stm32f479", +))] pub use {stm32f4xx_hal as hal, stm32f4xx_hal::stm32 as pac}; #[cfg(any(feature = "stm32l0x1", feature = "stm32l0x2", feature = "stm32l0x3",))] @@ -58,8 +77,6 @@ pub mod can; feature = "stm32f401", feature = "stm32f405", feature = "stm32f407", - feature = "stm32f410", - feature = "stm32f411", feature = "stm32f412", feature = "stm32f413", feature = "stm32f415", @@ -75,6 +92,25 @@ pub mod can; ))] pub mod rtc; +#[cfg(any( + feature = "stm32f401", + feature = "stm32f405", + feature = "stm32f407", + feature = "stm32f412", + feature = "stm32f413", + feature = "stm32f415", + feature = "stm32f417", + feature = "stm32f423", + feature = "stm32f427", + feature = "stm32f429", + feature = "stm32f437", + feature = "stm32f439", + feature = "stm32f446", + feature = "stm32f469", + feature = "stm32f479", +))] +pub use f4::{qei, serial}; + #[cfg(any( feature = "stm32f401", feature = "stm32f405", diff --git a/embassy-stm32f4-examples/Cargo.toml b/embassy-stm32f4-examples/Cargo.toml deleted file mode 100644 index c6ef9897..00000000 --- a/embassy-stm32f4-examples/Cargo.toml +++ /dev/null @@ -1,55 +0,0 @@ -[package] -authors = ["Dario Nieuwenhuis "] -edition = "2018" -name = "embassy-stm32f4-examples" -version = "0.1.0" - -[features] -default = [ - "defmt-default", -] -defmt-default = [] -defmt-trace = [] -defmt-debug = [] -defmt-info = [] -defmt-warn = [] -defmt-error = [] - -stm32f401 = ["stm32f4xx-hal/stm32f401", "embassy-stm32f4/stm32f401"] -stm32f405 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"] -stm32f407 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"] -stm32f410 = ["stm32f4xx-hal/stm32f410", "embassy-stm32f4/stm32f410"] -stm32f411 = ["stm32f4xx-hal/stm32f411", "embassy-stm32f4/stm32f411"] -stm32f412 = ["stm32f4xx-hal/stm32f412", "embassy-stm32f4/stm32f412"] -stm32f413 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"] -stm32f415 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"] -stm32f417 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"] -stm32f423 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"] -stm32f427 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"] -stm32f429 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"] -stm32f437 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"] -stm32f439 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"] -stm32f446 = ["stm32f4xx-hal/stm32f446", "embassy-stm32f4/stm32f446"] -stm32f469 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"] -stm32f479 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"] - - -[dependencies] -embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } -embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } -embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4" } -embassy-stm32 = { version = "*", path = "../embassy-stm32" } -embassy-extras = {version = "0.1.0", path = "../embassy-extras" } - -defmt = "0.2.0" -defmt-rtt = "0.2.0" - -cortex-m = "0.7.1" -cortex-m-rt = "0.6.13" -embedded-hal = { version = "0.2.4" } -panic-probe = "0.1.0" -stm32f4xx-hal = { version = "0.8.3", features = ["rt", "usb_fs"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"} -futures = { version = "0.3.8", default-features = false, features = ["async-await"] } -rtt-target = { version = "0.3", features = ["cortex-m"] } -bxcan = "0.5.0" -usb-device = "0.2.7" diff --git a/embassy-stm32f4/Cargo.toml b/embassy-stm32f4/Cargo.toml deleted file mode 100644 index 8e9b14f0..00000000 --- a/embassy-stm32f4/Cargo.toml +++ /dev/null @@ -1,45 +0,0 @@ -[package] -name = "embassy-stm32f4" -version = "0.1.0" -authors = ["Dario Nieuwenhuis "] -edition = "2018" - -[features] -defmt-trace = [ ] -defmt-debug = [ ] -defmt-info = [ ] -defmt-warn = [ ] -defmt-error = [ ] - -stm32f401 = ["stm32f4xx-hal/stm32f401", "embassy-stm32/stm32f401"] -stm32f405 = ["stm32f4xx-hal/stm32f405", "embassy-stm32/stm32f405"] -stm32f407 = ["stm32f4xx-hal/stm32f407", "embassy-stm32/stm32f407"] -stm32f410 = ["stm32f4xx-hal/stm32f410", "embassy-stm32/stm32f410"] -stm32f411 = ["stm32f4xx-hal/stm32f411", "embassy-stm32/stm32f411"] -stm32f412 = ["stm32f4xx-hal/stm32f412", "embassy-stm32/stm32f412"] -stm32f413 = ["stm32f4xx-hal/stm32f413", "embassy-stm32/stm32f413"] -stm32f415 = ["stm32f4xx-hal/stm32f405", "embassy-stm32/stm32f415"] -stm32f417 = ["stm32f4xx-hal/stm32f407", "embassy-stm32/stm32f417"] -stm32f423 = ["stm32f4xx-hal/stm32f413", "embassy-stm32/stm32f423"] -stm32f427 = ["stm32f4xx-hal/stm32f427", "embassy-stm32/stm32f427"] -stm32f429 = ["stm32f4xx-hal/stm32f429", "embassy-stm32/stm32f429"] -stm32f437 = ["stm32f4xx-hal/stm32f427", "embassy-stm32/stm32f437"] -stm32f439 = ["stm32f4xx-hal/stm32f429", "embassy-stm32/stm32f439"] -stm32f446 = ["stm32f4xx-hal/stm32f446", "embassy-stm32/stm32f446"] -stm32f469 = ["stm32f4xx-hal/stm32f469", "embassy-stm32/stm32f469"] -stm32f479 = ["stm32f4xx-hal/stm32f469", "embassy-stm32/stm32f479"] - -[dependencies] -embassy = { version = "0.1.0", path = "../embassy" } -embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" } - -defmt = { version = "0.2.0", optional = true } -log = { version = "0.4.11", optional = true } -cortex-m-rt = "0.6.13" -cortex-m = "0.7.1" -futures = { version = "0.3.5", default-features = false, features = ["async-await"] } -embedded-hal = { version = "0.2.4" } -embedded-dma = { version = "0.1.2" } -stm32f4xx-hal = { version = "0.8.3", features = ["rt", "can"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"} -bxcan = "0.5.0" -nb = "*" diff --git a/embassy-stm32f4/src/lib.rs b/embassy-stm32f4/src/lib.rs deleted file mode 100644 index eb6f04f8..00000000 --- a/embassy-stm32f4/src/lib.rs +++ /dev/null @@ -1,317 +0,0 @@ -#![no_std] -#![feature(generic_associated_types)] -#![feature(asm)] -#![feature(min_type_alias_impl_trait)] -#![feature(impl_trait_in_bindings)] -#![feature(type_alias_impl_trait)] -#![allow(incomplete_features)] - -#[cfg(not(any( - feature = "stm32f401", - feature = "stm32f405", - feature = "stm32f407", - feature = "stm32f410", - feature = "stm32f411", - feature = "stm32f412", - feature = "stm32f413", - feature = "stm32f415", - feature = "stm32f417", - feature = "stm32f423", - feature = "stm32f427", - feature = "stm32f429", - feature = "stm32f437", - feature = "stm32f439", - feature = "stm32f446", - feature = "stm32f469", - feature = "stm32f479", -)))] -compile_error!( - "No chip feature activated. You must activate exactly one of the following features: " -); - -#[cfg(any( - all(feature = "stm32f401", feature = "stm32f405"), - all(feature = "stm32f401", feature = "stm32f407"), - all(feature = "stm32f401", feature = "stm32f410"), - all(feature = "stm32f401", feature = "stm32f411"), - all(feature = "stm32f401", feature = "stm32f412"), - all(feature = "stm32f401", feature = "stm32f413"), - all(feature = "stm32f401", feature = "stm32f415"), - all(feature = "stm32f401", feature = "stm32f417"), - all(feature = "stm32f401", feature = "stm32f423"), - all(feature = "stm32f401", feature = "stm32f427"), - all(feature = "stm32f401", feature = "stm32f429"), - all(feature = "stm32f401", feature = "stm32f437"), - all(feature = "stm32f401", feature = "stm32f439"), - all(feature = "stm32f401", feature = "stm32f446"), - all(feature = "stm32f401", feature = "stm32f469"), - all(feature = "stm32f401", feature = "stm32f479"), - all(feature = "stm32f405", feature = "stm32f401"), - all(feature = "stm32f405", feature = "stm32f407"), - all(feature = "stm32f405", feature = "stm32f410"), - all(feature = "stm32f405", feature = "stm32f411"), - all(feature = "stm32f405", feature = "stm32f412"), - all(feature = "stm32f405", feature = "stm32f413"), - all(feature = "stm32f405", feature = "stm32f415"), - all(feature = "stm32f405", feature = "stm32f417"), - all(feature = "stm32f405", feature = "stm32f423"), - all(feature = "stm32f405", feature = "stm32f427"), - all(feature = "stm32f405", feature = "stm32f429"), - all(feature = "stm32f405", feature = "stm32f437"), - all(feature = "stm32f405", feature = "stm32f439"), - all(feature = "stm32f405", feature = "stm32f446"), - all(feature = "stm32f405", feature = "stm32f469"), - all(feature = "stm32f405", feature = "stm32f479"), - all(feature = "stm32f407", feature = "stm32f401"), - all(feature = "stm32f407", feature = "stm32f405"), - all(feature = "stm32f407", feature = "stm32f410"), - all(feature = "stm32f407", feature = "stm32f411"), - all(feature = "stm32f407", feature = "stm32f412"), - all(feature = "stm32f407", feature = "stm32f413"), - all(feature = "stm32f407", feature = "stm32f415"), - all(feature = "stm32f407", feature = "stm32f417"), - all(feature = "stm32f407", feature = "stm32f423"), - all(feature = "stm32f407", feature = "stm32f427"), - all(feature = "stm32f407", feature = "stm32f429"), - all(feature = "stm32f407", feature = "stm32f437"), - all(feature = "stm32f407", feature = "stm32f439"), - all(feature = "stm32f407", feature = "stm32f446"), - all(feature = "stm32f407", feature = "stm32f469"), - all(feature = "stm32f407", feature = "stm32f479"), - all(feature = "stm32f410", feature = "stm32f401"), - all(feature = "stm32f410", feature = "stm32f405"), - all(feature = "stm32f410", feature = "stm32f407"), - all(feature = "stm32f410", feature = "stm32f411"), - all(feature = "stm32f410", feature = "stm32f412"), - all(feature = "stm32f410", feature = "stm32f413"), - all(feature = "stm32f410", feature = "stm32f415"), - all(feature = "stm32f410", feature = "stm32f417"), - all(feature = "stm32f410", feature = "stm32f423"), - all(feature = "stm32f410", feature = "stm32f427"), - all(feature = "stm32f410", feature = "stm32f429"), - all(feature = "stm32f410", feature = "stm32f437"), - all(feature = "stm32f410", feature = "stm32f439"), - all(feature = "stm32f410", feature = "stm32f446"), - all(feature = "stm32f410", feature = "stm32f469"), - all(feature = "stm32f410", feature = "stm32f479"), - all(feature = "stm32f411", feature = "stm32f401"), - all(feature = "stm32f411", feature = "stm32f405"), - all(feature = "stm32f411", feature = "stm32f407"), - all(feature = "stm32f411", feature = "stm32f410"), - all(feature = "stm32f411", feature = "stm32f412"), - all(feature = "stm32f411", feature = "stm32f413"), - all(feature = "stm32f411", feature = "stm32f415"), - all(feature = "stm32f411", feature = "stm32f417"), - all(feature = "stm32f411", feature = "stm32f423"), - all(feature = "stm32f411", feature = "stm32f427"), - all(feature = "stm32f411", feature = "stm32f429"), - all(feature = "stm32f411", feature = "stm32f437"), - all(feature = "stm32f411", feature = "stm32f439"), - all(feature = "stm32f411", feature = "stm32f446"), - all(feature = "stm32f411", feature = "stm32f469"), - all(feature = "stm32f411", feature = "stm32f479"), - all(feature = "stm32f412", feature = "stm32f401"), - all(feature = "stm32f412", feature = "stm32f405"), - all(feature = "stm32f412", feature = "stm32f407"), - all(feature = "stm32f412", feature = "stm32f410"), - all(feature = "stm32f412", feature = "stm32f411"), - all(feature = "stm32f412", feature = "stm32f413"), - all(feature = "stm32f412", feature = "stm32f415"), - all(feature = "stm32f412", feature = "stm32f417"), - all(feature = "stm32f412", feature = "stm32f423"), - all(feature = "stm32f412", feature = "stm32f427"), - all(feature = "stm32f412", feature = "stm32f429"), - all(feature = "stm32f412", feature = "stm32f437"), - all(feature = "stm32f412", feature = "stm32f439"), - all(feature = "stm32f412", feature = "stm32f446"), - all(feature = "stm32f412", feature = "stm32f469"), - all(feature = "stm32f412", feature = "stm32f479"), - all(feature = "stm32f413", feature = "stm32f401"), - all(feature = "stm32f413", feature = "stm32f405"), - all(feature = "stm32f413", feature = "stm32f407"), - all(feature = "stm32f413", feature = "stm32f410"), - all(feature = "stm32f413", feature = "stm32f411"), - all(feature = "stm32f413", feature = "stm32f412"), - all(feature = "stm32f413", feature = "stm32f415"), - all(feature = "stm32f413", feature = "stm32f417"), - all(feature = "stm32f413", feature = "stm32f423"), - all(feature = "stm32f413", feature = "stm32f427"), - all(feature = "stm32f413", feature = "stm32f429"), - all(feature = "stm32f413", feature = "stm32f437"), - all(feature = "stm32f413", feature = "stm32f439"), - all(feature = "stm32f413", feature = "stm32f446"), - all(feature = "stm32f413", feature = "stm32f469"), - all(feature = "stm32f413", feature = "stm32f479"), - all(feature = "stm32f415", feature = "stm32f401"), - all(feature = "stm32f415", feature = "stm32f405"), - all(feature = "stm32f415", feature = "stm32f407"), - all(feature = "stm32f415", feature = "stm32f410"), - all(feature = "stm32f415", feature = "stm32f411"), - all(feature = "stm32f415", feature = "stm32f412"), - all(feature = "stm32f415", feature = "stm32f413"), - all(feature = "stm32f415", feature = "stm32f417"), - all(feature = "stm32f415", feature = "stm32f423"), - all(feature = "stm32f415", feature = "stm32f427"), - all(feature = "stm32f415", feature = "stm32f429"), - all(feature = "stm32f415", feature = "stm32f437"), - all(feature = "stm32f415", feature = "stm32f439"), - all(feature = "stm32f415", feature = "stm32f446"), - all(feature = "stm32f415", feature = "stm32f469"), - all(feature = "stm32f415", feature = "stm32f479"), - all(feature = "stm32f417", feature = "stm32f401"), - all(feature = "stm32f417", feature = "stm32f405"), - all(feature = "stm32f417", feature = "stm32f407"), - all(feature = "stm32f417", feature = "stm32f410"), - all(feature = "stm32f417", feature = "stm32f411"), - all(feature = "stm32f417", feature = "stm32f412"), - all(feature = "stm32f417", feature = "stm32f413"), - all(feature = "stm32f417", feature = "stm32f415"), - all(feature = "stm32f417", feature = "stm32f423"), - all(feature = "stm32f417", feature = "stm32f427"), - all(feature = "stm32f417", feature = "stm32f429"), - all(feature = "stm32f417", feature = "stm32f437"), - all(feature = "stm32f417", feature = "stm32f439"), - all(feature = "stm32f417", feature = "stm32f446"), - all(feature = "stm32f417", feature = "stm32f469"), - all(feature = "stm32f417", feature = "stm32f479"), - all(feature = "stm32f423", feature = "stm32f401"), - all(feature = "stm32f423", feature = "stm32f405"), - all(feature = "stm32f423", feature = "stm32f407"), - all(feature = "stm32f423", feature = "stm32f410"), - all(feature = "stm32f423", feature = "stm32f411"), - all(feature = "stm32f423", feature = "stm32f412"), - all(feature = "stm32f423", feature = "stm32f413"), - all(feature = "stm32f423", feature = "stm32f415"), - all(feature = "stm32f423", feature = "stm32f417"), - all(feature = "stm32f423", feature = "stm32f427"), - all(feature = "stm32f423", feature = "stm32f429"), - all(feature = "stm32f423", feature = "stm32f437"), - all(feature = "stm32f423", feature = "stm32f439"), - all(feature = "stm32f423", feature = "stm32f446"), - all(feature = "stm32f423", feature = "stm32f469"), - all(feature = "stm32f423", feature = "stm32f479"), - all(feature = "stm32f427", feature = "stm32f401"), - all(feature = "stm32f427", feature = "stm32f405"), - all(feature = "stm32f427", feature = "stm32f407"), - all(feature = "stm32f427", feature = "stm32f410"), - all(feature = "stm32f427", feature = "stm32f411"), - all(feature = "stm32f427", feature = "stm32f412"), - all(feature = "stm32f427", feature = "stm32f413"), - all(feature = "stm32f427", feature = "stm32f415"), - all(feature = "stm32f427", feature = "stm32f417"), - all(feature = "stm32f427", feature = "stm32f423"), - all(feature = "stm32f427", feature = "stm32f429"), - all(feature = "stm32f427", feature = "stm32f437"), - all(feature = "stm32f427", feature = "stm32f439"), - all(feature = "stm32f427", feature = "stm32f446"), - all(feature = "stm32f427", feature = "stm32f469"), - all(feature = "stm32f427", feature = "stm32f479"), - all(feature = "stm32f429", feature = "stm32f401"), - all(feature = "stm32f429", feature = "stm32f405"), - all(feature = "stm32f429", feature = "stm32f407"), - all(feature = "stm32f429", feature = "stm32f410"), - all(feature = "stm32f429", feature = "stm32f411"), - all(feature = "stm32f429", feature = "stm32f412"), - all(feature = "stm32f429", feature = "stm32f413"), - all(feature = "stm32f429", feature = "stm32f415"), - all(feature = "stm32f429", feature = "stm32f417"), - all(feature = "stm32f429", feature = "stm32f423"), - all(feature = "stm32f429", feature = "stm32f427"), - all(feature = "stm32f429", feature = "stm32f437"), - all(feature = "stm32f429", feature = "stm32f439"), - all(feature = "stm32f429", feature = "stm32f446"), - all(feature = "stm32f429", feature = "stm32f469"), - all(feature = "stm32f429", feature = "stm32f479"), - all(feature = "stm32f437", feature = "stm32f401"), - all(feature = "stm32f437", feature = "stm32f405"), - all(feature = "stm32f437", feature = "stm32f407"), - all(feature = "stm32f437", feature = "stm32f410"), - all(feature = "stm32f437", feature = "stm32f411"), - all(feature = "stm32f437", feature = "stm32f412"), - all(feature = "stm32f437", feature = "stm32f413"), - all(feature = "stm32f437", feature = "stm32f415"), - all(feature = "stm32f437", feature = "stm32f417"), - all(feature = "stm32f437", feature = "stm32f423"), - all(feature = "stm32f437", feature = "stm32f427"), - all(feature = "stm32f437", feature = "stm32f429"), - all(feature = "stm32f437", feature = "stm32f439"), - all(feature = "stm32f437", feature = "stm32f446"), - all(feature = "stm32f437", feature = "stm32f469"), - all(feature = "stm32f437", feature = "stm32f479"), - all(feature = "stm32f439", feature = "stm32f401"), - all(feature = "stm32f439", feature = "stm32f405"), - all(feature = "stm32f439", feature = "stm32f407"), - all(feature = "stm32f439", feature = "stm32f410"), - all(feature = "stm32f439", feature = "stm32f411"), - all(feature = "stm32f439", feature = "stm32f412"), - all(feature = "stm32f439", feature = "stm32f413"), - all(feature = "stm32f439", feature = "stm32f415"), - all(feature = "stm32f439", feature = "stm32f417"), - all(feature = "stm32f439", feature = "stm32f423"), - all(feature = "stm32f439", feature = "stm32f427"), - all(feature = "stm32f439", feature = "stm32f429"), - all(feature = "stm32f439", feature = "stm32f437"), - all(feature = "stm32f439", feature = "stm32f446"), - all(feature = "stm32f439", feature = "stm32f469"), - all(feature = "stm32f439", feature = "stm32f479"), - all(feature = "stm32f446", feature = "stm32f401"), - all(feature = "stm32f446", feature = "stm32f405"), - all(feature = "stm32f446", feature = "stm32f407"), - all(feature = "stm32f446", feature = "stm32f410"), - all(feature = "stm32f446", feature = "stm32f411"), - all(feature = "stm32f446", feature = "stm32f412"), - all(feature = "stm32f446", feature = "stm32f413"), - all(feature = "stm32f446", feature = "stm32f415"), - all(feature = "stm32f446", feature = "stm32f417"), - all(feature = "stm32f446", feature = "stm32f423"), - all(feature = "stm32f446", feature = "stm32f427"), - all(feature = "stm32f446", feature = "stm32f429"), - all(feature = "stm32f446", feature = "stm32f437"), - all(feature = "stm32f446", feature = "stm32f439"), - all(feature = "stm32f446", feature = "stm32f469"), - all(feature = "stm32f446", feature = "stm32f479"), - all(feature = "stm32f469", feature = "stm32f401"), - all(feature = "stm32f469", feature = "stm32f405"), - all(feature = "stm32f469", feature = "stm32f407"), - all(feature = "stm32f469", feature = "stm32f410"), - all(feature = "stm32f469", feature = "stm32f411"), - all(feature = "stm32f469", feature = "stm32f412"), - all(feature = "stm32f469", feature = "stm32f413"), - all(feature = "stm32f469", feature = "stm32f415"), - all(feature = "stm32f469", feature = "stm32f417"), - all(feature = "stm32f469", feature = "stm32f423"), - all(feature = "stm32f469", feature = "stm32f427"), - all(feature = "stm32f469", feature = "stm32f429"), - all(feature = "stm32f469", feature = "stm32f437"), - all(feature = "stm32f469", feature = "stm32f439"), - all(feature = "stm32f469", feature = "stm32f446"), - all(feature = "stm32f469", feature = "stm32f479"), - all(feature = "stm32f479", feature = "stm32f401"), - all(feature = "stm32f479", feature = "stm32f405"), - all(feature = "stm32f479", feature = "stm32f407"), - all(feature = "stm32f479", feature = "stm32f410"), - all(feature = "stm32f479", feature = "stm32f411"), - all(feature = "stm32f479", feature = "stm32f412"), - all(feature = "stm32f479", feature = "stm32f413"), - all(feature = "stm32f479", feature = "stm32f415"), - all(feature = "stm32f479", feature = "stm32f417"), - all(feature = "stm32f479", feature = "stm32f423"), - all(feature = "stm32f479", feature = "stm32f427"), - all(feature = "stm32f479", feature = "stm32f429"), - all(feature = "stm32f479", feature = "stm32f437"), - all(feature = "stm32f479", feature = "stm32f439"), - all(feature = "stm32f479", feature = "stm32f446"), - all(feature = "stm32f479", feature = "stm32f469"), -))] -compile_error!( - "Multile chip features activated. You must activate exactly one of the following features: " -); - -pub use embassy_stm32::{exti, fmt, hal, interrupt, pac, rtc}; - -#[cfg(not(any(feature = "stm32f401", feature = "stm32f410", feature = "stm32f411",)))] -pub use embassy_stm32::can; - -#[cfg(not(feature = "stm32f410"))] -pub mod qei; -pub mod serial; diff --git a/embassy-stm32l0/Cargo.toml b/embassy-stm32l0/Cargo.toml deleted file mode 100644 index 8926763d..00000000 --- a/embassy-stm32l0/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "embassy-stm32l0" -version = "0.1.0" -authors = ["Michael Beaumont "] -edition = "2018" - -[features] -defmt-trace = [ ] -defmt-debug = [ ] -defmt-info = [ ] -defmt-warn = [ ] -defmt-error = [ ] - -stm32l0x1 = ["stm32l0xx-hal/stm32l0x1", "embassy-stm32/stm32l0x1"] -stm32l0x2 = ["stm32l0xx-hal/stm32l0x2", "embassy-stm32/stm32l0x2"] -stm32l0x3 = ["stm32l0xx-hal/stm32l0x3", "embassy-stm32/stm32l0x3"] - -[dependencies] -embassy = { version = "0.1.0", path = "../embassy" } -embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" } -defmt = { version = "0.2.0", optional = true } -futures = { version = "0.3.5", default-features = false, features = [ "cfg-target-has-atomic", "unstable" ] } -log = { version = "0.4.11", optional = true } -cortex-m-rt = "0.6.13" -cortex-m = "0.7.1" -embedded-hal = { version = "0.2.4" } -embedded-dma = { version = "0.1.2" } -stm32l0xx-hal = { version = "0.7.0", features = ["rt"], git = "https://github.com/stm32-rs/stm32l0xx-hal.git"} diff --git a/embassy-stm32l0/src/lib.rs b/embassy-stm32l0/src/lib.rs deleted file mode 100644 index a684c4e3..00000000 --- a/embassy-stm32l0/src/lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![no_std] -#![feature(generic_associated_types)] -#![feature(asm)] -#![feature(type_alias_impl_trait)] -#![feature(min_type_alias_impl_trait)] -#![allow(incomplete_features)] - -#[cfg(not(any(feature = "stm32l0x1", feature = "stm32l0x2", feature = "stm32l0x3",)))] -compile_error!( - "No chip feature activated. You must activate exactly one of the following features: " -); - -#[cfg(any( - all(feature = "stm32l0x1", feature = "stm32l0x2"), - all(feature = "stm32l0x1", feature = "stm32l0x3"), - all(feature = "stm32l0x2", feature = "stm32l0x3"), -))] -compile_error!( - "Multile chip features activated. You must activate exactly one of the following features: " -); - -pub use embassy_stm32::{exti, fmt, hal, interrupt, pac}; diff --git a/embassy/src/util/signal.rs b/embassy/src/util/signal.rs index e4629bf9..2fc86906 100644 --- a/embassy/src/util/signal.rs +++ b/embassy/src/util/signal.rs @@ -121,7 +121,7 @@ unsafe impl cortex_m::interrupt::Nr for NrWrap { /// use embassy::traits::*; /// use embassy::util::InterruptFuture; /// use embassy::executor::task; -/// use embassy_stm32f4::interrupt; // Adjust this to your MCU's embassy HAL. +/// use embassy_stm32::interrupt; // Adjust this to your MCU's embassy HAL. /// #[embassy::task] /// async fn demo_interrupt_future() { /// // Using STM32f446 interrupt names, adjust this to your application as necessary.