From 2649ba2a49fad0c04e3323d17373707f2eb03097 Mon Sep 17 00:00:00 2001 From: Dion Dokter Date: Sat, 22 Nov 2025 14:12:46 +0100 Subject: Update metapack and add all(?) families + v1 support --- embassy-stm32/Cargo.toml | 4 ++-- 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" heapless = "0.9.1" #stm32-metapac = { version = "18" } -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-b77c8d968f53b18d6bdcd052e354b5070ec2bbc2" } +stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-61abfb115273dc66ed99bf14545779a2aa0722c8" } [build-dependencies] #stm32-metapac = { version = "18", default-features = false, features = ["metadata"]} -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-b77c8d968f53b18d6bdcd052e354b5070ec2bbc2", default-features = false, features = ["metadata"] } +stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-61abfb115273dc66ed99bf14545779a2aa0722c8", default-features = false, features = ["metadata"] } proc-macro2 = "1.0.36" 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; #[cfg(any(stm32u0, stm32l073, stm32l083))] const NUM_SEGMENTS: u8 = 52; -#[cfg(stm32wb)] +#[cfg(any(stm32wb, stm32l4x6, stm32l15x, stm32l162, stm32l4x3, stm32l4x6))] const NUM_SEGMENTS: u8 = 44; -#[cfg(any(stm32l053, stm32l063))] +#[cfg(any(stm32l053, stm32l063, stm32l100))] const NUM_SEGMENTS: u8 = 32; /// LCD configuration struct #[non_exhaustive] #[derive(Debug, Clone, Copy)] pub struct Config { + #[cfg(lcd_v2)] /// Enable the voltage output buffer for higher driving capability. /// /// The LCD driving capability is improved as buffers prevent the LCD capacitive loads from loading the resistor @@ -42,6 +43,7 @@ pub struct Config { impl Default for Config { fn default() -> Self { Self { + #[cfg(lcd_v2)] use_voltage_output_buffer: false, use_segment_muxing: false, bias: Default::default(), @@ -249,6 +251,7 @@ impl<'d, T: Instance> Lcd<'d, T> { // Set the control register values T::regs().cr().modify(|w| { + #[cfg(lcd_v2)] w.set_bufen(config.use_voltage_output_buffer); w.set_mux_seg(config.use_segment_muxing); w.set_bias(config.bias as u8); -- cgit