diff options
| author | James Munns <[email protected]> | 2025-11-12 18:54:40 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-11-12 18:54:40 +0100 |
| commit | dd7a90eb51197fae6ef6c6b7beae977a9143e268 (patch) | |
| tree | 1de532732f506c260fe9e091d51103874a1ab605 /examples | |
| parent | 2f08491f1a09df79bf1d41e26217d21b0bd7bdae (diff) | |
| parent | 6eb28d3e7b7290d2998229b1bfb624e33575ea83 (diff) | |
Merge remote-tracking branch 'origin/main' into james/impl-clocks
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/adc_interrupt.rs | 8 | ||||
| -rw-r--r-- | examples/adc_polling.rs | 8 | ||||
| -rw-r--r-- | examples/common/mod.rs | 10 | ||||
| -rw-r--r-- | examples/lpuart_buffered.rs | 2 | ||||
| -rw-r--r-- | examples/ostimer_race_test.rs | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/examples/adc_interrupt.rs b/examples/adc_interrupt.rs index f0df3196c..dc82cfd30 100644 --- a/examples/adc_interrupt.rs +++ b/examples/adc_interrupt.rs | |||
| @@ -3,11 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 5 | use hal::adc::{LpadcConfig, TriggerPriorityPolicy}; | 5 | use hal::adc::{LpadcConfig, TriggerPriorityPolicy}; |
| 6 | use hal::pac::adc1::cfg::{Pwrsel, Refsel}; | ||
| 7 | use hal::pac::adc1::cmdl1::{Adch, Mode}; | ||
| 8 | use hal::pac::adc1::ctrl::CalAvgs; | ||
| 9 | use hal::pac::adc1::tctrl::Tcmd; | ||
| 10 | use hal::uart; | 6 | use hal::uart; |
| 7 | use mcxa_pac::adc1::cfg::{Pwrsel, Refsel}; | ||
| 8 | use mcxa_pac::adc1::cmdl1::{Adch, Mode}; | ||
| 9 | use mcxa_pac::adc1::ctrl::CalAvgs; | ||
| 10 | use mcxa_pac::adc1::tctrl::Tcmd; | ||
| 11 | use {cortex_m, embassy_mcxa276 as hal}; | 11 | use {cortex_m, embassy_mcxa276 as hal}; |
| 12 | mod common; | 12 | mod common; |
| 13 | 13 | ||
diff --git a/examples/adc_polling.rs b/examples/adc_polling.rs index 561500d2d..4b5f9422d 100644 --- a/examples/adc_polling.rs +++ b/examples/adc_polling.rs | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 5 | use embassy_mcxa276 as hal; | 5 | use embassy_mcxa276 as hal; |
| 6 | use hal::adc::{ConvResult, LpadcConfig, TriggerPriorityPolicy}; | 6 | use hal::adc::{ConvResult, LpadcConfig, TriggerPriorityPolicy}; |
| 7 | use hal::pac::adc1::cfg::{Pwrsel, Refsel}; | ||
| 8 | use hal::pac::adc1::cmdl1::{Adch, Mode}; | ||
| 9 | use hal::pac::adc1::ctrl::CalAvgs; | ||
| 10 | use hal::pac::adc1::tctrl::Tcmd; | ||
| 11 | use hal::uart; | 7 | use hal::uart; |
| 8 | use mcxa_pac::adc1::cfg::{Pwrsel, Refsel}; | ||
| 9 | use mcxa_pac::adc1::cmdl1::{Adch, Mode}; | ||
| 10 | use mcxa_pac::adc1::ctrl::CalAvgs; | ||
| 11 | use mcxa_pac::adc1::tctrl::Tcmd; | ||
| 12 | 12 | ||
| 13 | mod common; | 13 | mod common; |
| 14 | 14 | ||
diff --git a/examples/common/mod.rs b/examples/common/mod.rs index 7ada4c456..8c52c8e86 100644 --- a/examples/common/mod.rs +++ b/examples/common/mod.rs | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | //! Shared board-specific helpers for the FRDM-MCXA276 examples. | 1 | //! Shared board-specific helpers for the FRDM-MCXA276 examples. |
| 2 | //! These live with the examples so the HAL stays generic. | 2 | //! These live with the examples so the HAL stays generic. |
| 3 | 3 | ||
| 4 | use embassy_mcxa276 as hal; | ||
| 5 | use hal::{clocks, pins, reset}; | 4 | use hal::{clocks, pins, reset}; |
| 5 | use {embassy_mcxa276 as hal, panic_probe as _}; | ||
| 6 | 6 | ||
| 7 | /// Initialize clocks and pin muxing for UART2 debug console. | 7 | /// Initialize clocks and pin muxing for UART2 debug console. |
| 8 | /// Safe to call multiple times; writes are idempotent for our use. | 8 | /// Safe to call multiple times; writes are idempotent for our use. |
| 9 | #[allow(dead_code)] | 9 | #[allow(dead_code)] |
| 10 | pub unsafe fn init_uart2(p: &hal::pac::Peripherals) { | 10 | pub unsafe fn init_uart2(p: &mcxa_pac::Peripherals) { |
| 11 | clocks::ensure_frolf_running(p); | 11 | clocks::ensure_frolf_running(p); |
| 12 | clocks::enable_uart2_port2(p); | 12 | clocks::enable_uart2_port2(p); |
| 13 | reset::release_reset_port2(p); | 13 | reset::release_reset_port2(p); |
| @@ -18,7 +18,7 @@ pub unsafe fn init_uart2(p: &hal::pac::Peripherals) { | |||
| 18 | 18 | ||
| 19 | /// Initialize clocks for the LED GPIO/PORT used by the blink example. | 19 | /// Initialize clocks for the LED GPIO/PORT used by the blink example. |
| 20 | #[allow(dead_code)] | 20 | #[allow(dead_code)] |
| 21 | pub unsafe fn init_led(p: &hal::pac::Peripherals) { | 21 | pub unsafe fn init_led(p: &mcxa_pac::Peripherals) { |
| 22 | clocks::enable_led_port(p); | 22 | clocks::enable_led_port(p); |
| 23 | reset::release_reset_gpio3(p); | 23 | reset::release_reset_gpio3(p); |
| 24 | reset::release_reset_port3(p); | 24 | reset::release_reset_port3(p); |
| @@ -26,7 +26,7 @@ pub unsafe fn init_led(p: &hal::pac::Peripherals) { | |||
| 26 | 26 | ||
| 27 | /// Initialize clocks for OSTIMER0 (1 MHz source). | 27 | /// Initialize clocks for OSTIMER0 (1 MHz source). |
| 28 | #[allow(dead_code)] | 28 | #[allow(dead_code)] |
| 29 | pub unsafe fn init_ostimer0(p: &hal::pac::Peripherals) { | 29 | pub unsafe fn init_ostimer0(p: &mcxa_pac::Peripherals) { |
| 30 | clocks::ensure_frolf_running(p); | 30 | clocks::ensure_frolf_running(p); |
| 31 | clocks::enable_ostimer0(p); | 31 | clocks::enable_ostimer0(p); |
| 32 | reset::release_reset_ostimer0(p); | 32 | reset::release_reset_ostimer0(p); |
| @@ -35,7 +35,7 @@ pub unsafe fn init_ostimer0(p: &hal::pac::Peripherals) { | |||
| 35 | 35 | ||
| 36 | /// Initialize clocks and pin muxing for ADC. | 36 | /// Initialize clocks and pin muxing for ADC. |
| 37 | #[allow(dead_code)] | 37 | #[allow(dead_code)] |
| 38 | pub unsafe fn init_adc(p: &hal::pac::Peripherals) { | 38 | pub unsafe fn init_adc(p: &mcxa_pac::Peripherals) { |
| 39 | clocks::ensure_frolf_running(p); | 39 | clocks::ensure_frolf_running(p); |
| 40 | clocks::enable_adc(p); | 40 | clocks::enable_adc(p); |
| 41 | reset::release_reset_port1(p); | 41 | reset::release_reset_port1(p); |
diff --git a/examples/lpuart_buffered.rs b/examples/lpuart_buffered.rs index 30ba3f333..35d311143 100644 --- a/examples/lpuart_buffered.rs +++ b/examples/lpuart_buffered.rs | |||
| @@ -26,7 +26,7 @@ async fn main(_spawner: Spawner) { | |||
| 26 | let p2 = lpuart::lib::init(); | 26 | let p2 = lpuart::lib::init(); |
| 27 | 27 | ||
| 28 | unsafe { | 28 | unsafe { |
| 29 | hal::interrupt::install_irq_handler(mcxa276_pac::Interrupt::LPUART2, lpuart2_handler); | 29 | hal::interrupt::install_irq_handler(mcxa_pac::Interrupt::LPUART2, lpuart2_handler); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | // Configure NVIC for LPUART2 | 32 | // Configure NVIC for LPUART2 |
diff --git a/examples/ostimer_race_test.rs b/examples/ostimer_race_test.rs index a637b6353..368a3e52f 100644 --- a/examples/ostimer_race_test.rs +++ b/examples/ostimer_race_test.rs | |||
| @@ -267,7 +267,7 @@ async fn test_concurrent_operations( | |||
| 267 | async fn test_reset_during_operation( | 267 | async fn test_reset_during_operation( |
| 268 | ostimer: &hal::ostimer::Ostimer<'_, hal::ostimer::Ostimer0>, | 268 | ostimer: &hal::ostimer::Ostimer<'_, hal::ostimer::Ostimer0>, |
| 269 | uart: &mut hal::uart::Uart<hal::uart::Lpuart2>, | 269 | uart: &mut hal::uart::Uart<hal::uart::Lpuart2>, |
| 270 | peripherals: &hal::pac::Peripherals, | 270 | peripherals: &mcxa_pac::Peripherals, |
| 271 | ) { | 271 | ) { |
| 272 | let initial_counter = ostimer.now(); | 272 | let initial_counter = ostimer.now(); |
| 273 | 273 | ||
