aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32u0/src/bin/lcd.rs
diff options
context:
space:
mode:
authorDion Dokter <[email protected]>2025-11-20 14:16:43 +0100
committerDion Dokter <[email protected]>2025-11-20 14:16:43 +0100
commitd111eceb4ba0094d34f58a4695bb3d43d188e591 (patch)
tree75f9824731af674208d357c01e4208804cec3ec6 /examples/stm32u0/src/bin/lcd.rs
parent4f2c36e447455e8d33607d586859d3d075cabf1d (diff)
Update LCD to modern embassy
Diffstat (limited to 'examples/stm32u0/src/bin/lcd.rs')
-rw-r--r--examples/stm32u0/src/bin/lcd.rs63
1 files changed, 33 insertions, 30 deletions
diff --git a/examples/stm32u0/src/bin/lcd.rs b/examples/stm32u0/src/bin/lcd.rs
index 5551dd819..f27c4458b 100644
--- a/examples/stm32u0/src/bin/lcd.rs
+++ b/examples/stm32u0/src/bin/lcd.rs
@@ -3,7 +3,10 @@
3 3
4use defmt::*; 4use defmt::*;
5use embassy_executor::Spawner; 5use embassy_executor::Spawner;
6use embassy_stm32::{lcd::{Bias, Config, Duty, Lcd, VoltageSource}, time::Hertz}; 6use embassy_stm32::{
7 lcd::{Bias, Config, Duty, Lcd, LcdPin},
8 time::Hertz,
9};
7use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
8 11
9#[embassy_executor::main] 12#[embassy_executor::main]
@@ -31,41 +34,41 @@ async fn main(_spawner: Spawner) {
31 let mut config = Config::default(); 34 let mut config = Config::default();
32 config.bias = Bias::Third; 35 config.bias = Bias::Third;
33 config.duty = Duty::Quarter; 36 config.duty = Duty::Quarter;
34 config.target_fps = Hertz(60); 37 config.target_fps = Hertz(100);
35 38
36 let mut lcd = Lcd::new( 39 let mut lcd = Lcd::new(
37 p.LCD, 40 p.LCD,
38 config, 41 config,
39 p.PC3, 42 p.PC3,
40 [ 43 [
41 p.PA8.into(), 44 LcdPin::from(p.PA8),
42 p.PA9.into(), 45 LcdPin::from(p.PA9),
43 p.PA10.into(), 46 LcdPin::from(p.PA10),
44 p.PB1.into(), 47 LcdPin::from(p.PB1),
45 p.PB9.into(), 48 LcdPin::from(p.PB9),
46 p.PB11.into(), 49 LcdPin::from(p.PB11),
47 p.PB14.into(), 50 LcdPin::from(p.PB14),
48 p.PB15.into(), 51 LcdPin::from(p.PB15),
49 p.PC4.into(), 52 LcdPin::from(p.PC4),
50 p.PC5.into(), 53 LcdPin::from(p.PC5),
51 p.PC6.into(), 54 LcdPin::from(p.PC6),
52 p.PC8.into(), 55 LcdPin::from(p.PC8),
53 p.PC9.into(), 56 LcdPin::from(p.PC9),
54 p.PC10.into(), 57 LcdPin::from(p.PC10),
55 p.PC11.into(), 58 LcdPin::from(p.PC11),
56 p.PD8.into(), 59 LcdPin::from(p.PD8),
57 p.PD9.into(), 60 LcdPin::from(p.PD9),
58 p.PD12.into(), 61 LcdPin::from(p.PD12),
59 p.PD13.into(), 62 LcdPin::from(p.PD13),
60 p.PD0.into(), 63 LcdPin::from(p.PD0),
61 p.PD1.into(), 64 LcdPin::from(p.PD1),
62 p.PD3.into(), 65 LcdPin::from(p.PD3),
63 p.PD4.into(), 66 LcdPin::from(p.PD4),
64 p.PD5.into(), 67 LcdPin::from(p.PD5),
65 p.PD6.into(), 68 LcdPin::from(p.PD6),
66 p.PE7.into(), 69 LcdPin::from(p.PE7),
67 p.PE8.into(), 70 LcdPin::from(p.PE8),
68 p.PE9.into(), 71 LcdPin::from(p.PE9),
69 ], 72 ],
70 ); 73 );
71 74