diff options
| author | James Munns <[email protected]> | 2025-12-12 20:45:15 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-12-15 14:31:39 +0100 |
| commit | 5f366957f31d87030182f80dd2d39dc8a8496883 (patch) | |
| tree | 97cbe9d67fa8190a230f30795d0c98eee9d5ab3a /embassy-mcxa/src/lib.rs | |
| parent | 3588023e3e04b18cf98a2a0d10756e1f236ca351 (diff) | |
Add SOSC support
Diffstat (limited to 'embassy-mcxa/src/lib.rs')
| -rw-r--r-- | embassy-mcxa/src/lib.rs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/embassy-mcxa/src/lib.rs b/embassy-mcxa/src/lib.rs index 22bc40e35..8d39728a7 100644 --- a/embassy-mcxa/src/lib.rs +++ b/embassy-mcxa/src/lib.rs | |||
| @@ -174,8 +174,18 @@ embassy_hal_internal::peripherals!( | |||
| 174 | P1_27, | 174 | P1_27, |
| 175 | P1_28, | 175 | P1_28, |
| 176 | P1_29, | 176 | P1_29, |
| 177 | P1_30, | 177 | // TODO: These pins are optionally used as the clock sources for SOSC. |
| 178 | P1_31, | 178 | // Ideally, we'd want to have a custom version of the `peripheral!` macro |
| 179 | // that presented these as `Option<Peri<'_, P1_30>>` instead of `Peri<'_, P1_30>` | ||
| 180 | // when the user DOES enable the external SOSC. For now, I'm guessing MOST designs | ||
| 181 | // will have an external clock sitting on these pins anyway, so we just notch them | ||
| 182 | // out from the `Peripherals` struct given to users. | ||
| 183 | // | ||
| 184 | // If you find this and want your extra two pins to be available: please open an | ||
| 185 | // embassy issue to discuss how we could do this. | ||
| 186 | // | ||
| 187 | // P1_30, | ||
| 188 | // P1_31, | ||
| 179 | 189 | ||
| 180 | P2_0, | 190 | P2_0, |
| 181 | P2_1, | 191 | P2_1, |
| @@ -336,6 +346,14 @@ embassy_hal_internal::peripherals!( | |||
| 336 | WWDT0, | 346 | WWDT0, |
| 337 | ); | 347 | ); |
| 338 | 348 | ||
| 349 | // See commented out items above to understand why we create the instances | ||
| 350 | // here but don't give them to the user. | ||
| 351 | pub(crate) mod internal_peripherals { | ||
| 352 | embassy_hal_internal::peripherals_definition!(P1_30, P1_31,); | ||
| 353 | |||
| 354 | pub(crate) use peripherals::*; | ||
| 355 | } | ||
| 356 | |||
| 339 | // Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it. | 357 | // Use cortex-m-rt's #[interrupt] attribute directly; PAC does not re-export it. |
| 340 | 358 | ||
| 341 | // Re-export interrupt traits and types | 359 | // Re-export interrupt traits and types |
| @@ -368,7 +386,7 @@ pub fn init(cfg: crate::config::Config) -> Peripherals { | |||
| 368 | crate::clocks::init(cfg.clock_cfg).unwrap(); | 386 | crate::clocks::init(cfg.clock_cfg).unwrap(); |
| 369 | 387 | ||
| 370 | unsafe { | 388 | unsafe { |
| 371 | crate::gpio::init(); | 389 | crate::gpio::interrupt_init(); |
| 372 | } | 390 | } |
| 373 | 391 | ||
| 374 | // Initialize DMA controller (clock, reset, configuration) | 392 | // Initialize DMA controller (clock, reset, configuration) |
