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> {
102102pub enum Event {
103103 /// Timer timed out / count down ended
104104 Update ,
105+ // CounterUnderflow,
106+ // CounterOverflow,
105107}
106108
107109impl < TIM > Timer < TIM >
108110where
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).
347353pub 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+ }
You can’t perform that action at this time.
0 commit comments