diff options
Diffstat (limited to 'embassy-mspm0/src/int_group/g151x.rs')
| -rw-r--r-- | embassy-mspm0/src/int_group/g151x.rs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/embassy-mspm0/src/int_group/g151x.rs b/embassy-mspm0/src/int_group/g151x.rs new file mode 100644 index 000000000..e785018a7 --- /dev/null +++ b/embassy-mspm0/src/int_group/g151x.rs | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | use crate::pac; | ||
| 2 | use crate::pac::interrupt; | ||
| 3 | |||
| 4 | #[cfg(feature = "rt")] | ||
| 5 | #[interrupt] | ||
| 6 | fn GROUP0() { | ||
| 7 | use mspm0_metapac::Group0; | ||
| 8 | |||
| 9 | let group = pac::CPUSS.int_group(0); | ||
| 10 | |||
| 11 | // Must subtract by 1 since NO_INTR is value 0 | ||
| 12 | let iidx = group.iidx().read().stat().to_bits() - 1; | ||
| 13 | |||
| 14 | let Ok(group) = pac::Group0::try_from(iidx as u8) else { | ||
| 15 | debug!("Invalid IIDX for group 0: {}", iidx); | ||
| 16 | return; | ||
| 17 | }; | ||
| 18 | |||
| 19 | match group { | ||
| 20 | Group0::WWDT0 => todo!("implement WWDT0"), | ||
| 21 | Group0::WWDT1 => todo!("implement WWDT1"), | ||
| 22 | Group0::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 23 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 24 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | #[cfg(feature = "rt")] | ||
| 29 | #[interrupt] | ||
| 30 | fn GROUP1() { | ||
| 31 | use mspm0_metapac::Group1; | ||
| 32 | |||
| 33 | let group = pac::CPUSS.int_group(1); | ||
| 34 | |||
| 35 | // Must subtract by 1 since NO_INTR is value 0 | ||
| 36 | let iidx = group.iidx().read().stat().to_bits() - 1; | ||
| 37 | |||
| 38 | let Ok(group) = pac::Group1::try_from(iidx as u8) else { | ||
| 39 | debug!("Invalid IIDX for group 1: {}", iidx); | ||
| 40 | return; | ||
| 41 | }; | ||
| 42 | |||
| 43 | match group { | ||
| 44 | Group1::GPIOA => crate::gpio::gpioa_interrupt(), | ||
| 45 | Group1::GPIOB => crate::gpio::gpiob_interrupt(), | ||
| 46 | Group1::COMP0 => todo!("implement COMP0"), | ||
| 47 | Group1::COMP1 => todo!("implement COMP1"), | ||
| 48 | Group1::COMP2 => todo!("implement COMP2"), | ||
| 49 | Group1::TRNG => todo!("implement TRNG"), | ||
| 50 | Group1::GPIOC => crate::gpio::gpioc_interrupt(), | ||
| 51 | } | ||
| 52 | } | ||
