aboutsummaryrefslogtreecommitdiff
path: root/embassy-mspm0
diff options
context:
space:
mode:
authori509VCB <[email protected]>2025-09-04 14:10:23 +0000
committerGitHub <[email protected]>2025-09-04 14:10:23 +0000
commitf2de2ca16b4fdb623a73de4d349c68c7292a8f11 (patch)
tree31597fb473c05b2aeeb5a305dd8c4763fb772e76 /embassy-mspm0
parent615fc36eb83e226492dd3dfd3bc4de95b1e2f065 (diff)
parent338227c21abea9621887ed428c2272d7bdeeafdd (diff)
Merge pull request #4600 from i509VCB/c1105_c1106
mspm0: add mspm0c1105/6
Diffstat (limited to 'embassy-mspm0')
-rw-r--r--embassy-mspm0/CHANGELOG.md3
-rw-r--r--embassy-mspm0/Cargo.toml22
-rw-r--r--embassy-mspm0/build.rs8
-rw-r--r--embassy-mspm0/src/gpio.rs14
-rw-r--r--embassy-mspm0/src/i2c.rs2
5 files changed, 40 insertions, 9 deletions
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"
69critical-section = "1.2.0" 69critical-section = "1.2.0"
70 70
71# mspm0-metapac = { version = "" } 71# mspm0-metapac = { version = "" }
72mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-fe17d879548757ca29821da66a1bebf2debd4846" } 72mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-d7bf3d01ac0780e716a45b0474234d39443dc5cf" }
73 73
74[build-dependencies] 74[build-dependencies]
75proc-macro2 = "1.0.94" 75proc-macro2 = "1.0.94"
@@ -77,7 +77,7 @@ quote = "1.0.40"
77cfg_aliases = "0.2.1" 77cfg_aliases = "0.2.1"
78 78
79# mspm0-metapac = { version = "", default-features = false, features = ["metadata"] } 79# mspm0-metapac = { version = "", default-features = false, features = ["metadata"] }
80mspm0-metapac = { git = "https://github.com/mspm0-rs/mspm0-data-generated/", tag = "mspm0-data-fe17d879548757ca29821da66a1bebf2debd4846", default-features = false, features = ["metadata"] } 80mspm0-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]
83default = ["rt"] 83default = ["rt"]
@@ -159,6 +159,24 @@ mspm0c1104dsg = ["mspm0-metapac/mspm0c1104dsg"]
159mspm0c1104dyy = ["mspm0-metapac/mspm0c1104dyy"] 159mspm0c1104dyy = ["mspm0-metapac/mspm0c1104dyy"]
160mspm0c1104ruk = ["mspm0-metapac/mspm0c1104ruk"] 160mspm0c1104ruk = ["mspm0-metapac/mspm0c1104ruk"]
161mspm0c1104ycj = ["mspm0-metapac/mspm0c1104ycj"] 161mspm0c1104ycj = ["mspm0-metapac/mspm0c1104ycj"]
162mspm0c1105pt = ["mspm0-metapac/mspm0c1105pt"]
163mspm0c1105rgz = ["mspm0-metapac/mspm0c1105rgz"]
164mspm0c1105rhb = ["mspm0-metapac/mspm0c1105rhb"]
165mspm0c1105dgs32 = ["mspm0-metapac/mspm0c1105dgs32"]
166mspm0c1105dgs28 = ["mspm0-metapac/mspm0c1105dgs28"]
167mspm0c1105rge = ["mspm0-metapac/mspm0c1105rge"]
168mspm0c1105dgs20 = ["mspm0-metapac/mspm0c1105dgs20"]
169mspm0c1105ruk = ["mspm0-metapac/mspm0c1105ruk"]
170mspm0c1105zcm = ["mspm0-metapac/mspm0c1105zcm"]
171mspm0c1106pt = ["mspm0-metapac/mspm0c1106pt"]
172mspm0c1106rgz = ["mspm0-metapac/mspm0c1106rgz"]
173mspm0c1106rhb = ["mspm0-metapac/mspm0c1106rhb"]
174mspm0c1106dgs32 = ["mspm0-metapac/mspm0c1106dgs32"]
175mspm0c1106dgs28 = ["mspm0-metapac/mspm0c1106dgs28"]
176mspm0c1106rge = ["mspm0-metapac/mspm0c1106rge"]
177mspm0c1106dgs20 = ["mspm0-metapac/mspm0c1106dgs20"]
178mspm0c1106ruk = ["mspm0-metapac/mspm0c1106ruk"]
179mspm0c1106zcm = ["mspm0-metapac/mspm0c1106zcm"]
162mspm0g1105dgs28 = ["mspm0-metapac/mspm0g1105dgs28"] 180mspm0g1105dgs28 = ["mspm0-metapac/mspm0g1105dgs28"]
163mspm0g1105pm = ["mspm0-metapac/mspm0g1105pm"] 181mspm0g1105pm = ["mspm0-metapac/mspm0g1105pm"]
164mspm0g1105pt = ["mspm0-metapac/mspm0g1105pt"] 182mspm0g1105pt = ["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
11use crate::pac::gpio::vals::*; 11use crate::pac::gpio::vals::*;
12use crate::pac::gpio::{self}; 12use crate::pac::gpio::{self};
13#[cfg(all(feature = "rt", any(mspm0c110x, mspm0l110x)))] 13#[cfg(all(feature = "rt", any(mspm0c110x, mspm0c1105_c1106, mspm0l110x)))]
14use crate::pac::interrupt; 14use crate::pac::interrupt;
15use crate::pac::{self}; 15use 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]
1113fn GPIOA() { 1113fn 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]
1119fn 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)]
1124fn GPIOA() { 1130fn 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)]
1131fn GPIOB() { 1137fn 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.