2 #include "AudioConfig.h"
7 #include "AudioTools/CoreAudio/AudioStreams.h"
8 #include "AudioTools/CoreAudio/AudioI2S/I2SConfig.h"
24 SPISettings settings{speed, MSBFIRST, SPI_MODE0};
25 #ifdef USE_SPI_SET_PINS
26 SPI.setCS(PIN_I2S_WS);
27 SPI.setSCK(PIN_I2S_BCK);
28 SPI.setTX(PIN_I2S_DATA);
31 SPI.beginTransaction(settings);
46 void end() { SPI.end(); }
48 size_t write(
const uint8_t *data,
size_t len) {
49 for (
int j = 0; j < len; j++) {
50 buffer.
write(data[j]);
52 digitalWrite(i2s_config.pin_ws, ws_state);
53 SPI.transfer(buffer.
data(), buffer.size());
64 bool ws_state =
false;
65 SingleBuffer<uint8_t> buffer{0};
70 using I2SStream = I2SBitBang;