我这边测试过的代码,可以运行,可进更新中断和比较中断。基于stm32U5系列。
LL_LPTIM_CC_EnableChannel(LPTIM1, LL_LPTIM_CHANNEL_CH1);
LL_LPTIM_CC_EnableChannel(LPTIM1, LL_LPTIM_CHANNEL_CH2);
LL_LPTIM_SetWaveform(LPTIM1, LL_LPTIM_OUTPUT_WAVEFORM_PWM);
LL_LPTIM_CC_SetChannelMode(LPTIM1, LL_LPTIM_CHANNEL_CH1,
LL_LPTIM_CCMODE_OUTPUT_PWM);
LL_LPTIM_CC_SetChannelMode(LPTIM1, LL_LPTIM_CHANNEL_CH2,
LL_LPTIM_CCMODE_OUTPUT_PWM);
LL_LPTIM_Enable(LPTIM1);
LL_LPTIM_EnableIT_UE(LPTIM1);
LL_LPTIM_EnableIT_CC1(LPTIM1);
LL_LPTIM_StartCounter(LPTIM1, LL_LPTIM_OPERATING_MODE_CONTINUOUS);
|