382ad96334de9082fe7c01bb5e587664b06b6322
Board-dat/NBL/NBL1005-dat/NBL1005-dat.md
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | ### Board Map, Dimension, Pins, chip info, Use Guide, Setup Jumper, etc. |
| 10 | 10 | |
| 11 | -- products - [[NBL1005-dat]] - [[CSR8510-dat]] - [[CSR-dat]] - [[BT-SDK-dat]] |
|
| 11 | +- products - [[NBL1005-dat]] - [[CSR8510-dat]] - [[CSR-dat]] - [[BT-SDK-dat]] - [[qualcomm-dat]] |
|
| 12 | 12 | |
| 13 | 13 | [Need driver for audio streaming.](http://www.vck.com.cn/?page_id=8) |
| 14 | 14 |
Board-new-dat/robotpet-dat/robotpet-dat.md
| ... | ... | @@ -42,3 +42,23 @@ camera_pins.h |
| 42 | 42 | #define HREF_GPIO_NUM 7 |
| 43 | 43 | #define PCLK_GPIO_NUM 13 |
| 44 | 44 | |
| 45 | + |
|
| 46 | +## code |
|
| 47 | + |
|
| 48 | +- speaker - [[MAX98357-dat]] - [[speaker-I2S-dat]] |
|
| 49 | + |
|
| 50 | + // MAX98357 |
|
| 51 | + #define MAX_DIN 36 |
|
| 52 | + #define MAX_LRC 47 |
|
| 53 | + #define MAX_BCLK 35 |
|
| 54 | + |
|
| 55 | + |
|
| 56 | + |
|
| 57 | +## demo |
|
| 58 | + |
|
| 59 | +- speaker - [[MAX98357-dat]] - [[speaker-I2S-dat]] == https://t.me/electrodragon3/444 |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + |
|
| 63 | +## ref |
|
| 64 | + |
Chip-dat/Analog-device-dat/MAX98357-dat/MAX98357-1-sd.ino
| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | + |
|
| 2 | + |
|
| 3 | +// Include required libraries |
|
| 4 | +#include "Arduino.h" |
|
| 5 | +#include "Audio.h" |
|
| 6 | +#include "SD.h" |
|
| 7 | +#include "FS.h" |
|
| 8 | + |
|
| 9 | +// microSD Card Reader connections |
|
| 10 | +#define SD_CS 5 |
|
| 11 | +#define SPI_MOSI 23 |
|
| 12 | +#define SPI_MISO 19 |
|
| 13 | +#define SPI_SCK 18 |
|
| 14 | + |
|
| 15 | +// I2S Connections |
|
| 16 | +#define I2S_DOUT 22 |
|
| 17 | +#define I2S_BCLK 26 |
|
| 18 | +#define I2S_LRC 25 |
|
| 19 | + |
|
| 20 | + // Create Audio object |
|
| 21 | +Audio audio; |
|
| 22 | + |
|
| 23 | +void setup() { |
|
| 24 | + |
|
| 25 | + // Set microSD Card CS as OUTPUT and set HIGH |
|
| 26 | + pinMode(SD_CS, OUTPUT); |
|
| 27 | + digitalWrite(SD_CS, HIGH); |
|
| 28 | + |
|
| 29 | + // Initialize SPI bus for microSD Card |
|
| 30 | + SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI); |
|
| 31 | + |
|
| 32 | + // Start Serial Port |
|
| 33 | + Serial.begin(115200); |
|
| 34 | + |
|
| 35 | + // Start microSD Card |
|
| 36 | + if(!SD.begin(SD_CS)) |
|
| 37 | + { |
|
| 38 | + Serial.println("Error accessing microSD card!"); |
|
| 39 | + while(true); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + // Setup I2S |
|
| 43 | + audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); |
|
| 44 | + |
|
| 45 | + // Set Volume |
|
| 46 | + audio.setVolume(5); |
|
| 47 | + |
|
| 48 | + // Open music file |
|
| 49 | + audio.connecttoFS(SD,"/MYMUSIC.mp3"); |
|
| 50 | + |
|
| 51 | +} |
|
| 52 | + |
|
| 53 | +void loop() |
|
| 54 | +{ |
|
| 55 | + audio.loop(); |
|
| 56 | +} |
|
| ... | ... | \ No newline at end of file |
Chip-dat/Analog-device-dat/MAX98357-dat/MAX98357-code.ino
| ... | ... | @@ -1,56 +0,0 @@ |
| 1 | - |
|
| 2 | - |
|
| 3 | -// Include required libraries |
|
| 4 | -#include "Arduino.h" |
|
| 5 | -#include "Audio.h" |
|
| 6 | -#include "SD.h" |
|
| 7 | -#include "FS.h" |
|
| 8 | - |
|
| 9 | -// microSD Card Reader connections |
|
| 10 | -#define SD_CS 5 |
|
| 11 | -#define SPI_MOSI 23 |
|
| 12 | -#define SPI_MISO 19 |
|
| 13 | -#define SPI_SCK 18 |
|
| 14 | - |
|
| 15 | -// I2S Connections |
|
| 16 | -#define I2S_DOUT 22 |
|
| 17 | -#define I2S_BCLK 26 |
|
| 18 | -#define I2S_LRC 25 |
|
| 19 | - |
|
| 20 | - // Create Audio object |
|
| 21 | -Audio audio; |
|
| 22 | - |
|
| 23 | -void setup() { |
|
| 24 | - |
|
| 25 | - // Set microSD Card CS as OUTPUT and set HIGH |
|
| 26 | - pinMode(SD_CS, OUTPUT); |
|
| 27 | - digitalWrite(SD_CS, HIGH); |
|
| 28 | - |
|
| 29 | - // Initialize SPI bus for microSD Card |
|
| 30 | - SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI); |
|
| 31 | - |
|
| 32 | - // Start Serial Port |
|
| 33 | - Serial.begin(115200); |
|
| 34 | - |
|
| 35 | - // Start microSD Card |
|
| 36 | - if(!SD.begin(SD_CS)) |
|
| 37 | - { |
|
| 38 | - Serial.println("Error accessing microSD card!"); |
|
| 39 | - while(true); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - // Setup I2S |
|
| 43 | - audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); |
|
| 44 | - |
|
| 45 | - // Set Volume |
|
| 46 | - audio.setVolume(5); |
|
| 47 | - |
|
| 48 | - // Open music file |
|
| 49 | - audio.connecttoFS(SD,"/MYMUSIC.mp3"); |
|
| 50 | - |
|
| 51 | -} |
|
| 52 | - |
|
| 53 | -void loop() |
|
| 54 | -{ |
|
| 55 | - audio.loop(); |
|
| 56 | -} |
|
| ... | ... | \ No newline at end of file |
Chip-dat/Analog-device-dat/MAX98357-dat/MAX98357-dat.md
| ... | ... | @@ -7,6 +7,9 @@ |
| 7 | 7 | |
| 8 | 8 | - [[MAX98357]] - [[analog-device]] |
| 9 | 9 | |
| 10 | + |
|
| 11 | + |
|
| 12 | + |
|
| 10 | 13 | ## Features |
| 11 | 14 | |
| 12 | 15 | - 01 Output power: 3.2W at 4Ω, THD 10% 1.8W at 8Q, THD 10% |
| ... | ... | @@ -95,7 +98,7 @@ Use the specified resistors or configurations: |
| 95 | 98 | |
| 96 | 99 | ## code |
| 97 | 100 | |
| 98 | -- [[MAX98357-code.ino]] - [[I2S-dat]] |
|
| 101 | +- [[MAX98357-1-sd.ino]] - [[I2S-dat]] |
|
| 99 | 102 | |
| 100 | 103 | ### code common error: |
| 101 | 104 | |
| ... | ... | @@ -103,6 +106,29 @@ i2s_write_bytes((i2s_port_t)0, (const char *)data, numData, portMAX_DELAY); |
| 103 | 106 | - 'i2s_write_bytes' was not declared in this scope |
| 104 | 107 | |
| 105 | 108 | |
| 109 | +FS_PIN |
|
| 110 | +SCK_PIN |
|
| 111 | +TX_PIN |
|
| 112 | +RX_PIN |
|
| 113 | + |
|
| 114 | + |
|
| 115 | + /*! |
|
| 116 | + @brief Class Constructor |
|
| 117 | + @param FS_PIN frame sync pin |
|
| 118 | + @param SCK_PIN bit clock pin |
|
| 119 | + @param TX_PIN data output pin |
|
| 120 | + @param RX_PIN data input pin |
|
| 121 | + */ |
|
| 122 | + |
|
| 123 | + |
|
| 124 | + |
|
| 125 | +## demo video |
|
| 126 | + |
|
| 127 | +- module == https://t.me/electrodragon3/443 |
|
| 128 | + |
|
| 129 | +- [[robotpet-dat]] |
|
| 130 | + |
|
| 131 | + |
|
| 106 | 132 | |
| 107 | 133 | ## ref |
| 108 | 134 |
Tech-dat/Interface-dat/I2S-dat/I2S-dat.md
| ... | ... | @@ -35,11 +35,11 @@ This makes I2S a popular choice for high-speed data transfer applications. |
| 35 | 35 | |
| 36 | 36 | To get this working, you simply need to map your microphone's pins to the ESP32’s I2S peripheral. Here is how they correspond: |
| 37 | 37 | |
| 38 | -| Microphone Label | I2S Standard Name | ESP32 Function | Role | |
|
| 39 | -| :---------------- | :------------------- | :------------- | :------------------------------------------------ | |
|
| 40 | -| **CLK** (or BCLK) | **SCK** (Bit Clock) | Output | The heartbeat that times every individual bit. | |
|
| 41 | -| **L/R** (or WS) | **WS** (Word Select) | Output | Toggles to define the start of Left/Right frames. | |
|
| 42 | -| **DATA** (or SD) | **SDIN** (Data In) | Input | The digital audio stream entering the ESP32. | |
|
| 38 | +| Microphone Label | I2S Standard Name | variants | ESP32 Function | Role | |
|
| 39 | +|:------------------|:---------------------|---|:---------------|:--------------------------------------------------| |
|
| 40 | +| **CLK** (or BCLK) | **SCK** (Bit Clock) | CLK | Output | The heartbeat that times every individual bit. | |
|
| 41 | +| **L/R** (or WS) | **WS** (Word Select) | FS | Output | Toggles to define the start of Left/Right frames. | |
|
| 42 | +| **DATA** (or SD) | **SDIN** (Data In) | TX | Input | The digital audio stream entering the ESP32. | |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | ### 2. Why "MCLK" is Missing |
| ... | ... | @@ -124,6 +124,9 @@ To save pins, you can sometimes share the **Clock** pin, but it is technically d |
| 124 | 124 | |
| 125 | 125 | ## code |
| 126 | 126 | |
| 127 | +- Adafruit_Zero_I2S_Library == SAMD MCUs only |
|
| 128 | + |
|
| 129 | + |
|
| 127 | 130 | https://github.com/sheaivey/ESP32-AudioInI2S |
| 128 | 131 | |
| 129 | 132 | https://github.com/atomic14/esp32_audio == [[platformIO-dat]] |