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.

Changes

RevisionDateWhoCommit message
14:9043626add45 2017-09-27 aidan1971 doc updates default tip
13:83c2aaf4a338 2017-09-27 aidan1971 doc updates
12:9ce7f3828c6a 2017-09-27 aidan1971 docs updated, noteing sync timing considerations
11:392c09372ae1 2017-09-27 aidan1971 A few documentation updates
10:49bb33f71d32 2017-09-26 aidan1971 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.
9:40e0ff8c2ba2 2017-07-15 aidan1971 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.
8:9fdf8501d14b 2017-07-07 aidan1971 Added init function to allow control over timing of I2C comms.
7:d65476c153a4 2017-07-05 aidan1971 Placed locks around I2C access.
6:4ab5aaeaa064 2017-07-01 aidan1971 Separated ISRs into Callback type and IRQ type to avoid unnecessary checks. ; Replaced ISR code with inline assembler to optimize memory calls.
5:664802e89661 2017-06-30 aidan1971 Packed data delivered as int16_t !
4:91354c908416 2017-06-30 aidan1971 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.
3:62c03088f256 2017-06-16 aidan1971 Documentation added and function types corrected to match accurate return types
2:a9d8242f76ea 2017-06-15 aidan1971 removed extra stack push from SYNC DMA ISR
1:d48e64f611fb 2017-06-15 aidan1971 192Khz commented
0:8f28f25e3435 2017-06-15 aidan1971 version 0.1