ql_codec_config.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*================================================================
  2. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  3. Quectel Wireless Solutions Proprietary and Confidential.
  4. =================================================================*/
  5. #ifndef _QL_CODEC_CONFIG_H_
  6. #define _QL_CODEC_CONFIG_H_
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /**********************************************************************************************
  11. Define
  12. **********************************************************************************************/
  13. #define QL_EXT_CODEC_LOG_LEVEL QL_LOG_LEVEL_INFO
  14. #define QL_EXT_CODEC_LOG(msg, ...) QL_LOG_TAG(QL_EXT_CODEC_LOG_LEVEL, QL_LOG_TAG_CODEC, "ql_ext_codec", msg, ##__VA_ARGS__)
  15. //CODEC ES8311
  16. #define ES8311_I2C_SLAVE_ADDR 0x18
  17. #define ES8311_VENDOR_ID 0x83
  18. #define ES8311_VENDOR_ID_REG 0XFD
  19. #define ES8311_REG_SYSTEM 0x14
  20. #define ES8311_REG_ADC 0x17
  21. #define ES8311_REG_DAC 0x32
  22. #define ES8311_INIT_CONFIG \
  23. { \
  24. {0x45, 0x00}, \
  25. {0x01, 0x30}, \
  26. {0x02, 0x10}, \
  27. {0x03, 0x10}, \
  28. {0x16, 0x24}, \
  29. {0x04, 0x20}, \
  30. {0x05, 0x00}, \
  31. {0x06, 0x15}, \
  32. {0x07, 0x00}, \
  33. {0x08, 0x7f}, \
  34. {0x09, 0x0c}, \
  35. {0x0a, 0x0c}, \
  36. {0x0b, 0x00}, \
  37. {0x0c, 0x00}, \
  38. {0x10, 0x03}, \
  39. {0x11, 0x7b}, \
  40. {0x13, 0x00}, \
  41. {0x00, 0x80}, \
  42. {0x0d, 0x01}, \
  43. {0x12, 0x02}, \
  44. {0x31, 0x60}, \
  45. {0x32, 0x00}, \
  46. }
  47. #define ES8311_PLAY_CONFIG \
  48. { \
  49. {0x01, 0xdf}, \
  50. {0x0e, 0x62}, \
  51. {0x0f, 0x01}, \
  52. {0x44, 0x08}, \
  53. {0x13, 0x00}, \
  54. {0x31, 0x00}, \
  55. {0x12, 0x00}, \
  56. {0x32, 0xbf}, \
  57. {0x37, 0x08}, \
  58. }
  59. #define ES8311_RECORD_CONFIG \
  60. { \
  61. {0x02, 0xA0}, \
  62. {0x01, 0x3f}, \
  63. {0x0e, 0x02}, \
  64. {0x0f, 0x44}, \
  65. {0x15, 0x10}, \
  66. {0x1b, 0x05}, \
  67. {0x1c, 0x65}, \
  68. {0x0f, 0x01}, \
  69. {0x44, 0x08}, \
  70. {0x14, 0x17}, \
  71. {0x17, 0xbf}, \
  72. }
  73. #define ES8311_CLOSE_CONFIG \
  74. { \
  75. {0x0E, 0xFF}, \
  76. {0x12, 0x02}, \
  77. {0x14, 0x00}, \
  78. {0x0D, 0xFA}, \
  79. {0x01, 0x30}, \
  80. {0x01, 0x00}, \
  81. {0x45, 0x00}, \
  82. }
  83. /**********************************************************************************************
  84. Struct
  85. **********************************************************************************************/
  86. typedef struct
  87. {
  88. uint8_t addr;
  89. uint8_t data;
  90. } ql_codec_reg_t;
  91. #ifdef __cplusplus
  92. } /*"C" */
  93. #endif
  94. #endif