14 # error "Wrong implementation included for this platform" 19 #define getADCReading() 0
20 #define channelNumToIndex(channel) channel 21 uint8_t adcPinToChannelNum(uint8_t pin) {
24 void adcStartConversion(uint8_t channel) {
25 #warning Fast analog read not implemented on this platform 27 void startSecondADCReadOnCurrentChannel() {
28 #warning Fast analog read not implemented on this platform 31 #warning Fast analog read not implemented on this platform 33 void setupMozziADC(int8_t speed) {
34 #warning Fast analog read not implemented on this platform 41 #define LOOP_YIELD yield(); 45 uint16_t output_buffer_size = 0;
47 #if (EXTERNAL_AUDIO_OUTPUT != true) 48 # include "AudioConfigESP.h" 52 inline bool canBufferAudioOutput() {
53 return (i2s_available() >= PDM_RESOLUTION);
55 inline void audioOutput(
const AudioOutput f) {
56 for (uint8_t words = 0; words < PDM_RESOLUTION; ++words) {
57 i2s_write_sample(pdmCode32(f.l()+AUDIO_BIAS));
62 inline bool canBufferAudioOutput() {
63 return (i2s_available() >= PDM_RESOLUTION);
65 inline void audioOutput(
const AudioOutput f) {
66 i2s_write_lr(f.l(), f.r());
71 void CACHED_FUNCTION_ATTR esp8266_serial_audio_output() {
73 while ((UART_TX_FIFO_SIZE - ((U1S >> USTXC) & 0xff)) > (
PDM_RESOLUTION * 4)) {
78 inline void audioOutput(
const AudioOutput f) {
87 static void startAudio() {
88 #if (EXTERNAL_AUDIO_OUTPUT == true) && (BYPASS_MOZZI_OUTPUT_BUFFER != true) 90 timer1_attachInterrupt(defaultAudioOutput);
91 timer1_enable(TIM_DIV1, TIM_EDGE, TIM_LOOP);
92 timer1_write(F_CPU / AUDIO_RATE);
103 timer1_attachInterrupt(esp8266_serial_audio_output);
107 timer1_enable(TIM_DIV16, TIM_EDGE, TIM_LOOP);
111 # if (ESP_AUDIO_OUT_MODE == PDM_VIA_I2S) 116 i2s_set_rate(AUDIO_RATE * PDM_RESOLUTION);
117 if (output_buffer_size == 0)
134 # define AUDIOTICK_ADJUSTMENT ((output_buffer_size - i2s_available()) / PDM_RESOLUTION) 136 # define AUDIOTICK_ADJUSTMENT (output_buffer_size - i2s_available())
#define ESP_AUDIO_OUT_MODE
void setupFastAnalogRead(int8_t speed)
NOTE: Code needed to set up faster than usual analog reads, e.g.
#define EXTERNAL_DAC_VIA_I2S