Skip to content

Commit 0460537

Browse files
committed
Ideas
1 parent 565b43c commit 0460537

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/timer.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,16 @@ pub struct Timer<TIM> {
102102
pub enum Event {
103103
/// Timer timed out / count down ended
104104
Update,
105+
// CounterUnderflow,
106+
// CounterOverflow,
105107
}
106108

107109
impl<TIM> Timer<TIM>
108110
where
109111
TIM: Instance,
110112
{
111113
/// Configures a TIM peripheral as a periodic count down timer
114+
// TODO: CHange clocks to be a global variable
112115
pub fn new(tim: TIM, clocks: Clocks, apb: &mut <TIM as rcc::RccBus>::Bus) -> Self {
113116
TIM::enable(apb);
114117
TIM::reset(apb);
@@ -344,6 +347,9 @@ where
344347
/// based on [`crate::pac::tim6::RegisterBlock`].
345348
///
346349
/// This is not meant to be used outside of this crate.
350+
// TODO: Maybe use transmute to create a real basic common register block
351+
// (e.g. pac::tim6::ReigsterBlock), as all blocks should be compatible to
352+
// each other ... (hopefully).
347353
pub trait CommonRegisterBlock: crate::private::Sealed {
348354
#[doc(hidden)]
349355
fn set_cr1_cen(&mut self, enable: bool);
@@ -582,3 +588,7 @@ cfg_if::cfg_if! {
582588
timer_var_clock!(1);
583589
}
584590
}
591+
592+
fn test(tim: pac::TIM16) {
593+
let tim6: *const pac::tim6::RegisterBlock = unsafe {core::mem::transmute(pac::TIM16::ptr())};
594+
}

0 commit comments

Comments
 (0)