13#include "stm32f439xx.h"
20#define TIM_CONFIG_DEFAULT \
27 .CCDS = TIM_CCDS_UPDATE, \
36#define TIM_CR1_CONFIG_MASK ( \
44#define TIM_CR2_CONFIG_MASK ( \
48#define TIM_DIER_CONFIG_MASK ( \
61#define TIM_CCMR_CONFIG_MASK 0xFF
115 TIM_CCM_SELECT_OUTPUT,
126 TIM_CCM_OUTPUT_MODE_FROZEN,
127 TIM_CCM_OUTPUT_MODE_ACTIVE,
128 TIM_CCM_OUTPUT_MODE_INACTIVE,
129 TIM_CCM_OUTPUT_MODE_TOGGLE,
130 TIM_CCM_OUTPUT_MODE_FORCE_INACTIVE,
131 TIM_CCM_OUTPUT_MODE_FORCE_ACTIVE,
132 TIM_CCM_OUTPUT_MODE_PWM_1,
133 TIM_CCM_OUTPUT_MODE_PWM_2
141 TIM_CCM_Selection S : 2;
144 TIM_CCM_OutputMode M : 3;
156 TIM_UpdateSource URS;
174 bool (*pollUpdate)(
struct TIM *tim);
175 bool (*setTimingPeriod)(
struct TIM *tim,
float period);
176 bool (*pollCompare)(
struct TIM *tim, TIM_Channel channel);
177 bool (*setTimingPWM)(
struct TIM *tim, TIM_Channel channel,
float duty);
void(* updateConfig)(struct TIM *tim, TIM_Config *config)
TIM configuration update method.
TIM_Config config
Configuration parameters for the TIM peripheral.
void(* startCounter)(struct TIM *tim)
TIM configuration update method.
TIM_TypeDef * interface
Pointer to TIM interface struct.
bool TIM_setTimingPeriod(TIM_t *tim, float period)
void TIM_updateConfig(TIM_t *tim, TIM_Config *config)
Update TIM peripheral configuration.
bool TIM_pollUpdate(TIM_t *tim)
TIM_t TIM_init(TIM_TypeDef *interface, TIM_Config *config)
Initialiser for an SPI device interface.
bool TIM_setTimingPWM(TIM_t *tim, TIM_Channel channel, float duty)
bool TIM_pollCompare(TIM_t *tim, TIM_Channel channel)
void TIM_startCounter(TIM_t *tim)
TIM configuration struct.
Struct definition for TIM interface. Provides the interface for API consumers to interact with the TI...