5#if defined(IS_MBED) && defined(USE_ANALOG) || defined(DOXYGEN)
28 LOGE(
"Only 16 bits_per_sample supported");
32 LOGE(
"max channels: 2");
70 size_t write(
const uint8_t *src,
size_t size_bytes)
override {
72 if (!
dac1.available())
return 0;
76 int sample_count = size_bytes / 2;
77 Sample *data = (Sample *)src;
78 for (
int j = 0; j < sample_count; j++) {
90 const uint8_t data[size] = {0};
95 size_t readBytes(uint8_t *dest,
size_t size_bytes)
override {
98 int16_t *data = (int16_t *)dest;
99 size_t samples = size_bytes / 2;
102 for (
int j = 0; j < samples; j++) {
103 data[j] =
adc1.read();
108 for (
int j = 0; j < samples; j += 2) {
109 data[j] =
adc1.read();
110 data[j + 1] =
adc2.read();
141 SampleBuffer buf =
dac1.dequeue();
142 for (
size_t i = 0; i < buf.size(); i++) {
149 SampleBuffer buf1 =
dac1.dequeue();
150 SampleBuffer buf2 =
dac2.dequeue();
151 for (
size_t i = 0; i < buf1.size(); i += 2) {
#define PIN_ANALOG_START
Definition AnalogConfigStd.h:6
#define TRACEI()
Definition AudioLoggerIDF.h:32
#define TRACED()
Definition AudioLoggerIDF.h:31
#define LOGE(...)
Definition AudioLoggerIDF.h:30
#define assert(T)
Definition avr.h:10
#define PIN_DAC_1
Definition giga.h:20
#define PIN_DAC_2
Definition giga.h:21