diff options
| author | Dion Dokter <[email protected]> | 2025-11-22 14:12:46 +0100 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2025-11-22 14:12:46 +0100 |
| commit | 2649ba2a49fad0c04e3323d17373707f2eb03097 (patch) | |
| tree | 4aee291b820ea5e9818a647d70069d0174638493 | |
| parent | 992ab2ec63d4ca41045d52f50be487a001023396 (diff) | |
Update metapack and add all(?) families + v1 support
| -rw-r--r-- | embassy-stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/lcd.rs | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 2f4f2ce51..fbd00895d 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -200,11 +200,11 @@ aligned = "0.4.1" | |||
| 200 | heapless = "0.9.1" | 200 | heapless = "0.9.1" |
| 201 | 201 | ||
| 202 | #stm32-metapac = { version = "18" } | 202 | #stm32-metapac = { version = "18" } |
| 203 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-b77c8d968f53b18d6bdcd052e354b5070ec2bbc2" } | 203 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-61abfb115273dc66ed99bf14545779a2aa0722c8" } |
| 204 | 204 | ||
| 205 | [build-dependencies] | 205 | [build-dependencies] |
| 206 | #stm32-metapac = { version = "18", default-features = false, features = ["metadata"]} | 206 | #stm32-metapac = { version = "18", default-features = false, features = ["metadata"]} |
| 207 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-b77c8d968f53b18d6bdcd052e354b5070ec2bbc2", default-features = false, features = ["metadata"] } | 207 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-61abfb115273dc66ed99bf14545779a2aa0722c8", default-features = false, features = ["metadata"] } |
| 208 | 208 | ||
| 209 | proc-macro2 = "1.0.36" | 209 | proc-macro2 = "1.0.36" |
| 210 | quote = "1.0.15" | 210 | quote = "1.0.15" |
diff --git a/embassy-stm32/src/lcd.rs b/embassy-stm32/src/lcd.rs index dc1989168..348865fbd 100644 --- a/embassy-stm32/src/lcd.rs +++ b/embassy-stm32/src/lcd.rs | |||
| @@ -10,15 +10,16 @@ use crate::time::Hertz; | |||
| 10 | 10 | ||
| 11 | #[cfg(any(stm32u0, stm32l073, stm32l083))] | 11 | #[cfg(any(stm32u0, stm32l073, stm32l083))] |
| 12 | const NUM_SEGMENTS: u8 = 52; | 12 | const NUM_SEGMENTS: u8 = 52; |
| 13 | #[cfg(stm32wb)] | 13 | #[cfg(any(stm32wb, stm32l4x6, stm32l15x, stm32l162, stm32l4x3, stm32l4x6))] |
| 14 | const NUM_SEGMENTS: u8 = 44; | 14 | const NUM_SEGMENTS: u8 = 44; |
| 15 | #[cfg(any(stm32l053, stm32l063))] | 15 | #[cfg(any(stm32l053, stm32l063, stm32l100))] |
| 16 | const NUM_SEGMENTS: u8 = 32; | 16 | const NUM_SEGMENTS: u8 = 32; |
| 17 | 17 | ||
| 18 | /// LCD configuration struct | 18 | /// LCD configuration struct |
| 19 | #[non_exhaustive] | 19 | #[non_exhaustive] |
| 20 | #[derive(Debug, Clone, Copy)] | 20 | #[derive(Debug, Clone, Copy)] |
| 21 | pub struct Config { | 21 | pub struct Config { |
| 22 | #[cfg(lcd_v2)] | ||
| 22 | /// Enable the voltage output buffer for higher driving capability. | 23 | /// Enable the voltage output buffer for higher driving capability. |
| 23 | /// | 24 | /// |
| 24 | /// The LCD driving capability is improved as buffers prevent the LCD capacitive loads from loading the resistor | 25 | /// The LCD driving capability is improved as buffers prevent the LCD capacitive loads from loading the resistor |
| @@ -42,6 +43,7 @@ pub struct Config { | |||
| 42 | impl Default for Config { | 43 | impl Default for Config { |
| 43 | fn default() -> Self { | 44 | fn default() -> Self { |
| 44 | Self { | 45 | Self { |
| 46 | #[cfg(lcd_v2)] | ||
| 45 | use_voltage_output_buffer: false, | 47 | use_voltage_output_buffer: false, |
| 46 | use_segment_muxing: false, | 48 | use_segment_muxing: false, |
| 47 | bias: Default::default(), | 49 | bias: Default::default(), |
| @@ -249,6 +251,7 @@ impl<'d, T: Instance> Lcd<'d, T> { | |||
| 249 | 251 | ||
| 250 | // Set the control register values | 252 | // Set the control register values |
| 251 | T::regs().cr().modify(|w| { | 253 | T::regs().cr().modify(|w| { |
| 254 | #[cfg(lcd_v2)] | ||
| 252 | w.set_bufen(config.use_voltage_output_buffer); | 255 | w.set_bufen(config.use_voltage_output_buffer); |
| 253 | w.set_mux_seg(config.use_segment_muxing); | 256 | w.set_mux_seg(config.use_segment_muxing); |
| 254 | w.set_bias(config.bias as u8); | 257 | w.set_bias(config.bias as u8); |
