esp32,stm32: Add new machine.I2S class for I2S protocol support.

This commit adds I2S protocol support for the esp32 and stm32 ports, via
a new machine.I2S class.  It builds on the stm32 work of blmorris, #1361.

Features include:
- a consistent I2S API across the esp32 and stm32 ports
- I2S configurations supported:
  - master transmit and master receive
  - 16-bit and 32-bit sample sizes
  - mono and stereo formats
  - sampling frequency
  - 3 modes of operation:
    - blocking
    - non-blocking with callback
    - uasyncio
  - internal ring buffer size can be tuned
- documentation for Pyboards and esp32-based boards
- tested on the following development boards:
  - Pyboard D SF2W
  - Pyboard V1.1
  - ESP32 with SPIRAM
  - ESP32

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
This commit is contained in:
Mike Teachman
2021-04-16 21:27:40 -07:00
committed by Damien George
parent 031fe0f144
commit 8a5bfe44a5
21 changed files with 2218 additions and 1 deletions

View File

@@ -527,6 +527,10 @@ soft_reset:
pyb_usb_init0();
#endif
#if MICROPY_HW_ENABLE_I2S
machine_i2s_init0();
#endif
// Initialise the local flash filesystem.
// Create it if needed, mount in on /flash, and set it as current dir.
bool mounted_flash = false;