config.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _BOARD_CONFIG_H_
  2. #define _BOARD_CONFIG_H_
  3. #include <driver/gpio.h>
  4. enum XiaozhiStatus {
  5. kDevice_null,
  6. kDevice_join_Sleep,
  7. kDevice_Exit_Sleep,
  8. kDevice_Distributionnetwork,
  9. kDevice_Exit_Distributionnetwork,
  10. };
  11. enum LcdStatus {
  12. kDevicelcdbacklightOn,
  13. kDevicelcdbacklightOff,
  14. };
  15. enum WakeStatus {
  16. kDeviceAwakened,
  17. kDeviceWaitWake,
  18. kDeviceSleeped,
  19. };
  20. enum PowerSupply {
  21. kDeviceTypecSupply,
  22. kDeviceBatterySupply,
  23. };
  24. enum PowerSleep {
  25. kDeviceNoSleep,
  26. kDeviceDeepSleep,
  27. kDeviceNeutralSleep,
  28. };
  29. #define SYS_POW_PIN GPIO_NUM_2
  30. #define CHG_CTRL_PIN GPIO_NUM_47
  31. #define CODEC_PWR_PIN GPIO_NUM_14
  32. #define CHRG_PIN GPIO_NUM_48
  33. #define BAT_VSEN_PIN GPIO_NUM_1
  34. #define AUDIO_INPUT_SAMPLE_RATE 16000
  35. #define AUDIO_OUTPUT_SAMPLE_RATE 16000
  36. #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_13
  37. #define AUDIO_I2S_GPIO_WS GPIO_NUM_10
  38. #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_5
  39. #define AUDIO_I2S_GPIO_DIN GPIO_NUM_6
  40. #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_9
  41. #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_11
  42. #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_12
  43. #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
  44. #define AUDIO_SPK_GPIO_PIN GPIO_NUM_21
  45. #define R_BUTTON_GPIO GPIO_NUM_0
  46. #define M_BUTTON_GPIO GPIO_NUM_4
  47. #define L_BUTTON_GPIO GPIO_NUM_3
  48. #define BUILTIN_LED_GPIO GPIO_NUM_13
  49. #define LCD_SCLK_PIN GPIO_NUM_39
  50. #define LCD_MOSI_PIN GPIO_NUM_40
  51. #define LCD_MISO_PIN GPIO_NUM_NC
  52. #define LCD_DC_PIN GPIO_NUM_38
  53. #define LCD_CS_PIN GPIO_NUM_41
  54. #define LCD_RST_PIN GPIO_NUM_NC
  55. #define DISPLAY_WIDTH 240
  56. #define DISPLAY_HEIGHT 240
  57. #define DISPLAY_MIRROR_X false
  58. #define DISPLAY_MIRROR_Y false
  59. #define DISPLAY_SWAP_XY false
  60. #define DISPLAY_OFFSET_X 0
  61. #define DISPLAY_OFFSET_Y 0
  62. #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_42
  63. #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false
  64. #endif // _BOARD_CONFIG_H_