@@ -26,6 +26,7 @@ struct I2SCodecConfig : public I2SConfig {
2626 output_device_t output_device = DAC_OUTPUT_ALL;
2727 // to be compatible with the AudioKitStream -> do not activate SD spi if false
2828 bool sd_active = true ;
29+ bool sdmmc_active = false ;
2930 // define pin source in driver configuration
3031 PinFunction i2s_function = PinFunction::UNDEFINED; // CODEC;
3132 bool operator ==(I2SCodecConfig alt) {
@@ -205,6 +206,16 @@ class I2SCodecStream : public AudioStream, public VolumeSupport {
205206 // / Provides the i2s driver
206207 I2SDriver *driver () { return i2s.driver (); }
207208
209+ // / set value of digital pin
210+ void digitalWrite (int pin, bool value) {
211+ p_board->getPins ().getGPIO ().digitalWrite (pin, value);
212+ }
213+
214+ // / get value of digital pin
215+ bool digitalRead (int pin) {
216+ return p_board->getPins ().getGPIO ().digitalRead (pin);
217+ }
218+
208219 protected:
209220 I2SStream i2s;
210221 I2SCodecConfig cfg;
@@ -298,6 +309,7 @@ class I2SCodecStream : public AudioStream, public VolumeSupport {
298309 break ;
299310 }
300311 codec_cfg.sd_active = info.sd_active ;
312+ codec_cfg.sdmmc_active = info.sdmmc_active ;
301313 LOGD (" input: %d" , info.input_device );
302314 LOGD (" output: %d" , info.output_device );
303315 codec_cfg.i2s .bits = toCodecBits (info.bits_per_sample );
0 commit comments