diff options
| author | i509VCB <[email protected]> | 2025-08-28 15:00:46 -0500 |
|---|---|---|
| committer | i509VCB <[email protected]> | 2025-08-28 15:03:50 -0500 |
| commit | 338227c21abea9621887ed428c2272d7bdeeafdd (patch) | |
| tree | 2de4e3ab189c70b88049be6974c2f947808a428e | |
| parent | d3c84ee1d34329e61464c9acbedab74e9076ac0d (diff) | |
mspm0: add mspm0c1105/6
| -rwxr-xr-x | ci.sh | 25 | ||||
| -rw-r--r-- | embassy-mspm0/CHANGELOG.md | 3 | ||||
| -rw-r--r-- | embassy-mspm0/Cargo.toml | 22 | ||||
| -rw-r--r-- | embassy-mspm0/build.rs | 8 | ||||
| -rw-r--r-- | embassy-mspm0/src/gpio.rs | 14 | ||||
| -rw-r--r-- | embassy-mspm0/src/i2c.rs | 2 |
6 files changed, 53 insertions, 21 deletions
| @@ -190,18 +190,19 @@ cargo batch \ | |||
| 190 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf --features lpc55,defmt \ | 190 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv8m.main-none-eabihf --features lpc55,defmt \ |
| 191 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1011,rt,defmt,time-driver-pit \ | 191 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1011,rt,defmt,time-driver-pit \ |
| 192 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1062,rt,defmt,time-driver-pit \ | 192 | --- build --release --manifest-path embassy-nxp/Cargo.toml --target thumbv7em-none-eabihf --features mimxrt1062,rt,defmt,time-driver-pit \ |
| 193 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1104dgs20,defmt,time-driver-any \ | 193 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1104dgs20,rt,defmt,time-driver-any \ |
| 194 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507pm,defmt,time-driver-any \ | 194 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0c1106rgz,rt,defmt,time-driver-any \ |
| 195 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3519pz,defmt,time-driver-any \ | 195 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3507pm,rt,defmt,time-driver-any \ |
| 196 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1306rhb,defmt,time-driver-any \ | 196 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3519pz,rt,defmt,time-driver-any \ |
| 197 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l2228pn,defmt,time-driver-any \ | 197 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1306rhb,rt,defmt,time-driver-any \ |
| 198 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1345dgs28,defmt,time-driver-any \ | 198 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l2228pn,rt,defmt,time-driver-any \ |
| 199 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1106dgs28,defmt,time-driver-any \ | 199 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1345dgs28,rt,defmt,time-driver-any \ |
| 200 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1228pm,defmt,time-driver-any \ | 200 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1106dgs28,rt,defmt,time-driver-any \ |
| 201 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1107ycj,defmt,time-driver-any \ | 201 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0l1228pm,rt,defmt,time-driver-any \ |
| 202 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3105rhb,defmt,time-driver-any \ | 202 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1107ycj,rt,defmt,time-driver-any \ |
| 203 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1505pt,defmt,time-driver-any \ | 203 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g3105rhb,rt,defmt,time-driver-any \ |
| 204 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1519rhb,defmt,time-driver-any \ | 204 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1505pt,rt,defmt,time-driver-any \ |
| 205 | --- build --release --manifest-path embassy-mspm0/Cargo.toml --target thumbv6m-none-eabi --features mspm0g1519rhb,rt,defmt,time-driver-any \ | ||
| 205 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ | 206 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features ''\ |
| 206 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ | 207 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'log' \ |
| 207 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ | 208 | --- build --release --manifest-path cyw43/Cargo.toml --target thumbv6m-none-eabi --features 'defmt' \ |
diff --git a/embassy-mspm0/CHANGELOG.md b/embassy-mspm0/CHANGELOG.md index eca0defd7..c7da4eb33 100644 --- a/embassy-mspm0/CHANGELOG.md +++ b/embassy-mspm0/CHANGELOG.md | |||
| @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 7 | 7 | ||
| 8 | <!-- next-header --> | 8 | <!-- next-header --> |
| 9 | ## Unreleased - ReleaseDate | 9 | ## Unreleased - ReleaseDate |
| 10 | 10 | ||
| 11 | - feat: Add I2C Controller (blocking & async) + examples for mspm0l1306, mspm0g3507 (tested MCUs) (#4435) | 11 | - feat: Add I2C Controller (blocking & async) + examples for mspm0l1306, mspm0g3507 (tested MCUs) (#4435) |
| 12 | - fix gpio interrupt not being set for mspm0l110x | 12 | - fix gpio interrupt not being set for mspm0l110x |
| 13 | - feat: Add window watchdog implementation based on WWDT0, WWDT1 peripherals (#4574) | 13 | - feat: Add window watchdog implementation based on WWDT0, WWDT1 peripherals (#4574) |
| 14 | - feat: Add MSPM0C1105/C1106 support | ||
diff --git a/embassy-mspm0/Cargo.toml b/embassy-mspm0/Cargo.toml index 92f7a2655..1b32c4d43 100644 --- a/embassy-mspm0/Cargo.toml +++ b/embassy-mspm0/Cargo.toml | |||
| @@ -69,7 +69,7 @@ cortex-m = "0.7.6" | |||
| 69 | critical-section = "1.2.0" | 69 | critical-section = "1.2.0" |
| 70 | 70 | ||
| 71 | # mspm0-metapac = { version = "" } | 71 | # mspm0-metapac = { version = "" } |
| 72 | mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-fe17d879548757ca29821da66a1bebf2debd4846" } | 72 | mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-d7bf3d01ac0780e716a45b0474234d39443dc5cf" } |
| 73 | 73 | ||
| 74 | [build-dependencies] | 74 | [build-dependencies] |
| 75 | proc-macro2 = "1.0.94" | 75 | proc-macro2 = "1.0.94" |
| @@ -77,7 +77,7 @@ quote = "1.0.40" | |||
| 77 | cfg_aliases = "0.2.1" | 77 | cfg_aliases = "0.2.1" |
| 78 | 78 | ||
| 79 | # mspm0-metapac = { version = "", default-features = false, features = ["metadata"] } | 79 | # mspm0-metapac = { version = "", default-features = false, features = ["metadata"] } |
| 80 | mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-fe17d879548757ca29821da66a1bebf2debd4846", default-features = false, features = ["metadata"] } | 80 | mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-d7bf3d01ac0780e716a45b0474234d39443dc5cf", default-features = false, features = ["metadata"] } |
| 81 | 81 | ||
| 82 | [features] | 82 | [features] |
| 83 | default = ["rt"] | 83 | default = ["rt"] |
| @@ -159,6 +159,24 @@ mspm0c1104dsg = ["mspm0-metapac/mspm0c1104dsg"] | |||
| 159 | mspm0c1104dyy = ["mspm0-metapac/mspm0c1104dyy"] | 159 | mspm0c1104dyy = ["mspm0-metapac/mspm0c1104dyy"] |
| 160 | mspm0c1104ruk = ["mspm0-metapac/mspm0c1104ruk"] | 160 | mspm0c1104ruk = ["mspm0-metapac/mspm0c1104ruk"] |
| 161 | mspm0c1104ycj = ["mspm0-metapac/mspm0c1104ycj"] | 161 | mspm0c1104ycj = ["mspm0-metapac/mspm0c1104ycj"] |
| 162 | mspm0c1105pt = ["mspm0-metapac/mspm0c1105pt"] | ||
| 163 | mspm0c1105rgz = ["mspm0-metapac/mspm0c1105rgz"] | ||
| 164 | mspm0c1105rhb = ["mspm0-metapac/mspm0c1105rhb"] | ||
| 165 | mspm0c1105dgs32 = ["mspm0-metapac/mspm0c1105dgs32"] | ||
| 166 | mspm0c1105dgs28 = ["mspm0-metapac/mspm0c1105dgs28"] | ||
| 167 | mspm0c1105rge = ["mspm0-metapac/mspm0c1105rge"] | ||
| 168 | mspm0c1105dgs20 = ["mspm0-metapac/mspm0c1105dgs20"] | ||
| 169 | mspm0c1105ruk = ["mspm0-metapac/mspm0c1105ruk"] | ||
| 170 | mspm0c1105zcm = ["mspm0-metapac/mspm0c1105zcm"] | ||
| 171 | mspm0c1106pt = ["mspm0-metapac/mspm0c1106pt"] | ||
| 172 | mspm0c1106rgz = ["mspm0-metapac/mspm0c1106rgz"] | ||
| 173 | mspm0c1106rhb = ["mspm0-metapac/mspm0c1106rhb"] | ||
| 174 | mspm0c1106dgs32 = ["mspm0-metapac/mspm0c1106dgs32"] | ||
| 175 | mspm0c1106dgs28 = ["mspm0-metapac/mspm0c1106dgs28"] | ||
| 176 | mspm0c1106rge = ["mspm0-metapac/mspm0c1106rge"] | ||
| 177 | mspm0c1106dgs20 = ["mspm0-metapac/mspm0c1106dgs20"] | ||
| 178 | mspm0c1106ruk = ["mspm0-metapac/mspm0c1106ruk"] | ||
| 179 | mspm0c1106zcm = ["mspm0-metapac/mspm0c1106zcm"] | ||
| 162 | mspm0g1105dgs28 = ["mspm0-metapac/mspm0g1105dgs28"] | 180 | mspm0g1105dgs28 = ["mspm0-metapac/mspm0g1105dgs28"] |
| 163 | mspm0g1105pm = ["mspm0-metapac/mspm0g1105pm"] | 181 | mspm0g1105pm = ["mspm0-metapac/mspm0g1105pm"] |
| 164 | mspm0g1105pt = ["mspm0-metapac/mspm0g1105pt"] | 182 | mspm0g1105pt = ["mspm0-metapac/mspm0g1105pt"] |
diff --git a/embassy-mspm0/build.rs b/embassy-mspm0/build.rs index 256192f8b..e8364e31a 100644 --- a/embassy-mspm0/build.rs +++ b/embassy-mspm0/build.rs | |||
| @@ -79,10 +79,14 @@ fn get_chip_cfgs(chip_name: &str) -> Vec<String> { | |||
| 79 | let mut cfgs = Vec::new(); | 79 | let mut cfgs = Vec::new(); |
| 80 | 80 | ||
| 81 | // GPIO on C110x is special as it does not belong to an interrupt group. | 81 | // GPIO on C110x is special as it does not belong to an interrupt group. |
| 82 | if chip_name.starts_with("mspm0c110") || chip_name.starts_with("msps003f") { | 82 | if chip_name.starts_with("mspm0c1103") || chip_name.starts_with("mspm0c1104") || chip_name.starts_with("msps003f") { |
| 83 | cfgs.push("mspm0c110x".to_string()); | 83 | cfgs.push("mspm0c110x".to_string()); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | if chip_name.starts_with("mspm0c1105") || chip_name.starts_with("mspm0c1106") { | ||
| 87 | cfgs.push("mspm0c1105_c1106".to_string()); | ||
| 88 | } | ||
| 89 | |||
| 86 | // Family ranges (temporary until int groups are generated) | 90 | // Family ranges (temporary until int groups are generated) |
| 87 | // | 91 | // |
| 88 | // TODO: Remove this once int group stuff is generated. | 92 | // TODO: Remove this once int group stuff is generated. |
| @@ -537,6 +541,8 @@ fn generate_interrupts() -> TokenStream { | |||
| 537 | pub fn enable_group_interrupts(_cs: critical_section::CriticalSection) { | 541 | pub fn enable_group_interrupts(_cs: critical_section::CriticalSection) { |
| 538 | use crate::interrupt::typelevel::Interrupt; | 542 | use crate::interrupt::typelevel::Interrupt; |
| 539 | 543 | ||
| 544 | // This is empty for C1105/6 | ||
| 545 | #[allow(unused_unsafe)] | ||
| 540 | unsafe { | 546 | unsafe { |
| 541 | #(#group_interrupt_enables)* | 547 | #(#group_interrupt_enables)* |
| 542 | } | 548 | } |
diff --git a/embassy-mspm0/src/gpio.rs b/embassy-mspm0/src/gpio.rs index f77848888..d5fd36dbf 100644 --- a/embassy-mspm0/src/gpio.rs +++ b/embassy-mspm0/src/gpio.rs | |||
| @@ -10,7 +10,7 @@ use embassy_sync::waitqueue::AtomicWaker; | |||
| 10 | 10 | ||
| 11 | use crate::pac::gpio::vals::*; | 11 | use crate::pac::gpio::vals::*; |
| 12 | use crate::pac::gpio::{self}; | 12 | use crate::pac::gpio::{self}; |
| 13 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0l110x)))] | 13 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0c1105_c1106, mspm0l110x)))] |
| 14 | use crate::pac::interrupt; | 14 | use crate::pac::interrupt; |
| 15 | use crate::pac::{self}; | 15 | use crate::pac::{self}; |
| 16 | 16 | ||
| @@ -1108,24 +1108,30 @@ fn irq_handler(gpio: gpio::Gpio, wakers: &[AtomicWaker; 32]) { | |||
| 1108 | // C110x and L110x have a dedicated interrupts just for GPIOA. | 1108 | // C110x and L110x have a dedicated interrupts just for GPIOA. |
| 1109 | // | 1109 | // |
| 1110 | // These chips do not have a GROUP1 interrupt. | 1110 | // These chips do not have a GROUP1 interrupt. |
| 1111 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0l110x)))] | 1111 | #[cfg(all(feature = "rt", any(mspm0c110x, mspm0c1105_c1106, mspm0l110x)))] |
| 1112 | #[interrupt] | 1112 | #[interrupt] |
| 1113 | fn GPIOA() { | 1113 | fn GPIOA() { |
| 1114 | irq_handler(pac::GPIOA, &PORTA_WAKERS); | 1114 | irq_handler(pac::GPIOA, &PORTA_WAKERS); |
| 1115 | } | 1115 | } |
| 1116 | 1116 | ||
| 1117 | #[cfg(all(feature = "rt", mspm0c1105_c1106))] | ||
| 1118 | #[interrupt] | ||
| 1119 | fn GPIOB() { | ||
| 1120 | irq_handler(pac::GPIOB, &PORTB_WAKERS); | ||
| 1121 | } | ||
| 1122 | |||
| 1117 | // These symbols are weakly defined as DefaultHandler and are called by the interrupt group implementation. | 1123 | // These symbols are weakly defined as DefaultHandler and are called by the interrupt group implementation. |
| 1118 | // | 1124 | // |
| 1119 | // Defining these as no_mangle is required so that the linker will pick these over the default handler. | 1125 | // Defining these as no_mangle is required so that the linker will pick these over the default handler. |
| 1120 | 1126 | ||
| 1121 | #[cfg(all(feature = "rt", not(any(mspm0c110x, mspm0l110x))))] | 1127 | #[cfg(all(feature = "rt", not(any(mspm0c110x, mspm0c1105_c1106, mspm0l110x))))] |
| 1122 | #[no_mangle] | 1128 | #[no_mangle] |
| 1123 | #[allow(non_snake_case)] | 1129 | #[allow(non_snake_case)] |
| 1124 | fn GPIOA() { | 1130 | fn GPIOA() { |
| 1125 | irq_handler(pac::GPIOA, &PORTA_WAKERS); | 1131 | irq_handler(pac::GPIOA, &PORTA_WAKERS); |
| 1126 | } | 1132 | } |
| 1127 | 1133 | ||
| 1128 | #[cfg(all(feature = "rt", gpio_pb))] | 1134 | #[cfg(all(feature = "rt", gpio_pb, not(mspm0c1105_c1106)))] |
| 1129 | #[no_mangle] | 1135 | #[no_mangle] |
| 1130 | #[allow(non_snake_case)] | 1136 | #[allow(non_snake_case)] |
| 1131 | fn GPIOB() { | 1137 | fn GPIOB() { |
diff --git a/embassy-mspm0/src/i2c.rs b/embassy-mspm0/src/i2c.rs index 7e22bb724..1906e37ba 100644 --- a/embassy-mspm0/src/i2c.rs +++ b/embassy-mspm0/src/i2c.rs | |||
| @@ -195,7 +195,7 @@ impl Config { | |||
| 195 | .unwrap(); | 195 | .unwrap(); |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | #[cfg(any(mspm0c110x))] | 198 | #[cfg(any(mspm0c110x, mspm0c1105_c1106))] |
| 199 | fn calculate_clock_source(&self) -> u32 { | 199 | fn calculate_clock_source(&self) -> u32 { |
| 200 | // Assume that BusClk has default value. | 200 | // Assume that BusClk has default value. |
| 201 | // TODO: calculate BusClk more precisely. | 201 | // TODO: calculate BusClk more precisely. |
