Skip to content

Commit 3fcc932

Browse files
authored
Merge pull request #1407 from arduino/karlsoderby/esp32-i2s-update
[Nano ESP32] I2S docs
2 parents eb6426e + 38c8f2e commit 3fcc932

File tree

1 file changed

+41
-0
lines changed
  • content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet

1 file changed

+41
-0
lines changed

Diff for: content/hardware/03.nano/boards/nano-esp32/tutorials/cheat-sheet/cheat-sheet.md

+41
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,47 @@ And to write something, we can use the following command:
411411
Serial0.write("Hello world!");
412412
```
413413

414+
## I2S
415+
416+
The Inter-IC Sound (I2S or IIS) protocol is used for connecting digital audio devices with a variety of configurations (Philips mode, PDM, ADC/DAC).
417+
418+
The default pin configuration for I2S is:
419+
420+
| Pin | Definition |
421+
| --- | ---------------- |
422+
| D7 | `PIN_I2S_SCK` |
423+
| D8 | `PIN_I2S_FS` |
424+
| D9 | `PIN_I2S_SD` |
425+
| D9 | `PIN_I2S_SD_OUT` |
426+
| D10 | `PIN_I2S_SD_IN` |
427+
428+
The default pins can be changed by using the `setAllPins()` method:
429+
430+
```arduino
431+
I2S.setAllPins(sck, fs, sd, sd_out, sd_in)
432+
```
433+
434+
To inialitize the library, use the `begin()` method:
435+
436+
```arduino
437+
I2S.begin(mode, sampleRate, bitPerSample)
438+
```
439+
440+
To read data, use the `read()` method, which will return the last sample.
441+
442+
```arduino
443+
I2S.read()
444+
```
445+
446+
Examples for different modes & different audio devices are available in the core under **Examples > I2S**.
447+
448+
449+
Further reading:
450+
- [I2S API docs (Espressif)](https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/i2s.html)
451+
- [I2S Reference (Espressif)](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/i2s.html)
452+
453+
454+
414455
## IO Mux & GPIO Matrix
415456

416457
The ESP32-S3 SoC features an IO mux (input/output multiplexer) and a GPIO matrix. The IO mux acts as a data selector and allows for different peripherals to be connected to a physical pin.

0 commit comments

Comments
 (0)