← index #8527PR #8322
Off-topic · high · value 0.454
QUERY · ISSUE

ESP32: Support I2S-driven ADC sampling

openby oclykeopened 2022-04-13updated 2024-07-24
port-esp32

The ESP32 I2S peripheral supports an interesting feature: it can be used to push ADC samples into DMA memory. Currently the ESP32 I2S interface does not allow configuration of the peripheral in this way, though it would only require a little effort.

There is not much configuration available. Besides sample rate and number of bits (already included in the I2S module)

  • which ADC peripheral to use
  • which ADC channel to use

Proposal:

  • create a class similar to the I2S class called I2SADC for the ESP32 port
  • leverage most of the existing code (machine_i2s_init_helper) for initialization of this new class

Any thoughts? I really would like to see support for this and so will begin work on a PR asap.

CANDIDATE · PULL REQUEST

mixmrt/i2s: Add I2S protocol support.

closedby miketeachmanopened 2022-02-17updated 2022-03-30
port-mimxrt
  • I2S API consistent with STM32, ESP32, and RP2 ports
  • I2S features:
    • controller transmit and controller receive
    • 16-bit and 32-bit sample sizes
    • mono and stereo formats
    • sampling frequencies from 8kHz to 48kHz
    • 3 modes of operation:
      • blocking
      • non-blocking with callback
      • uasyncio
    • configurable internal buffer
    • optional MCK
  • tested with the following development boards:
    • MIMXRT1010_EVK, MIMXRT1015_EVK, MIMXRT1020_EVK, MIMXRT1050_EVK
    • Teensy 4.0, Teensy 4.1
    • Olimex RT1010
    • Seeed ARCH MIX
  • tested with the following I2S hardware peripherals:
    • UDA1334
    • GY-SPH0645LM4H
    • WM8960 codec on board the MIMXRT boards and separate breakout board
    • INMP441
    • PCM5102
    • SGTL5000 on the Teensy audio shield
  • mimxrt build metric changes versus master branch: text(+7464), data(+28), bss(+128)
  • mimxrt quickref doc updates are missing and are dependent on https://github.com/micropython/micropython/pull/7494 being accepted.
  • this PR is a collaborative effort between myself, @robert-hh, @alphaFred, and @rdagger

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied