well ... your last message is a bit confusing for me (I exclusively work on the Teensy 4.1), so I believe that I have missed some points !
Therefore I have 2 more questions:
Q1:
You write:
Why do you say that I2S2 has only 2 pins, whereas you list:
I2S2 pins
MCLK2: 33
BCLK2: 4
LRCLK2: 3
OUT2: 2
IN2: 5
Q2:
You write:
This is important for my project, because the input is always SPDIF, and the output will be SPDIF in most cases, but I2S in a few cases, and SPI in a few others.
If I understand what you mean, I should use the pin 14 for the SPDIF input (named SPDIF IN) and pin 15 for SPDIF OUT: this is exactly what I plan to do when the Input and the Output are both SPDIFs.
But when my Output is I2S, is there any restriction to use I2S1 or I2S2 as Output ? I believe there is none, but...
More interesting for me: do you have a link that can provide information on how to use the I2S ports to act as SPDIF ?
Thank you
Paul, FrankB, or somebody more familiar probably should explain it better, but what I meant by ports is the non-specific pins that can be configured for either input or output. I didn't include MCLK, LRCLK, and BCLK since those are required for I2S. In theory, with I2S1, since there are 5 pins that that can be configured, you could have 5 outputs and no inputs, or 4 inputs and 1 output, etc. By default, 1 pin is configured for input, and 1 for output, and the other 3 pins are not used. The 2nd I2S port only has 2 pins (i.e. 1 output, 1 input, 2 outputs, or 2 inputs).
Ultimately, you are going to have to dive into the iMX RT1060 reference manual (
https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf), pages around 2065 through 2151, if you are going to do more than the library provides. I've only used the library for I2S1 and I2S2 with the standard input/output pins.
If you go into the audio design tool (
https://www.pjrc.com/teensy/gui/), and add the various I2S and S/PDIF inputs and outputs to the project, when you click on them, on the right side is the documentation for the parameters and such. The input/output
spdif1 is S/PDIF over I2S1, output
spdif2 is S/PDIF over I2S2, input/output
spdif3 uses the hardware pins, and input
spdif_async resamples the S/PDIF3 input to make it fit into the standard I2S data rates. All I know about this is what the gui tool documents.