File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,16 @@ pub struct Timer<TIM> {
102
102
pub enum Event {
103
103
/// Timer timed out / count down ended
104
104
Update ,
105
+ // CounterUnderflow,
106
+ // CounterOverflow,
105
107
}
106
108
107
109
impl < TIM > Timer < TIM >
108
110
where
109
111
TIM : Instance ,
110
112
{
111
113
/// Configures a TIM peripheral as a periodic count down timer
114
+ // TODO: CHange clocks to be a global variable
112
115
pub fn new ( tim : TIM , clocks : Clocks , apb : & mut <TIM as rcc:: RccBus >:: Bus ) -> Self {
113
116
TIM :: enable ( apb) ;
114
117
TIM :: reset ( apb) ;
@@ -344,6 +347,9 @@ where
344
347
/// based on [`crate::pac::tim6::RegisterBlock`].
345
348
///
346
349
/// 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).
347
353
pub trait CommonRegisterBlock : crate :: private:: Sealed {
348
354
#[ doc( hidden) ]
349
355
fn set_cr1_cen ( & mut self , enable : bool ) ;
@@ -582,3 +588,7 @@ cfg_if::cfg_if! {
582
588
timer_var_clock!( 1 ) ;
583
589
}
584
590
}
591
+
592
+ fn test ( tim : pac:: TIM16 ) {
593
+ let tim6: * const pac:: tim6:: RegisterBlock = unsafe { core:: mem:: transmute ( pac:: TIM16 :: ptr ( ) ) } ;
594
+ }
You can’t perform that action at this time.
0 commit comments