diff options
| author | i509VCB <[email protected]> | 2025-05-20 17:17:03 -0500 |
|---|---|---|
| committer | i509VCB <[email protected]> | 2025-05-20 17:17:03 -0500 |
| commit | d23c71ea290828cbdf12b0ce64e9cd420e9038ab (patch) | |
| tree | b6beb0fadff32636aaf95d63a3cab9fb27bb58b4 /embassy-mspm0/src | |
| parent | 156bf00009495bbdffefd67f920919b4cd35c418 (diff) | |
mspm0: generate interrupt group handlers
Diffstat (limited to 'embassy-mspm0/src')
| -rw-r--r-- | embassy-mspm0/src/gpio.rs | 24 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/c110x.rs | 25 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g110x.rs | 47 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g150x.rs | 51 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g151x.rs | 52 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g310x.rs | 48 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g350x.rs | 51 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/g351x.rs | 52 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/l11xx.rs | 25 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/l12xx.rs | 49 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/l13xx.rs | 46 | ||||
| -rw-r--r-- | embassy-mspm0/src/int_group/l222x.rs | 49 | ||||
| -rw-r--r-- | embassy-mspm0/src/lib.rs | 14 |
13 files changed, 18 insertions, 515 deletions
diff --git a/embassy-mspm0/src/gpio.rs b/embassy-mspm0/src/gpio.rs index 19a6230b6..738d51928 100644 --- a/embassy-mspm0/src/gpio.rs +++ b/embassy-mspm0/src/gpio.rs | |||
| @@ -1119,24 +1119,36 @@ impl Iterator for BitIter { | |||
| 1119 | } | 1119 | } |
| 1120 | } | 1120 | } |
| 1121 | 1121 | ||
| 1122 | // C110x has a dedicated interrupt just for GPIOA, as it does not have a GROUP1 interrupt. | 1122 | // C110x and L110x have a dedicated interrupts just for GPIOA. |
| 1123 | // | ||
| 1124 | // These chips do not have a GROUP1 interrupt. | ||
| 1123 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0l110x)))] | 1125 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0l110x)))] |
| 1124 | #[interrupt] | 1126 | #[interrupt] |
| 1125 | fn GPIOA() { | 1127 | fn GPIOA() { |
| 1126 | gpioa_interrupt(); | 1128 | irq_handler(pac::GPIOA, &PORTA_WAKERS); |
| 1127 | } | 1129 | } |
| 1128 | 1130 | ||
| 1129 | #[cfg(feature = "rt")] | 1131 | // These symbols are weakly defined as DefaultHandler and are called by the interrupt group implementation. |
| 1130 | pub(crate) fn gpioa_interrupt() { | 1132 | // |
| 1133 | // Defining these as no_mangle is required so that the linker will pick these over the default handler. | ||
| 1134 | |||
| 1135 | #[cfg(all(feature = "rt", not(any(mspm0c110x, mspm0l110x))))] | ||
| 1136 | #[no_mangle] | ||
| 1137 | #[allow(non_snake_case)] | ||
| 1138 | fn GPIOA() { | ||
| 1131 | irq_handler(pac::GPIOA, &PORTA_WAKERS); | 1139 | irq_handler(pac::GPIOA, &PORTA_WAKERS); |
| 1132 | } | 1140 | } |
| 1133 | 1141 | ||
| 1134 | #[cfg(all(feature = "rt", gpio_pb))] | 1142 | #[cfg(all(feature = "rt", gpio_pb))] |
| 1135 | pub(crate) fn gpiob_interrupt() { | 1143 | #[no_mangle] |
| 1144 | #[allow(non_snake_case)] | ||
| 1145 | fn GPIOB() { | ||
| 1136 | irq_handler(pac::GPIOB, &PORTB_WAKERS); | 1146 | irq_handler(pac::GPIOB, &PORTB_WAKERS); |
| 1137 | } | 1147 | } |
| 1138 | 1148 | ||
| 1139 | #[cfg(all(feature = "rt", gpio_pc))] | 1149 | #[cfg(all(feature = "rt", gpio_pc))] |
| 1140 | pub(crate) fn gpioc_interrupt() { | 1150 | #[allow(non_snake_case)] |
| 1151 | #[no_mangle] | ||
| 1152 | fn GPIOC() { | ||
| 1141 | irq_handler(pac::GPIOC, &PORTC_WAKERS); | 1153 | irq_handler(pac::GPIOC, &PORTC_WAKERS); |
| 1142 | } | 1154 | } |
diff --git a/embassy-mspm0/src/int_group/c110x.rs b/embassy-mspm0/src/int_group/c110x.rs deleted file mode 100644 index e6a9ddb99..000000000 --- a/embassy-mspm0/src/int_group/c110x.rs +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 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 | // TODO: Decompose to direct u8 | ||
| 12 | let iidx = group.iidx().read().stat().to_bits(); | ||
| 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::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 22 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 23 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/embassy-mspm0/src/int_group/g110x.rs b/embassy-mspm0/src/int_group/g110x.rs deleted file mode 100644 index 9f8ac4d7b..000000000 --- a/embassy-mspm0/src/int_group/g110x.rs +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 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 | } | ||
| 47 | } | ||
diff --git a/embassy-mspm0/src/int_group/g150x.rs b/embassy-mspm0/src/int_group/g150x.rs deleted file mode 100644 index 706ba2078..000000000 --- a/embassy-mspm0/src/int_group/g150x.rs +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 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 | } | ||
| 51 | } | ||
diff --git a/embassy-mspm0/src/int_group/g151x.rs b/embassy-mspm0/src/int_group/g151x.rs deleted file mode 100644 index e785018a7..000000000 --- a/embassy-mspm0/src/int_group/g151x.rs +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 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 | } | ||
diff --git a/embassy-mspm0/src/int_group/g310x.rs b/embassy-mspm0/src/int_group/g310x.rs deleted file mode 100644 index ad508d3a2..000000000 --- a/embassy-mspm0/src/int_group/g310x.rs +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 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::TRNG => todo!("implement TRNG"), | ||
| 47 | } | ||
| 48 | } | ||
diff --git a/embassy-mspm0/src/int_group/g350x.rs b/embassy-mspm0/src/int_group/g350x.rs deleted file mode 100644 index 706ba2078..000000000 --- a/embassy-mspm0/src/int_group/g350x.rs +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 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 | } | ||
| 51 | } | ||
diff --git a/embassy-mspm0/src/int_group/g351x.rs b/embassy-mspm0/src/int_group/g351x.rs deleted file mode 100644 index e785018a7..000000000 --- a/embassy-mspm0/src/int_group/g351x.rs +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 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 | } | ||
diff --git a/embassy-mspm0/src/int_group/l11xx.rs b/embassy-mspm0/src/int_group/l11xx.rs deleted file mode 100644 index 426a80c13..000000000 --- a/embassy-mspm0/src/int_group/l11xx.rs +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 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::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 22 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 23 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 24 | } | ||
| 25 | } | ||
diff --git a/embassy-mspm0/src/int_group/l12xx.rs b/embassy-mspm0/src/int_group/l12xx.rs deleted file mode 100644 index eeb2ce70d..000000000 --- a/embassy-mspm0/src/int_group/l12xx.rs +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 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::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 22 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 23 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | #[cfg(feature = "rt")] | ||
| 28 | #[interrupt] | ||
| 29 | fn GROUP1() { | ||
| 30 | use mspm0_metapac::Group1; | ||
| 31 | |||
| 32 | let group = pac::CPUSS.int_group(1); | ||
| 33 | |||
| 34 | // Must subtract by 1 since NO_INTR is value 0 | ||
| 35 | let iidx = group.iidx().read().stat().to_bits() - 1; | ||
| 36 | |||
| 37 | let Ok(group) = pac::Group1::try_from(iidx as u8) else { | ||
| 38 | debug!("Invalid IIDX for group 1: {}", iidx); | ||
| 39 | return; | ||
| 40 | }; | ||
| 41 | |||
| 42 | match group { | ||
| 43 | Group1::GPIOA => crate::gpio::gpioa_interrupt(), | ||
| 44 | Group1::GPIOB => crate::gpio::gpiob_interrupt(), | ||
| 45 | Group1::COMP0 => todo!("implement COMP0"), | ||
| 46 | Group1::TRNG => todo!("implement TRNG"), | ||
| 47 | Group1::GPIOC => crate::gpio::gpioc_interrupt(), | ||
| 48 | } | ||
| 49 | } | ||
diff --git a/embassy-mspm0/src/int_group/l13xx.rs b/embassy-mspm0/src/int_group/l13xx.rs deleted file mode 100644 index 8be5adcad..000000000 --- a/embassy-mspm0/src/int_group/l13xx.rs +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 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::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 22 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 23 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | #[cfg(feature = "rt")] | ||
| 28 | #[interrupt] | ||
| 29 | fn GROUP1() { | ||
| 30 | use mspm0_metapac::Group1; | ||
| 31 | |||
| 32 | let group = pac::CPUSS.int_group(1); | ||
| 33 | |||
| 34 | // Must subtract by 1 since NO_INTR is value 0 | ||
| 35 | let iidx = group.iidx().read().stat().to_bits() - 1; | ||
| 36 | |||
| 37 | let Ok(group) = pac::Group1::try_from(iidx as u8) else { | ||
| 38 | debug!("Invalid IIDX for group 1: {}", iidx); | ||
| 39 | return; | ||
| 40 | }; | ||
| 41 | |||
| 42 | match group { | ||
| 43 | Group1::GPIOA => crate::gpio::gpioa_interrupt(), | ||
| 44 | Group1::COMP0 => todo!("implement COMP0"), | ||
| 45 | } | ||
| 46 | } | ||
diff --git a/embassy-mspm0/src/int_group/l222x.rs b/embassy-mspm0/src/int_group/l222x.rs deleted file mode 100644 index eeb2ce70d..000000000 --- a/embassy-mspm0/src/int_group/l222x.rs +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 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::DEBUGSS => todo!("implement DEBUGSS"), | ||
| 22 | Group0::FLASHCTL => todo!("implement FLASHCTL"), | ||
| 23 | Group0::SYSCTL => todo!("implement SYSCTL"), | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | #[cfg(feature = "rt")] | ||
| 28 | #[interrupt] | ||
| 29 | fn GROUP1() { | ||
| 30 | use mspm0_metapac::Group1; | ||
| 31 | |||
| 32 | let group = pac::CPUSS.int_group(1); | ||
| 33 | |||
| 34 | // Must subtract by 1 since NO_INTR is value 0 | ||
| 35 | let iidx = group.iidx().read().stat().to_bits() - 1; | ||
| 36 | |||
| 37 | let Ok(group) = pac::Group1::try_from(iidx as u8) else { | ||
| 38 | debug!("Invalid IIDX for group 1: {}", iidx); | ||
| 39 | return; | ||
| 40 | }; | ||
| 41 | |||
| 42 | match group { | ||
| 43 | Group1::GPIOA => crate::gpio::gpioa_interrupt(), | ||
| 44 | Group1::GPIOB => crate::gpio::gpiob_interrupt(), | ||
| 45 | Group1::COMP0 => todo!("implement COMP0"), | ||
| 46 | Group1::TRNG => todo!("implement TRNG"), | ||
| 47 | Group1::GPIOC => crate::gpio::gpioc_interrupt(), | ||
| 48 | } | ||
| 49 | } | ||
diff --git a/embassy-mspm0/src/lib.rs b/embassy-mspm0/src/lib.rs index f129e221b..7ff60e946 100644 --- a/embassy-mspm0/src/lib.rs +++ b/embassy-mspm0/src/lib.rs | |||
| @@ -39,20 +39,6 @@ pub mod mode { | |||
| 39 | #[cfg(feature = "_time-driver")] | 39 | #[cfg(feature = "_time-driver")] |
| 40 | mod time_driver; | 40 | mod time_driver; |
| 41 | 41 | ||
| 42 | // Interrupt group handlers. | ||
| 43 | #[cfg_attr(mspm0c110x, path = "int_group/c110x.rs")] | ||
| 44 | #[cfg_attr(mspm0g110x, path = "int_group/g110x.rs")] | ||
| 45 | #[cfg_attr(mspm0g150x, path = "int_group/g150x.rs")] | ||
| 46 | #[cfg_attr(mspm0g350x, path = "int_group/g350x.rs")] | ||
| 47 | #[cfg_attr(mspm0g151x, path = "int_group/g151x.rs")] | ||
| 48 | #[cfg_attr(mspm0g351x, path = "int_group/g351x.rs")] | ||
| 49 | #[cfg_attr(mspm0g310x, path = "int_group/g310x.rs")] | ||
| 50 | #[cfg_attr(mspm0l110x, path = "int_group/l11xx.rs")] | ||
| 51 | #[cfg_attr(mspm0l122x, path = "int_group/l12xx.rs")] | ||
| 52 | #[cfg_attr(any(mspm0l130x, mspm0l134x), path = "int_group/l13xx.rs")] | ||
| 53 | #[cfg_attr(mspm0l222x, path = "int_group/l222x.rs")] | ||
| 54 | mod int_group; | ||
| 55 | |||
| 56 | pub(crate) mod _generated { | 42 | pub(crate) mod _generated { |
| 57 | #![allow(dead_code)] | 43 | #![allow(dead_code)] |
| 58 | #![allow(unused_imports)] | 44 | #![allow(unused_imports)] |
