example_config.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: CC0-1.0
  5. */
  6. #pragma once
  7. #include "sdkconfig.h"
  8. /* Example configurations */
  9. #define EXAMPLE_RECV_BUF_SIZE (2400)
  10. #define EXAMPLE_SAMPLE_RATE (16000)
  11. #define EXAMPLE_MCLK_MULTIPLE (384) // If not using 24-bit data width, 256 should be enough
  12. #define EXAMPLE_MCLK_FREQ_HZ (EXAMPLE_SAMPLE_RATE * EXAMPLE_MCLK_MULTIPLE)
  13. #define EXAMPLE_VOICE_VOLUME CONFIG_EXAMPLE_VOICE_VOLUME
  14. #if CONFIG_EXAMPLE_MODE_ECHO
  15. #define EXAMPLE_MIC_GAIN CONFIG_EXAMPLE_MIC_GAIN
  16. #endif
  17. #if !defined(CONFIG_EXAMPLE_BSP)
  18. /* I2C port and GPIOs */
  19. #define I2C_NUM (0)
  20. #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
  21. #define I2C_SCL_IO (GPIO_NUM_16)
  22. #define I2C_SDA_IO (GPIO_NUM_17)
  23. #elif CONFIG_IDF_TARGET_ESP32H2
  24. #define I2C_SCL_IO (GPIO_NUM_8)
  25. #define I2C_SDA_IO (GPIO_NUM_9)
  26. #else
  27. #define I2C_SCL_IO (GPIO_NUM_6)
  28. #define I2C_SDA_IO (GPIO_NUM_7)
  29. #endif
  30. /* I2S port and GPIOs */
  31. #define I2S_NUM (0)
  32. #define I2S_MCK_IO (GPIO_NUM_0)
  33. #define I2S_BCK_IO (GPIO_NUM_4)
  34. #define I2S_WS_IO (GPIO_NUM_5)
  35. #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
  36. #define I2S_DO_IO (GPIO_NUM_18)
  37. #define I2S_DI_IO (GPIO_NUM_19)
  38. #else
  39. #define I2S_DO_IO (GPIO_NUM_2)
  40. #define I2S_DI_IO (GPIO_NUM_3)
  41. #endif
  42. #else // CONFIG_EXAMPLE_BSP
  43. #include "bsp/esp-bsp.h"
  44. #define I2C_NUM BSP_I2C_NUM
  45. #endif // CONFIG_EXAMPLE_BSP