ES8311 support added for the ESP32-P4 EV board with mic.

This commit is contained in:
Troy
2024-10-02 09:15:46 -04:00
parent 63ff7205d6
commit 283a7284b4
2 changed files with 115 additions and 1 deletions

View File

@@ -2022,7 +2022,16 @@ class AudioReactive : public Usermod {
if ((sclPin >= 0) && (i2c_scl < 0)) i2c_scl = sclPin;
if (i2c_sda >= 0) sdaPin = -1; // -1 = use global
if (i2c_scl >= 0) sclPin = -1;
case 9:
DEBUGSR_PRINTLN(F("AR: ES8311 Source (Mic)"));
audioSource = new ES8311Source(SAMPLE_RATE, BLOCK_SIZE, 1.0f);
//useInputFilter = 0; // to disable low-cut software filtering and restore previous behaviour
delay(100);
// WLEDMM align global pins
if ((sdaPin >= 0) && (i2c_sda < 0)) i2c_sda = sdaPin; // copy usermod prefs into globals (if globals not defined)
if ((sclPin >= 0) && (i2c_scl < 0)) i2c_scl = sclPin;
if (i2c_sda >= 0) sdaPin = -1; // -1 = use global
if (i2c_scl >= 0) sclPin = -1;
if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
break;
@@ -2934,6 +2943,11 @@ class AudioReactive : public Usermod {
#else
oappend(SET_F("addOption(dd,'AC101 ☾',8);"));
#endif
#if SR_DMTYPE==9
oappend(SET_F("addOption(dd,'ES8311 ☾ (⎌)',9);"));
#else
oappend(SET_F("addOption(dd,'ES8311 ☾',9);"));
#endif
#ifdef SR_SQUELCH
oappend(SET_F("addInfo(ux+':config:squelch',1,'<i>&#9100; ")); oappendi(SR_SQUELCH); oappend("</i>');"); // 0 is field type, 1 is actual field
#endif