#ifndef PWM_CONTROL_H #define PWM_CONTROL_H #ifdef __cplusplus extern "C" { #endif // 定义枚举类型来选择不同的PWM输出通道 typedef enum { PWM_PUMP_PUL = 0, PWM_LASER, PWM_GY } PWM_Channel_TypeDef; #include // 初始化定时器和GPIO void TIM_PWM_Init(void); // 更新指定通道的PWM频率和占空比 void Update_PWM(PWM_Channel_TypeDef channel, uint32_t frequency, uint8_t duty_cycle); #ifdef __cplusplus } #endif #endif