mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 21:17:18 +03:00
prepare 4.4 migration + esp32s3 + mck on 0,1,3
This commit is contained in:
@@ -23,7 +23,7 @@ static void speaker(bool active) { }
|
||||
static void headset(bool active) { }
|
||||
static bool volume(unsigned left, unsigned right) { return false; }
|
||||
static void power(adac_power_e mode);
|
||||
static bool init(char *config, int i2c_port_num, i2s_config_t *i2s_config);
|
||||
static bool init(char *config, int i2c_port_num, i2s_config_t *i2s_config, bool *mck);
|
||||
|
||||
static esp_err_t i2c_write_shadow(uint8_t reg, uint16_t val);
|
||||
static uint16_t i2c_read_shadow(uint8_t reg);
|
||||
@@ -47,12 +47,14 @@ static uint16_t WM8978_REGVAL_TBL[58] = {
|
||||
/****************************************************************************************
|
||||
* init
|
||||
*/
|
||||
static bool init(char *config, int i2c_port, i2s_config_t *i2s_config) {
|
||||
static bool init(char *config, int i2c_port, i2s_config_t *i2s_config, bool *mck) {
|
||||
WM8978 = adac_init(config, i2c_port);
|
||||
|
||||
if (!WM8978) WM8978 = 0x1a;
|
||||
ESP_LOGI(TAG, "WM8978 detected @%d", WM8978);
|
||||
|
||||
|
||||
*mck = true;
|
||||
|
||||
// init sequence
|
||||
i2c_write_shadow(0, 0);
|
||||
i2c_write_shadow(4, 16);
|
||||
@@ -61,11 +63,6 @@ static bool init(char *config, int i2c_port, i2s_config_t *i2s_config) {
|
||||
i2c_write_shadow(43, 16);
|
||||
i2c_write_shadow(49, 102);
|
||||
|
||||
// Configure system clk to GPIO0 for DAC MCLK input
|
||||
ESP_LOGI(TAG, "Configuring MCLK on GPIO0");
|
||||
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
|
||||
REG_WRITE(PIN_CTRL, 0xFFFFFFF0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user