From 42750f50e78133131de932f029ba166ba6b5b522 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Fri, 25 Oct 2024 18:36:12 +0000 Subject: [PATCH] deploy: cd5e1cb4c44739849687d93c2ad6ffe879207e8f --- AudioRadioRelay_8ino-example.html | 4 +- AutoAnalogAudio_8cpp.html | 4 +- AutoAnalogAudio_8cpp_source.html | 4 +- AutoAnalogAudio_8h.html | 4 +- AutoAnalogAudio_8h_source.html | 184 +++++++++++----------- MultiChannelAdcStream_8ino-example.html | 4 +- NRF52_PDM_PWMTest_8ino-example.html | 8 +- SdAudioAuto_8ino-example.html | 4 +- SdAudioBasic_8ino-example.html | 4 +- SdAudioRecording_8ino-example.html | 4 +- SdAudioWavPlayer_8ino-example.html | 4 +- SimpleAdcStream_8ino-example.html | 4 +- SimpleSine12Bit_8ino-example.html | 4 +- SimpleSine_8ino-example.html | 4 +- WirelessMicrophone_8ino-example.html | 4 +- WirelessSpeaker_8ino-example.html | 4 +- annotated.html | 4 +- classAutoAnalog-members.html | 4 +- classAutoAnalog.html | 4 +- classes.html | 4 +- dir_68267d1309a1af8e8297ef4c3efbcdba.html | 4 +- dir_d35e8d9c847c512a0480f8070ffef7ed.html | 4 +- examples.html | 4 +- files.html | 4 +- functions.html | 4 +- functions_func.html | 4 +- functions_vars.html | 4 +- globals.html | 4 +- globals_defs.html | 4 +- index.html | 4 +- 30 files changed, 155 insertions(+), 149 deletions(-) diff --git a/AudioRadioRelay_8ino-example.html b/AudioRadioRelay_8ino-example.html index 91e7e8b..e90777d 100644 --- a/AudioRadioRelay_8ino-example.html +++ b/AudioRadioRelay_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -239,7 +239,7 @@
diff --git a/AutoAnalogAudio_8cpp.html b/AutoAnalogAudio_8cpp.html index ba23e84..1b21713 100644 --- a/AutoAnalogAudio_8cpp.html +++ b/AutoAnalogAudio_8cpp.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -91,7 +91,7 @@
diff --git a/AutoAnalogAudio_8cpp_source.html b/AutoAnalogAudio_8cpp_source.html index 0ff796c..fc498d6 100644 --- a/AutoAnalogAudio_8cpp_source.html +++ b/AutoAnalogAudio_8cpp_source.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -533,7 +533,7 @@
diff --git a/AutoAnalogAudio_8h.html b/AutoAnalogAudio_8h.html index c40027c..4d91b85 100644 --- a/AutoAnalogAudio_8h.html +++ b/AutoAnalogAudio_8h.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -155,7 +155,7 @@

diff --git a/AutoAnalogAudio_8h_source.html b/AutoAnalogAudio_8h_source.html index 615f65d..fa732f4 100644 --- a/AutoAnalogAudio_8h_source.html +++ b/AutoAnalogAudio_8h_source.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -181,98 +181,104 @@
202 inline static bool adcReady;
203 inline static uint16_t dacBuf0[MAX_BUFFER_SIZE];
204 inline static uint16_t dacBuf1[MAX_BUFFER_SIZE];
-
205 bool micOn;
-
206 int pwrPin;
-
207 int dinPin;
-
208 int clkPin;
-
209 int8_t gain;
-
210 inline static uint32_t sampleCounter;
-
211 bool useI2S;
-
212
-
213#elif defined (ARDUINO_ARCH_NRF52840) || defined (ARDUINO_ARCH_NRF52) || defined (ARDUINO_NRF52840_FEATHER) && !defined __MBED__
-
214 uint16_t dacBuf0[MAX_BUFFER_SIZE];
-
215 uint16_t dacBuf1[MAX_BUFFER_SIZE];
-
216 static uint8_t aCtr;
-
217 static uint32_t aSize;
-
218 static uint16_t *buf0;
-
219 static uint16_t *buf1;
-
220 static void (*_onReceive)(uint16_t *buf, uint32_t buf_len);
-
221 static void adcCallback(uint16_t *buf, uint32_t buf_len);
-
222 void set_callback(void(*function)(uint16_t *buf, uint32_t buf_len));
-
223 static bool adcReady;
-
224 bool micOn;
-
225 int pwrPin;
-
226 int dinPin;
-
227 int clkPin;
-
228 int8_t gain;
-
229 uint32_t sampleCounter;
-
230 //void DACC_Handler();
-
231 bool useI2S;
-
232#endif
-
233
-
234private:
-
235
-
244#if defined (ARDUINO_ARCH_SAM)
-
245 bool whichDma = 0;
-
246 bool whichDac;
-
247 bool dacChan;
-
248
-
249 uint8_t aCtr = 0; /* Internal counter for ADC data */
-
250 uint16_t realBuf[MAX_BUFFER_SIZE]; /* Internal DAC buffer */
-
251 uint16_t adcDma[MAX_BUFFER_SIZE]; /* Buffers for ADC DMA transfers */
-
252 uint16_t dataReady; /* Internal indicator for DAC data */
-
253
-
254 uint32_t dataTimer; /* Internal timer tracks timing of incoming data */
-
255 uint32_t sampleCount; /* Internal counter for delaying analysis of timing */
-
256 uint32_t tcTicks; /* Stores the current TC0 Ch0 counter value */
-
257 uint32_t tcTicks2; /* Stores the current TC0 Ch1 counter value */
-
258 uint32_t adjustDivider; /* Internal variables for adjusting timers on-the-fly */
+
205 inline static uint32_t sampleCounter;
+
206
+
207#elif defined (ARDUINO_ARCH_NRF52840) || defined (ARDUINO_ARCH_NRF52) || defined (ARDUINO_NRF52840_FEATHER) && !defined __MBED__
+
208 uint16_t dacBuf0[MAX_BUFFER_SIZE];
+
209 uint16_t dacBuf1[MAX_BUFFER_SIZE];
+
210 static uint8_t aCtr;
+
211 static uint32_t aSize;
+
212 static uint16_t *buf0;
+
213 static uint16_t *buf1;
+
214 static void (*_onReceive)(uint16_t *buf, uint32_t buf_len);
+
215 static void adcCallback(uint16_t *buf, uint32_t buf_len);
+
216 void set_callback(void(*function)(uint16_t *buf, uint32_t buf_len));
+
217 static bool adcReady;
+
218 uint32_t sampleCounter;
+
219 //void DACC_Handler();
+
220#endif
+
221#if defined (ARDUINO_ARCH_NRF52840) || defined (ARDUINO_ARCH_NRF52)
+
222 bool micOn;
+
223 int pwrPin;
+
224 int dinPin;
+
225 int clkPin;
+
226 int8_t gain;
+
227 bool useI2S;
+
228 uint16_t I2S_PIN_MCK;
+
229 uint8_t I2S_PORT_MCK;
+
230 uint16_t I2S_PIN_SCK;
+
231 uint8_t I2S_PORT_SCK;
+
232 uint16_t I2S_PIN_LRCK;
+
233 uint8_t I2S_PORT_LRCK;
+
234 uint16_t I2S_PIN_SDOUT;
+
235 uint8_t I2S_PORT_SDOUT;
+
236
+
237#endif
+
238
+
239
+
240private:
+
241
+
250#if defined (ARDUINO_ARCH_SAM)
+
251 bool whichDma = 0;
+
252 bool whichDac;
+
253 bool dacChan;
+
254
+
255 uint8_t aCtr = 0; /* Internal counter for ADC data */
+
256 uint16_t realBuf[MAX_BUFFER_SIZE]; /* Internal DAC buffer */
+
257 uint16_t adcDma[MAX_BUFFER_SIZE]; /* Buffers for ADC DMA transfers */
+
258 uint16_t dataReady; /* Internal indicator for DAC data */
259
-
260 uint32_t dacNumSamples; /* Internal variable for number of samples sent to the DAC */
-
261 uint32_t adcNumSamples;
-
262 uint16_t adjustCtr; /* Internal variables for adjusting timers on-the-fly */
-
263 uint16_t adjustCtr2; /* Internal variables for adjusting timers on-the-fly */
-
264 uint32_t adcLastAdjust;
-
265#endif
-
266 void adcSetup(void); /* Enable the ADC */
-
267 void dacSetup(void); /* Enable the DAC */
-
268
-
269 void dacBufferStereo(uint8_t dacChannel);
-
270
-
271 void tcSetup(uint32_t sampRate = 0); /* Sets up Timer TC0 Channel 0 */
-
272 void tc2Setup(uint32_t sampRate = 0); /* Sets up Timer TC0 Channel 1 */
-
273
-
274 uint32_t frequencyToTimerCount(uint32_t Frequency); /* Function to calculate timer counters */
-
275
-
276#if defined ESP32
-
277
-
278 uint32_t sampleRate;
-
279 i2s_config_t i2s_cfg;
-
280
-
281 bool i2sStopped;
-
282 adc1_channel_t adcChannel;
+
260 uint32_t dataTimer; /* Internal timer tracks timing of incoming data */
+
261 uint32_t sampleCount; /* Internal counter for delaying analysis of timing */
+
262 uint32_t tcTicks; /* Stores the current TC0 Ch0 counter value */
+
263 uint32_t tcTicks2; /* Stores the current TC0 Ch1 counter value */
+
264 uint32_t adjustDivider; /* Internal variables for adjusting timers on-the-fly */
+
265
+
266 uint32_t dacNumSamples; /* Internal variable for number of samples sent to the DAC */
+
267 uint32_t adcNumSamples;
+
268 uint16_t adjustCtr; /* Internal variables for adjusting timers on-the-fly */
+
269 uint16_t adjustCtr2; /* Internal variables for adjusting timers on-the-fly */
+
270 uint32_t adcLastAdjust;
+
271#endif
+
272 void adcSetup(void); /* Enable the ADC */
+
273 void dacSetup(void); /* Enable the DAC */
+
274
+
275 void dacBufferStereo(uint8_t dacChannel);
+
276
+
277 void tcSetup(uint32_t sampRate = 0); /* Sets up Timer TC0 Channel 0 */
+
278 void tc2Setup(uint32_t sampRate = 0); /* Sets up Timer TC0 Channel 1 */
+
279
+
280 uint32_t frequencyToTimerCount(uint32_t Frequency); /* Function to calculate timer counters */
+
281
+
282#if defined ESP32
283
-
284 bool taskCreated;
-
285
-
286 bool dacEnabled;
-
287 uint8_t lastDacSample;
-
288 i2s_event_t myI2SQueue[5];
-
289 //void dacTask(void *args);
-
290
-
291 bool adcTaskCreated;
-
292 bool adcDisabled;
-
293
-
294 #define DELAY_250MS (250 / portTICK_PERIOD_MS)
-
295
-
296#endif
-
298};
-
+
284 uint32_t sampleRate;
+
285 i2s_config_t i2s_cfg;
+
286
+
287 bool i2sStopped;
+
288 adc1_channel_t adcChannel;
+
289
+
290 bool taskCreated;
+
291
+
292 bool dacEnabled;
+
293 uint8_t lastDacSample;
+
294 i2s_event_t myI2SQueue[5];
+
295 //void dacTask(void *args);
+
296
+
297 bool adcTaskCreated;
+
298 bool adcDisabled;
299
-
300
+
300 #define DELAY_250MS (250 / portTICK_PERIOD_MS)
301
302#endif
-
303
-
304
+
304};
+

+
305
+
306
+
307
+
308#endif
+
309
+
310
void adcInterrupts(bool enabled=true)
void dacHandler(void)
@@ -299,7 +305,7 @@ diff --git a/MultiChannelAdcStream_8ino-example.html b/MultiChannelAdcStream_8ino-example.html index 2c4a887..92fb3ee 100644 --- a/MultiChannelAdcStream_8ino-example.html +++ b/MultiChannelAdcStream_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -190,7 +190,7 @@
diff --git a/NRF52_PDM_PWMTest_8ino-example.html b/NRF52_PDM_PWMTest_8ino-example.html index 0f5a17c..171f168 100644 --- a/NRF52_PDM_PWMTest_8ino-example.html +++ b/NRF52_PDM_PWMTest_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -97,8 +97,8 @@
void loop() {
aaAudio.getADC(320); // Get 320 Samples from the ADC
-
for (int i = 0; i < 320; i++) { // Copy them into the DAC Buffer and change from signed to unsigned ( + 0x8000)
-
aaAudio.dacBuffer16[i] = (uint16_t)(aaAudio.adcBuffer16[i] + 0x8000);
+
for (int i = 0; i < 320; i++) { // Copy them into the DAC Buffer
+
aaAudio.dacBuffer16[i] = (uint16_t)(aaAudio.adcBuffer16[i]);
}
aaAudio.feedDAC(0,320); // Feed the DAC with the ADC data
}
@@ -116,7 +116,7 @@
diff --git a/SdAudioAuto_8ino-example.html b/SdAudioAuto_8ino-example.html index 4a7697e..44e6ab0 100644 --- a/SdAudioAuto_8ino-example.html +++ b/SdAudioAuto_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -223,7 +223,7 @@
diff --git a/SdAudioBasic_8ino-example.html b/SdAudioBasic_8ino-example.html index b230e37..f5986b0 100644 --- a/SdAudioBasic_8ino-example.html +++ b/SdAudioBasic_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -195,7 +195,7 @@
diff --git a/SdAudioRecording_8ino-example.html b/SdAudioRecording_8ino-example.html index f8339fb..e603a65 100644 --- a/SdAudioRecording_8ino-example.html +++ b/SdAudioRecording_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -193,7 +193,7 @@
diff --git a/SdAudioWavPlayer_8ino-example.html b/SdAudioWavPlayer_8ino-example.html index 4b56dac..857093a 100644 --- a/SdAudioWavPlayer_8ino-example.html +++ b/SdAudioWavPlayer_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -169,7 +169,7 @@
diff --git a/SimpleAdcStream_8ino-example.html b/SimpleAdcStream_8ino-example.html index d5105eb..713ac6a 100644 --- a/SimpleAdcStream_8ino-example.html +++ b/SimpleAdcStream_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -179,7 +179,7 @@
diff --git a/SimpleSine12Bit_8ino-example.html b/SimpleSine12Bit_8ino-example.html index 1e989e0..d698a49 100644 --- a/SimpleSine12Bit_8ino-example.html +++ b/SimpleSine12Bit_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -241,7 +241,7 @@
diff --git a/SimpleSine_8ino-example.html b/SimpleSine_8ino-example.html index 40b321d..8dfc95c 100644 --- a/SimpleSine_8ino-example.html +++ b/SimpleSine_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -249,7 +249,7 @@
diff --git a/WirelessMicrophone_8ino-example.html b/WirelessMicrophone_8ino-example.html index 84285e6..dcda4c7 100644 --- a/WirelessMicrophone_8ino-example.html +++ b/WirelessMicrophone_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -190,7 +190,7 @@
diff --git a/WirelessSpeaker_8ino-example.html b/WirelessSpeaker_8ino-example.html index ae3f4ac..18b05f9 100644 --- a/WirelessSpeaker_8ino-example.html +++ b/WirelessSpeaker_8ino-example.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -224,7 +224,7 @@
diff --git a/annotated.html b/annotated.html index 529f465..2ebfe3b 100644 --- a/annotated.html +++ b/annotated.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -82,7 +82,7 @@
diff --git a/classAutoAnalog-members.html b/classAutoAnalog-members.html index 57cdd22..52d2c0b 100644 --- a/classAutoAnalog-members.html +++ b/classAutoAnalog-members.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -102,7 +102,7 @@
diff --git a/classAutoAnalog.html b/classAutoAnalog.html index 1528080..d2da99a 100644 --- a/classAutoAnalog.html +++ b/classAutoAnalog.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -676,7 +676,7 @@

diff --git a/classes.html b/classes.html index 5bc41d9..8434926 100644 --- a/classes.html +++ b/classes.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -83,7 +83,7 @@
diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 1a8e4da..feead93 100644 --- a/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -92,7 +92,7 @@
diff --git a/dir_d35e8d9c847c512a0480f8070ffef7ed.html b/dir_d35e8d9c847c512a0480f8070ffef7ed.html index 39019ef..0a5dcdf 100644 --- a/dir_d35e8d9c847c512a0480f8070ffef7ed.html +++ b/dir_d35e8d9c847c512a0480f8070ffef7ed.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -87,7 +87,7 @@
diff --git a/examples.html b/examples.html index ef896a7..7503748 100644 --- a/examples.html +++ b/examples.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -91,7 +91,7 @@
diff --git a/files.html b/files.html index fb53026..0db7e2a 100644 --- a/files.html +++ b/files.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -85,7 +85,7 @@
diff --git a/functions.html b/functions.html index 6d2baff..343c4a6 100644 --- a/functions.html +++ b/functions.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -98,7 +98,7 @@
diff --git a/functions_func.html b/functions_func.html index 26ccea3..ce39c53 100644 --- a/functions_func.html +++ b/functions_func.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -90,7 +90,7 @@
diff --git a/functions_vars.html b/functions_vars.html index a00ce5b..49f40b9 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -84,7 +84,7 @@
diff --git a/globals.html b/globals.html index 8ae65f9..7f665fd 100644 --- a/globals.html +++ b/globals.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -79,7 +79,7 @@
diff --git a/globals_defs.html b/globals_defs.html index a8db79b..d57b3e0 100644 --- a/globals_defs.html +++ b/globals_defs.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -79,7 +79,7 @@
diff --git a/index.html b/index.html index ff7e183..ac19d8b 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ -
Auto Analog Audio v1.51.0 +
Auto Analog Audio v1.51.1
TMRh20 2020 - Automatic DAC, ADC & Timers on Arduino Due
@@ -101,7 +101,7 @@