seems i am the only one using the ADC and pwm drivers on Stm32 at maximum.
in the TIMv1 driver this line is missing when configuring registers
Code: Select all
pwmp->tim->DIER = pwmp->config->dier; /* DIER settings. */
regards
Tec
Moderator: RoccoMarco
Code: Select all
pwmp->tim->DIER = pwmp->config->dier; /* DIER settings. */
Code: Select all
pwmp->tim->DIER = pwmp->config->dier & /* DMA-related DIER settings. */
~STM32_TIM_DIER_IRQ_MASKCode: Select all
&~STM32_TIM_DIER_IRQ_MASKCode: Select all
/**
* @brief TIM DIER register initialization data.
* @note The value of this field should normally be equal to zero.
* @note Only the DMA-related bits can be specified in this field.
*/
uint32_t dier;
Code: Select all
/* Changing channel duty cycle on the fly.*/
#if STM32_TIM_MAX_CHANNELS <= 4
pwmp->tim->CCR[channel] = width;
+ pwmp->tim->DIER |= (2 << channel);
#else
if (channel <= 4)
pwmp->tim->CCR[channel] = width;
+ pwmp->tim->DIER |= (2 << channel);
else
pwmp->tim->CCXR[channel - 4] = width;
+ pwmp->tim->DIER |= (2 << (channel - 4));
#endif
}
Code: Select all
pwmEnableChannel(&PWMD1, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD1, 7500));
pwmEnableChannelNotification(&PWMD1, 0);
Code: Select all
void pwmEnablePeriodicNotification(PWMDriver *pwmp);
void pwmDisablePeriodicNotification(PWMDriver *pwmp);
void pwmEnableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel);
void pwmDisableChannelNotification(PWMDriver *pwmp, pwmchannel_t channel);