beep.h 737 B

12345678910111213141516171819202122
  1. /**
  2. * @Author: 李建
  3. * @Date: 2025/4/22 10:24
  4. * Description: 蜂鸣器模块
  5. * Copyright: Copyright (©) 2025 永续绿建. All rights reserved.
  6. */
  7. #ifndef WIRE_CONTROLLER_BEEP_H
  8. #define WIRE_CONTROLLER_BEEP_H
  9. #define LEDC_TIMER LEDC_TIMER_0
  10. #define LEDC_MODE LEDC_LOW_SPEED_MODE
  11. #define LEDC_OUTPUT_IO (42) // Define the output GPIO
  12. #define LEDC_CHANNEL LEDC_CHANNEL_0
  13. #define LEDC_DUTY_RES LEDC_TIMER_12_BIT // Set duty resolution to 10 bits
  14. #define LEDC_DUTY (50) // Set duty to 50%.
  15. #define LEDC_FREQUENCY (2900) // Frequency in Hertz. Set frequency at 4 kHz
  16. void beep_init(void);
  17. void beep();
  18. void beep_stop();
  19. #endif //WIRE_CONTROLLER_BEEP_H