Prusa MINI Firmware overview
timer_defaults.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------//
2 // timer_defaults.h - default values for timers
3 #ifndef _TIMER_DEFAULTS_H
4 #define _TIMER_DEFAULTS_H
5 
6 #define TIM_BASE_CLK_MHZ 84
7 
8 //timer defaults
9 //50000 us
10 #define TIM1_default_Prescaler 0x3fff
11 #define TIM1_default_Period 0xff
12 #define TIM3_default_Prescaler 0x3fff
13 #define TIM3_default_Period 0xff
14 
15 //must be macro to be able to inicialize variables with it
16 #define GEN_PERIOD_US(prescaler, period) \
17  (prescaler + 1) * (period + 1) / (int32_t)TIM_BASE_CLK_MHZ;
18 
19 #endif //_TIMER_DEFAULTS_H