config.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef _BOARD_CONFIG_H_
  2. #define _BOARD_CONFIG_H_
  3. #include <driver/gpio.h>
  4. #include <driver/uart.h>
  5. #define AUDIO_INPUT_SAMPLE_RATE 16000
  6. #define AUDIO_OUTPUT_SAMPLE_RATE 16000
  7. #define AUDIO_I2S_GPIO_MCLK GPIO_NUM_45
  8. #define AUDIO_I2S_GPIO_WS GPIO_NUM_41
  9. #define AUDIO_I2S_GPIO_BCLK GPIO_NUM_39
  10. #define AUDIO_I2S_GPIO_DIN GPIO_NUM_40
  11. #define AUDIO_I2S_GPIO_DOUT GPIO_NUM_42
  12. #define AUDIO_CODEC_PA_PIN GPIO_NUM_46
  13. #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_4
  14. #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_5
  15. #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR
  16. #define BUILTIN_LED_GPIO GPIO_NUM_NC
  17. #define BOOT_BUTTON_GPIO GPIO_NUM_0
  18. #define VOLUME_UP_BUTTON_GPIO GPIO_NUM_NC
  19. #define VOLUME_DOWN_BUTTON_GPIO GPIO_NUM_NC
  20. #define DISPLAY_WIDTH 240
  21. #define DISPLAY_HEIGHT 240
  22. #define DISPLAY_MIRROR_X false
  23. #define DISPLAY_MIRROR_Y false
  24. #define DISPLAY_SWAP_XY false
  25. #define DISPLAY_OFFSET_X 0
  26. #define DISPLAY_OFFSET_Y 0
  27. #define DISPLAY_DC_GPIO GPIO_NUM_43
  28. #define DISPLAY_CS_GPIO GPIO_NUM_44
  29. #define DISPLAY_CLK_GPIO GPIO_NUM_21
  30. #define DISPLAY_MOSI_GPIO GPIO_NUM_47
  31. #define DISPLAY_RST_GPIO GPIO_NUM_NC
  32. #define DISPLAY_BACKLIGHT_PIN GPIO_NUM_46
  33. #define DISPLAY_BACKLIGHT_OUTPUT_INVERT false
  34. #define UART_ECHO_TXD GPIO_NUM_38
  35. #define UART_ECHO_RXD GPIO_NUM_48
  36. #define UART_ECHO_RTS (-1)
  37. #define UART_ECHO_CTS (-1)
  38. #define MOTOR_SPEED_MAX 100
  39. #define MOTOR_SPEED_80 80
  40. #define MOTOR_SPEED_60 60
  41. #define MOTOR_SPEED_MIN 0
  42. #define ECHO_UART_PORT_NUM UART_NUM_1
  43. #define ECHO_UART_BAUD_RATE (115200)
  44. #define BUF_SIZE (1024)
  45. typedef enum {
  46. LIGHT_MODE_CHARGING_BREATH = 0,
  47. LIGHT_MODE_POWER_LOW,
  48. LIGHT_MODE_ALWAYS_ON,
  49. LIGHT_MODE_BLINK,
  50. LIGHT_MODE_WHITE_BREATH_SLOW,
  51. LIGHT_MODE_WHITE_BREATH_FAST,
  52. LIGHT_MODE_FLOWING,
  53. LIGHT_MODE_SHOW,
  54. LIGHT_MODE_SLEEP,
  55. LIGHT_MODE_MAX
  56. } light_mode_t;
  57. /* Camera PINs*/
  58. #define SPARKBOT_CAMERA_XCLK (GPIO_NUM_15)
  59. #define SPARKBOT_CAMERA_PCLK (GPIO_NUM_13)
  60. #define SPARKBOT_CAMERA_VSYNC (GPIO_NUM_6)
  61. #define SPARKBOT_CAMERA_HSYNC (GPIO_NUM_7)
  62. #define SPARKBOT_CAMERA_D0 (GPIO_NUM_11)
  63. #define SPARKBOT_CAMERA_D1 (GPIO_NUM_9)
  64. #define SPARKBOT_CAMERA_D2 (GPIO_NUM_8)
  65. #define SPARKBOT_CAMERA_D3 (GPIO_NUM_10)
  66. #define SPARKBOT_CAMERA_D4 (GPIO_NUM_12)
  67. #define SPARKBOT_CAMERA_D5 (GPIO_NUM_18)
  68. #define SPARKBOT_CAMERA_D6 (GPIO_NUM_17)
  69. #define SPARKBOT_CAMERA_D7 (GPIO_NUM_16)
  70. #define SPARKBOT_CAMERA_PWDN (GPIO_NUM_NC)
  71. #define SPARKBOT_CAMERA_RESET (GPIO_NUM_NC)
  72. #define SPARKBOT_CAMERA_XCLK (GPIO_NUM_15)
  73. #define SPARKBOT_CAMERA_PCLK (GPIO_NUM_13)
  74. #define SPARKBOT_CAMERA_VSYNC (GPIO_NUM_6)
  75. #define SPARKBOT_CAMERA_HSYNC (GPIO_NUM_7)
  76. #define SPARKBOT_CAMERA_XCLK_FREQ (16000000)
  77. #define SPARKBOT_LEDC_TIMER (LEDC_TIMER_0)
  78. #define SPARKBOT_LEDC_CHANNEL (LEDC_CHANNEL_0)
  79. #define SPARKBOT_CAMERA_SIOD (GPIO_NUM_NC)
  80. #define SPARKBOT_CAMERA_SIOC (GPIO_NUM_NC)
  81. #endif // _BOARD_CONFIG_H_