WS_GPIO.h 1.4 KB

12345678910111213141516171819202122232425262728
  1. #ifndef _WS_GPIO_H_
  2. #define _WS_GPIO_H_
  3. #include <HardwareSerial.h> // Reference the ESP32 built-in serial port library
  4. /************************************************************* I/O *************************************************************/
  5. #define TXD1 17 //The TXD of UART1 corresponds to GPIO
  6. #define RXD1 18 //The RXD of UART1 corresponds to GPIO
  7. #define GPIO_PIN_CH1 1 // CH1 Control GPIO
  8. #define GPIO_PIN_CH2 2 // CH2 Control GPIO
  9. #define GPIO_PIN_CH3 41 // CH3 Control GPIO
  10. #define GPIO_PIN_CH4 42 // CH4 Control GPIO
  11. #define GPIO_PIN_CH5 45 // CH5 Control GPIO
  12. #define GPIO_PIN_CH6 46 // CH6 Control GPIO
  13. #define GPIO_PIN_RGB 38 // RGB Control GPIO
  14. #define GPIO_PIN_Buzzer 21 // Buzzer Control GPIO
  15. /*********************************************************** Buzzer ***********************************************************/
  16. #define PWM_Channel 1 // PWM Channel
  17. #define Frequency 1000 // PWM frequencyconst
  18. #define Resolution 8 // PWM resolution ratio
  19. #define Dutyfactor 200 // PWM Dutyfactor
  20. /************************************************************* I/O *************************************************************/
  21. void digitalToggle(int pin);
  22. void RGB_Light(uint8_t red_val, uint8_t green_val, uint8_t blue_val);
  23. void GPIO_Init();
  24. void Buzzer_PWM(uint16_t Time);
  25. #endif