amp gpio control with jack - release

This commit is contained in:
Philippe G
2021-11-20 11:08:48 -08:00
parent c0c37bd98a
commit 9588ae9f39
3 changed files with 35 additions and 12 deletions

View File

@@ -20,8 +20,8 @@
static const char TAG[] = "DAC external";
static void speaker(bool active) { }
static void headset(bool active) { }
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);
@@ -95,6 +95,22 @@ static void power(adac_power_e mode) {
else i2c_json_execute("poweron");
}
/****************************************************************************************
* speaker
*/
static void speaker(bool active) {
if (active) i2c_json_execute("speakeron");
else i2c_json_execute("speakeroff");
}
/****************************************************************************************
* headset
*/
static void headset(bool active) {
if (active) i2c_json_execute("headseton");
else i2c_json_execute("headsetoff");
}
/****************************************************************************************
*
*/