aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Munns <[email protected]>2025-11-12 18:54:40 +0100
committerJames Munns <[email protected]>2025-11-12 18:54:40 +0100
commitdd7a90eb51197fae6ef6c6b7beae977a9143e268 (patch)
tree1de532732f506c260fe9e091d51103874a1ab605
parent2f08491f1a09df79bf1d41e26217d21b0bd7bdae (diff)
parent6eb28d3e7b7290d2998229b1bfb624e33575ea83 (diff)
Merge remote-tracking branch 'origin/main' into james/impl-clocks
-rw-r--r--Cargo.toml13
-rw-r--r--examples/adc_interrupt.rs8
-rw-r--r--examples/adc_polling.rs8
-rw-r--r--examples/common/mod.rs10
-rw-r--r--examples/lpuart_buffered.rs2
-rw-r--r--examples/ostimer_race_test.rs2
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" }
36nb = "1.1.0" 36nb = "1.1.0"
37 37
38[dev-dependencies] 38[dev-dependencies]
39defmt = "1.0"
39defmt-rtt = "1.0" 40defmt-rtt = "1.0"
40panic-probe = { version = "1.0", features = ["print-defmt"] } 41panic-probe = { version = "1.0", features = ["print-defmt"] }
41 42
@@ -52,51 +53,39 @@ unstable-pac = []
52 53
53[[example]] 54[[example]]
54name = "hello" 55name = "hello"
55required-features = ["lpuart2"]
56 56
57[[example]] 57[[example]]
58name = "blink" 58name = "blink"
59required-features = ["gpio", "ostimer0"]
60 59
61[[example]] 60[[example]]
62name = "uart_interrupt" 61name = "uart_interrupt"
63required-features = ["lpuart2", "ostimer0"]
64 62
65[[example]] 63[[example]]
66name = "ostimer_alarm" 64name = "ostimer_alarm"
67required-features = ["lpuart2", "ostimer0"]
68 65
69[[example]] 66[[example]]
70name = "ostimer_async" 67name = "ostimer_async"
71required-features = ["lpuart2", "ostimer0"]
72 68
73[[example]] 69[[example]]
74name = "ostimer_counter" 70name = "ostimer_counter"
75required-features = ["lpuart2", "ostimer0"]
76 71
77[[example]] 72[[example]]
78name = "ostimer_race_test" 73name = "ostimer_race_test"
79required-features = ["lpuart2", "ostimer0"]
80 74
81[[example]] 75[[example]]
82name = "lpuart_polling" 76name = "lpuart_polling"
83required-features = ["lpuart2", "ostimer0"]
84 77
85[[example]] 78[[example]]
86name = "lpuart_buffered" 79name = "lpuart_buffered"
87required-features = ["lpuart2", "ostimer0"]
88 80
89[[example]] 81[[example]]
90name = "rtc_alarm" 82name = "rtc_alarm"
91required-features = ["lpuart2", "rtc0"]
92 83
93[[example]] 84[[example]]
94name = "adc_polling" 85name = "adc_polling"
95required-features = ["adc1", "lpuart2"]
96 86
97[[example]] 87[[example]]
98name = "adc_interrupt" 88name = "adc_interrupt"
99required-features = ["adc1", "lpuart2"]
100 89
101[profile.release] 90[profile.release]
102debug = 2 91debug = 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
4use embassy_executor::Spawner; 4use embassy_executor::Spawner;
5use hal::adc::{LpadcConfig, TriggerPriorityPolicy}; 5use hal::adc::{LpadcConfig, TriggerPriorityPolicy};
6use hal::pac::adc1::cfg::{Pwrsel, Refsel};
7use hal::pac::adc1::cmdl1::{Adch, Mode};
8use hal::pac::adc1::ctrl::CalAvgs;
9use hal::pac::adc1::tctrl::Tcmd;
10use hal::uart; 6use hal::uart;
7use mcxa_pac::adc1::cfg::{Pwrsel, Refsel};
8use mcxa_pac::adc1::cmdl1::{Adch, Mode};
9use mcxa_pac::adc1::ctrl::CalAvgs;
10use mcxa_pac::adc1::tctrl::Tcmd;
11use {cortex_m, embassy_mcxa276 as hal}; 11use {cortex_m, embassy_mcxa276 as hal};
12mod common; 12mod 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 @@
4use embassy_executor::Spawner; 4use embassy_executor::Spawner;
5use embassy_mcxa276 as hal; 5use embassy_mcxa276 as hal;
6use hal::adc::{ConvResult, LpadcConfig, TriggerPriorityPolicy}; 6use hal::adc::{ConvResult, LpadcConfig, TriggerPriorityPolicy};
7use hal::pac::adc1::cfg::{Pwrsel, Refsel};
8use hal::pac::adc1::cmdl1::{Adch, Mode};
9use hal::pac::adc1::ctrl::CalAvgs;
10use hal::pac::adc1::tctrl::Tcmd;
11use hal::uart; 7use hal::uart;
8use mcxa_pac::adc1::cfg::{Pwrsel, Refsel};
9use mcxa_pac::adc1::cmdl1::{Adch, Mode};
10use mcxa_pac::adc1::ctrl::CalAvgs;
11use mcxa_pac::adc1::tctrl::Tcmd;
12 12
13mod common; 13mod 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
4use embassy_mcxa276 as hal;
5use hal::{clocks, pins, reset}; 4use hal::{clocks, pins, reset};
5use {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)]
10pub unsafe fn init_uart2(p: &hal::pac::Peripherals) { 10pub 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)]
21pub unsafe fn init_led(p: &hal::pac::Peripherals) { 21pub 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)]
29pub unsafe fn init_ostimer0(p: &hal::pac::Peripherals) { 29pub 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)]
38pub unsafe fn init_adc(p: &hal::pac::Peripherals) { 38pub 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(
267async fn test_reset_during_operation( 267async 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