diff --git a/_audio_config_8h_source.html b/_audio_config_8h_source.html
index a46eeb4057..7c015c3e26 100644
--- a/_audio_config_8h_source.html
+++ b/_audio_config_8h_source.html
@@ -470,296 +470,297 @@
427 #define PIN_I2S_WS PIN_I2S_BCK+1
428 #define PIN_I2S_DATA_IN 28
429 #define PIN_I2S_DATA_OUT 28
-
- 431 #define PIN_I2S_MUTE -1
- 432 #define SOFT_MUTE_VALUE 0
- 433 #define PIN_CS PIN_SPI0_SS
-
-
- 436 #define FIX_SYNC_SYNCHRONIZE
-
-
- 439 #ifndef ANALOG_BUFFER_SIZE
- 440 #define ANALOG_BUFFER_SIZE 256
-
-
- 443 #ifndef ANALOG_BUFFERS
- 444 #define ANALOG_BUFFERS 100
-
-
-
-
-
-
- 451 #if defined(ARDUINO_ARCH_RP2040) && LWIP_IPV4==1
-
- 453 # define USE_URL_ARDUINO
-
- 455 # define USE_WIFI_CLIENT_SECURE
- 456 # define USE_AUDIO_SERVER
- 457 using WiFiServerSecure = BearSSL::WiFiServerSecure;
-
-
+ 430 #define PIN_I2S_MCK -1
+
+ 432 #define PIN_I2S_MUTE -1
+ 433 #define SOFT_MUTE_VALUE 0
+ 434 #define PIN_CS PIN_SPI0_SS
+
+
+ 437 #define FIX_SYNC_SYNCHRONIZE
+
+
+ 440 #ifndef ANALOG_BUFFER_SIZE
+ 441 #define ANALOG_BUFFER_SIZE 256
+
+
+ 444 #ifndef ANALOG_BUFFERS
+ 445 #define ANALOG_BUFFERS 100
+
+
+
+
+
+
+ 452 #if defined(ARDUINO_ARCH_RP2040) && LWIP_IPV4==1
+
+ 454 # define USE_URL_ARDUINO
+
+ 456 # define USE_WIFI_CLIENT_SECURE
+ 457 # define USE_AUDIO_SERVER
+ 458 using WiFiServerSecure = BearSSL::WiFiServerSecure;
+
-
-
-
-
-
-
-
-
-
-
-
-
- 473 #define PIN_PWM_START 6
-
-
- 476 #undef PWM_BUFFER_SIZE
- 477 #define PWM_BUFFER_SIZE 125
-
- 479 #undef DEFAULT_BUFFER_SIZE
- 480 #define DEFAULT_BUFFER_SIZE 125
-
-
-
- 484 #undef LOG_PRINTF_BUFFER_SIZE
- 485 #define LOG_PRINTF_BUFFER_SIZE 80
-
-
-
-
-
- 491 #define PIN_I2S_BCK 13
- 492 #define PIN_I2S_WS 10
- 493 #define PIN_I2S_DATA_IN 12
- 494 #define PIN_I2S_DATA_OUT 11
- 495 #define PIN_I2S_MUTE -1
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 474 #define PIN_PWM_START 6
+
+
+ 477 #undef PWM_BUFFER_SIZE
+ 478 #define PWM_BUFFER_SIZE 125
+
+ 480 #undef DEFAULT_BUFFER_SIZE
+ 481 #define DEFAULT_BUFFER_SIZE 125
+
+
+
+ 485 #undef LOG_PRINTF_BUFFER_SIZE
+ 486 #define LOG_PRINTF_BUFFER_SIZE 80
+
+
+
+
+
+ 492 #define PIN_I2S_BCK 13
+ 493 #define PIN_I2S_WS 10
+ 494 #define PIN_I2S_DATA_IN 12
+ 495 #define PIN_I2S_DATA_OUT 11
+ 496 #define PIN_I2S_MUTE -1
+
+
-
- 501 #if defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32)
-
-
-
-
-
-
-
- 509 #define USE_ANALOG_ARDUINO
- 510 #define USE_INT24_FROM_INT
-
- 512 #define ANALOG_BUFFER_SIZE 1024
- 513 #define ANALOG_BUFFERS 20
- 514 #define PIN_ANALOG_START PA0
- 515 #define PIN_PWM_START PA0
- 516 #define PWM_DEFAULT_TIMER TIM2
- 517 #define PWM_FREQ_TIMER_NO 3
-
- 519 #define PIN_I2S_BCK -1
- 520 #define PIN_I2S_WS -1
- 521 #define PIN_I2S_DATA_IN -1
- 522 #define PIN_I2S_DATA_OUT -1
- 523 #define PIN_I2S_MUTE -1
- 524 #define SOFT_MUTE_VALUE 0
-
-
-
-
-
- 530 #ifdef ARDUINO_ARCH_SAMD
-
- 532 #define USE_INT24_FROM_INT
- 533 #define PIN_I2S_BCK 1
- 534 #define PIN_I2S_WS PIN_I2S_BCK+1
- 535 #define PIN_I2S_DATA_IN 3
- 536 #define PIN_I2S_DATA_OUT 3
- 537 #define PIN_I2S_MUTE -1
- 538 #define SOFT_MUTE_VALUE 0
-
-
- 541 #ifdef ARDUINO_SAMD_MKRWIFI1010
- 542 #include <WiFiNINA.h>
- 543 #define USE_URL_ARDUINO
- 544 #define USE_AUDIO_SERVER
-
-
-
-
- 549 #if defined(ARDUINO_GIGA)
-
- 551 #include <Arduino_AdvancedAnalog.h>
-
- 553 #define USE_INT24_FROM_INT
- 554 #define USE_TYPETRAITS
- 555 #define USE_EFFECTS_SUITE
-
- 557 #define USE_STREAM_WRITE_OVERRIDE
- 558 #define ANALOG_BUFFER_SIZE 1024
- 559 #define ANALOG_BUFFERS 10
- 560 #define USE_URL_ARDUINO
- 561 #define USE_AUDIO_SERVER
-
- 563 #define PIN_ANALOG_START A7
- 564 #define PIN_DAC_1 A12
- 565 #define PIN_DAC_2 A13
-
-
-
-
-
- 571 #if defined(ARDUINO_ARCH_MBED_PORTENTA)
-
- 573 #include <Arduino_AdvancedAnalog.h>
-
- 575 #define USE_INT24_FROM_INT
- 576 #define USE_TYPETRAITS
- 577 #define USE_EFFECTS_SUITE
-
-
-
- 581 #define USE_STREAM_WRITE_OVERRIDE
- 582 #define ANALOG_BUFFER_SIZE 1024
- 583 #define ANALOG_BUFFERS 10
- 584 #define USE_URL_ARDUINO
- 585 #define USE_AUDIO_SERVER
-
- 587 #define PIN_ANALOG_START A0
- 588 #define PIN_PWM_START D2
-
-
-
-
-
-
- 595 #if defined(ARDUINO_ARCH_RENESAS) || defined(_RENESAS_RA_)
-
-
-
-
- 600 #define USE_INT24_FROM_INT
-
- 602 #define USE_TYPETRAITS
- 603 #define USE_EFFECTS_SUITE
-
-
- 606 #define PIN_PWM_START D2
- 607 #define PIN_PWM_COUNT 12
-
- 609 #define USE_ANALOG_ARDUINO
-
- 611 #define PIN_ANALOG_START A0
- 612 #define ANALOG_BUFFER_SIZE 512
- 613 #define ANALOG_BUFFERS 5
- 614 #define ANALOG_MAX_OUT_CHANNELS 1
- 615 #define ANALOG_MAX_SAMPLE_RATE 16000
-
-
-
- 619 #define VS1053_DREQ 2
- 620 #define VS1053_CS_SD 9
- 621 #define VS1053_RESET 8
- 622 #define VS1053_DEFINED
-
-
- 625 #if defined(ARDUINO) && !defined(ARDUINO_MINIMA)
-
- 627 # define USE_URL_ARDUINO
- 628 # define USE_AUDIO_SERVER
-
-
-
-
-
-
-
-
- 637 #ifndef VS1053_DEFINED
-
- 639 # define VS1053_DCS 16
- 640 # define VS1053_DREQ 4
- 641 # define VS1053_RESET 15
- 642 # define VS1053_CS_SD -1
-
-
-
-
-
- 648 #define VS1053_DEFAULT_VOLUME 0.7
-
+
+
+ 502 #if defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32)
+
+
+
+
+
+
+
+ 510 #define USE_ANALOG_ARDUINO
+ 511 #define USE_INT24_FROM_INT
+
+ 513 #define ANALOG_BUFFER_SIZE 1024
+ 514 #define ANALOG_BUFFERS 20
+ 515 #define PIN_ANALOG_START PA0
+ 516 #define PIN_PWM_START PA0
+ 517 #define PWM_DEFAULT_TIMER TIM2
+ 518 #define PWM_FREQ_TIMER_NO 3
+
+ 520 #define PIN_I2S_BCK -1
+ 521 #define PIN_I2S_WS -1
+ 522 #define PIN_I2S_DATA_IN -1
+ 523 #define PIN_I2S_DATA_OUT -1
+ 524 #define PIN_I2S_MUTE -1
+ 525 #define SOFT_MUTE_VALUE 0
+
+
+
+
+
+ 531 #ifdef ARDUINO_ARCH_SAMD
+
+ 533 #define USE_INT24_FROM_INT
+ 534 #define PIN_I2S_BCK 1
+ 535 #define PIN_I2S_WS PIN_I2S_BCK+1
+ 536 #define PIN_I2S_DATA_IN 3
+ 537 #define PIN_I2S_DATA_OUT 3
+ 538 #define PIN_I2S_MUTE -1
+ 539 #define SOFT_MUTE_VALUE 0
+
+
+ 542 #ifdef ARDUINO_SAMD_MKRWIFI1010
+ 543 #include <WiFiNINA.h>
+ 544 #define USE_URL_ARDUINO
+ 545 #define USE_AUDIO_SERVER
+
+
+
+
+ 550 #if defined(ARDUINO_GIGA)
+
+ 552 #include <Arduino_AdvancedAnalog.h>
+
+ 554 #define USE_INT24_FROM_INT
+ 555 #define USE_TYPETRAITS
+ 556 #define USE_EFFECTS_SUITE
+
+ 558 #define USE_STREAM_WRITE_OVERRIDE
+ 559 #define ANALOG_BUFFER_SIZE 1024
+ 560 #define ANALOG_BUFFERS 10
+ 561 #define USE_URL_ARDUINO
+ 562 #define USE_AUDIO_SERVER
+
+ 564 #define PIN_ANALOG_START A7
+ 565 #define PIN_DAC_1 A12
+ 566 #define PIN_DAC_2 A13
+
+
+
+
+
+ 572 #if defined(ARDUINO_ARCH_MBED_PORTENTA)
+
+ 574 #include <Arduino_AdvancedAnalog.h>
+
+ 576 #define USE_INT24_FROM_INT
+ 577 #define USE_TYPETRAITS
+ 578 #define USE_EFFECTS_SUITE
+
+
+
+ 582 #define USE_STREAM_WRITE_OVERRIDE
+ 583 #define ANALOG_BUFFER_SIZE 1024
+ 584 #define ANALOG_BUFFERS 10
+ 585 #define USE_URL_ARDUINO
+ 586 #define USE_AUDIO_SERVER
+
+ 588 #define PIN_ANALOG_START A0
+ 589 #define PIN_PWM_START D2
+
+
+
+
+
+
+ 596 #if defined(ARDUINO_ARCH_RENESAS) || defined(_RENESAS_RA_)
+
+
+
+
+ 601 #define USE_INT24_FROM_INT
+
+ 603 #define USE_TYPETRAITS
+ 604 #define USE_EFFECTS_SUITE
+
+
+ 607 #define PIN_PWM_START D2
+ 608 #define PIN_PWM_COUNT 12
+
+ 610 #define USE_ANALOG_ARDUINO
+
+ 612 #define PIN_ANALOG_START A0
+ 613 #define ANALOG_BUFFER_SIZE 512
+ 614 #define ANALOG_BUFFERS 5
+ 615 #define ANALOG_MAX_OUT_CHANNELS 1
+ 616 #define ANALOG_MAX_SAMPLE_RATE 16000
+
+
+
+ 620 #define VS1053_DREQ 2
+ 621 #define VS1053_CS_SD 9
+ 622 #define VS1053_RESET 8
+ 623 #define VS1053_DEFINED
+
+
+ 626 #if defined(ARDUINO) && !defined(ARDUINO_MINIMA)
+
+ 628 # define USE_URL_ARDUINO
+ 629 # define USE_AUDIO_SERVER
+
+
+
+
+
+
+
+
+ 638 #ifndef VS1053_DEFINED
+
+ 640 # define VS1053_DCS 16
+ 641 # define VS1053_DREQ 4
+ 642 # define VS1053_RESET 15
+ 643 # define VS1053_CS_SD -1
+
+
+
+
+
+ 649 #define VS1053_DEFAULT_VOLUME 0.7
-
-
-
-
-
-
-
- 659 # define USE_URL_ARDUINO
- 660 # define USE_STREAM_WRITE_OVERRIDE
- 661 # define USE_STREAM_READ_OVERRIDE
- 662 # define USE_STREAM_READCHAR_OVERRIDE
-
- 664 typedef WiFiClient WiFiClientSecure;
-
-
-
- 668 #ifdef IS_MIN_DESKTOP
-
- 670 # include "AudioLibs/Desktop/Millis.h"
- 671 # include "AudioLibs/Desktop/Main.h"
- 672 # include "AudioLibs/Desktop/File.h"
- 673 # define USE_STREAM_READ_OVERRIDE
-
-
-
- 677 # define USE_STREAM_WRITE_OVERRIDE
-
-
-
- 681 # define USE_STREAM_READ_OVERRIDE
-
-
- 684 #ifdef AUDIOKIT_USE_IDF
- 685 # define USE_INT24_FROM_INT
-
-
- 688 #if USE_INLINE_VARS && !defined(INGNORE_INLINE_VARS)
- 689 # define INLINE_VAR inline
-
- 691 # define INLINE_VAR static
-
-
- 694 #ifndef ANALOG_MAX_SAMPLE_RATE
- 695 # define ANALOG_MAX_SAMPLE_RATE 44000
-
-
-
- 699 #include "AudioBasic/Int24_3bytes_t.h"
- 700 #include "AudioBasic/Int24_4bytes_t.h"
- 701 #ifdef USE_3BYTE_INT24
-
-
-
-
-
-
- 708 #define ESP_IDF_VERSION_VAL(a, b , c) 0
-
-
- 711 #pragma GCC diagnostic ignored "-Wunused-variable"
- 712 #pragma GCC diagnostic ignored "-Wunused-function"
- 713 #pragma GCC diagnostic ignored "-Wvla"
- 714 #pragma GCC diagnostic ignored "-Wsign-compare"
- 715 #ifdef USE_INITIALIZER_LIST
- 716 #pragma GCC diagnostic ignored "-Wnarrowing"
-
-
-
+
+
+
+
+
+
+
+
+ 660 # define USE_URL_ARDUINO
+ 661 # define USE_STREAM_WRITE_OVERRIDE
+ 662 # define USE_STREAM_READ_OVERRIDE
+ 663 # define USE_STREAM_READCHAR_OVERRIDE
+
+ 665 typedef WiFiClient WiFiClientSecure;
+
+
+
+ 669 #ifdef IS_MIN_DESKTOP
+
+ 671 # include "AudioLibs/Desktop/Millis.h"
+ 672 # include "AudioLibs/Desktop/Main.h"
+ 673 # include "AudioLibs/Desktop/File.h"
+ 674 # define USE_STREAM_READ_OVERRIDE
+
+
+
+ 678 # define USE_STREAM_WRITE_OVERRIDE
+
+
+
+ 682 # define USE_STREAM_READ_OVERRIDE
+
+
+ 685 #ifdef AUDIOKIT_USE_IDF
+ 686 # define USE_INT24_FROM_INT
+
+
+ 689 #if USE_INLINE_VARS && !defined(INGNORE_INLINE_VARS)
+ 690 # define INLINE_VAR inline
+
+ 692 # define INLINE_VAR static
+
+
+ 695 #ifndef ANALOG_MAX_SAMPLE_RATE
+ 696 # define ANALOG_MAX_SAMPLE_RATE 44000
+
+
+
+ 700 #include "AudioBasic/Int24_3bytes_t.h"
+ 701 #include "AudioBasic/Int24_4bytes_t.h"
+ 702 #ifdef USE_3BYTE_INT24
+
+
+
+
+
+
+ 709 #define ESP_IDF_VERSION_VAL(a, b , c) 0
+
+
+ 712 #pragma GCC diagnostic ignored "-Wunused-variable"
+ 713 #pragma GCC diagnostic ignored "-Wunused-function"
+ 714 #pragma GCC diagnostic ignored "-Wvla"
+ 715 #pragma GCC diagnostic ignored "-Wsign-compare"
+ 716 #ifdef USE_INITIALIZER_LIST
+ 717 #pragma GCC diagnostic ignored "-Wnarrowing"
+
+
+
If you want to use the framework w/o Arduino you need to provide the implementation of a couple of cl...
diff --git a/_i2_s_r_p2040_8h_source.html b/_i2_s_r_p2040_8h_source.html
index f9a302b14b..ff2d473318 100644
--- a/_i2_s_r_p2040_8h_source.html
+++ b/_i2_s_r_p2040_8h_source.html
@@ -129,281 +129,283 @@
68 LOGE(
"Could not set data pin: %d", cfg.pin_data);
- 71 if (!i2s.setMCLK(cfg.pin_mck)){
- 72 LOGE(
"Could not set data pin: %d", cfg.pin_mck);
-
-
-
- 76 if (cfg.bits_per_sample==8 || !i2s.setBitsPerSample(cfg.bits_per_sample)){
- 77 LOGE(
"Could not set bits per sample: %d", cfg.bits_per_sample);
-
-
-
- 81 if (!i2s.setBuffers(cfg.buffer_count, cfg.buffer_size)){
- 82 LOGE(
"Could not set buffers: Count: '%d', size: '%d'", cfg.buffer_count, cfg.buffer_size);
-
-
-
-
- 87 if(cfg.i2s_format == I2S_STD_FORMAT || cfg.i2s_format == I2S_PHILIPS_FORMAT){
-
- 89 }
else if(cfg.i2s_format == I2S_LEFT_JUSTIFIED_FORMAT || cfg.i2s_format==I2S_LSB_FORMAT){
- 90 if(!i2s.setLSBJFormat()){
- 91 LOGE(
"Could not set LSB Format")
-
-
-
- 95 LOGE(
"Unsupported I2S format");
-
-
-
- 99 if (cfg.channels < 1 || cfg.channels > 2 ){
- 100 LOGE(
"Unsupported channels: '%d'", cfg.channels);
-
-
-
- 104 if (!i2s.begin(cfg.sample_rate)){
- 105 LOGE(
"Could not start I2S");
-
-
-
-
-
-
-
-
-
-
- 118 I2SConfigStd config() {
-
-
-
- 123 size_t writeBytes(
const void *src,
size_t size_bytes) {
- 124 LOGD(
"writeBytes(%d)", size_bytes);
-
-
- 127 if (cfg.channels==1){
- 128 result = writeExpandChannel(src, size_bytes);
- 129 }
else if (cfg.channels==2){
- 130 const uint8_t *p = (
const uint8_t*) src;
- 131 while(size_bytes >=
sizeof(int32_t)){
- 132 bool justWritten = i2s.write(*(int32_t*)p,
true);
-
- 134 size_bytes -=
sizeof(int32_t);
- 135 p +=
sizeof(int32_t);
- 136 result +=
sizeof(int32_t);
- 137 }
else return result;
-
-
-
-
-
- 143 size_t readBytes(
void *dest,
size_t size_bytes) {
-
- 145 switch(cfg.channels){
-
- 147 return read1Channel(dest, size_bytes);
-
- 149 return read2Channels(dest, size_bytes);
-
-
-
-
- 154 int availableForWrite() {
- 155 if (cfg.channels == 1){
- 156 return cfg.buffer_size;
-
- 158 return i2s.availableForWrite();
-
-
-
-
- 163 return min(i2s.available(), cfg.buffer_size);
-
-
-
-
-
-
-
-
-
-
-
-
- 177 size_t writeExpandChannel(
const void *src,
size_t size_bytes) {
- 178 switch(cfg.bits_per_sample){
-
-
-
-
-
-
-
-
-
-
- 189 int16_t *pt16 = (int16_t*) src;
- 190 for (
int j=0;j<size_bytes/
sizeof(int16_t);j++){
- 191 i2s.write16(pt16[j], pt16[j]);
-
-
-
- 195 int32_t *pt24 = (int32_t*) src;
- 196 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
- 197 i2s.write24(pt24[j], pt24[j]);
-
-
-
- 201 int32_t *pt32 = (int32_t*) src;
- 202 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
- 203 i2s.write32(pt32[j], pt32[j]);
-
-
-
-
-
-
- 211 size_t read2Channels(
void *dest,
size_t size_bytes) {
-
-
- 214 switch(cfg.bits_per_sample){
-
-
-
-
-
-
-
-
-
-
-
-
- 227 int16_t *data = (int16_t *)dest;
- 228 for (
int j=0;j<size_bytes/
sizeof(int16_t);j+=2){
- 229 if (i2s.read16(data+j, data+j+1)){
-
-
-
-
-
-
-
-
- 238 int32_t *data = (int32_t *)dest;
- 239 for (
int j=0;j<size_bytes/
sizeof(int32_t);j+=2){
- 240 if (i2s.read24(data+j, data+j+1)){
-
-
-
-
-
-
-
-
- 249 int32_t *data = (int32_t *)dest;
- 250 for (
int j=0;j<size_bytes/
sizeof(int32_t);j+=2){
- 251 if (i2s.read32(data+j, data+j+1)){
-
-
-
-
-
-
-
-
-
-
-
- 264 size_t read1Channel(
void *dest,
size_t size_bytes) {
-
-
- 267 switch(cfg.bits_per_sample){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 283 int16_t *data = (int16_t*)dest;
- 284 for (
int j=0;j<size_bytes/
sizeof(int16_t);j++){
- 285 if (i2s.read16(tmp, tmp+1)){
- 286 data[j] = mix(tmp[0], tmp[1]);
-
-
-
-
-
-
-
-
-
- 296 int32_t *data = (int32_t*)dest;
- 297 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
- 298 if (i2s.read24(tmp, tmp+1)){
- 299 data[j] = mix(tmp[0],tmp[1]);
-
-
-
-
-
-
-
-
-
- 309 int32_t *data = (int32_t*)dest;
- 310 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
- 311 if (i2s.read32(tmp, tmp+1)){
- 312 data[j] = mix(tmp[0],tmp[1]);
-
-
-
-
-
-
-
-
-
-
-
-
- 325 T mix (T left, T right) {
- 326 if (left!=0) has_input[0]=
true;
- 327 if (right!=0) has_input[1]=
true;
-
-
- 330 if (has_input[0]&&!has_input[1]){
-
-
-
-
- 335 if (!has_input[0]&&has_input[1]){
-
-
-
- 339 return (left/2) + (right/2);
-
-
+ 71 if (cfg.pin_mck != -1){
+ 72 if (!i2s.setMCLK(cfg.pin_mck)){
+ 73 LOGE(
"Could not set data pin: %d", cfg.pin_mck);
+
+
+
+
+ 78 if (cfg.bits_per_sample==8 || !i2s.setBitsPerSample(cfg.bits_per_sample)){
+ 79 LOGE(
"Could not set bits per sample: %d", cfg.bits_per_sample);
+
+
+
+ 83 if (!i2s.setBuffers(cfg.buffer_count, cfg.buffer_size)){
+ 84 LOGE(
"Could not set buffers: Count: '%d', size: '%d'", cfg.buffer_count, cfg.buffer_size);
+
+
+
+
+ 89 if(cfg.i2s_format == I2S_STD_FORMAT || cfg.i2s_format == I2S_PHILIPS_FORMAT){
+
+ 91 }
else if(cfg.i2s_format == I2S_LEFT_JUSTIFIED_FORMAT || cfg.i2s_format==I2S_LSB_FORMAT){
+ 92 if(!i2s.setLSBJFormat()){
+ 93 LOGE(
"Could not set LSB Format")
+
+
+
+ 97 LOGE(
"Unsupported I2S format");
+
+
+
+ 101 if (cfg.channels < 1 || cfg.channels > 2 ){
+ 102 LOGE(
"Unsupported channels: '%d'", cfg.channels);
+
+
+
+ 106 if (!i2s.begin(cfg.sample_rate)){
+ 107 LOGE(
"Could not start I2S");
+
+
+
+
+
+
+
+
+
+
+ 120 I2SConfigStd config() {
+
+
+
+ 125 size_t writeBytes(
const void *src,
size_t size_bytes) {
+ 126 LOGD(
"writeBytes(%d)", size_bytes);
+
+
+ 129 if (cfg.channels==1){
+ 130 result = writeExpandChannel(src, size_bytes);
+ 131 }
else if (cfg.channels==2){
+ 132 const uint8_t *p = (
const uint8_t*) src;
+ 133 while(size_bytes >=
sizeof(int32_t)){
+ 134 bool justWritten = i2s.write(*(int32_t*)p,
true);
+
+ 136 size_bytes -=
sizeof(int32_t);
+ 137 p +=
sizeof(int32_t);
+ 138 result +=
sizeof(int32_t);
+ 139 }
else return result;
+
+
+
+
+
+ 145 size_t readBytes(
void *dest,
size_t size_bytes) {
+
+ 147 switch(cfg.channels){
+
+ 149 return read1Channel(dest, size_bytes);
+
+ 151 return read2Channels(dest, size_bytes);
+
+
+
+
+ 156 int availableForWrite() {
+ 157 if (cfg.channels == 1){
+ 158 return cfg.buffer_size;
+
+ 160 return i2s.availableForWrite();
+
+
+
+
+ 165 return min(i2s.available(), cfg.buffer_size);
+
+
+
+
+
+
+
+
+
+
+
+
+ 179 size_t writeExpandChannel(
const void *src,
size_t size_bytes) {
+ 180 switch(cfg.bits_per_sample){
+
+
+
+
+
+
+
+
+
+
+ 191 int16_t *pt16 = (int16_t*) src;
+ 192 for (
int j=0;j<size_bytes/
sizeof(int16_t);j++){
+ 193 i2s.write16(pt16[j], pt16[j]);
+
+
+
+ 197 int32_t *pt24 = (int32_t*) src;
+ 198 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
+ 199 i2s.write24(pt24[j], pt24[j]);
+
+
+
+ 203 int32_t *pt32 = (int32_t*) src;
+ 204 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
+ 205 i2s.write32(pt32[j], pt32[j]);
+
+
+
+
+
+
+ 213 size_t read2Channels(
void *dest,
size_t size_bytes) {
+
+
+ 216 switch(cfg.bits_per_sample){
+
+
+
+
+
+
+
+
+
+
+
+
+ 229 int16_t *data = (int16_t *)dest;
+ 230 for (
int j=0;j<size_bytes/
sizeof(int16_t);j+=2){
+ 231 if (i2s.read16(data+j, data+j+1)){
+
+
+
+
+
+
+
+
+ 240 int32_t *data = (int32_t *)dest;
+ 241 for (
int j=0;j<size_bytes/
sizeof(int32_t);j+=2){
+ 242 if (i2s.read24(data+j, data+j+1)){
+
+
+
+
+
+
+
+
+ 251 int32_t *data = (int32_t *)dest;
+ 252 for (
int j=0;j<size_bytes/
sizeof(int32_t);j+=2){
+ 253 if (i2s.read32(data+j, data+j+1)){
+
+
+
+
+
+
+
+
+
+
+
+ 266 size_t read1Channel(
void *dest,
size_t size_bytes) {
+
+
+ 269 switch(cfg.bits_per_sample){
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 285 int16_t *data = (int16_t*)dest;
+ 286 for (
int j=0;j<size_bytes/
sizeof(int16_t);j++){
+ 287 if (i2s.read16(tmp, tmp+1)){
+ 288 data[j] = mix(tmp[0], tmp[1]);
+
+
+
+
+
+
+
+
+
+ 298 int32_t *data = (int32_t*)dest;
+ 299 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
+ 300 if (i2s.read24(tmp, tmp+1)){
+ 301 data[j] = mix(tmp[0],tmp[1]);
+
+
+
+
+
+
+
+
+
+ 311 int32_t *data = (int32_t*)dest;
+ 312 for (
int j=0;j<size_bytes/
sizeof(int32_t);j++){
+ 313 if (i2s.read32(tmp, tmp+1)){
+ 314 data[j] = mix(tmp[0],tmp[1]);
+
+
+
+
+
+
+
+
+
+
+
+
+ 327 T mix (T left, T right) {
+ 328 if (left!=0) has_input[0]=
true;
+ 329 if (right!=0) has_input[1]=
true;
+
+
+ 332 if (has_input[0]&&!has_input[1]){
+
+
+
+
+ 337 if (!has_input[0]&&has_input[1]){
+
+
+
+ 341 return (left/2) + (right/2);
-
-
+
+
- 346 using I2SDriver = I2SDriverRP2040;
+
-
-
+ 348 using I2SDriver = I2SDriverRP2040;
+
-
+
+
+
RxTxMode
Audio Source (TX_MODE) or Audio Sink (RX_MODE). RXTX_MODE is Source and Sink at the same time!
Definition: AudioTypes.h:24