LP-551 Remove popup - Increase neutral diff levels for alarm
[librepilot.git] / flight / pios / inc / pios_tim_priv.h
blobe607f70338d5dbb481a83ae1bee7fdd0c94e5dbe
1 #ifndef PIOS_TIM_PRIV_H
2 #define PIOS_TIM_PRIV_H
4 #include <pios_stm32.h>
6 struct pios_tim_clock_cfg {
7 TIM_TypeDef *timer;
8 const TIM_TimeBaseInitTypeDef *time_base_init;
9 struct stm32_irq irq;
12 struct pios_tim_channel {
13 TIM_TypeDef *timer;
14 uint8_t timer_chan;
16 struct stm32_gpio pin;
17 uint32_t remap;
20 struct pios_tim_callbacks {
21 void (*overflow)(uint32_t tim_id, uint32_t context, uint8_t chan_idx, uint16_t count);
22 void (*edge)(uint32_t tim_id, uint32_t context, uint8_t chan_idx, uint16_t count);
25 extern int32_t PIOS_TIM_InitClock(const struct pios_tim_clock_cfg *cfg);
26 extern int32_t PIOS_TIM_InitChannels(uint32_t *tim_id, const struct pios_tim_channel *channels, uint8_t num_channels, const struct pios_tim_callbacks *callbacks, uint32_t context);
28 #endif /* PIOS_TIM_PRIV_H */