20 #if !defined(USABLE_TIMER_CHANNEL_COUNT)
21 #define USABLE_TIMER_CHANNEL_COUNT 14
26 #if defined(STM32F303)
27 typedef uint32_t timCCR_t;
28 typedef uint32_t timCCER_t;
29 typedef uint32_t timSR_t;
30 typedef uint32_t timCNT_t;
31 #elif defined(STM32F10X)
32 typedef uint16_t timCCR_t;
33 typedef uint16_t timCCER_t;
34 typedef uint16_t timSR_t;
35 typedef uint16_t timCNT_t;
36 #elif defined(UNIT_TEST)
37 typedef uint32_t timCCR_t;
38 typedef uint32_t timCCER_t;
39 typedef uint32_t timSR_t;
40 typedef uint32_t timCNT_t;
42 # error "Unknown CPU defined"
69 uint8_t gpioPinSource;
70 uint8_t alternateFunction;
const timerHardware_t timerHardware[]
uint8_t type
Definition: fat_standard.h:67
uint16_t pin
Definition: timer.h:63
volatile timCCR_t * timerChCCRLo(const timerHardware_t *timHw)
Definition: timer.c:759
void timerChConfigICDual(const timerHardware_t *timHw, bool polarityRising, unsigned inputFilterSamples)
Definition: timer.c:726
void timerChITConfigDualLo(const timerHardware_t *timHw, FunctionalState newState)
Definition: timer.c:661
void timerChConfigCallbacksDual(const timerHardware_t *channel, timerCCHandlerRec_t *edgeCallbackLo, timerCCHandlerRec_t *edgeCallbackHi, timerOvrHandlerRec_t *overflowCallback)
Definition: timer.c:626
void configTimeBase(TIM_TypeDef *tim, uint16_t period, uint8_t mhz)
Definition: timer.c:504
void timerChITConfig(const timerHardware_t *timHw, FunctionalState newState)
Definition: timer.c:667
GPIO_TypeDef * gpio
Definition: timer.h:62
volatile timCCR_t * timerChCCRHi(const timerHardware_t *timHw)
Definition: timer.c:754
void timerChConfigGPIO(const timerHardware_t *timHw, GPIO_Mode mode)
Definition: timer.c:679
void timerChConfigOC(const timerHardware_t *timHw, bool outEnable, bool stateHigh)
Definition: timer.c:771
uint16_t captureCompare_t
Definition: timer.h:24
void timerChConfigIC(const timerHardware_t *timHw, bool polarityRising, unsigned inputFilterSamples)
Definition: timer.c:710
void timerCCHandlerCallback(struct timerCCHandlerRec_s *self, uint16_t capture)
Definition: timer.h:48
uint8_t mode
Definition: gimbal.h:49
void timerChClearCCFlag(const timerHardware_t *timHw)
Definition: timer.c:673
struct timerOvrHandlerRec_s timerOvrHandlerRec_t
void timerForceOverflow(TIM_TypeDef *tim)
Definition: timer.c:1011
struct timerOvrHandlerRec_s * next
Definition: timer.h:57
void timerChCCHandlerInit(timerCCHandlerRec_t *self, timerCCHandlerCallback *fn)
Definition: timer.c:575
void timerStart(void)
Definition: timer.c:978
void timerChICPolarity(const timerHardware_t *timHw, bool polarityRising)
Definition: timer.c:746
channelType_t
Definition: timer.h:76
struct timerCCHandlerRec_s timerCCHandlerRec_t
Definition: platform.h:43
void timerChInit(const timerHardware_t *timHw, channelType_t type, int irqPriority)
Definition: timer.c:548
void timerInit(void)
Definition: timer.c:939
struct timerHardware_s timerHardware_t
void timerConfigure(const timerHardware_t *timHw, uint16_t period, uint8_t mhz)
Definition: timer.c:521
timerCCHandlerCallback * fn
Definition: timer.h:52
uint8_t channel
Definition: timer.h:64
GPIO_Mode gpioInputMode
Definition: timer.h:67
Definition: platform.h:48
TIM_TypeDef * tim
Definition: timer.h:61
uint8_t outputEnable
Definition: timer.h:66
volatile timCCR_t * timerChCCR(const timerHardware_t *timHw)
Definition: timer.c:766
void timerChOvrHandlerInit(timerOvrHandlerRec_t *self, timerOvrHandlerCallback *fn)
Definition: timer.c:580
void timerOvrHandlerCallback(struct timerOvrHandlerRec_s *self, uint16_t capture)
Definition: timer.h:49
uint8_t irq
Definition: timer.h:65
timerOvrHandlerCallback * fn
Definition: timer.h:56
void timerChConfigCallbacks(const timerHardware_t *channel, timerCCHandlerRec_t *edgeCallback, timerOvrHandlerRec_t *overflowCallback)
Definition: timer.c:604