teensy-i2s icon indicating copy to clipboard operation
teensy-i2s copied to clipboard

I2S digital audio library for Teensy3

I2S for Teensy3

The I2S protocol is designed for high-quality digital audio between devices.

Teensy3, programmed with Arduino, uses a Kinetis K20 processor (ARM Cortex M4) with hardware support for one I2S channel. This library can drive the I2S either directly or using DMA. DMA is much preferred, because the CPU isn't kept busy dealing with the I/O. It can transmit and receive simultaneously. It should be able to drive a multi-channel codec using "DSP"-mode (not yet implemented).

The example sketches use the WM8731 stereo codec with this library. Examples show configuration for two different boards using this codec: the MikroE proto board (48kHz, master) and for the Open Music Labs codec shield (44.1kHz, slave).

Current status:

  • Stereo Transmit and Receive implemented with and without DMA.
  • Current examples are tested with 16-bit audio and the Open Codec Labs shield.
  • Receive is synchronized to Transmit, so may not actually work if Transmit is not running. Change I2S_RCR2_SYNC(1) to I2S_RCR2_SYNC(0) to work around this. Later I'll make it switchable.
  • Patches and suggestions please!

For more status, see the forum.