Skip to content

Commit ac2dbde

Browse files
committed
special case for n6 ltdc
1 parent b273364 commit ac2dbde

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

stm32-data-gen/src/interrupts.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl ChipInterrupts {
339339
}
340340

341341
for (p, mut ss) in peri_signals.into_iter() {
342-
let known = valid_signals(&p);
342+
let known = valid_signals(&p, chip_name);
343343

344344
// If we have no interrupt_signals for the peri, assume it's "global" so assign it all known ones
345345
if ss.is_empty() {
@@ -496,7 +496,7 @@ fn match_peris(peris: &[String], name: &str) -> Vec<String> {
496496
res
497497
}
498498

499-
fn valid_signals(peri: &str) -> Vec<String> {
499+
fn valid_signals(peri: &str, chip_name: &str) -> Vec<String> {
500500
const IRQ_SIGNALS_MAP: &[(&str, &[&str])] = &[
501501
("CAN", &["TX", "RX0", "RX1", "SCE"]),
502502
("FDCAN", &["IT0", "IT1", "CAL"]),
@@ -516,7 +516,6 @@ fn valid_signals(peri: &str) -> Vec<String> {
516516
("RCC", &["RCC", "CRS"]),
517517
("MDIOS", &["GLOBAL", "WKUP"]),
518518
("ETH", &["GLOBAL", "WKUP"]),
519-
("LTDC", &["GLOBAL", "ER", "LO", "ERR"]),
520519
(
521520
"DFSDM",
522521
&["FLT0", "FLT1", "FLT2", "FLT3", "FLT4", "FLT5", "FLT6", "FLT7"],
@@ -538,6 +537,22 @@ fn valid_signals(peri: &str) -> Vec<String> {
538537
("DCMIPP", &["CSI"]),
539538
];
540539

540+
// Special handling for LTDC based on chip family
541+
if peri.starts_with("LTDC") {
542+
if chip_name.starts_with("STM32N6") {
543+
// STM32N6 variants support all LTDC signals
544+
return vec![
545+
"GLOBAL".to_string(),
546+
"ER".to_string(),
547+
"LO".to_string(),
548+
"ERR".to_string(),
549+
];
550+
} else {
551+
// Other devices only support basic LTDC signals
552+
return vec!["GLOBAL".to_string(), "ER".to_string()];
553+
}
554+
}
555+
541556
for (prefix, signals) in IRQ_SIGNALS_MAP {
542557
if peri.starts_with(prefix) {
543558
return signals.iter().map(ToString::to_string).collect();

0 commit comments

Comments
 (0)