diff options
| author | xoviat <[email protected]> | 2025-12-18 09:15:30 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-12-18 09:15:30 -0600 |
| commit | cec833c5f48ae93d1a47d5b763e613d8407d48a1 (patch) | |
| tree | 2fa25c7907ba8ef1923c4baeeb93dd88c57bce7e /embassy-mcxa/src/lib.rs | |
| parent | a886e97a33690cf9724dedd272d3073a577f9fa4 (diff) | |
| parent | b5b49cbcf3a991bf6d434b0870da50f3ee722612 (diff) | |
Merge branch 'main' of github.com:embassy-rs/embassy into low-power-rtc
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 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. | ||
| 352 | pub(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) |
