Start timer abstractions
This commit is contained in:
@@ -5,4 +5,35 @@
|
||||
|
||||
|
||||
|
||||
class Timer {
|
||||
public:
|
||||
|
||||
explicit Timer(Timer_Key t);
|
||||
|
||||
//Starts the counter
|
||||
void start();
|
||||
|
||||
//Stops the counter
|
||||
void stop();
|
||||
|
||||
void setPrescaler(uint16_t presc);
|
||||
|
||||
void setARR(uint16_t arr);
|
||||
|
||||
void enableInterrupt();
|
||||
|
||||
private:
|
||||
|
||||
Timer_Key timer;
|
||||
volatile TIM_TypeDef* timer_reg;
|
||||
|
||||
};
|
||||
|
||||
extern "C" void TIM2_IRQHandler(void){
|
||||
if(TIM2->SR & TIM_SR_UIF) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user