29#if HAL_USE_PWM || defined(__DOXYGEN__)
44#if !defined(KINETIS_PWM_USE_FTM0)
45 #define KINETIS_PWM_USE_FTM0 FALSE
48#if !defined(KINETIS_PWM_USE_FTM1)
49 #define KINETIS_PWM_USE_FTM1 FALSE
52#if !defined(KINETIS_PWM_USE_FTM2)
53 #define KINETIS_PWM_USE_FTM2 FALSE
56#if !defined(KINETIS_PWM_USE_FTM3)
57 #define KINETIS_PWM_USE_FTM3 FALSE
63#if !defined(KINETIS_PWM_FTM0_PRIORITY) || defined(__DOXYGEN__)
64#define KINETIS_PWM_FTM0_PRIORITY 12
70#if !defined(KINETIS_PWM_FTM1_PRIORITY) || defined(__DOXYGEN__)
71#define KINETIS_PWM_FTM1_PRIORITY 12
77#if !defined(KINETIS_PWM_FTM2_PRIORITY) || defined(__DOXYGEN__)
78#define KINETIS_PWM_FTM2_PRIORITY 12
84#if !defined(KINETIS_PWM_FTM3_PRIORITY) || defined(__DOXYGEN__)
85#define KINETIS_PWM_FTM3_PRIORITY 12
100#if !defined(KINETIS_PWM_USE_ADVANCED) || defined(__DOXYGEN__)
101#define KINETIS_PWM_USE_ADVANCED FALSE
109#if !KINETIS_PWM_USE_FTM0 && !KINETIS_PWM_USE_FTM1 && !KINETIS_PWM_USE_FTM2 && !KINETIS_PWM_USE_FTM3
110#error "PWM driver activated but no FTM peripheral assigned"
220#if defined(PWM_DRIVER_EXT_FIELDS)
221 PWM_DRIVER_EXT_FIELDS
250#define pwm_lld_change_period(pwmp, period) \
252 (pwmp)->ftm->MOD = ((period) - 1); \
253 pwmp->ftm->PWMLOAD = FTM_PWMLOAD_LDOK_MASK;\
260#if KINETIS_PWM_USE_FTM0 || defined(__DOXYGEN__)
263#if KINETIS_PWM_USE_FTM1 || defined(__DOXYGEN__)
266#if KINETIS_PWM_USE_FTM2 || defined(__DOXYGEN__)
269#if KINETIS_PWM_USE_FTM3 || defined(__DOXYGEN__)
static GppwmChannel channels[GPPWM_CHANNELS]
void pwm_lld_disable_periodic_notification(PWMDriver *pwmp)
Disables the periodic activation edge notification.
PWMDriver PWMD2
PWMD2 driver identifier.
void pwm_lld_stop(PWMDriver *pwmp)
Deactivates the PWM peripheral.
void pwm_lld_disable_channel_notification(PWMDriver *pwmp, pwmchannel_t channel)
Disables a channel de-activation edge notification.
void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel)
Disables a PWM channel and its notification.
void pwm_lld_init(void)
Low level PWM driver initialization.
void pwm_lld_start(PWMDriver *pwmp)
Configures and activates the PWM peripheral.
void pwm_lld_enable_channel(PWMDriver *pwmp, pwmchannel_t channel, pwmcnt_t width)
Enables a PWM channel.
void pwm_lld_enable_periodic_notification(PWMDriver *pwmp)
Enables the periodic activation edge notification.
void pwm_lld_enable_channel_notification(PWMDriver *pwmp, pwmchannel_t channel)
Enables a channel de-activation edge notification.
PWMDriver PWMD1
PWMD1 driver identifier.
PWMDriver PWMD4
PWMD4 driver identifier.
PWMDriver PWMD3
PWMD3 driver identifier.
uint32_t pwmmode_t
Type of a PWM mode.
uint8_t pwmchannel_t
Type of a PWM channel.
uint32_t pwmchnmsk_t
Type of a channels mask.
uint16_t pwmcnt_t
Type of a PWM counter.
Type of a PWM driver channel configuration structure.
pwmcallback_t callback
Channel callback pointer.
pwmmode_t mode
Channel active logic level.
Type of a PWM driver configuration structure.
pwmcallback_t callback
Periodic callback pointer.
uint32_t dier
TIM DIER register initialization data.
uint32_t frequency
Timer clock in Hz.
uint32_t cr2
TIM CR2 register initialization data.
pwmcnt_t period
PWM period in ticks.
Structure representing a PWM driver.
pwmcnt_t period
Current PWM period in ticks.
PWM_DRIVER_EXT_FIELDS FTM_TypeDef * ftm
Pointer to the FTM registers block.
pwmchannel_t channels
Number of channels in this instance.
pwmchnmsk_t enabled
Mask of the enabled channels.
const PWMConfig * config
Current driver configuration data.
pwmstate_t state
Driver state.