Skip to content

Commit 1c3cd6e

Browse files
committed
wip
1 parent e55d747 commit 1c3cd6e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

embassy-stm32/src/timer/low_level.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
303303
pub fn bits(&self) -> TimerBits {
304304
match T::Word::bits() {
305305
16 => TimerBits::Bits16,
306+
#[cfg(not(stm32l0))]
306307
32 => TimerBits::Bits32,
307308
_ => unreachable!(),
308309
}

embassy-stm32/src/timer/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ pub trait CoreInstance: SealedInstance + 'static {
177177
/// This is a raw pointer to the register block. The actual register block layout varies depending on the timer type.
178178
fn regs() -> *mut ();
179179
}
180+
181+
#[cfg(stm32l0)]
182+
impl From<crate::pac::timer::regs::Ccr1ch> for u32 {
183+
fn from(value: crate::pac::timer::regs::Ccr1ch) -> Self {
184+
value.ccr().into()
185+
}
186+
}
187+
188+
#[cfg(stm32l0)]
189+
impl From<u32> for crate::pac::timer::regs::ArrCore {
190+
fn from(value: u32) -> Self {
191+
crate::pac::timer::regs::ArrCore(value)
192+
}
193+
}
194+
180195
/// Cut-down basic timer instance.
181196
pub trait BasicNoCr2Instance: CoreInstance {}
182197
/// Basic timer instance.

0 commit comments

Comments
 (0)