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 | |
| parent | 2f08491f1a09df79bf1d41e26217d21b0bd7bdae (diff) | |
| parent | 6eb28d3e7b7290d2998229b1bfb624e33575ea83 (diff) | |
Merge remote-tracking branch 'origin/main' into james/impl-clocks
| -rw-r--r-- | Cargo.toml | 13 | ||||
| -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 |
6 files changed, 16 insertions, 27 deletions
diff --git a/Cargo.toml b/Cargo.toml index afcb2d3c9..34eba8d23 100644 --- a/Cargo.toml +++ b/Cargo.toml | |||
| @@ -36,6 +36,7 @@ embedded-io-async = { version = "0.6.1" } | |||
| 36 | nb = "1.1.0" | 36 | nb = "1.1.0" |
| 37 | 37 | ||
| 38 | [dev-dependencies] | 38 | [dev-dependencies] |
| 39 | defmt = "1.0" | ||
| 39 | defmt-rtt = "1.0" | 40 | defmt-rtt = "1.0" |
| 40 | panic-probe = { version = "1.0", features = ["print-defmt"] } | 41 | panic-probe = { version = "1.0", features = ["print-defmt"] } |
| 41 | 42 | ||
| @@ -52,51 +53,39 @@ unstable-pac = [] | |||
| 52 | 53 | ||
| 53 | [[example]] | 54 | [[example]] |
| 54 | name = "hello" | 55 | name = "hello" |
| 55 | required-features = ["lpuart2"] | ||
| 56 | 56 | ||
| 57 | [[example]] | 57 | [[example]] |
| 58 | name = "blink" | 58 | name = "blink" |
| 59 | required-features = ["gpio", "ostimer0"] | ||
| 60 | 59 | ||
| 61 | [[example]] | 60 | [[example]] |
| 62 | name = "uart_interrupt" | 61 | name = "uart_interrupt" |
| 63 | required-features = ["lpuart2", "ostimer0"] | ||
| 64 | 62 | ||
| 65 | [[example]] | 63 | [[example]] |
| 66 | name = "ostimer_alarm" | 64 | name = "ostimer_alarm" |
| 67 | required-features = ["lpuart2", "ostimer0"] | ||
| 68 | 65 | ||
| 69 | [[example]] | 66 | [[example]] |
| 70 | name = "ostimer_async" | 67 | name = "ostimer_async" |
| 71 | required-features = ["lpuart2", "ostimer0"] | ||
| 72 | 68 | ||
| 73 | [[example]] | 69 | [[example]] |
| 74 | name = "ostimer_counter" | 70 | name = "ostimer_counter" |
| 75 | required-features = ["lpuart2", "ostimer0"] | ||
| 76 | 71 | ||
| 77 | [[example]] | 72 | [[example]] |
| 78 | name = "ostimer_race_test" | 73 | name = "ostimer_race_test" |
| 79 | required-features = ["lpuart2", "ostimer0"] | ||
| 80 | 74 | ||
| 81 | [[example]] | 75 | [[example]] |
| 82 | name = "lpuart_polling" | 76 | name = "lpuart_polling" |
| 83 | required-features = ["lpuart2", "ostimer0"] | ||
| 84 | 77 | ||
| 85 | [[example]] | 78 | [[example]] |
| 86 | name = "lpuart_buffered" | 79 | name = "lpuart_buffered" |
| 87 | required-features = ["lpuart2", "ostimer0"] | ||
| 88 | 80 | ||
| 89 | [[example]] | 81 | [[example]] |
| 90 | name = "rtc_alarm" | 82 | name = "rtc_alarm" |
| 91 | required-features = ["lpuart2", "rtc0"] | ||
| 92 | 83 | ||
| 93 | [[example]] | 84 | [[example]] |
| 94 | name = "adc_polling" | 85 | name = "adc_polling" |
| 95 | required-features = ["adc1", "lpuart2"] | ||
| 96 | 86 | ||
| 97 | [[example]] | 87 | [[example]] |
| 98 | name = "adc_interrupt" | 88 | name = "adc_interrupt" |
| 99 | required-features = ["adc1", "lpuart2"] | ||
| 100 | 89 | ||
| 101 | [profile.release] | 90 | [profile.release] |
| 102 | debug = 2 | 91 | debug = 2 |
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 | ||
