aboutsummaryrefslogtreecommitdiff
path: root/embassy-mcxa
diff options
context:
space:
mode:
authorJames Munns <[email protected]>2025-12-04 19:19:23 +0100
committerJames Munns <[email protected]>2025-12-04 19:19:23 +0100
commite7e4d0e03f6ccee7a8577058bfccefaf92b2689e (patch)
tree21fedd516fc5bd2cc54f893a9ef119ee3d847afd /embassy-mcxa
parent6530bcd8bcff9169f39732ba93a612f9262b809e (diff)
rustfmt
Diffstat (limited to 'embassy-mcxa')
-rw-r--r--embassy-mcxa/src/adc.rs2
-rw-r--r--embassy-mcxa/src/clkout.rs2
-rw-r--r--embassy-mcxa/src/clocks/periph_helpers.rs6
-rw-r--r--embassy-mcxa/src/i2c/controller.rs6
-rw-r--r--embassy-mcxa/src/interrupt.rs2
-rw-r--r--embassy-mcxa/src/lpuart/buffered.rs2
-rw-r--r--embassy-mcxa/src/lpuart/mod.rs6
-rw-r--r--embassy-mcxa/src/ostimer.rs8
8 files changed, 15 insertions, 19 deletions
diff --git a/embassy-mcxa/src/adc.rs b/embassy-mcxa/src/adc.rs
index b5ec5983f..7475299ba 100644
--- a/embassy-mcxa/src/adc.rs
+++ b/embassy-mcxa/src/adc.rs
@@ -4,7 +4,7 @@ use core::sync::atomic::{AtomicBool, Ordering};
4use embassy_hal_internal::{Peri, PeripheralType}; 4use embassy_hal_internal::{Peri, PeripheralType};
5 5
6use crate::clocks::periph_helpers::{AdcClockSel, AdcConfig, Div4}; 6use crate::clocks::periph_helpers::{AdcClockSel, AdcConfig, Div4};
7use crate::clocks::{enable_and_reset, Gate, PoweredClock}; 7use crate::clocks::{Gate, PoweredClock, enable_and_reset};
8use crate::pac; 8use crate::pac;
9use crate::pac::adc1::cfg::{HptExdi, Pwrsel, Refsel, Tcmdres, Tprictrl, Tres}; 9use crate::pac::adc1::cfg::{HptExdi, Pwrsel, Refsel, Tcmdres, Tprictrl, Tres};
10use crate::pac::adc1::cmdh1::{Avgs, Cmpen, Next, Sts}; 10use crate::pac::adc1::cmdh1::{Avgs, Cmpen, Next, Sts};
diff --git a/embassy-mcxa/src/clkout.rs b/embassy-mcxa/src/clkout.rs
index 88c731df1..5b21f24b0 100644
--- a/embassy-mcxa/src/clkout.rs
+++ b/embassy-mcxa/src/clkout.rs
@@ -9,7 +9,7 @@ use core::marker::PhantomData;
9use embassy_hal_internal::Peri; 9use embassy_hal_internal::Peri;
10 10
11pub use crate::clocks::periph_helpers::Div4; 11pub use crate::clocks::periph_helpers::Div4;
12use crate::clocks::{with_clocks, ClockError, PoweredClock}; 12use crate::clocks::{ClockError, PoweredClock, with_clocks};
13use crate::pac::mrcc0::mrcc_clkout_clksel::Mux; 13use crate::pac::mrcc0::mrcc_clkout_clksel::Mux;
14use crate::peripherals::CLKOUT; 14use crate::peripherals::CLKOUT;
15 15
diff --git a/embassy-mcxa/src/clocks/periph_helpers.rs b/embassy-mcxa/src/clocks/periph_helpers.rs
index 1ea7a99ed..fed5e558e 100644
--- a/embassy-mcxa/src/clocks/periph_helpers.rs
+++ b/embassy-mcxa/src/clocks/periph_helpers.rs
@@ -108,11 +108,7 @@ impl Div4 {
108 /// by 1, and `Div4::from_raw(15)` will divide the source by 108 /// by 1, and `Div4::from_raw(15)` will divide the source by
109 /// 16. 109 /// 16.
110 pub const fn from_raw(n: u8) -> Option<Self> { 110 pub const fn from_raw(n: u8) -> Option<Self> {
111 if n > 0b1111 { 111 if n > 0b1111 { None } else { Some(Self(n)) }
112 None
113 } else {
114 Some(Self(n))
115 }
116 } 112 }
117 113
118 /// Store a specific divisor value that will divide the source 114 /// Store a specific divisor value that will divide the source
diff --git a/embassy-mcxa/src/i2c/controller.rs b/embassy-mcxa/src/i2c/controller.rs
index 182a53aea..c27d508b0 100644
--- a/embassy-mcxa/src/i2c/controller.rs
+++ b/embassy-mcxa/src/i2c/controller.rs
@@ -3,15 +3,15 @@
3use core::future::Future; 3use core::future::Future;
4use core::marker::PhantomData; 4use core::marker::PhantomData;
5 5
6use embassy_hal_internal::drop::OnDrop;
7use embassy_hal_internal::Peri; 6use embassy_hal_internal::Peri;
7use embassy_hal_internal::drop::OnDrop;
8use mcxa_pac::lpi2c0::mtdr::Cmd; 8use mcxa_pac::lpi2c0::mtdr::Cmd;
9 9
10use super::{Async, Blocking, Error, Instance, InterruptHandler, Mode, Result, SclPin, SdaPin}; 10use super::{Async, Blocking, Error, Instance, InterruptHandler, Mode, Result, SclPin, SdaPin};
11use crate::AnyPin;
11use crate::clocks::periph_helpers::{Div4, Lpi2cClockSel, Lpi2cConfig}; 12use crate::clocks::periph_helpers::{Div4, Lpi2cClockSel, Lpi2cConfig};
12use crate::clocks::{enable_and_reset, PoweredClock}; 13use crate::clocks::{PoweredClock, enable_and_reset};
13use crate::interrupt::typelevel::Interrupt; 14use crate::interrupt::typelevel::Interrupt;
14use crate::AnyPin;
15 15
16/// Bus speed (nominal SCL, no clock stretching) 16/// Bus speed (nominal SCL, no clock stretching)
17#[derive(Clone, Copy, Default, PartialEq)] 17#[derive(Clone, Copy, Default, PartialEq)]
diff --git a/embassy-mcxa/src/interrupt.rs b/embassy-mcxa/src/interrupt.rs
index 1d10e3b2d..c1f7e55a0 100644
--- a/embassy-mcxa/src/interrupt.rs
+++ b/embassy-mcxa/src/interrupt.rs
@@ -32,7 +32,7 @@ mod generated {
32 32
33use core::sync::atomic::{AtomicU16, AtomicU32, Ordering}; 33use core::sync::atomic::{AtomicU16, AtomicU32, Ordering};
34 34
35pub use generated::interrupt::{typelevel, Priority}; 35pub use generated::interrupt::{Priority, typelevel};
36 36
37use crate::pac::Interrupt; 37use crate::pac::Interrupt;
38 38
diff --git a/embassy-mcxa/src/lpuart/buffered.rs b/embassy-mcxa/src/lpuart/buffered.rs
index 8eb443ca7..34fdbb76c 100644
--- a/embassy-mcxa/src/lpuart/buffered.rs
+++ b/embassy-mcxa/src/lpuart/buffered.rs
@@ -3,8 +3,8 @@ use core::marker::PhantomData;
3use core::sync::atomic::{AtomicBool, Ordering}; 3use core::sync::atomic::{AtomicBool, Ordering};
4use core::task::Poll; 4use core::task::Poll;
5 5
6use embassy_hal_internal::atomic_ring_buffer::RingBuffer;
7use embassy_hal_internal::Peri; 6use embassy_hal_internal::Peri;
7use embassy_hal_internal::atomic_ring_buffer::RingBuffer;
8use embassy_sync::waitqueue::AtomicWaker; 8use embassy_sync::waitqueue::AtomicWaker;
9 9
10use super::*; 10use super::*;
diff --git a/embassy-mcxa/src/lpuart/mod.rs b/embassy-mcxa/src/lpuart/mod.rs
index 2d8308ec8..b8a2d5172 100644
--- a/embassy-mcxa/src/lpuart/mod.rs
+++ b/embassy-mcxa/src/lpuart/mod.rs
@@ -4,13 +4,13 @@ use embassy_hal_internal::{Peri, PeripheralType};
4use paste::paste; 4use paste::paste;
5 5
6use crate::clocks::periph_helpers::{Div4, LpuartClockSel, LpuartConfig}; 6use crate::clocks::periph_helpers::{Div4, LpuartClockSel, LpuartConfig};
7use crate::clocks::{enable_and_reset, ClockError, Gate, PoweredClock}; 7use crate::clocks::{ClockError, Gate, PoweredClock, enable_and_reset};
8use crate::gpio::SealedPin; 8use crate::gpio::SealedPin;
9use crate::pac::lpuart0::baud::Sbns as StopBits; 9use crate::pac::lpuart0::baud::Sbns as StopBits;
10use crate::pac::lpuart0::ctrl::{Idlecfg as IdleConfig, Ilt as IdleType, Pt as Parity, M as DataBits}; 10use crate::pac::lpuart0::ctrl::{Idlecfg as IdleConfig, Ilt as IdleType, M as DataBits, Pt as Parity};
11use crate::pac::lpuart0::modir::{Txctsc as TxCtsConfig, Txctssrc as TxCtsSource}; 11use crate::pac::lpuart0::modir::{Txctsc as TxCtsConfig, Txctssrc as TxCtsSource};
12use crate::pac::lpuart0::stat::Msbf as MsbFirst; 12use crate::pac::lpuart0::stat::Msbf as MsbFirst;
13use crate::{interrupt, pac, AnyPin}; 13use crate::{AnyPin, interrupt, pac};
14 14
15pub mod buffered; 15pub mod buffered;
16 16
diff --git a/embassy-mcxa/src/ostimer.rs b/embassy-mcxa/src/ostimer.rs
index c51812e3d..9e66e82d8 100644
--- a/embassy-mcxa/src/ostimer.rs
+++ b/embassy-mcxa/src/ostimer.rs
@@ -32,7 +32,7 @@ use core::sync::atomic::{AtomicBool, Ordering};
32use embassy_hal_internal::{Peri, PeripheralType}; 32use embassy_hal_internal::{Peri, PeripheralType};
33 33
34use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel}; 34use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel};
35use crate::clocks::{assert_reset, enable_and_reset, is_reset_released, release_reset, Gate, PoweredClock}; 35use crate::clocks::{Gate, PoweredClock, assert_reset, enable_and_reset, is_reset_released, release_reset};
36use crate::interrupt::InterruptExt; 36use crate::interrupt::InterruptExt;
37use crate::pac; 37use crate::pac;
38 38
@@ -521,11 +521,11 @@ pub mod time_driver {
521 use embassy_time_driver as etd; 521 use embassy_time_driver as etd;
522 522
523 use super::{ 523 use super::{
524 bin_to_gray, now_ticks_read, Regs, ALARM_ACTIVE, ALARM_CALLBACK, ALARM_FLAG, ALARM_TARGET_TIME, 524 ALARM_ACTIVE, ALARM_CALLBACK, ALARM_FLAG, ALARM_TARGET_TIME, EVTIMER_HI_MASK, EVTIMER_HI_SHIFT,
525 EVTIMER_HI_MASK, EVTIMER_HI_SHIFT, LOW_32_BIT_MASK, 525 LOW_32_BIT_MASK, Regs, bin_to_gray, now_ticks_read,
526 }; 526 };
527 use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel}; 527 use crate::clocks::periph_helpers::{OsTimerConfig, OstimerClockSel};
528 use crate::clocks::{enable_and_reset, PoweredClock}; 528 use crate::clocks::{PoweredClock, enable_and_reset};
529 use crate::pac; 529 use crate::pac;
530 530
531 #[allow(non_camel_case_types)] 531 #[allow(non_camel_case_types)]