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> {
98
98
pub enum Event {
99
99
/// Timer timed out / count down ended
100
100
Update ,
101
+ // CounterUnderflow,
102
+ // CounterOverflow,
101
103
}
102
104
103
105
impl < TIM > Timer < TIM >
104
106
where
105
107
TIM : Instance ,
106
108
{
107
109
/// Configures a TIM peripheral as a periodic count down timer
110
+ // TODO: CHange clocks to be a global variable
108
111
pub fn new ( tim : TIM , clocks : Clocks , apb : & mut <TIM as rcc:: RccBus >:: Bus ) -> Self {
109
112
TIM :: enable ( apb) ;
110
113
TIM :: reset ( apb) ;
@@ -315,6 +318,9 @@ where
315
318
/// based on [`crate::pac::tim6::RegisterBlock`].
316
319
///
317
320
/// 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).
318
324
pub trait CommonRegisterBlock : crate :: private:: Sealed {
319
325
#[ doc( hidden) ]
320
326
fn set_cr1_cen ( & mut self , enable : bool ) ;
@@ -553,3 +559,7 @@ cfg_if::cfg_if! {
553
559
timer_var_clock!( 1 ) ;
554
560
}
555
561
}
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