77 if (mime ==
nullptr)
return false;
92 buf[5] = (info.
channels >> 8) & 0xFF;
105 result.
channels = (uint16_t)buf[4] | ((uint16_t)buf[5] << 8);
123 if (!
active || data ==
nullptr)
return 0;
125 while (written < len) {
128 if (space < (
int)chunk) {
136 if (chunk == 0)
break;
151 if (len + 1 >
tx.
size())
return false;
153 memcpy(
tx.
data() + 1, data, len);
162 if (!
active || len == 0 || len + 1 >
tx.
size())
return false;
166 p_spi->transfer(req,
sizeof(req));
171 p_spi->transfer(out, len);
177 p_spi->beginTransaction(
184 p_spi->endTransaction();
#define HIGH
Definition Arduino.h:46
#define OUTPUT
Definition Arduino.h:38
#define LOW
Definition Arduino.h:49
@ SPIREG_MIME
32 bytes (rw): zero terminated mime type
Definition SPIRegAudioRegisters.h:29
@ SPIREG_AUDIO_INFO
8 bytes (rw): sample_rate u32, channels u16, bits_per_sample u8, reserved
Definition SPIRegAudioRegisters.h:27
@ SPIREG_DATA
stream (wo): the bytes of the frame are appended to the audio buffer
Definition SPIRegAudioRegisters.h:33
@ SPIREG_AVAILABLE
4 bytes (ro): u32 free space in the slave audio buffer in bytes
Definition SPIRegAudioRegisters.h:31