123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- /*================================================================
- Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
- Quectel Wireless Solutions Proprietary and Confidential.
- =================================================================*/
-
- #ifndef _QL_CODEC_CONFIG_H_
- #define _QL_CODEC_CONFIG_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- /**********************************************************************************************
- Define
- **********************************************************************************************/
- #define QL_EXT_CODEC_LOG_LEVEL QL_LOG_LEVEL_INFO
- #define QL_EXT_CODEC_LOG(msg, ...) QL_LOG_TAG(QL_EXT_CODEC_LOG_LEVEL, QL_LOG_TAG_CODEC, "ql_ext_codec", msg, ##__VA_ARGS__)
- //CODEC ES8311
- #define ES8311_I2C_SLAVE_ADDR 0x18
- #define ES8311_VENDOR_ID 0x83
- #define ES8311_VENDOR_ID_REG 0XFD
- #define ES8311_REG_SYSTEM 0x14
- #define ES8311_REG_ADC 0x17
- #define ES8311_REG_DAC 0x32
- #define ES8311_INIT_CONFIG \
- { \
- {0x45, 0x00}, \
- {0x01, 0x30}, \
- {0x02, 0x10}, \
- {0x03, 0x10}, \
- {0x16, 0x24}, \
- {0x04, 0x20}, \
- {0x05, 0x00}, \
- {0x06, 0x15}, \
- {0x07, 0x00}, \
- {0x08, 0x7f}, \
- {0x09, 0x0c}, \
- {0x0a, 0x0c}, \
- {0x0b, 0x00}, \
- {0x0c, 0x00}, \
- {0x10, 0x03}, \
- {0x11, 0x7b}, \
- {0x13, 0x00}, \
- {0x00, 0x80}, \
- {0x0d, 0x01}, \
- {0x12, 0x02}, \
- {0x31, 0x60}, \
- {0x32, 0x00}, \
- }
- #define ES8311_PLAY_CONFIG \
- { \
- {0x01, 0xdf}, \
- {0x0e, 0x62}, \
- {0x0f, 0x01}, \
- {0x44, 0x08}, \
- {0x13, 0x00}, \
- {0x31, 0x00}, \
- {0x12, 0x00}, \
- {0x32, 0xbf}, \
- {0x37, 0x08}, \
- }
- #define ES8311_RECORD_CONFIG \
- { \
- {0x02, 0xA0}, \
- {0x01, 0x3f}, \
- {0x0e, 0x02}, \
- {0x0f, 0x44}, \
- {0x15, 0x10}, \
- {0x1b, 0x05}, \
- {0x1c, 0x65}, \
- {0x0f, 0x01}, \
- {0x44, 0x08}, \
- {0x14, 0x17}, \
- {0x17, 0xbf}, \
- }
- #define ES8311_CLOSE_CONFIG \
- { \
- {0x0E, 0xFF}, \
- {0x12, 0x02}, \
- {0x14, 0x00}, \
- {0x0D, 0xFA}, \
- {0x01, 0x30}, \
- {0x01, 0x00}, \
- {0x45, 0x00}, \
- }
- /**********************************************************************************************
- Struct
- **********************************************************************************************/
- typedef struct
- {
- uint8_t addr;
- uint8_t data;
- } ql_codec_reg_t;
- #ifdef __cplusplus
- } /*"C" */
- #endif
- #endif
|