Uses NXP SCTimer and NXP LPC-SPI to provide a curtain of I2S interface emulation (software based I2S)
Add driver and example files for i2s bus emulation with timer and spi
There are 3 kinds of interfaces for popular MEMS microphones: analog interface, I2S slave interface and digital PDM interface. For some Arm cortex-M MCU like QN9080, QN9020 and other ARM Cortex MCU, neither I2S master interface nor PDM interface is present.
This patches serial uses NXP SCTimer and NXP LPC-SPI to provide a curtain of I2S interface emulation (software based I2S). The main feature includes:
- Supports I2S sensor recording, will enhance to I2S sensor playback
- I2S Pins configurable
- Supports all PCM format, 16 bits and 32 bits can be switched
- supports I2S SAMPLING_MODE_FALLING, verified SPH0645LM4H sensor
- supports I2S SAMPLING_MODE_RISING, verified ICS_43432 sensor
- I2S FIFO depth (entry size) configurable
- I2S supports low power consumption - Clock can be closed
- Supports IMA-Microsoft ADPCM codec/decoder
- Supports I2S Interrupt mode to offload MCU 10.Supports I2S DMA mode with double buffer 11.Supports Sampling rate: 8kHz, 16kHz, 32kHz, 64kHz
- support I2S playback sensor
- support double channels and more
- support BIG_ENDIAN and LITTLE_ENDIAN at all FIFO width
- support DMA while playback to further offload MCU
- support emulation by either 2 separate CTimers or a single SCTimer
limitation:
- Only Mono for current version
- DMA mode does not support low power mode.
Signed-off-by: Jianhua Xie [email protected]