1 #ifndef PIOS_TIM_PRIV_H
2 #define PIOS_TIM_PRIV_H
4 #include <pios_stm32.h>
6 struct pios_tim_clock_cfg
{
8 const TIM_TimeBaseInitTypeDef
*time_base_init
;
12 struct pios_tim_channel
{
16 struct stm32_gpio pin
;
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 */