aboutsummaryrefslogtreecommitdiff
path: root/embassy-mcxa/src/lib.rs
diff options
context:
space:
mode:
authorJames Munns <[email protected]>2025-12-18 13:55:57 +0000
committerGitHub <[email protected]>2025-12-18 13:55:57 +0000
commitb5b49cbcf3a991bf6d434b0870da50f3ee722612 (patch)
treedd1c673cbe1e2512c785173762f8d63e472c5e8b /embassy-mcxa/src/lib.rs
parentf85337064c724f8fdb855e847345908e4c7384e9 (diff)
parentd6c65cd0e4b651b1b07e1583562dfccfd5db22b1 (diff)
Merge pull request #5071 from jamesmunns/james/bad-sosc
[MCXA]: Add support for SOSC/clk_in
Diffstat (limited to 'embassy-mcxa/src/lib.rs')
-rw-r--r--embassy-mcxa/src/lib.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/embassy-mcxa/src/lib.rs b/embassy-mcxa/src/lib.rs
index 6383353db..76fd58210 100644
--- a/embassy-mcxa/src/lib.rs
+++ b/embassy-mcxa/src/lib.rs
@@ -175,8 +175,18 @@ embassy_hal_internal::peripherals!(
175 P1_27, 175 P1_27,
176 P1_28, 176 P1_28,
177 P1_29, 177 P1_29,
178 P1_30, 178 // TODO: These pins are optionally used as the clock sources for SOSC.
179 P1_31, 179 // Ideally, we'd want to have a custom version of the `peripheral!` macro
180 // that presented these as `Option<Peri<'_, P1_30>>` instead of `Peri<'_, P1_30>`
181 // when the user DOES enable the external SOSC. For now, I'm guessing MOST designs
182 // will have an external clock sitting on these pins anyway, so we just notch them
183 // out from the `Peripherals` struct given to users.
184 //
185 // If you find this and want your extra two pins to be available: please open an
186 // embassy issue to discuss how we could do this.
187 //
188 // P1_30,
189 // P1_31,
180 190
181 P2_0, 191 P2_0,
182 P2_1, 192 P2_1,
@@ -337,6 +347,14 @@ embassy_hal_internal::peripherals!(
337 WWDT0, 347 WWDT0,
338); 348);
339 349
350// See commented out items above to understand why we create the instances
351// here but don't give them to the user.
352pub(crate) mod internal_peripherals {
353 embassy_hal_internal::peripherals_definition!(P1_30, P1_31,);
354
355 pub(crate) use peripherals::*;
356}
357
340// Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it. 358// Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it.
341 359
342// Re-export interrupt traits and types 360// Re-export interrupt traits and types
@@ -369,7 +387,7 @@ pub fn init(cfg: crate::config::Config) -> Peripherals {
369 crate::clocks::init(cfg.clock_cfg).unwrap(); 387 crate::clocks::init(cfg.clock_cfg).unwrap();
370 388
371 unsafe { 389 unsafe {
372 crate::gpio::init(); 390 crate::gpio::interrupt_init();
373 } 391 }
374 392
375 // Initialize DMA controller (clock, reset, configuration) 393 // Initialize DMA controller (clock, reset, configuration)