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 @@ -98,13 +98,16 @@ pub struct Timer<TIM> {
9898pub enum Event {
9999 /// Timer timed out / count down ended
100100 Update ,
101+ // CounterUnderflow,
102+ // CounterOverflow,
101103}
102104
103105impl < TIM > Timer < TIM >
104106where
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).
318324pub 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+ }
You can’t perform that action at this time.
0 commit comments