13 # error "Wrong implementation included for this platform"
19 #if MOZZI_IS(MOZZI_ANALOG_READ, MOZZI_ANALOG_READ_STANDARD)
20 #error not yet implemented
22 #define getADCReading() 0
23 #define channelNumToIndex(channel) channel
39 #define LOOP_YIELD yield();
45 uint16_t output_buffer_size = 0;
47 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S, MOZZI_OUTPUT_PDM_VIA_SERIAL, MOZZI_OUTPUT_I2S_DAC)
49 # if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S)
61 # elif MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_I2S_DAC)
91 static void startAudio() {
92 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_EXTERNAL_TIMED)
94 timer1_attachInterrupt(defaultAudioOutput);
95 timer1_enable(TIM_DIV1, TIM_EDGE, TIM_LOOP);
96 timer1_write(F_CPU / MOZZI_AUDIO_RATE);
97 #elif MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_SERIAL)
99 MOZZI_AUDIO_RATE * (MOZZI_PDM_RESOLUTION * 40), SERIAL_8N1,
107 timer1_attachInterrupt(esp8266_serial_audio_output);
111 timer1_enable(TIM_DIV16, TIM_EDGE, TIM_LOOP);
112 timer1_write(F_CPU / (MOZZI_AUDIO_RATE * MOZZI_PDM_RESOLUTION));
115 # if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S)
120 i2s_set_rate(MOZZI_AUDIO_RATE * MOZZI_PDM_RESOLUTION);
121 if (output_buffer_size == 0)
129 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S, MOZZI_OUTPUT_I2S_DAC)
131 #elif MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_SERIAL, MOZZI_OUTPUT_EXTERNAL_TIMED)
137 #if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S) && (MOZZI_PDM_RESOLUTION != 1
)
138 # define AUDIOTICK_ADJUSTMENT ((output_buffer_size - i2s_available()) / MOZZI_PDM_RESOLUTION)
140 # define AUDIOTICK_ADJUSTMENT (output_buffer_size - i2s_available())
147 #include <esp8266_peri.h>