#include "timer.h" #define BASE ((TIM_TypeDef *)timerBase_Addr_List[timer]) void timerActivateBus(timerNo_t timer) { if(timerBus_No[timer]==1) { RCC->APB1ENR |= (1<APB2ENR |= (1<CR1 &= ~0x01; //all the timers have the same CEN bit in CR1 register pos 0 } void timerSetClkSource(timerNo_t timer, clkSources_t clk) { } void timerSetMode(timerNo_t timer, timerMode_t mode) { } void timerSetCountDirection(timerNo_t timer, timerCountDirection_t direction) { } void timerSetPrescaler(timerNo_t timer, uint32_t prescaler) { BASE->PSC = prescaler; } void timerSetPostscaler(timerNo_t timer, uint32_t postscaler) { } void timerSetAutoReload(timerNo_t timer, uint32_t reload) { BASE->ARR = reload; } void timerClearCounter(timerNo_t timer) { BASE->CNT = 0; } /* Second stage configuration */ void timerSetHz(timerNo_t timer, uint16_t hz) { } void timerSetMs(timerNo_t timer, uint16_t ms) { } void timerSetNs(timerNo_t timer, uint16_t ns) { } void timerSetPs(timerNo_t timer, uint16_t ps) { } void timerSart(timerNo_t timer) { } void timerStop(timerNo_t timer) { } uint32_t timerGetCount(timerNo_t timer) { } void timerThrowError(timerError_t error) { }