diff options
80 files changed, 291 insertions, 285 deletions
diff --git a/cyw43/Cargo.toml b/cyw43/Cargo.toml index 855d54b11..59b297e0b 100644 --- a/cyw43/Cargo.toml +++ b/cyw43/Cargo.toml | |||
| @@ -11,7 +11,7 @@ log = ["dep:log"] | |||
| 11 | firmware-logs = [] | 11 | firmware-logs = [] |
| 12 | 12 | ||
| 13 | [dependencies] | 13 | [dependencies] |
| 14 | embassy-time = { version = "0.1.2", path = "../embassy-time"} | 14 | embassy-time = { version = "0.1.3", path = "../embassy-time"} |
| 15 | embassy-sync = { version = "0.2.0", path = "../embassy-sync"} | 15 | embassy-sync = { version = "0.2.0", path = "../embassy-sync"} |
| 16 | embassy-futures = { version = "0.1.0", path = "../embassy-futures"} | 16 | embassy-futures = { version = "0.1.0", path = "../embassy-futures"} |
| 17 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"} | 17 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"} |
| @@ -31,4 +31,4 @@ num_enum = { version = "0.5.7", default-features = false } | |||
| 31 | src_base = "https://github.com/embassy-rs/embassy/blob/cyw43-v$VERSION/cyw43/src/" | 31 | src_base = "https://github.com/embassy-rs/embassy/blob/cyw43-v$VERSION/cyw43/src/" |
| 32 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/cyw43/src/" | 32 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/cyw43/src/" |
| 33 | target = "thumbv6m-none-eabi" | 33 | target = "thumbv6m-none-eabi" |
| 34 | features = ["defmt", "firmware-logs"] \ No newline at end of file | 34 | features = ["defmt", "firmware-logs"] |
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index fd921d277..b311b5912 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -21,7 +21,7 @@ default = ["time"] | |||
| 21 | [dependencies] | 21 | [dependencies] |
| 22 | embassy-futures = { version = "0.1.0", path = "../embassy-futures", optional = true } | 22 | embassy-futures = { version = "0.1.0", path = "../embassy-futures", optional = true } |
| 23 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 23 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 24 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true } | 24 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true } |
| 25 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ | 25 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = [ |
| 26 | "unproven", | 26 | "unproven", |
| 27 | ] } | 27 | ] } |
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index 5bf68fc6b..35944625f 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -59,7 +59,7 @@ rtos-trace = { version = "0.1.2", optional = true } | |||
| 59 | 59 | ||
| 60 | futures-util = { version = "0.3.17", default-features = false } | 60 | futures-util = { version = "0.3.17", default-features = false } |
| 61 | embassy-macros = { version = "0.2.1", path = "../embassy-macros" } | 61 | embassy-macros = { version = "0.2.1", path = "../embassy-macros" } |
| 62 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true} | 62 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true} |
| 63 | atomic-polyfill = "1.0.1" | 63 | atomic-polyfill = "1.0.1" |
| 64 | critical-section = "1.1" | 64 | critical-section = "1.1" |
| 65 | static_cell = "1.1" | 65 | static_cell = "1.1" |
diff --git a/embassy-lora/Cargo.toml b/embassy-lora/Cargo.toml index feea06582..fa445a39e 100644 --- a/embassy-lora/Cargo.toml +++ b/embassy-lora/Cargo.toml | |||
| @@ -20,7 +20,7 @@ defmt = ["dep:defmt", "lorawan-device/defmt"] | |||
| 20 | defmt = { version = "0.3", optional = true } | 20 | defmt = { version = "0.3", optional = true } |
| 21 | log = { version = "0.4.14", optional = true } | 21 | log = { version = "0.4.14", optional = true } |
| 22 | 22 | ||
| 23 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true } | 23 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true } |
| 24 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 24 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 25 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } | 25 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } |
| 26 | embedded-hal-async = { version = "=1.0.0-rc.1" } | 26 | embedded-hal-async = { version = "=1.0.0-rc.1" } |
| @@ -31,4 +31,4 @@ lora-phy = { version = "1" } | |||
| 31 | lorawan-device = { version = "0.10.0", default-features = false, features = ["async"], optional = true } | 31 | lorawan-device = { version = "0.10.0", default-features = false, features = ["async"], optional = true } |
| 32 | 32 | ||
| 33 | [patch.crates-io] | 33 | [patch.crates-io] |
| 34 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} \ No newline at end of file | 34 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} |
diff --git a/embassy-net-enc28j60/Cargo.toml b/embassy-net-enc28j60/Cargo.toml index e02c984e9..161d055c0 100644 --- a/embassy-net-enc28j60/Cargo.toml +++ b/embassy-net-enc28j60/Cargo.toml | |||
| @@ -11,7 +11,7 @@ edition = "2021" | |||
| 11 | embedded-hal = { version = "1.0.0-rc.1" } | 11 | embedded-hal = { version = "1.0.0-rc.1" } |
| 12 | embedded-hal-async = { version = "=1.0.0-rc.1" } | 12 | embedded-hal-async = { version = "=1.0.0-rc.1" } |
| 13 | embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" } | 13 | embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" } |
| 14 | embassy-time = { version = "0.1.2", path = "../embassy-time" } | 14 | embassy-time = { version = "0.1.3", path = "../embassy-time" } |
| 15 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 15 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 16 | 16 | ||
| 17 | defmt = { version = "0.3", optional = true } | 17 | defmt = { version = "0.3", optional = true } |
| @@ -20,4 +20,4 @@ log = { version = "0.4.14", optional = true } | |||
| 20 | [package.metadata.embassy_docs] | 20 | [package.metadata.embassy_docs] |
| 21 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-enc28j60-v$VERSION/embassy-net-enc28j60/src/" | 21 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-enc28j60-v$VERSION/embassy-net-enc28j60/src/" |
| 22 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-enc28j60/src/" | 22 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-enc28j60/src/" |
| 23 | target = "thumbv7em-none-eabi" \ No newline at end of file | 23 | target = "thumbv7em-none-eabi" |
diff --git a/embassy-net-esp-hosted/Cargo.toml b/embassy-net-esp-hosted/Cargo.toml index d334cf3fe..67c869364 100644 --- a/embassy-net-esp-hosted/Cargo.toml +++ b/embassy-net-esp-hosted/Cargo.toml | |||
| @@ -7,7 +7,7 @@ edition = "2021" | |||
| 7 | defmt = { version = "0.3", optional = true } | 7 | defmt = { version = "0.3", optional = true } |
| 8 | log = { version = "0.4.14", optional = true } | 8 | log = { version = "0.4.14", optional = true } |
| 9 | 9 | ||
| 10 | embassy-time = { version = "0.1.2", path = "../embassy-time" } | 10 | embassy-time = { version = "0.1.3", path = "../embassy-time" } |
| 11 | embassy-sync = { version = "0.2.0", path = "../embassy-sync"} | 11 | embassy-sync = { version = "0.2.0", path = "../embassy-sync"} |
| 12 | embassy-futures = { version = "0.1.0", path = "../embassy-futures"} | 12 | embassy-futures = { version = "0.1.0", path = "../embassy-futures"} |
| 13 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"} | 13 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel"} |
| @@ -23,4 +23,4 @@ heapless = "0.7.16" | |||
| 23 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-esp-hosted-v$VERSION/embassy-net-esp-hosted/src/" | 23 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-esp-hosted-v$VERSION/embassy-net-esp-hosted/src/" |
| 24 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-esp-hosted/src/" | 24 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-esp-hosted/src/" |
| 25 | target = "thumbv7em-none-eabi" | 25 | target = "thumbv7em-none-eabi" |
| 26 | features = ["defmt"] \ No newline at end of file | 26 | features = ["defmt"] |
diff --git a/embassy-net-wiznet/Cargo.toml b/embassy-net-wiznet/Cargo.toml index adf0b45fc..afa0d5cd5 100644 --- a/embassy-net-wiznet/Cargo.toml +++ b/embassy-net-wiznet/Cargo.toml | |||
| @@ -11,7 +11,7 @@ edition = "2021" | |||
| 11 | embedded-hal = { version = "1.0.0-rc.1" } | 11 | embedded-hal = { version = "1.0.0-rc.1" } |
| 12 | embedded-hal-async = { version = "=1.0.0-rc.1" } | 12 | embedded-hal-async = { version = "=1.0.0-rc.1" } |
| 13 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel" } | 13 | embassy-net-driver-channel = { version = "0.1.0", path = "../embassy-net-driver-channel" } |
| 14 | embassy-time = { version = "0.1.2", path = "../embassy-time" } | 14 | embassy-time = { version = "0.1.3", path = "../embassy-time" } |
| 15 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 15 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 16 | defmt = { version = "0.3", optional = true } | 16 | defmt = { version = "0.3", optional = true } |
| 17 | 17 | ||
| @@ -19,4 +19,4 @@ defmt = { version = "0.3", optional = true } | |||
| 19 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-wiznet-v$VERSION/embassy-net-wiznet/src/" | 19 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-wiznet-v$VERSION/embassy-net-wiznet/src/" |
| 20 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-wiznet/src/" | 20 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-wiznet/src/" |
| 21 | target = "thumbv7em-none-eabi" | 21 | target = "thumbv7em-none-eabi" |
| 22 | features = ["defmt"] \ No newline at end of file | 22 | features = ["defmt"] |
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index 0361f1db7..c763d41c2 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml | |||
| @@ -51,7 +51,7 @@ smoltcp = { version = "0.10.0", default-features = false, features = [ | |||
| 51 | ] } | 51 | ] } |
| 52 | 52 | ||
| 53 | embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" } | 53 | embassy-net-driver = { version = "0.1.0", path = "../embassy-net-driver" } |
| 54 | embassy-time = { version = "0.1.2", path = "../embassy-time" } | 54 | embassy-time = { version = "0.1.3", path = "../embassy-time" } |
| 55 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 55 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 56 | embedded-io-async = { version = "0.5.0", optional = true } | 56 | embedded-io-async = { version = "0.5.0", optional = true } |
| 57 | 57 | ||
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 67ec4eb93..e7afef26b 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -91,7 +91,7 @@ _dppi = [] | |||
| 91 | _gpio-p1 = [] | 91 | _gpio-p1 = [] |
| 92 | 92 | ||
| 93 | [dependencies] | 93 | [dependencies] |
| 94 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true } | 94 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true } |
| 95 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 95 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 96 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] } | 96 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-3"] } |
| 97 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 97 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 60143c2b9..eebb6e3bc 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -60,7 +60,7 @@ unstable-traits = ["embedded-hal-1", "embedded-hal-nb"] | |||
| 60 | 60 | ||
| 61 | [dependencies] | 61 | [dependencies] |
| 62 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 62 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 63 | embassy-time = { version = "0.1.2", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } | 63 | embassy-time = { version = "0.1.3", path = "../embassy-time", features = [ "tick-hz-1_000_000" ] } |
| 64 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 64 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 65 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] } | 65 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-2"] } |
| 66 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 66 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
diff --git a/embassy-stm32-wpan/Cargo.toml b/embassy-stm32-wpan/Cargo.toml index 96c474845..7a4d3ec66 100644 --- a/embassy-stm32-wpan/Cargo.toml +++ b/embassy-stm32-wpan/Cargo.toml | |||
| @@ -13,7 +13,7 @@ features = ["stm32wb55rg"] | |||
| 13 | [dependencies] | 13 | [dependencies] |
| 14 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" } | 14 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32" } |
| 15 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 15 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 16 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true } | 16 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true } |
| 17 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 17 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 18 | embassy-hal-internal = { version = "0.1.0", path = "../embassy-hal-internal" } | 18 | embassy-hal-internal = { version = "0.1.0", path = "../embassy-hal-internal" } |
| 19 | embassy-embedded-hal = { version = "0.1.0", path = "../embassy-embedded-hal" } | 19 | embassy-embedded-hal = { version = "0.1.0", path = "../embassy-embedded-hal" } |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 150014afe..d169107df 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -32,7 +32,7 @@ flavors = [ | |||
| 32 | 32 | ||
| 33 | [dependencies] | 33 | [dependencies] |
| 34 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } | 34 | embassy-sync = { version = "0.2.0", path = "../embassy-sync" } |
| 35 | embassy-time = { version = "0.1.2", path = "../embassy-time", optional = true } | 35 | embassy-time = { version = "0.1.3", path = "../embassy-time", optional = true } |
| 36 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } | 36 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 37 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] } | 37 | embassy-hal-internal = {version = "0.1.0", path = "../embassy-hal-internal", features = ["cortex-m", "prio-bits-4"] } |
| 38 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 38 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
| @@ -58,7 +58,7 @@ sdio-host = "0.5.0" | |||
| 58 | embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true } | 58 | embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true } |
| 59 | critical-section = "1.1" | 59 | critical-section = "1.1" |
| 60 | atomic-polyfill = "1.0.1" | 60 | atomic-polyfill = "1.0.1" |
| 61 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2b87e34c661e19ff6dc603fabfe7fe99ab7261f7" } | 61 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9a61a1f090462df8bd1751f89951f04934fdceb3" } |
| 62 | vcell = "0.1.3" | 62 | vcell = "0.1.3" |
| 63 | bxcan = "0.7.0" | 63 | bxcan = "0.7.0" |
| 64 | nb = "1.0.0" | 64 | nb = "1.0.0" |
| @@ -77,7 +77,7 @@ critical-section = { version = "1.1", features = ["std"] } | |||
| 77 | [build-dependencies] | 77 | [build-dependencies] |
| 78 | proc-macro2 = "1.0.36" | 78 | proc-macro2 = "1.0.36" |
| 79 | quote = "1.0.15" | 79 | quote = "1.0.15" |
| 80 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2b87e34c661e19ff6dc603fabfe7fe99ab7261f7", default-features = false, features = ["metadata"]} | 80 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9a61a1f090462df8bd1751f89951f04934fdceb3", default-features = false, features = ["metadata"]} |
| 81 | 81 | ||
| 82 | [features] | 82 | [features] |
| 83 | default = ["rt"] | 83 | default = ["rt"] |
diff --git a/embassy-stm32/src/rcc/bd.rs b/embassy-stm32/src/rcc/bd.rs new file mode 100644 index 000000000..0fc116ed8 --- /dev/null +++ b/embassy-stm32/src/rcc/bd.rs | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | #[derive(Copy, Clone, Debug, PartialEq)] | ||
| 2 | #[repr(u8)] | ||
| 3 | #[allow(dead_code)] | ||
| 4 | pub enum RtcClockSource { | ||
| 5 | /// 00: No clock | ||
| 6 | NoClock = 0b00, | ||
| 7 | /// 01: LSE oscillator clock used as RTC clock | ||
| 8 | LSE = 0b01, | ||
| 9 | /// 10: LSI oscillator clock used as RTC clock | ||
| 10 | LSI = 0b10, | ||
| 11 | /// 11: HSE oscillator clock divided by 32 used as RTC clock | ||
| 12 | HSE = 0b11, | ||
| 13 | } | ||
| 14 | |||
| 15 | #[cfg(not(any(rtc_v2l0, rtc_v2l1, stm32c0)))] | ||
| 16 | #[allow(dead_code)] | ||
| 17 | type Bdcr = crate::pac::rcc::regs::Bdcr; | ||
| 18 | |||
| 19 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 20 | #[allow(dead_code)] | ||
| 21 | type Bdcr = crate::pac::rcc::regs::Csr; | ||
| 22 | |||
| 23 | #[allow(dead_code)] | ||
| 24 | pub struct BackupDomain {} | ||
| 25 | |||
| 26 | impl BackupDomain { | ||
| 27 | #[cfg(any( | ||
| 28 | rtc_v2f0, rtc_v2f2, rtc_v2f3, rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l0, rtc_v2l1, rtc_v2l4, rtc_v2wb, rtc_v3, | ||
| 29 | rtc_v3u5 | ||
| 30 | ))] | ||
| 31 | #[allow(dead_code, unused_variables)] | ||
| 32 | fn modify<R>(f: impl FnOnce(&mut Bdcr) -> R) -> R { | ||
| 33 | #[cfg(any(rtc_v2f2, rtc_v2f3, rtc_v2l1))] | ||
| 34 | let cr = crate::pac::PWR.cr(); | ||
| 35 | #[cfg(any(rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l4, rtc_v2wb, rtc_v3, rtc_v3u5))] | ||
| 36 | let cr = crate::pac::PWR.cr1(); | ||
| 37 | |||
| 38 | // TODO: Missing from PAC for l0 and f0? | ||
| 39 | #[cfg(not(any(rtc_v2f0, rtc_v2l0, rtc_v3u5)))] | ||
| 40 | { | ||
| 41 | cr.modify(|w| w.set_dbp(true)); | ||
| 42 | while !cr.read().dbp() {} | ||
| 43 | } | ||
| 44 | |||
| 45 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 46 | let cr = crate::pac::RCC.csr(); | ||
| 47 | |||
| 48 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 49 | let cr = crate::pac::RCC.bdcr(); | ||
| 50 | |||
| 51 | cr.modify(|w| f(w)) | ||
| 52 | } | ||
| 53 | |||
| 54 | #[cfg(any( | ||
| 55 | rtc_v2f0, rtc_v2f2, rtc_v2f3, rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l0, rtc_v2l1, rtc_v2l4, rtc_v2wb, rtc_v3, | ||
| 56 | rtc_v3u5 | ||
| 57 | ))] | ||
| 58 | #[allow(dead_code)] | ||
| 59 | fn read() -> Bdcr { | ||
| 60 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 61 | let r = crate::pac::RCC.csr().read(); | ||
| 62 | |||
| 63 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 64 | let r = crate::pac::RCC.bdcr().read(); | ||
| 65 | |||
| 66 | r | ||
| 67 | } | ||
| 68 | |||
| 69 | #[cfg(any( | ||
| 70 | rtc_v2f0, rtc_v2f2, rtc_v2f3, rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l0, rtc_v2l1, rtc_v2l4, rtc_v2wb, rtc_v3, | ||
| 71 | rtc_v3u5 | ||
| 72 | ))] | ||
| 73 | #[allow(dead_code, unused_variables)] | ||
| 74 | pub fn set_rtc_clock_source(clock_source: RtcClockSource) { | ||
| 75 | let clock_source = clock_source as u8; | ||
| 76 | #[cfg(any( | ||
| 77 | all(not(any(rtc_v3, rtc_v3u5)), not(rtc_v2wb)), | ||
| 78 | all(any(rtc_v3, rtc_v3u5), not(any(rcc_wl5, rcc_wle))) | ||
| 79 | ))] | ||
| 80 | let clock_source = crate::pac::rcc::vals::Rtcsel::from_bits(clock_source); | ||
| 81 | |||
| 82 | #[cfg(not(rtc_v2wb))] | ||
| 83 | Self::modify(|w| { | ||
| 84 | // Select RTC source | ||
| 85 | w.set_rtcsel(clock_source); | ||
| 86 | }); | ||
| 87 | } | ||
| 88 | |||
| 89 | #[cfg(any( | ||
| 90 | rtc_v2f0, rtc_v2f2, rtc_v2f3, rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l0, rtc_v2l1, rtc_v2l4, rtc_v2wb | ||
| 91 | ))] | ||
| 92 | #[allow(dead_code)] | ||
| 93 | pub fn enable_rtc() { | ||
| 94 | let reg = Self::read(); | ||
| 95 | |||
| 96 | #[cfg(any(rtc_v2h7, rtc_v2l4, rtc_v2wb))] | ||
| 97 | assert!(!reg.lsecsson(), "RTC is not compatible with LSE CSS, yet."); | ||
| 98 | |||
| 99 | if !reg.rtcen() { | ||
| 100 | #[cfg(not(any(rtc_v2l0, rtc_v2l1, rtc_v2f2)))] | ||
| 101 | Self::modify(|w| w.set_bdrst(true)); | ||
| 102 | |||
| 103 | Self::modify(|w| { | ||
| 104 | // Reset | ||
| 105 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 106 | w.set_bdrst(false); | ||
| 107 | |||
| 108 | w.set_rtcen(true); | ||
| 109 | w.set_rtcsel(reg.rtcsel()); | ||
| 110 | |||
| 111 | // Restore bcdr | ||
| 112 | #[cfg(any(rtc_v2l4, rtc_v2wb))] | ||
| 113 | w.set_lscosel(reg.lscosel()); | ||
| 114 | #[cfg(any(rtc_v2l4, rtc_v2wb))] | ||
| 115 | w.set_lscoen(reg.lscoen()); | ||
| 116 | |||
| 117 | w.set_lseon(reg.lseon()); | ||
| 118 | |||
| 119 | #[cfg(any(rtc_v2f0, rtc_v2f7, rtc_v2h7, rtc_v2l4, rtc_v2wb))] | ||
| 120 | w.set_lsedrv(reg.lsedrv()); | ||
| 121 | w.set_lsebyp(reg.lsebyp()); | ||
| 122 | }); | ||
| 123 | } | ||
| 124 | } | ||
| 125 | |||
| 126 | #[cfg(any(rtc_v3, rtc_v3u5))] | ||
| 127 | #[allow(dead_code)] | ||
| 128 | pub fn enable_rtc() { | ||
| 129 | let reg = Self::read(); | ||
| 130 | assert!(!reg.lsecsson(), "RTC is not compatible with LSE CSS, yet."); | ||
| 131 | |||
| 132 | if !reg.rtcen() { | ||
| 133 | Self::modify(|w| w.set_bdrst(true)); | ||
| 134 | |||
| 135 | Self::modify(|w| { | ||
| 136 | w.set_bdrst(false); | ||
| 137 | |||
| 138 | w.set_rtcen(true); | ||
| 139 | w.set_rtcsel(reg.rtcsel()); | ||
| 140 | |||
| 141 | // Restore bcdr | ||
| 142 | w.set_lscosel(reg.lscosel()); | ||
| 143 | w.set_lscoen(reg.lscoen()); | ||
| 144 | |||
| 145 | w.set_lseon(reg.lseon()); | ||
| 146 | w.set_lsedrv(reg.lsedrv()); | ||
| 147 | w.set_lsebyp(reg.lsebyp()); | ||
| 148 | }); | ||
| 149 | } | ||
| 150 | } | ||
| 151 | } | ||
diff --git a/embassy-stm32/src/rcc/common.rs b/embassy-stm32/src/rcc/bus.rs index 62736a43a..62736a43a 100644 --- a/embassy-stm32/src/rcc/common.rs +++ b/embassy-stm32/src/rcc/bus.rs | |||
diff --git a/embassy-stm32/src/rcc/c0.rs b/embassy-stm32/src/rcc/c0.rs index 6a9326347..d85790797 100644 --- a/embassy-stm32/src/rcc/c0.rs +++ b/embassy-stm32/src/rcc/c0.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 2 | use crate::pac::flash::vals::Latency; | 2 | use crate::pac::flash::vals::Latency; |
| 3 | use crate::pac::rcc::vals::{Hsidiv, Ppre, Sw}; | 3 | use crate::pac::rcc::vals::{Hsidiv, Ppre, Sw}; |
| 4 | use crate::pac::{FLASH, RCC}; | 4 | use crate::pac::{FLASH, RCC}; |
diff --git a/embassy-stm32/src/rcc/f2.rs b/embassy-stm32/src/rcc/f2.rs index ec4ed99b8..9d9bc59fd 100644 --- a/embassy-stm32/src/rcc/f2.rs +++ b/embassy-stm32/src/rcc/f2.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::convert::TryFrom; | 1 | use core::convert::TryFrom; |
| 2 | use core::ops::{Div, Mul}; | 2 | use core::ops::{Div, Mul}; |
| 3 | 3 | ||
| 4 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 4 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 5 | use crate::pac::flash::vals::Latency; | 5 | use crate::pac::flash::vals::Latency; |
| 6 | use crate::pac::rcc::vals::{Pllp, Pllsrc, Sw}; | 6 | use crate::pac::rcc::vals::{Pllp, Pllsrc, Sw}; |
| 7 | use crate::pac::{FLASH, RCC}; | 7 | use crate::pac::{FLASH, RCC}; |
| @@ -201,7 +201,7 @@ pub struct PLLClocks { | |||
| 201 | pub pll48_freq: Hertz, | 201 | pub pll48_freq: Hertz, |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | pub use super::common::VoltageScale; | 204 | pub use super::bus::VoltageScale; |
| 205 | 205 | ||
| 206 | impl VoltageScale { | 206 | impl VoltageScale { |
| 207 | const fn wait_states(&self, ahb_freq: Hertz) -> Option<Latency> { | 207 | const fn wait_states(&self, ahb_freq: Hertz) -> Option<Latency> { |
diff --git a/embassy-stm32/src/rcc/f3.rs b/embassy-stm32/src/rcc/f3.rs index 321270a70..7480c0393 100644 --- a/embassy-stm32/src/rcc/f3.rs +++ b/embassy-stm32/src/rcc/f3.rs | |||
| @@ -201,9 +201,9 @@ fn calc_pll(config: &Config, Hertz(sysclk): Hertz) -> (Hertz, PllConfig) { | |||
| 201 | // Calculates the Multiplier and the Divisor to arrive at | 201 | // Calculates the Multiplier and the Divisor to arrive at |
| 202 | // the required System clock from PLL source frequency | 202 | // the required System clock from PLL source frequency |
| 203 | let get_mul_div = |sysclk, pllsrcclk| { | 203 | let get_mul_div = |sysclk, pllsrcclk| { |
| 204 | let common_div = gcd(sysclk, pllsrcclk); | 204 | let bus_div = gcd(sysclk, pllsrcclk); |
| 205 | let mut multiplier = sysclk / common_div; | 205 | let mut multiplier = sysclk / bus_div; |
| 206 | let mut divisor = pllsrcclk / common_div; | 206 | let mut divisor = pllsrcclk / bus_div; |
| 207 | // Minimum PLL multiplier is two | 207 | // Minimum PLL multiplier is two |
| 208 | if multiplier == 1 { | 208 | if multiplier == 1 { |
| 209 | multiplier *= 2; | 209 | multiplier *= 2; |
diff --git a/embassy-stm32/src/rcc/f4.rs b/embassy-stm32/src/rcc/f4.rs index ee9cb2897..10d3322aa 100644 --- a/embassy-stm32/src/rcc/f4.rs +++ b/embassy-stm32/src/rcc/f4.rs | |||
| @@ -8,8 +8,8 @@ use crate::gpio::sealed::AFType; | |||
| 8 | use crate::gpio::Speed; | 8 | use crate::gpio::Speed; |
| 9 | use crate::pac::rcc::vals::{Hpre, Ppre, Sw}; | 9 | use crate::pac::rcc::vals::{Hpre, Ppre, Sw}; |
| 10 | use crate::pac::{FLASH, PWR, RCC}; | 10 | use crate::pac::{FLASH, PWR, RCC}; |
| 11 | use crate::rcc::bd::{BackupDomain, RtcClockSource}; | ||
| 11 | use crate::rcc::{set_freqs, Clocks}; | 12 | use crate::rcc::{set_freqs, Clocks}; |
| 12 | use crate::rtc::{Rtc, RtcClockSource}; | ||
| 13 | use crate::time::Hertz; | 13 | use crate::time::Hertz; |
| 14 | use crate::{peripherals, Peripheral}; | 14 | use crate::{peripherals, Peripheral}; |
| 15 | 15 | ||
| @@ -470,7 +470,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | config.rtc.map(|clock_source| { | 472 | config.rtc.map(|clock_source| { |
| 473 | Rtc::set_clock_source(clock_source); | 473 | BackupDomain::set_rtc_clock_source(clock_source); |
| 474 | }); | 474 | }); |
| 475 | 475 | ||
| 476 | let rtc = match config.rtc { | 476 | let rtc = match config.rtc { |
diff --git a/embassy-stm32/src/rcc/g0.rs b/embassy-stm32/src/rcc/g0.rs index bf2d5199e..7fdbcb00c 100644 --- a/embassy-stm32/src/rcc/g0.rs +++ b/embassy-stm32/src/rcc/g0.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 2 | use crate::pac::flash::vals::Latency; | 2 | use crate::pac::flash::vals::Latency; |
| 3 | use crate::pac::rcc::vals::{self, Hsidiv, Ppre, Sw}; | 3 | use crate::pac::rcc::vals::{self, Hsidiv, Ppre, Sw}; |
| 4 | use crate::pac::{FLASH, PWR, RCC}; | 4 | use crate::pac::{FLASH, PWR, RCC}; |
diff --git a/embassy-stm32/src/rcc/g4.rs b/embassy-stm32/src/rcc/g4.rs index dff04023e..3b044cd11 100644 --- a/embassy-stm32/src/rcc/g4.rs +++ b/embassy-stm32/src/rcc/g4.rs | |||
| @@ -2,7 +2,7 @@ use stm32_metapac::flash::vals::Latency; | |||
| 2 | use stm32_metapac::rcc::vals::{Hpre, Pllsrc, Ppre, Sw}; | 2 | use stm32_metapac::rcc::vals::{Hpre, Pllsrc, Ppre, Sw}; |
| 3 | use stm32_metapac::FLASH; | 3 | use stm32_metapac::FLASH; |
| 4 | 4 | ||
| 5 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 5 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 6 | use crate::pac::{PWR, RCC}; | 6 | use crate::pac::{PWR, RCC}; |
| 7 | use crate::rcc::sealed::RccPeripheral; | 7 | use crate::rcc::sealed::RccPeripheral; |
| 8 | use crate::rcc::{set_freqs, Clocks}; | 8 | use crate::rcc::{set_freqs, Clocks}; |
diff --git a/embassy-stm32/src/rcc/h5.rs b/embassy-stm32/src/rcc/h5.rs index 2e72b1931..5741cdf92 100644 --- a/embassy-stm32/src/rcc/h5.rs +++ b/embassy-stm32/src/rcc/h5.rs | |||
| @@ -26,7 +26,7 @@ const VCO_MAX: u32 = 420_000_000; | |||
| 26 | const VCO_WIDE_MIN: u32 = 128_000_000; | 26 | const VCO_WIDE_MIN: u32 = 128_000_000; |
| 27 | const VCO_WIDE_MAX: u32 = 560_000_000; | 27 | const VCO_WIDE_MAX: u32 = 560_000_000; |
| 28 | 28 | ||
| 29 | pub use super::common::{AHBPrescaler, APBPrescaler, VoltageScale}; | 29 | pub use super::bus::{AHBPrescaler, APBPrescaler, VoltageScale}; |
| 30 | 30 | ||
| 31 | pub enum HseMode { | 31 | pub enum HseMode { |
| 32 | /// crystal/ceramic oscillator (HSEBYP=0) | 32 | /// crystal/ceramic oscillator (HSEBYP=0) |
diff --git a/embassy-stm32/src/rcc/h7.rs b/embassy-stm32/src/rcc/h7.rs index 7fb4fb95b..a6e694618 100644 --- a/embassy-stm32/src/rcc/h7.rs +++ b/embassy-stm32/src/rcc/h7.rs | |||
| @@ -24,7 +24,7 @@ pub const HSI48_FREQ: Hertz = Hertz(48_000_000); | |||
| 24 | /// LSI speed | 24 | /// LSI speed |
| 25 | pub const LSI_FREQ: Hertz = Hertz(32_000); | 25 | pub const LSI_FREQ: Hertz = Hertz(32_000); |
| 26 | 26 | ||
| 27 | pub use super::common::VoltageScale; | 27 | pub use super::bus::VoltageScale; |
| 28 | 28 | ||
| 29 | #[derive(Clone, Copy)] | 29 | #[derive(Clone, Copy)] |
| 30 | pub enum AdcClockSource { | 30 | pub enum AdcClockSource { |
diff --git a/embassy-stm32/src/rcc/l0.rs b/embassy-stm32/src/rcc/l0.rs index 46b58ca7c..7f9ab01f1 100644 --- a/embassy-stm32/src/rcc/l0.rs +++ b/embassy-stm32/src/rcc/l0.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 2 | use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw}; | 2 | use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw}; |
| 3 | use crate::pac::RCC; | 3 | use crate::pac::RCC; |
| 4 | #[cfg(crs)] | 4 | #[cfg(crs)] |
diff --git a/embassy-stm32/src/rcc/l1.rs b/embassy-stm32/src/rcc/l1.rs index bdfc5b87a..ed949ea6f 100644 --- a/embassy-stm32/src/rcc/l1.rs +++ b/embassy-stm32/src/rcc/l1.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 2 | use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw}; | 2 | use crate::pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw}; |
| 3 | use crate::pac::{FLASH, RCC}; | 3 | use crate::pac::{FLASH, RCC}; |
| 4 | use crate::rcc::{set_freqs, Clocks}; | 4 | use crate::rcc::{set_freqs, Clocks}; |
diff --git a/embassy-stm32/src/rcc/l4.rs b/embassy-stm32/src/rcc/l4.rs index b34b8caab..c6bccfd26 100644 --- a/embassy-stm32/src/rcc/l4.rs +++ b/embassy-stm32/src/rcc/l4.rs | |||
| @@ -4,13 +4,13 @@ use embassy_hal_internal::into_ref; | |||
| 4 | use stm32_metapac::rcc::regs::Cfgr; | 4 | use stm32_metapac::rcc::regs::Cfgr; |
| 5 | use stm32_metapac::rcc::vals::{Lsedrv, Mcopre, Mcosel}; | 5 | use stm32_metapac::rcc::vals::{Lsedrv, Mcopre, Mcosel}; |
| 6 | 6 | ||
| 7 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 7 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 8 | use crate::gpio::sealed::AFType; | 8 | use crate::gpio::sealed::AFType; |
| 9 | use crate::gpio::Speed; | 9 | use crate::gpio::Speed; |
| 10 | use crate::pac::rcc::vals::{Hpre, Msirange, Pllsrc, Ppre, Sw}; | 10 | use crate::pac::rcc::vals::{Hpre, Msirange, Pllsrc, Ppre, Sw}; |
| 11 | use crate::pac::{FLASH, PWR, RCC}; | 11 | use crate::pac::{FLASH, PWR, RCC}; |
| 12 | use crate::rcc::bd::{BackupDomain, RtcClockSource}; | ||
| 12 | use crate::rcc::{set_freqs, Clocks}; | 13 | use crate::rcc::{set_freqs, Clocks}; |
| 13 | use crate::rtc::{Rtc, RtcClockSource as RCS}; | ||
| 14 | use crate::time::Hertz; | 14 | use crate::time::Hertz; |
| 15 | use crate::{peripherals, Peripheral}; | 15 | use crate::{peripherals, Peripheral}; |
| 16 | 16 | ||
| @@ -254,16 +254,11 @@ impl Default for Config { | |||
| 254 | pllsai1: None, | 254 | pllsai1: None, |
| 255 | #[cfg(not(any(stm32l471, stm32l475, stm32l476, stm32l486)))] | 255 | #[cfg(not(any(stm32l471, stm32l475, stm32l476, stm32l486)))] |
| 256 | hsi48: false, | 256 | hsi48: false, |
| 257 | rtc_mux: RtcClockSource::LSI32, | 257 | rtc_mux: RtcClockSource::LSI, |
| 258 | } | 258 | } |
| 259 | } | 259 | } |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | pub enum RtcClockSource { | ||
| 263 | LSE32, | ||
| 264 | LSI32, | ||
| 265 | } | ||
| 266 | |||
| 267 | pub enum McoClock { | 262 | pub enum McoClock { |
| 268 | DIV1, | 263 | DIV1, |
| 269 | DIV2, | 264 | DIV2, |
| @@ -413,7 +408,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 413 | RCC.apb1enr1().modify(|w| w.set_pwren(true)); | 408 | RCC.apb1enr1().modify(|w| w.set_pwren(true)); |
| 414 | 409 | ||
| 415 | match config.rtc_mux { | 410 | match config.rtc_mux { |
| 416 | RtcClockSource::LSE32 => { | 411 | RtcClockSource::LSE => { |
| 417 | // 1. Unlock the backup domain | 412 | // 1. Unlock the backup domain |
| 418 | PWR.cr1().modify(|w| w.set_dbp(true)); | 413 | PWR.cr1().modify(|w| w.set_dbp(true)); |
| 419 | 414 | ||
| @@ -429,17 +424,18 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 429 | // Wait until LSE is running | 424 | // Wait until LSE is running |
| 430 | while !RCC.bdcr().read().lserdy() {} | 425 | while !RCC.bdcr().read().lserdy() {} |
| 431 | 426 | ||
| 432 | Rtc::set_clock_source(RCS::LSE); | 427 | BackupDomain::set_rtc_clock_source(RtcClockSource::LSE); |
| 433 | } | 428 | } |
| 434 | RtcClockSource::LSI32 => { | 429 | RtcClockSource::LSI => { |
| 435 | // Turn on the internal 32 kHz LSI oscillator | 430 | // Turn on the internal 32 kHz LSI oscillator |
| 436 | RCC.csr().modify(|w| w.set_lsion(true)); | 431 | RCC.csr().modify(|w| w.set_lsion(true)); |
| 437 | 432 | ||
| 438 | // Wait until LSI is running | 433 | // Wait until LSI is running |
| 439 | while !RCC.csr().read().lsirdy() {} | 434 | while !RCC.csr().read().lsirdy() {} |
| 440 | 435 | ||
| 441 | Rtc::set_clock_source(RCS::LSI); | 436 | BackupDomain::set_rtc_clock_source(RtcClockSource::LSI); |
| 442 | } | 437 | } |
| 438 | _ => unreachable!(), | ||
| 443 | } | 439 | } |
| 444 | 440 | ||
| 445 | let (sys_clk, sw) = match config.mux { | 441 | let (sys_clk, sw) = match config.mux { |
| @@ -451,7 +447,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 451 | w.set_msirgsel(true); | 447 | w.set_msirgsel(true); |
| 452 | w.set_msion(true); | 448 | w.set_msion(true); |
| 453 | 449 | ||
| 454 | if let RtcClockSource::LSE32 = config.rtc_mux { | 450 | if let RtcClockSource::LSE = config.rtc_mux { |
| 455 | // If LSE is enabled, enable calibration of MSI | 451 | // If LSE is enabled, enable calibration of MSI |
| 456 | w.set_msipllen(true); | 452 | w.set_msipllen(true); |
| 457 | } else { | 453 | } else { |
diff --git a/embassy-stm32/src/rcc/l5.rs b/embassy-stm32/src/rcc/l5.rs index a85e14889..9e4e0fc75 100644 --- a/embassy-stm32/src/rcc/l5.rs +++ b/embassy-stm32/src/rcc/l5.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use stm32_metapac::PWR; | 1 | use stm32_metapac::PWR; |
| 2 | 2 | ||
| 3 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 3 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 4 | use crate::pac::rcc::vals::{Hpre, Msirange, Pllsrc, Ppre, Sw}; | 4 | use crate::pac::rcc::vals::{Hpre, Msirange, Pllsrc, Ppre, Sw}; |
| 5 | use crate::pac::{FLASH, RCC}; | 5 | use crate::pac::{FLASH, RCC}; |
| 6 | use crate::rcc::{set_freqs, Clocks}; | 6 | use crate::rcc::{set_freqs, Clocks}; |
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index 45a4d880d..9f1b3b663 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | pub mod common; | 3 | pub(crate) mod bd; |
| 4 | 4 | pub mod bus; | |
| 5 | use core::mem::MaybeUninit; | 5 | use core::mem::MaybeUninit; |
| 6 | 6 | ||
| 7 | pub use crate::rcc::bd::RtcClockSource; | ||
| 7 | use crate::time::Hertz; | 8 | use crate::time::Hertz; |
| 8 | 9 | ||
| 9 | #[cfg_attr(rcc_f0, path = "f0.rs")] | 10 | #[cfg_attr(rcc_f0, path = "f0.rs")] |
diff --git a/embassy-stm32/src/rcc/u5.rs b/embassy-stm32/src/rcc/u5.rs index b5feeb0c4..4aca9cd3d 100644 --- a/embassy-stm32/src/rcc/u5.rs +++ b/embassy-stm32/src/rcc/u5.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use stm32_metapac::rcc::vals::{Msirange, Msirgsel, Pllm, Pllsrc, Sw}; | 1 | use stm32_metapac::rcc::vals::{Msirange, Msirgsel, Pllm, Pllsrc, Sw}; |
| 2 | 2 | ||
| 3 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 3 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 4 | use crate::pac::{FLASH, RCC}; | 4 | use crate::pac::{FLASH, RCC}; |
| 5 | use crate::rcc::{set_freqs, Clocks}; | 5 | use crate::rcc::{set_freqs, Clocks}; |
| 6 | use crate::time::Hertz; | 6 | use crate::time::Hertz; |
| @@ -11,7 +11,7 @@ pub const HSI_FREQ: Hertz = Hertz(16_000_000); | |||
| 11 | /// LSI speed | 11 | /// LSI speed |
| 12 | pub const LSI_FREQ: Hertz = Hertz(32_000); | 12 | pub const LSI_FREQ: Hertz = Hertz(32_000); |
| 13 | 13 | ||
| 14 | pub use super::common::VoltageScale; | 14 | pub use super::bus::VoltageScale; |
| 15 | 15 | ||
| 16 | #[derive(Copy, Clone)] | 16 | #[derive(Copy, Clone)] |
| 17 | pub enum ClockSrc { | 17 | pub enum ClockSrc { |
diff --git a/embassy-stm32/src/rcc/wb.rs b/embassy-stm32/src/rcc/wb.rs index ae708b37f..6a3eab707 100644 --- a/embassy-stm32/src/rcc/wb.rs +++ b/embassy-stm32/src/rcc/wb.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler}; |
| 2 | use crate::rcc::bd::{BackupDomain, RtcClockSource}; | ||
| 2 | use crate::rcc::Clocks; | 3 | use crate::rcc::Clocks; |
| 3 | use crate::rtc::{Rtc, RtcClockSource}; | ||
| 4 | use crate::time::{khz, mhz, Hertz}; | 4 | use crate::time::{khz, mhz, Hertz}; |
| 5 | 5 | ||
| 6 | /// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC, | 6 | /// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC, |
| @@ -375,5 +375,7 @@ pub(crate) fn configure_clocks(config: &Config) { | |||
| 375 | w.set_shdhpre(config.ahb3_pre.into()); | 375 | w.set_shdhpre(config.ahb3_pre.into()); |
| 376 | }); | 376 | }); |
| 377 | 377 | ||
| 378 | config.rtc.map(|clock_source| Rtc::set_clock_source(clock_source)); | 378 | config |
| 379 | .rtc | ||
| 380 | .map(|clock_source| BackupDomain::set_rtc_clock_source(clock_source)); | ||
| 379 | } | 381 | } |
diff --git a/embassy-stm32/src/rcc/wl.rs b/embassy-stm32/src/rcc/wl.rs index f1dd2bd7e..e33690d10 100644 --- a/embassy-stm32/src/rcc/wl.rs +++ b/embassy-stm32/src/rcc/wl.rs | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | pub use super::common::{AHBPrescaler, APBPrescaler, VoltageScale}; | 1 | pub use super::bus::{AHBPrescaler, APBPrescaler, VoltageScale}; |
| 2 | use crate::pac::pwr::vals::Dbp; | ||
| 3 | use crate::pac::{FLASH, PWR, RCC}; | 2 | use crate::pac::{FLASH, PWR, RCC}; |
| 3 | use crate::rcc::bd::{BackupDomain, RtcClockSource}; | ||
| 4 | use crate::rcc::{set_freqs, Clocks}; | 4 | use crate::rcc::{set_freqs, Clocks}; |
| 5 | use crate::rtc::{Rtc, RtcClockSource as RCS}; | ||
| 6 | use crate::time::Hertz; | 5 | use crate::time::Hertz; |
| 7 | 6 | ||
| 8 | /// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC, | 7 | /// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC, |
| @@ -130,16 +129,11 @@ impl Default for Config { | |||
| 130 | apb2_pre: APBPrescaler::NotDivided, | 129 | apb2_pre: APBPrescaler::NotDivided, |
| 131 | enable_lsi: false, | 130 | enable_lsi: false, |
| 132 | enable_rtc_apb: false, | 131 | enable_rtc_apb: false, |
| 133 | rtc_mux: RtcClockSource::LSI32, | 132 | rtc_mux: RtcClockSource::LSI, |
| 134 | } | 133 | } |
| 135 | } | 134 | } |
| 136 | } | 135 | } |
| 137 | 136 | ||
| 138 | pub enum RtcClockSource { | ||
| 139 | LSE32, | ||
| 140 | LSI32, | ||
| 141 | } | ||
| 142 | |||
| 143 | #[repr(u8)] | 137 | #[repr(u8)] |
| 144 | pub enum Lsedrv { | 138 | pub enum Lsedrv { |
| 145 | Low = 0, | 139 | Low = 0, |
| @@ -215,9 +209,9 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 215 | while FLASH.acr().read().latency() != ws {} | 209 | while FLASH.acr().read().latency() != ws {} |
| 216 | 210 | ||
| 217 | match config.rtc_mux { | 211 | match config.rtc_mux { |
| 218 | RtcClockSource::LSE32 => { | 212 | RtcClockSource::LSE => { |
| 219 | // 1. Unlock the backup domain | 213 | // 1. Unlock the backup domain |
| 220 | PWR.cr1().modify(|w| w.set_dbp(Dbp::ENABLED)); | 214 | PWR.cr1().modify(|w| w.set_dbp(true)); |
| 221 | 215 | ||
| 222 | // 2. Setup the LSE | 216 | // 2. Setup the LSE |
| 223 | RCC.bdcr().modify(|w| { | 217 | RCC.bdcr().modify(|w| { |
| @@ -231,17 +225,18 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 231 | // Wait until LSE is running | 225 | // Wait until LSE is running |
| 232 | while !RCC.bdcr().read().lserdy() {} | 226 | while !RCC.bdcr().read().lserdy() {} |
| 233 | 227 | ||
| 234 | Rtc::set_clock_source(RCS::LSE); | 228 | BackupDomain::set_rtc_clock_source(RtcClockSource::LSE); |
| 235 | } | 229 | } |
| 236 | RtcClockSource::LSI32 => { | 230 | RtcClockSource::LSI => { |
| 237 | // Turn on the internal 32 kHz LSI oscillator | 231 | // Turn on the internal 32 kHz LSI oscillator |
| 238 | RCC.csr().modify(|w| w.set_lsion(true)); | 232 | RCC.csr().modify(|w| w.set_lsion(true)); |
| 239 | 233 | ||
| 240 | // Wait until LSI is running | 234 | // Wait until LSI is running |
| 241 | while !RCC.csr().read().lsirdy() {} | 235 | while !RCC.csr().read().lsirdy() {} |
| 242 | 236 | ||
| 243 | Rtc::set_clock_source(RCS::LSI); | 237 | BackupDomain::set_rtc_clock_source(RtcClockSource::LSI); |
| 244 | } | 238 | } |
| 239 | _ => unreachable!(), | ||
| 245 | } | 240 | } |
| 246 | 241 | ||
| 247 | match config.mux { | 242 | match config.mux { |
| @@ -266,7 +261,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 266 | w.set_msirange(range.into()); | 261 | w.set_msirange(range.into()); |
| 267 | w.set_msion(true); | 262 | w.set_msion(true); |
| 268 | 263 | ||
| 269 | if let RtcClockSource::LSE32 = config.rtc_mux { | 264 | if let RtcClockSource::LSE = config.rtc_mux { |
| 270 | // If LSE is enabled, enable calibration of MSI | 265 | // If LSE is enabled, enable calibration of MSI |
| 271 | w.set_msipllen(true); | 266 | w.set_msipllen(true); |
| 272 | } else { | 267 | } else { |
diff --git a/embassy-stm32/src/rtc/datetime.rs b/embassy-stm32/src/rtc/datetime.rs index a9c48d88d..3efe9be5d 100644 --- a/embassy-stm32/src/rtc/datetime.rs +++ b/embassy-stm32/src/rtc/datetime.rs | |||
| @@ -89,7 +89,7 @@ pub enum DayOfWeek { | |||
| 89 | #[cfg(feature = "chrono")] | 89 | #[cfg(feature = "chrono")] |
| 90 | impl From<chrono::Weekday> for DayOfWeek { | 90 | impl From<chrono::Weekday> for DayOfWeek { |
| 91 | fn from(weekday: Weekday) -> Self { | 91 | fn from(weekday: Weekday) -> Self { |
| 92 | day_of_week_from_u8(weekday.number_from_monday() as u8).unwrap() | 92 | day_of_week_from_u8(weekday.num_days_from_monday() as u8).unwrap() |
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | 95 | ||
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs index 1f1abb78d..c408b2d61 100644 --- a/embassy-stm32/src/rtc/mod.rs +++ b/embassy-stm32/src/rtc/mod.rs | |||
| @@ -10,6 +10,8 @@ use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | |||
| 10 | use embassy_sync::blocking_mutex::Mutex; | 10 | use embassy_sync::blocking_mutex::Mutex; |
| 11 | 11 | ||
| 12 | pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError}; | 12 | pub use self::datetime::{DateTime, DayOfWeek, Error as DateTimeError}; |
| 13 | use crate::rcc::bd::BackupDomain; | ||
| 14 | pub use crate::rcc::RtcClockSource; | ||
| 13 | 15 | ||
| 14 | /// refer to AN4759 to compare features of RTC2 and RTC3 | 16 | /// refer to AN4759 to compare features of RTC2 and RTC3 |
| 15 | #[cfg_attr(any(rtc_v1), path = "v1.rs")] | 17 | #[cfg_attr(any(rtc_v1), path = "v1.rs")] |
| @@ -107,19 +109,6 @@ pub struct Rtc { | |||
| 107 | stop_time: Mutex<CriticalSectionRawMutex, Cell<Option<RtcInstant>>>, | 109 | stop_time: Mutex<CriticalSectionRawMutex, Cell<Option<RtcInstant>>>, |
| 108 | } | 110 | } |
| 109 | 111 | ||
| 110 | #[derive(Copy, Clone, Debug, PartialEq)] | ||
| 111 | #[repr(u8)] | ||
| 112 | pub enum RtcClockSource { | ||
| 113 | /// 00: No clock | ||
| 114 | NoClock = 0b00, | ||
| 115 | /// 01: LSE oscillator clock used as RTC clock | ||
| 116 | LSE = 0b01, | ||
| 117 | /// 10: LSI oscillator clock used as RTC clock | ||
| 118 | LSI = 0b10, | ||
| 119 | /// 11: HSE oscillator clock divided by 32 used as RTC clock | ||
| 120 | HSE = 0b11, | ||
| 121 | } | ||
| 122 | |||
| 123 | #[derive(Copy, Clone, PartialEq)] | 112 | #[derive(Copy, Clone, PartialEq)] |
| 124 | pub struct RtcConfig { | 113 | pub struct RtcConfig { |
| 125 | /// Asynchronous prescaler factor | 114 | /// Asynchronous prescaler factor |
| @@ -189,7 +178,7 @@ impl Rtc { | |||
| 189 | stop_time: Mutex::const_new(CriticalSectionRawMutex::new(), Cell::new(None)), | 178 | stop_time: Mutex::const_new(CriticalSectionRawMutex::new(), Cell::new(None)), |
| 190 | }; | 179 | }; |
| 191 | 180 | ||
| 192 | Self::enable(); | 181 | BackupDomain::enable_rtc(); |
| 193 | 182 | ||
| 194 | rtc_struct.configure(rtc_config); | 183 | rtc_struct.configure(rtc_config); |
| 195 | rtc_struct.rtc_config = rtc_config; | 184 | rtc_struct.rtc_config = rtc_config; |
diff --git a/embassy-stm32/src/rtc/v2.rs b/embassy-stm32/src/rtc/v2.rs index bf926f986..1e0ca9b48 100644 --- a/embassy-stm32/src/rtc/v2.rs +++ b/embassy-stm32/src/rtc/v2.rs | |||
| @@ -2,7 +2,7 @@ use stm32_metapac::rtc::vals::{Init, Osel, Pol}; | |||
| 2 | 2 | ||
| 3 | #[cfg(feature = "low-power")] | 3 | #[cfg(feature = "low-power")] |
| 4 | use super::RtcInstant; | 4 | use super::RtcInstant; |
| 5 | use super::{sealed, RtcClockSource, RtcConfig}; | 5 | use super::{sealed, RtcConfig}; |
| 6 | use crate::pac::rtc::Rtc; | 6 | use crate::pac::rtc::Rtc; |
| 7 | use crate::peripherals::RTC; | 7 | use crate::peripherals::RTC; |
| 8 | use crate::rtc::sealed::Instance; | 8 | use crate::rtc::sealed::Instance; |
| @@ -73,22 +73,6 @@ impl WakeupPrescaler { | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | impl super::Rtc { | 75 | impl super::Rtc { |
| 76 | fn unlock_registers() { | ||
| 77 | #[cfg(any(rtc_v2f2, rtc_v2f3, rtc_v2l1))] | ||
| 78 | let cr = crate::pac::PWR.cr(); | ||
| 79 | #[cfg(any(rtc_v2f4, rtc_v2f7, rtc_v2h7, rtc_v2l4, rtc_v2wb))] | ||
| 80 | let cr = crate::pac::PWR.cr1(); | ||
| 81 | |||
| 82 | // TODO: Missing from PAC for l0 and f0? | ||
| 83 | #[cfg(not(any(rtc_v2f0, rtc_v2l0)))] | ||
| 84 | { | ||
| 85 | if !cr.read().dbp() { | ||
| 86 | cr.modify(|w| w.set_dbp(true)); | ||
| 87 | while !cr.read().dbp() {} | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | #[cfg(feature = "low-power")] | 76 | #[cfg(feature = "low-power")] |
| 93 | /// start the wakeup alarm and wtih a duration that is as close to but less than | 77 | /// start the wakeup alarm and wtih a duration that is as close to but less than |
| 94 | /// the requested duration, and record the instant the wakeup alarm was started | 78 | /// the requested duration, and record the instant the wakeup alarm was started |
| @@ -155,69 +139,6 @@ impl super::Rtc { | |||
| 155 | }) | 139 | }) |
| 156 | } | 140 | } |
| 157 | 141 | ||
| 158 | #[allow(dead_code)] | ||
| 159 | pub(crate) fn set_clock_source(clock_source: RtcClockSource) { | ||
| 160 | #[cfg(not(rtc_v2wb))] | ||
| 161 | use stm32_metapac::rcc::vals::Rtcsel; | ||
| 162 | |||
| 163 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 164 | let cr = crate::pac::RCC.bdcr(); | ||
| 165 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 166 | let cr = crate::pac::RCC.csr(); | ||
| 167 | |||
| 168 | Self::unlock_registers(); | ||
| 169 | |||
| 170 | cr.modify(|w| { | ||
| 171 | // Select RTC source | ||
| 172 | #[cfg(not(rtc_v2wb))] | ||
| 173 | w.set_rtcsel(Rtcsel::from_bits(clock_source as u8)); | ||
| 174 | #[cfg(rtc_v2wb)] | ||
| 175 | w.set_rtcsel(clock_source as u8); | ||
| 176 | }); | ||
| 177 | } | ||
| 178 | |||
| 179 | pub(super) fn enable() { | ||
| 180 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 181 | let reg = crate::pac::RCC.bdcr().read(); | ||
| 182 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 183 | let reg = crate::pac::RCC.csr().read(); | ||
| 184 | |||
| 185 | #[cfg(any(rtc_v2h7, rtc_v2l4, rtc_v2wb))] | ||
| 186 | assert!(!reg.lsecsson(), "RTC is not compatible with LSE CSS, yet."); | ||
| 187 | |||
| 188 | if !reg.rtcen() { | ||
| 189 | Self::unlock_registers(); | ||
| 190 | |||
| 191 | #[cfg(not(any(rtc_v2l0, rtc_v2l1, rtc_v2f2)))] | ||
| 192 | crate::pac::RCC.bdcr().modify(|w| w.set_bdrst(true)); | ||
| 193 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 194 | let cr = crate::pac::RCC.bdcr(); | ||
| 195 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | ||
| 196 | let cr = crate::pac::RCC.csr(); | ||
| 197 | |||
| 198 | cr.modify(|w| { | ||
| 199 | // Reset | ||
| 200 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | ||
| 201 | w.set_bdrst(false); | ||
| 202 | |||
| 203 | w.set_rtcen(true); | ||
| 204 | w.set_rtcsel(reg.rtcsel()); | ||
| 205 | |||
| 206 | // Restore bcdr | ||
| 207 | #[cfg(any(rtc_v2l4, rtc_v2wb))] | ||
| 208 | w.set_lscosel(reg.lscosel()); | ||
| 209 | #[cfg(any(rtc_v2l4, rtc_v2wb))] | ||
| 210 | w.set_lscoen(reg.lscoen()); | ||
| 211 | |||
| 212 | w.set_lseon(reg.lseon()); | ||
| 213 | |||
| 214 | #[cfg(any(rtc_v2f0, rtc_v2f7, rtc_v2h7, rtc_v2l4, rtc_v2wb))] | ||
| 215 | w.set_lsedrv(reg.lsedrv()); | ||
| 216 | w.set_lsebyp(reg.lsebyp()); | ||
| 217 | }); | ||
| 218 | } | ||
| 219 | } | ||
| 220 | |||
| 221 | /// Applies the RTC config | 142 | /// Applies the RTC config |
| 222 | /// It this changes the RTC clock source the time will be reset | 143 | /// It this changes the RTC clock source the time will be reset |
| 223 | pub(super) fn configure(&mut self, rtc_config: RtcConfig) { | 144 | pub(super) fn configure(&mut self, rtc_config: RtcConfig) { |
diff --git a/embassy-stm32/src/rtc/v3.rs b/embassy-stm32/src/rtc/v3.rs index 3297303ee..12952b15a 100644 --- a/embassy-stm32/src/rtc/v3.rs +++ b/embassy-stm32/src/rtc/v3.rs | |||
| @@ -1,74 +1,11 @@ | |||
| 1 | use stm32_metapac::rtc::vals::{Calp, Calw16, Calw8, Fmt, Init, Key, Osel, Pol, TampalrmPu, TampalrmType}; | 1 | use stm32_metapac::rtc::vals::{Calp, Calw16, Calw8, Fmt, Init, Key, Osel, Pol, TampalrmPu, TampalrmType}; |
| 2 | 2 | ||
| 3 | use super::{sealed, RtcCalibrationCyclePeriod, RtcClockSource, RtcConfig}; | 3 | use super::{sealed, RtcCalibrationCyclePeriod, RtcConfig}; |
| 4 | use crate::pac::rtc::Rtc; | 4 | use crate::pac::rtc::Rtc; |
| 5 | use crate::peripherals::RTC; | 5 | use crate::peripherals::RTC; |
| 6 | use crate::rtc::sealed::Instance; | 6 | use crate::rtc::sealed::Instance; |
| 7 | 7 | ||
| 8 | impl super::Rtc { | 8 | impl super::Rtc { |
| 9 | fn unlock_registers() { | ||
| 10 | // Unlock the backup domain | ||
| 11 | #[cfg(not(any(rtc_v3u5, rcc_wl5, rcc_wle)))] | ||
| 12 | { | ||
| 13 | if !crate::pac::PWR.cr1().read().dbp() { | ||
| 14 | crate::pac::PWR.cr1().modify(|w| w.set_dbp(true)); | ||
| 15 | while !crate::pac::PWR.cr1().read().dbp() {} | ||
| 16 | } | ||
| 17 | } | ||
| 18 | #[cfg(any(rcc_wl5, rcc_wle))] | ||
| 19 | { | ||
| 20 | use crate::pac::pwr::vals::Dbp; | ||
| 21 | |||
| 22 | if crate::pac::PWR.cr1().read().dbp() != Dbp::ENABLED { | ||
| 23 | crate::pac::PWR.cr1().modify(|w| w.set_dbp(Dbp::ENABLED)); | ||
| 24 | while crate::pac::PWR.cr1().read().dbp() != Dbp::ENABLED {} | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | #[allow(dead_code)] | ||
| 30 | pub(crate) fn set_clock_source(clock_source: RtcClockSource) { | ||
| 31 | let clock_source = clock_source as u8; | ||
| 32 | #[cfg(not(any(rcc_wl5, rcc_wle)))] | ||
| 33 | let clock_source = crate::pac::rcc::vals::Rtcsel::from_bits(clock_source); | ||
| 34 | |||
| 35 | Self::unlock_registers(); | ||
| 36 | |||
| 37 | crate::pac::RCC.bdcr().modify(|w| { | ||
| 38 | // Select RTC source | ||
| 39 | w.set_rtcsel(clock_source); | ||
| 40 | }); | ||
| 41 | } | ||
| 42 | |||
| 43 | pub(super) fn enable() { | ||
| 44 | let bdcr = crate::pac::RCC.bdcr(); | ||
| 45 | |||
| 46 | let reg = bdcr.read(); | ||
| 47 | assert!(!reg.lsecsson(), "RTC is not compatible with LSE CSS, yet."); | ||
| 48 | |||
| 49 | if !reg.rtcen() { | ||
| 50 | Self::unlock_registers(); | ||
| 51 | |||
| 52 | bdcr.modify(|w| w.set_bdrst(true)); | ||
| 53 | |||
| 54 | bdcr.modify(|w| { | ||
| 55 | // Reset | ||
| 56 | w.set_bdrst(false); | ||
| 57 | |||
| 58 | w.set_rtcen(true); | ||
| 59 | w.set_rtcsel(reg.rtcsel()); | ||
| 60 | |||
| 61 | // Restore bcdr | ||
| 62 | w.set_lscosel(reg.lscosel()); | ||
| 63 | w.set_lscoen(reg.lscoen()); | ||
| 64 | |||
| 65 | w.set_lseon(reg.lseon()); | ||
| 66 | w.set_lsedrv(reg.lsedrv()); | ||
| 67 | w.set_lsebyp(reg.lsebyp()); | ||
| 68 | }); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | /// Applies the RTC config | 9 | /// Applies the RTC config |
| 73 | /// It this changes the RTC clock source the time will be reset | 10 | /// It this changes the RTC clock source the time will be reset |
| 74 | pub(super) fn configure(&mut self, rtc_config: RtcConfig) { | 11 | pub(super) fn configure(&mut self, rtc_config: RtcConfig) { |
diff --git a/embassy-time/CHANGELOG.md b/embassy-time/CHANGELOG.md index 26640d930..8bf02dbc1 100644 --- a/embassy-time/CHANGELOG.md +++ b/embassy-time/CHANGELOG.md | |||
| @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. | |||
| 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | 7 | ||
| 8 | ## 0.1.3 - 2023-08-28 | ||
| 9 | |||
| 10 | - Update `embedded-hal-async` to `1.0.0-rc.1` | ||
| 11 | - Update `embedded-hal v1` to `1.0.0-rc.1` | ||
| 12 | |||
| 8 | ## 0.1.2 - 2023-07-05 | 13 | ## 0.1.2 - 2023-07-05 |
| 9 | 14 | ||
| 10 | - Update `embedded-hal-async` to `0.2.0-alpha.2`. | 15 | - Update `embedded-hal-async` to `0.2.0-alpha.2`. |
| @@ -26,4 +31,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 26 | 31 | ||
| 27 | ## 0.1.0 - 2022-08-26 | 32 | ## 0.1.0 - 2022-08-26 |
| 28 | 33 | ||
| 29 | - First release \ No newline at end of file | 34 | - First release |
diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 00d31d30f..03aa6ca2b 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "embassy-time" | 2 | name = "embassy-time" |
| 3 | version = "0.1.2" | 3 | version = "0.1.3" |
| 4 | edition = "2021" | 4 | edition = "2021" |
| 5 | description = "Instant and Duration for embedded no-std systems, with async timer support" | 5 | description = "Instant and Duration for embedded no-std systems, with async timer support" |
| 6 | repository = "https://github.com/embassy-rs/embassy" | 6 | repository = "https://github.com/embassy-rs/embassy" |
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index 46ce7ba9b..49f6eb13c 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly"] } |
| 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly"] } | 11 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly"] } |
| 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = ["nightly"] } | 12 | embassy-boot = { version = "0.1.0", path = "../../../../embassy-boot/boot", features = ["nightly"] } |
| 13 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf", features = ["nightly"] } | 13 | embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf", features = ["nightly"] } |
diff --git a/examples/boot/application/rp/Cargo.toml b/examples/boot/application/rp/Cargo.toml index be85f4437..e9d4fb32e 100644 --- a/examples/boot/application/rp/Cargo.toml +++ b/examples/boot/application/rp/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers", "arch-cortex-m", "executor-thread"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly"] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", "unstable-traits", "nightly"] } | 11 | embassy-rp = { version = "0.1.0", path = "../../../../embassy-rp", features = ["time-driver", "unstable-traits", "nightly"] } |
| 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = ["nightly"] } | 12 | embassy-boot-rp = { version = "0.1.0", path = "../../../../embassy-boot/rp", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index ea8789332..6a6f967b8 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index b39bc2922..55a631e91 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index f015b2cae..ff960f224 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync" } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index f221e1de7..a0f885858 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 2896afa3e..1a251df31 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 50d8967a1..8d1c8af1d 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index 275414391..441b355aa 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../../../embassy-time", features = ["nightly", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } |
| 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } | 12 | embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32", features = ["nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } |
diff --git a/examples/nrf-rtos-trace/Cargo.toml b/examples/nrf-rtos-trace/Cargo.toml index b06722f5c..ed6aca81e 100644 --- a/examples/nrf-rtos-trace/Cargo.toml +++ b/examples/nrf-rtos-trace/Cargo.toml | |||
| @@ -18,7 +18,7 @@ log = [ | |||
| 18 | [dependencies] | 18 | [dependencies] |
| 19 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync" } | 19 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync" } |
| 20 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "rtos-trace", "rtos-trace-interrupt", "integrated-timers"] } | 20 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "rtos-trace", "rtos-trace-interrupt", "integrated-timers"] } |
| 21 | embassy-time = { version = "0.1.2", path = "../../embassy-time" } | 21 | embassy-time = { version = "0.1.3", path = "../../embassy-time" } |
| 22 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 22 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 23 | 23 | ||
| 24 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 24 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
diff --git a/examples/nrf52840-rtic/Cargo.toml b/examples/nrf52840-rtic/Cargo.toml index 715f1ecfe..02a7f98b4 100644 --- a/examples/nrf52840-rtic/Cargo.toml +++ b/examples/nrf52840-rtic/Cargo.toml | |||
| @@ -9,7 +9,7 @@ rtic = { version = "2", features = ["thumbv7-backend"] } | |||
| 9 | 9 | ||
| 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "generic-queue"] } |
| 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } | 13 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nightly", "unstable-traits", "defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index 1b2f1eb11..8b7121ab2 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
| @@ -31,7 +31,7 @@ nightly = [ | |||
| 31 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 31 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 32 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 32 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 33 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 33 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 34 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 34 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 35 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } | 35 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] } |
| 36 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], optional = true } | 36 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet"], optional = true } |
| 37 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt", "msos-descriptor",], optional = true } | 37 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt", "msos-descriptor",], optional = true } |
| @@ -67,4 +67,4 @@ microfft = "0.5.0" | |||
| 67 | debug = 2 | 67 | debug = 2 |
| 68 | 68 | ||
| 69 | [patch.crates-io] | 69 | [patch.crates-io] |
| 70 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} \ No newline at end of file | 70 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} |
diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml index 4968a79aa..e423ad95a 100644 --- a/examples/nrf5340/Cargo.toml +++ b/examples/nrf5340/Cargo.toml | |||
| @@ -14,7 +14,7 @@ embassy-executor = { version = "0.3.0", path = "../../embassy-executor", feature | |||
| 14 | "defmt", | 14 | "defmt", |
| 15 | "integrated-timers", | 15 | "integrated-timers", |
| 16 | ] } | 16 | ] } |
| 17 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = [ | 17 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = [ |
| 18 | "defmt", | 18 | "defmt", |
| 19 | "defmt-timestamp-uptime", | 19 | "defmt-timestamp-uptime", |
| 20 | ] } | 20 | ] } |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index 3efc804ac..3b086133b 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } | 9 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal", features = ["defmt"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime"] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver", "critical-section-impl"] } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
| @@ -57,4 +57,4 @@ rand = { version = "0.8.5", default-features = false } | |||
| 57 | debug = 2 | 57 | debug = 2 |
| 58 | 58 | ||
| 59 | [patch.crates-io] | 59 | [patch.crates-io] |
| 60 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} \ No newline at end of file | 60 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} |
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 7b0d0bda2..ca061d683 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-std", "executor-thread", "log", "nightly", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["log", "std", "nightly"] } | 10 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["log", "std", "nightly"] } |
| 11 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } | 11 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "nightly", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } |
| 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } | 12 | embassy-net-tuntap = { version = "0.1.0", path = "../../embassy-net-tuntap" } |
| 13 | embassy-net-ppp = { version = "0.1.0", path = "../../embassy-net-ppp", features = ["log"]} | 13 | embassy-net-ppp = { version = "0.1.0", path = "../../embassy-net-ppp", features = ["log"]} |
diff --git a/examples/stm32c0/Cargo.toml b/examples/stm32c0/Cargo.toml index 9d188513a..a691be426 100644 --- a/examples/stm32c0/Cargo.toml +++ b/examples/stm32c0/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32c031c6", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
| 15 | defmt-rtt = "0.4" | 15 | defmt-rtt = "0.4" |
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index ca9ab1cf8..894681d0e 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -16,7 +16,7 @@ defmt-rtt = "0.4" | |||
| 16 | panic-probe = "0.3" | 16 | panic-probe = "0.3" |
| 17 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 17 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 18 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 18 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 19 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 19 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 20 | static_cell = { version = "1.1", features = ["nightly"]} | 20 | static_cell = { version = "1.1", features = ["nightly"]} |
| 21 | 21 | ||
| 22 | [profile.release] | 22 | [profile.release] |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index 16796841e..bec7bf659 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any", "unstable-traits" ] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 15 | 15 | ||
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index 54eadd1a9..7cc5747d9 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
| 15 | defmt-rtt = "0.4" | 15 | defmt-rtt = "0.4" |
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 5d8f5f74c..ffacece53 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 15 | 15 | ||
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index ed456c5cb..ca517df70 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } |
| 15 | 15 | ||
diff --git a/examples/stm32f4/src/bin/rtc.rs b/examples/stm32f4/src/bin/rtc.rs index 0eca58203..23ff8ac47 100644 --- a/examples/stm32f4/src/bin/rtc.rs +++ b/examples/stm32f4/src/bin/rtc.rs | |||
| @@ -5,13 +5,17 @@ | |||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 5 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 8 | use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; |
| 9 | use embassy_stm32::Config; | ||
| 9 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 10 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 12 | ||
| 12 | #[embassy_executor::main] | 13 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner) { | 14 | async fn main(_spawner: Spawner) { |
| 14 | let p = embassy_stm32::init(Default::default()); | 15 | let mut config = Config::default(); |
| 16 | config.rcc.rtc = Option::Some(RtcClockSource::LSI); | ||
| 17 | let p = embassy_stm32::init(config); | ||
| 18 | |||
| 15 | info!("Hello World!"); | 19 | info!("Hello World!"); |
| 16 | 20 | ||
| 17 | let now = NaiveDate::from_ymd_opt(2020, 5, 15) | 21 | let now = NaiveDate::from_ymd_opt(2020, 5, 15) |
| @@ -23,8 +27,11 @@ async fn main(_spawner: Spawner) { | |||
| 23 | 27 | ||
| 24 | rtc.set_datetime(now.into()).expect("datetime not set"); | 28 | rtc.set_datetime(now.into()).expect("datetime not set"); |
| 25 | 29 | ||
| 26 | // In reality the delay would be much longer | 30 | loop { |
| 27 | Timer::after(Duration::from_millis(20000)).await; | 31 | let now: NaiveDateTime = rtc.now().unwrap().into(); |
| 32 | |||
| 33 | info!("{}", now.timestamp()); | ||
| 28 | 34 | ||
| 29 | let _then: NaiveDateTime = rtc.now().unwrap().into(); | 35 | Timer::after(Duration::from_millis(1000)).await; |
| 36 | } | ||
| 30 | } | 37 | } |
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index b658a9640..f7a7fb8ca 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f767zi", "memory-x", "unstable-pac", "time-driver-any", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } | 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } |
| 14 | embedded-io-async = { version = "0.5.0" } | 14 | embedded-io-async = { version = "0.5.0" } |
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index 4e88151a5..474c2af80 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
| 15 | defmt-rtt = "0.4" | 15 | defmt-rtt = "0.4" |
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index 7bb05dbc8..0c1cdd67c 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
diff --git a/examples/stm32h5/Cargo.toml b/examples/stm32h5/Cargo.toml index f7a1de63e..d4b7d18c1 100644 --- a/examples/stm32h5/Cargo.toml +++ b/examples/stm32h5/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h563zi", "memory-x", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } | 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } |
| 14 | embedded-io-async = { version = "0.5.0" } | 14 | embedded-io-async = { version = "0.5.0" } |
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index 1ee11b07f..eda04e449 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "unstable-traits"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "time-driver-any", "exti", "memory-x", "unstable-pac", "unstable-traits"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } |
| 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } | 13 | embassy-net = { path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "proto-ipv6"] } |
| 14 | embedded-io-async = { version = "0.5.0" } | 14 | embedded-io-async = { version = "0.5.0" } |
| 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 15 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index d4e0da0bb..d33e03784 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -14,7 +14,7 @@ nightly = ["embassy-stm32/nightly", "embassy-time/nightly", "embassy-time/unstab | |||
| 14 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 14 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 15 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 15 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 16 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 16 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 17 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 17 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 18 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"], optional = true } | 18 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["time", "defmt"], optional = true } |
| 19 | lora-phy = { version = "1", optional = true } | 19 | lora-phy = { version = "1", optional = true } |
| 20 | lorawan-device = { version = "0.10.0", default-features = false, features = ["async", "external-lora-phy"], optional = true } | 20 | lorawan-device = { version = "0.10.0", default-features = false, features = ["async", "external-lora-phy"], optional = true } |
| @@ -39,4 +39,4 @@ static_cell = "1.1" | |||
| 39 | debug = 2 | 39 | debug = 2 |
| 40 | 40 | ||
| 41 | [patch.crates-io] | 41 | [patch.crates-io] |
| 42 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} \ No newline at end of file | 42 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} |
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 192fd3e39..9bf633ce1 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" | |||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
| 12 | 12 | ||
| 13 | defmt = "0.3" | 13 | defmt = "0.3" |
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index e864759b0..92337e712 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "unstable-traits", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5qi", "memory-x", "time-driver-any", "exti", "unstable-traits", "chrono"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", "unstable-traits", "nightly"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768", "unstable-traits", "nightly"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 15 | embassy-net-adin1110 = { version = "0.2.0", path = "../../embassy-net-adin1110" } | 15 | embassy-net-adin1110 = { version = "0.2.0", path = "../../embassy-net-adin1110" } |
diff --git a/examples/stm32l4/src/bin/rtc.rs b/examples/stm32l4/src/bin/rtc.rs index 294ea456c..f3f8aa46f 100644 --- a/examples/stm32l4/src/bin/rtc.rs +++ b/examples/stm32l4/src/bin/rtc.rs | |||
| @@ -23,7 +23,7 @@ async fn main(_spawner: Spawner) { | |||
| 23 | PLLMul::Mul20, | 23 | PLLMul::Mul20, |
| 24 | None, | 24 | None, |
| 25 | ); | 25 | ); |
| 26 | config.rcc.rtc_mux = rcc::RtcClockSource::LSE32; | 26 | config.rcc.rtc_mux = rcc::RtcClockSource::LSE; |
| 27 | embassy_stm32::init(config) | 27 | embassy_stm32::init(config) |
| 28 | }; | 28 | }; |
| 29 | info!("Hello World!"); | 29 | info!("Hello World!"); |
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index baaa9dfad..287521582 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -86,7 +86,7 @@ async fn main(spawner: Spawner) { | |||
| 86 | None, | 86 | None, |
| 87 | ); | 87 | ); |
| 88 | config.rcc.hsi48 = true; // needed for rng | 88 | config.rcc.hsi48 = true; // needed for rng |
| 89 | config.rcc.rtc_mux = rcc::RtcClockSource::LSI32; | 89 | config.rcc.rtc_mux = rcc::RtcClockSource::LSI; |
| 90 | 90 | ||
| 91 | let dp = embassy_stm32::init(config); | 91 | let dp = embassy_stm32::init(config); |
| 92 | 92 | ||
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index b46c25701..d387ee62c 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet"] } |
| 15 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 15 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index f928e7a6c..403e57146 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | 14 | ||
| 15 | defmt = "0.3" | 15 | defmt = "0.3" |
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 16db92c1f..81d9ec695 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -10,7 +10,7 @@ embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [" | |||
| 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } | 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wb55rg"] } |
| 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "udp", "proto-ipv6", "medium-ieee802154", "nightly"], optional=true } |
| 15 | 15 | ||
| 16 | defmt = "0.3" | 16 | defmt = "0.3" |
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 1c771ddce..3ea76cbb0 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" | |||
| 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } | 9 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti", "chrono"] } |
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["nightly", "unstable-traits", "defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 13 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
| 14 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } | 14 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } |
| 15 | lora-phy = { version = "1" } | 15 | lora-phy = { version = "1" } |
| @@ -32,4 +32,4 @@ chrono = { version = "^0.4", default-features = false } | |||
| 32 | debug = 2 | 32 | debug = 2 |
| 33 | 33 | ||
| 34 | [patch.crates-io] | 34 | [patch.crates-io] |
| 35 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} \ No newline at end of file | 35 | lora-phy = { git = "https://github.com/embassy-rs/lora-phy", rev = "1323eccc1c470d4259f95f4f315d1be830d572a3"} |
diff --git a/examples/stm32wl/src/bin/rtc.rs b/examples/stm32wl/src/bin/rtc.rs index fb1bc6e3d..2be6c7b93 100644 --- a/examples/stm32wl/src/bin/rtc.rs +++ b/examples/stm32wl/src/bin/rtc.rs | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | use chrono::{NaiveDate, NaiveDateTime}; | 5 | use chrono::{NaiveDate, NaiveDateTime}; |
| 6 | use defmt::*; | 6 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_stm32::rcc::{self, ClockSrc}; | 8 | use embassy_stm32::rcc::ClockSrc; |
| 9 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 9 | use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; |
| 10 | use embassy_stm32::Config; | 10 | use embassy_stm32::Config; |
| 11 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::{Duration, Timer}; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| @@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) { | |||
| 16 | let p = { | 16 | let p = { |
| 17 | let mut config = Config::default(); | 17 | let mut config = Config::default(); |
| 18 | config.rcc.mux = ClockSrc::HSE32; | 18 | config.rcc.mux = ClockSrc::HSE32; |
| 19 | config.rcc.rtc_mux = rcc::RtcClockSource::LSE32; | 19 | config.rcc.rtc_mux = RtcClockSource::LSE; |
| 20 | config.rcc.enable_rtc_apb = true; | 20 | config.rcc.enable_rtc_apb = true; |
| 21 | embassy_stm32::init(config) | 21 | embassy_stm32::init(config) |
| 22 | }; | 22 | }; |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index 5b206d716..2999dc52f 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -10,7 +10,7 @@ crate-type = ["cdylib"] | |||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } | 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["log"] } |
| 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-wasm", "executor-thread", "log", "nightly", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["log", "wasm", "nightly"] } | 13 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["log", "wasm", "nightly"] } |
| 14 | 14 | ||
| 15 | wasm-logger = "0.2.0" | 15 | wasm-logger = "0.2.0" |
| 16 | wasm-bindgen = "0.2" | 16 | wasm-bindgen = "0.2" |
diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml index 4e31bed59..867bf2727 100644 --- a/tests/nrf/Cargo.toml +++ b/tests/nrf/Cargo.toml | |||
| @@ -10,7 +10,7 @@ teleprobe-meta = "1" | |||
| 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } | 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } |
| 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] } | 12 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits", "defmt-timestamp-uptime"] } | 13 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits", "defmt-timestamp-uptime"] } |
| 14 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nightly", "unstable-traits", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 14 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nightly", "unstable-traits", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 15 | embedded-io-async = { version = "0.5.0" } | 15 | embedded-io-async = { version = "0.5.0" } |
| 16 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } | 16 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] } |
| @@ -25,4 +25,4 @@ defmt-rtt = "0.4" | |||
| 25 | 25 | ||
| 26 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 26 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 27 | cortex-m-rt = "0.7.0" | 27 | cortex-m-rt = "0.7.0" |
| 28 | panic-probe = { version = "0.3", features = ["print-defmt"] } \ No newline at end of file | 28 | panic-probe = { version = "0.3", features = ["print-defmt"] } |
diff --git a/tests/riscv32/Cargo.toml b/tests/riscv32/Cargo.toml index be610b1c5..66ab34ec1 100644 --- a/tests/riscv32/Cargo.toml +++ b/tests/riscv32/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | critical-section = { version = "1.1.1", features = ["restore-state-bool"] } | 8 | critical-section = { version = "1.1.1", features = ["restore-state-bool"] } |
| 9 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync" } | 9 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync" } |
| 10 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-riscv32", "nightly", "executor-thread"] } | 10 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["arch-riscv32", "nightly", "executor-thread"] } |
| 11 | embassy-time = { version = "0.1.2", path = "../../embassy-time" } | 11 | embassy-time = { version = "0.1.3", path = "../../embassy-time" } |
| 12 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 12 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 13 | 13 | ||
| 14 | riscv-rt = "0.11" | 14 | riscv-rt = "0.11" |
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index c494b66ee..d71db8bb7 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml | |||
| @@ -9,7 +9,7 @@ teleprobe-meta = "1.1" | |||
| 9 | 9 | ||
| 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits"] } | 12 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "nightly", "unstable-traits"] } |
| 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "time-driver", "critical-section-impl", "intrinsics", "rom-v2-intrinsics", "run-from-ram"] } | 13 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "time-driver", "critical-section-impl", "intrinsics", "rom-v2-intrinsics", "run-from-ram"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } | 15 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "udp", "dhcpv4", "medium-ethernet"] } |
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index 1f8c7373c..c96b5a5a8 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -31,7 +31,7 @@ teleprobe-meta = "1" | |||
| 31 | 31 | ||
| 32 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 32 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 33 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 33 | embassy-executor = { version = "0.3.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 34 | embassy-time = { version = "0.1.2", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } | 34 | embassy-time = { version = "0.1.3", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } |
| 35 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } | 35 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } |
| 36 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 36 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 37 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg", "ble"] } | 37 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg", "ble"] } |
diff --git a/tests/stm32/src/bin/rtc.rs b/tests/stm32/src/bin/rtc.rs index 7df415b44..1a64dd387 100644 --- a/tests/stm32/src/bin/rtc.rs +++ b/tests/stm32/src/bin/rtc.rs | |||
| @@ -10,7 +10,8 @@ use chrono::{NaiveDate, NaiveDateTime}; | |||
| 10 | use common::*; | 10 | use common::*; |
| 11 | use defmt::assert; | 11 | use defmt::assert; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; | 13 | use embassy_stm32::rcc::RtcClockSource; |
| 14 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 14 | use embassy_time::{Duration, Timer}; | 15 | use embassy_time::{Duration, Timer}; |
| 15 | 16 | ||
| 16 | #[embassy_executor::main] | 17 | #[embassy_executor::main] |
diff --git a/tests/stm32/src/bin/stop.rs b/tests/stm32/src/bin/stop.rs index 4a49bde9d..0b3f4a300 100644 --- a/tests/stm32/src/bin/stop.rs +++ b/tests/stm32/src/bin/stop.rs | |||
| @@ -11,7 +11,8 @@ use common::*; | |||
| 11 | use cortex_m_rt::entry; | 11 | use cortex_m_rt::entry; |
| 12 | use embassy_executor::Spawner; | 12 | use embassy_executor::Spawner; |
| 13 | use embassy_stm32::low_power::{stop_with_rtc, Executor}; | 13 | use embassy_stm32::low_power::{stop_with_rtc, Executor}; |
| 14 | use embassy_stm32::rtc::{Rtc, RtcClockSource, RtcConfig}; | 14 | use embassy_stm32::rcc::RtcClockSource; |
| 15 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | ||
| 15 | use embassy_time::{Duration, Timer}; | 16 | use embassy_time::{Duration, Timer}; |
| 16 | use static_cell::make_static; | 17 | use static_cell::make_static; |
| 17 | 18 | ||
