Limiting the scope of my statements to the 1062 blocks of code.
I haven't read the KINETISL or KINETISK parts, but if anyone goes to investigate after reading this, be careful because those parts are interleaved in and it's really easy to screw up.
input_i2s.cpp.....uses config_i2s from output_i2s.cpp and ONLY enables the RECEIVER in both master and slave begins
output_i2s.cpp.....enables RECEIVER then TRANSMITTER for both master and slave instances
input_i2s2.cpp.....uses config_i2s from output_i2s2.cpp and enables the RECEIVER then TRANSMITTER for both master and slave instances
output_i2s2.cpp....enables TRANSMITTER only for both master and slave
In the i2s(1) group the transmitter is the one that has the sync bit set in both master and slave configs because the RECEIVER bck and L/R signals are the ones of primary interest and the opposing part (TRANSMITTER) has it's sync bit set to 1.
In the i2s(2) group the receiver is the one that has the sync bit set in both master and slave configs because the TRANSMITTER bck and L/R signals are the ones of primary interest and the opposing part (RECEIVER) has it's sync bit set to 1.
Since these are crisscrossed I'd expect to see the enables in the begin() go in reverse order but they do not.
The imxrt manual is very deliberate about the enable order, except that it has a logical contradiction the way I read it. It says something to the effect of enable the transmitter before you enable the transmitter. So one of these is right and one is not. Just don't know which.
It's actually referred to twice in the same section of the manual and both sections are jibberish.
There is also what I think is a mistake and also a typo at the same time. In the i2s(1) group...the slave config_i2s leaves the unused TX FSD port on....so no real consequences but it's done with a macro (right word?) from the opposite group that happens to be equal...I2S_RCR4_FSD = 0x1....in the tcr4 section.
I haven't read the KINETISL or KINETISK parts, but if anyone goes to investigate after reading this, be careful because those parts are interleaved in and it's really easy to screw up.
input_i2s.cpp.....uses config_i2s from output_i2s.cpp and ONLY enables the RECEIVER in both master and slave begins
output_i2s.cpp.....enables RECEIVER then TRANSMITTER for both master and slave instances
input_i2s2.cpp.....uses config_i2s from output_i2s2.cpp and enables the RECEIVER then TRANSMITTER for both master and slave instances
output_i2s2.cpp....enables TRANSMITTER only for both master and slave
In the i2s(1) group the transmitter is the one that has the sync bit set in both master and slave configs because the RECEIVER bck and L/R signals are the ones of primary interest and the opposing part (TRANSMITTER) has it's sync bit set to 1.
In the i2s(2) group the receiver is the one that has the sync bit set in both master and slave configs because the TRANSMITTER bck and L/R signals are the ones of primary interest and the opposing part (RECEIVER) has it's sync bit set to 1.
Since these are crisscrossed I'd expect to see the enables in the begin() go in reverse order but they do not.
The imxrt manual is very deliberate about the enable order, except that it has a logical contradiction the way I read it. It says something to the effect of enable the transmitter before you enable the transmitter. So one of these is right and one is not. Just don't know which.
It's actually referred to twice in the same section of the manual and both sections are jibberish.
There is also what I think is a mistake and also a typo at the same time. In the i2s(1) group...the slave config_i2s leaves the unused TX FSD port on....so no real consequences but it's done with a macro (right word?) from the opposite group that happens to be equal...I2S_RCR4_FSD = 0x1....in the tcr4 section.
Code:
// configure transmitter
I2S1_TMR = 0;
I2S1_TCR1 = I2S_TCR1_RFW(1); // watermark at half fifo size
I2S1_TCR2 = I2S_TCR2_SYNC(1) | I2S_TCR2_BCP;
I2S1_TCR3 = I2S_TCR3_TCE;
I2S1_TCR4 = I2S_TCR4_FRSZ(1) | I2S_TCR4_SYWD(31) | I2S_TCR4_MF
| I2S_TCR4_FSE | I2S_TCR4_FSP | I2S_RCR4_FSD;
I2S1_TCR5 = I2S_TCR5_WNW(31) | I2S_TCR5_W0W(31) | I2S_TCR5_FBT(31);
// configure receiver
I2S1_RMR = 0;
I2S1_RCR1 = I2S_RCR1_RFW(1);
I2S1_RCR2 = I2S_RCR2_SYNC(0) | I2S_TCR2_BCP;
I2S1_RCR3 = I2S_RCR3_RCE;
I2S1_RCR4 = I2S_RCR4_FRSZ(1) | I2S_RCR4_SYWD(31) | I2S_RCR4_MF
| I2S_RCR4_FSE | I2S_RCR4_FSP;
I2S1_RCR5 = I2S_RCR5_WNW(31) | I2S_RCR5_W0W(31) | I2S_RCR5_FBT(31);