Dear All,

I am a student working on a project to interface multi channel audio board to Teensy 3.6.

This multi-channel audio board (ctag face 2/4) based on ad1938 codec and you can find more details about the board in
https://github.com/ctag-fh-kiel/ctag-face-2-4

I have connected ad1938 board and Teensy 3.6 board as follows

AD1938 pins -Teensy 3.6 gpio pins
Chip select - 7
MOSI - 11
MISO -12
SCK -14
RESET -17
ADCBLK -9
ADCLRCLK -23
DSDATA1 TX -22
ASDARA1 RX -13

I am able to verify the 8 channel i2s in TDM mode with Teensy 3.6 board using"AudioInputTDM" and "AudioOutTDM".
(4 channels input and 8 channels output).

I have written a "AudioControlAD1938" class by seeing other codec examples in the teensy audio library.

I have committed the files in the github fork of Paul's audio library
https://github.com/yasmeensultana/lib-teensy-audio-fork

please have a look at control_ad1938.cpp and control_ad1938.h files.

By default, AD1938 codec is configured as i2s slave 8 channel TDM mode each audio sample 24 bit.

I will add more functions to support different sampling rates and channels.

I would like to contribute and improve control_ad1938 class so that other teensy members can use.

Could you please help me how to create a pull request for these two files.

please excuse me if there are any mistakes in my coding as I am still student and learning.

Thanking you in advance

Yasmeen

The sketch used for testing
---------------------------------
#include"control_ad1938.h"

/*
AD1938 pins Teensy gpio pins
Chip select - 7
MOSI - 11
MISO -12
SCK -14
RESET -17

DAC/ADCBLK -9
DAC/ADCLRCLK -23

DSDATA1 TX -22
ASDARA1 RX -13
*/
AudioControlAD1938 ad1938codec;

AudioInputTDM i2s_in;
AudioOutputTDM i2s_out;

/*ADC0 to DAC0*/
AudioConnection pc1(i2s_in, 0, i2s_out, 0);
AudioConnection pc2(i2s_in, 1, i2s_out, 1);
AudioConnection pc3(i2s_in, 2, i2s_out, 2);
AudioConnection pc4(i2s_in, 3, i2s_out, 3);

/*ADC1 to DAC1*/
AudioConnection pc5(i2s_in, 4, i2s_out, 4);
AudioConnection pc6(i2s_in, 5, i2s_out, 5);
AudioConnection pc7(i2s_in, 6, i2s_out, 6);
AudioConnection pc8(i2s_in, 7, i2s_out, 7);
/*ADC0 to DAC2*/
AudioConnection pc9(i2s_in, 0, i2s_out, 8);
AudioConnection pc10(i2s_in, 1, i2s_out, 9);
AudioConnection pc11(i2s_in, 2, i2s_out, 10);
AudioConnection pc12(i2s_in, 3 , i2s_out, 11);
/*ADC1 to DAC3*/
AudioConnection pc13(i2s_in, 4, i2s_out, 12);
AudioConnection pc14(i2s_in, 5, i2s_out, 13);
AudioConnection pc15(i2s_in, 6, i2s_out, 14);
AudioConnection pc16(i2s_in, 7, i2s_out, 15);

void setup() {
// put your setup code here, to run once:

Serial.begin(115200);
AudioMemory(64);
AudioInterrupts();

ad1938codec.init();
ad1938codec.configI2SSlave();
ad1938codec.volume(1);
ad1938codec.enable();
}