基质喷涂
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
485 B

3 weeks ago
  1. #ifndef PWM_CONTROL_H
  2. #define PWM_CONTROL_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // 定义枚举类型来选择不同的PWM输出通道
  7. typedef enum {
  8. PWM_PUMP_PUL = 0,
  9. PWM_LASER,
  10. PWM_GY
  11. } PWM_Channel_TypeDef;
  12. #include <stdint.h>
  13. // 初始化定时器和GPIO
  14. void TIM_PWM_Init(void);
  15. // 更新指定通道的PWM频率和占空比
  16. void Update_PWM(PWM_Channel_TypeDef channel, uint32_t frequency, uint8_t duty_cycle);
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20. #endif