diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-09-11 01:00:23 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-09-11 01:19:46 +0200 |
| commit | c739091085eafeb01703626284428905d75aa98f (patch) | |
| tree | 81f7e1f31eeeafc626c93c41265fce303fead0a7 | |
| parent | d69f68b8c006dc785652a74fbe730583900d1923 (diff) | |
Update stm32-metapac.
| -rw-r--r-- | embassy-stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/adc/mod.rs | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 9a6a5908e..3c6484c96 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -72,7 +72,7 @@ rand_core = "0.6.3" | |||
| 72 | sdio-host = "0.5.0" | 72 | sdio-host = "0.5.0" |
| 73 | critical-section = "1.1" | 73 | critical-section = "1.1" |
| 74 | #stm32-metapac = { version = "15" } | 74 | #stm32-metapac = { version = "15" } |
| 75 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-5ef354f3e49f790e47f5c818f243459742c9b83b" } | 75 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ad00827345b4b758b2453082809d6e3b634b5364" } |
| 76 | 76 | ||
| 77 | vcell = "0.1.3" | 77 | vcell = "0.1.3" |
| 78 | nb = "1.0.0" | 78 | nb = "1.0.0" |
| @@ -99,7 +99,7 @@ proc-macro2 = "1.0.36" | |||
| 99 | quote = "1.0.15" | 99 | quote = "1.0.15" |
| 100 | 100 | ||
| 101 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} | 101 | #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} |
| 102 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-5ef354f3e49f790e47f5c818f243459742c9b83b", default-features = false, features = ["metadata"] } | 102 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ad00827345b4b758b2453082809d6e3b634b5364", default-features = false, features = ["metadata"] } |
| 103 | 103 | ||
| 104 | [features] | 104 | [features] |
| 105 | default = ["rt"] | 105 | default = ["rt"] |
diff --git a/embassy-stm32/src/adc/mod.rs b/embassy-stm32/src/adc/mod.rs index 2ac0c0083..4ab82c1d9 100644 --- a/embassy-stm32/src/adc/mod.rs +++ b/embassy-stm32/src/adc/mod.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #![allow(missing_docs)] // TODO | 4 | #![allow(missing_docs)] // TODO |
| 5 | #![cfg_attr(adc_f3_v2, allow(unused))] | 5 | #![cfg_attr(adc_f3_v2, allow(unused))] |
| 6 | 6 | ||
| 7 | #[cfg(not(adc_f3_v2))] | 7 | #[cfg(not(any(adc_f3_v2, adc_u5)))] |
| 8 | #[cfg_attr(adc_f1, path = "f1.rs")] | 8 | #[cfg_attr(adc_f1, path = "f1.rs")] |
| 9 | #[cfg_attr(adc_f3, path = "f3.rs")] | 9 | #[cfg_attr(adc_f3, path = "f3.rs")] |
| 10 | #[cfg_attr(adc_f3_v1_1, path = "f3_v1_1.rs")] | 10 | #[cfg_attr(adc_f3_v1_1, path = "f3_v1_1.rs")] |
| @@ -19,14 +19,16 @@ mod _version; | |||
| 19 | use core::marker::PhantomData; | 19 | use core::marker::PhantomData; |
| 20 | 20 | ||
| 21 | #[allow(unused)] | 21 | #[allow(unused)] |
| 22 | #[cfg(not(adc_f3_v2))] | 22 | #[cfg(not(any(adc_f3_v2, adc_u5)))] |
| 23 | pub use _version::*; | 23 | pub use _version::*; |
| 24 | #[cfg(any(adc_f1, adc_f3, adc_v1, adc_l0, adc_f3_v1_1))] | 24 | #[cfg(any(adc_f1, adc_f3, adc_v1, adc_l0, adc_f3_v1_1))] |
| 25 | use embassy_sync::waitqueue::AtomicWaker; | 25 | use embassy_sync::waitqueue::AtomicWaker; |
| 26 | 26 | ||
| 27 | #[cfg(not(any(adc_u5)))] | ||
| 27 | pub use crate::pac::adc::vals; | 28 | pub use crate::pac::adc::vals; |
| 28 | #[cfg(not(any(adc_f1, adc_f3_v2)))] | 29 | #[cfg(not(any(adc_f1, adc_f3_v2, adc_u5)))] |
| 29 | pub use crate::pac::adc::vals::Res as Resolution; | 30 | pub use crate::pac::adc::vals::Res as Resolution; |
| 31 | #[cfg(not(any(adc_u5)))] | ||
| 30 | pub use crate::pac::adc::vals::SampleTime; | 32 | pub use crate::pac::adc::vals::SampleTime; |
| 31 | use crate::peripherals; | 33 | use crate::peripherals; |
| 32 | 34 | ||
| @@ -36,7 +38,7 @@ dma_trait!(RxDma, Instance); | |||
| 36 | pub struct Adc<'d, T: Instance> { | 38 | pub struct Adc<'d, T: Instance> { |
| 37 | #[allow(unused)] | 39 | #[allow(unused)] |
| 38 | adc: crate::PeripheralRef<'d, T>, | 40 | adc: crate::PeripheralRef<'d, T>, |
| 39 | #[cfg(not(any(adc_f3_v2, adc_f3_v1_1)))] | 41 | #[cfg(not(any(adc_f3_v2, adc_f3_v1_1, adc_u5)))] |
| 40 | sample_time: SampleTime, | 42 | sample_time: SampleTime, |
| 41 | } | 43 | } |
| 42 | 44 | ||
| @@ -57,7 +59,7 @@ impl State { | |||
| 57 | trait SealedInstance { | 59 | trait SealedInstance { |
| 58 | #[allow(unused)] | 60 | #[allow(unused)] |
| 59 | fn regs() -> crate::pac::adc::Adc; | 61 | fn regs() -> crate::pac::adc::Adc; |
| 60 | #[cfg(not(any(adc_f1, adc_v1, adc_l0, adc_f3_v2, adc_f3_v1_1, adc_g0)))] | 62 | #[cfg(not(any(adc_f1, adc_v1, adc_l0, adc_f3_v2, adc_f3_v1_1, adc_g0, adc_u5)))] |
| 61 | #[allow(unused)] | 63 | #[allow(unused)] |
| 62 | fn common_regs() -> crate::pac::adccommon::AdcCommon; | 64 | fn common_regs() -> crate::pac::adccommon::AdcCommon; |
| 63 | #[cfg(any(adc_f1, adc_f3, adc_v1, adc_l0, adc_f3_v1_1))] | 65 | #[cfg(any(adc_f1, adc_f3, adc_v1, adc_l0, adc_f3_v1_1))] |
| @@ -163,7 +165,7 @@ foreach_adc!( | |||
| 163 | crate::pac::$inst | 165 | crate::pac::$inst |
| 164 | } | 166 | } |
| 165 | 167 | ||
| 166 | #[cfg(not(any(adc_f1, adc_v1, adc_l0, adc_f3_v2, adc_f3_v1_1, adc_g0)))] | 168 | #[cfg(not(any(adc_f1, adc_v1, adc_l0, adc_f3_v2, adc_f3_v1_1, adc_g0, adc_u5)))] |
| 167 | fn common_regs() -> crate::pac::adccommon::AdcCommon { | 169 | fn common_regs() -> crate::pac::adccommon::AdcCommon { |
| 168 | return crate::pac::$common_inst | 170 | return crate::pac::$common_inst |
| 169 | } | 171 | } |
| @@ -200,7 +202,7 @@ macro_rules! impl_adc_pin { | |||
| 200 | /// Get the maximum reading value for this resolution. | 202 | /// Get the maximum reading value for this resolution. |
| 201 | /// | 203 | /// |
| 202 | /// This is `2**n - 1`. | 204 | /// This is `2**n - 1`. |
| 203 | #[cfg(not(any(adc_f1, adc_f3_v2)))] | 205 | #[cfg(not(any(adc_f1, adc_f3_v2, adc_u5)))] |
| 204 | pub const fn resolution_to_max_count(res: Resolution) -> u32 { | 206 | pub const fn resolution_to_max_count(res: Resolution) -> u32 { |
| 205 | match res { | 207 | match res { |
| 206 | #[cfg(adc_v4)] | 208 | #[cfg(adc_v4)] |
