Skip to content

Commit f2d0f93

Browse files
committed
Ideas
1 parent 31f34d2 commit f2d0f93

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
@@ -98,13 +98,16 @@ pub struct Timer<TIM> {
9898
pub enum Event {
9999
/// Timer timed out / count down ended
100100
Update,
101+
// CounterUnderflow,
102+
// CounterOverflow,
101103
}
102104

103105
impl<TIM> Timer<TIM>
104106
where
105107
TIM: Instance,
106108
{
107109
/// Configures a TIM peripheral as a periodic count down timer
110+
// TODO: CHange clocks to be a global variable
108111
pub fn new(tim: TIM, clocks: Clocks, apb: &mut <TIM as rcc::RccBus>::Bus) -> Self {
109112
TIM::enable(apb);
110113
TIM::reset(apb);
@@ -315,6 +318,9 @@ where
315318
/// based on [`crate::pac::tim6::RegisterBlock`].
316319
///
317320
/// This is not meant to be used outside of this crate.
321+
// TODO: Maybe use transmute to create a real basic common register block
322+
// (e.g. pac::tim6::ReigsterBlock), as all blocks should be compatible to
323+
// each other ... (hopefully).
318324
pub trait CommonRegisterBlock: crate::private::Sealed {
319325
#[doc(hidden)]
320326
fn set_cr1_cen(&mut self, enable: bool);
@@ -553,3 +559,7 @@ cfg_if::cfg_if! {
553559
timer_var_clock!(1);
554560
}
555561
}
562+
563+
fn test(tim: pac::TIM16) {
564+
let tim6: *const pac::tim6::RegisterBlock = unsafe {core::mem::transmute(pac::TIM16::ptr())};
565+
}

0 commit comments

Comments
 (0)