diff options
| author | Dion Dokter <[email protected]> | 2024-06-14 16:55:05 +0200 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2024-06-14 16:55:05 +0200 |
| commit | f758c4b3910e8cb4d09c284db245e66de8cb5e5e (patch) | |
| tree | 095ac0d4fe20d6205f2dd531569f383e8c72d566 /embassy-stm32/build.rs | |
| parent | 74739997bd70d3c23b5c58d25aa5c9ba4db55f35 (diff) | |
Start implementing lcd
Diffstat (limited to 'embassy-stm32/build.rs')
| -rw-r--r-- | embassy-stm32/build.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 6aedcc228..b7c00f8f7 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -1072,12 +1072,28 @@ fn main() { | |||
| 1072 | (("tsc", "G8_IO2"), quote!(crate::tsc::G8IO2Pin)), | 1072 | (("tsc", "G8_IO2"), quote!(crate::tsc::G8IO2Pin)), |
| 1073 | (("tsc", "G8_IO3"), quote!(crate::tsc::G8IO3Pin)), | 1073 | (("tsc", "G8_IO3"), quote!(crate::tsc::G8IO3Pin)), |
| 1074 | (("tsc", "G8_IO4"), quote!(crate::tsc::G8IO4Pin)), | 1074 | (("tsc", "G8_IO4"), quote!(crate::tsc::G8IO4Pin)), |
| 1075 | (("lcd", "SEG"), quote!(crate::lcd::SegComPin)), | ||
| 1076 | (("lcd", "COM"), quote!(crate::lcd::SegComPin)), | ||
| 1075 | ].into(); | 1077 | ].into(); |
| 1076 | 1078 | ||
| 1079 | let mut seen_lcd_pins = HashSet::new(); | ||
| 1080 | |||
| 1077 | for p in METADATA.peripherals { | 1081 | for p in METADATA.peripherals { |
| 1078 | if let Some(regs) = &p.registers { | 1082 | if let Some(regs) = &p.registers { |
| 1079 | for pin in p.pins { | 1083 | for pin in p.pins { |
| 1080 | let key = (regs.kind, pin.signal); | 1084 | let mut key = (regs.kind, pin.signal); |
| 1085 | |||
| 1086 | // LCD is special | ||
| 1087 | if regs.kind == "lcd" { | ||
| 1088 | key.1 = pin.signal.trim_end_matches(char::is_numeric); | ||
| 1089 | |||
| 1090 | // Some lcd pins have multiple lcd functions | ||
| 1091 | // Dedup so they don't get the trait implemented twice | ||
| 1092 | if !seen_lcd_pins.insert(pin.pin) { | ||
| 1093 | continue; | ||
| 1094 | } | ||
| 1095 | } | ||
| 1096 | |||
| 1081 | if let Some(tr) = signals.get(&key) { | 1097 | if let Some(tr) = signals.get(&key) { |
| 1082 | let mut peri = format_ident!("{}", p.name); | 1098 | let mut peri = format_ident!("{}", p.name); |
| 1083 | 1099 | ||
