Library to control and transfer data from NXP SGTL5000. As used on the Teensy Audio Shield. It uses DMA to transfer I2S FIFO data.

The Library now supports dual codecs. Allowing all 4 channels of the Teensy I2S interface to RX and TX data to separate SGTL5000 devices.

The ISR routines that handles pointer swaps for double buffering has been fully coded in assembler to reduce overhead and now takes < 800nS per FIFO transfer when using all 4 channels.

Support added for all typical sample rates and system Clock speeds of 96Mhz or 120Mhz.

Pause and Resume functions added to allow quick and simple suppression of IRQs and stream halting and restart. This required software triggered IRQ, in order to ensure accurate word sync control.

Revisions of sgtl5000.cpp

Revision Date Message Actions
10:49bb33f71d32 2017-09-26 Significant re-work.; The library now supports dual codecs. Using channel 0 and channel 1 of the I2S silicon of Teensy 3.2.; replaced c code with inline assembler reduces time of pointer swaps < 800nS. File  Diff  Annotate
9:40e0ff8c2ba2 2017-07-15 Changed the stop functions to suspend IRQs and DMA requests, also the codec's I2S interface is disabled. During start, the MCUs I2S state machine is now reset, before acquiring sync. File  Diff  Annotate
8:9fdf8501d14b 2017-07-07 Added init function to allow control over timing of I2C comms. File  Diff  Annotate
7:d65476c153a4 2017-07-05 Placed locks around I2C access. File  Diff  Annotate
6:4ab5aaeaa064 2017-07-01 Separated ISRs into Callback type and IRQ type to avoid unnecessary checks. ; Replaced ISR code with inline assembler to optimize memory calls. File  Diff  Annotate
5:664802e89661 2017-06-30 Packed data delivered as int16_t ! File  Diff  Annotate
4:91354c908416 2017-06-30 Added a new CODEC rate of 144Ks/s.; Added packing option to the start functions. Allowing data to be delivered as int15_t within the buffers. This allows data to be more easily manipulated using SIMD instructions within user code. File  Diff  Annotate
3:62c03088f256 2017-06-16 Documentation added and function types corrected to match accurate return types File  Diff  Annotate
2:a9d8242f76ea 2017-06-15 removed extra stack push from SYNC DMA ISR File  Diff  Annotate
1:d48e64f611fb 2017-06-15 192Khz commented File  Diff  Annotate
0:8f28f25e3435 2017-06-15 version 0.1 File  Diff  Annotate