I will try this evening to add a first CS bit to 1 to set the "Pro" interface and then zeros. it is the minimum implementation from the spec.
On the Stm32 SAI module, the data are fed through a 32bit register:
- 0..23 = data,
- 24 = Validity bit,
- 25 = User bit,
- 26 = CS bit.
There is no "function" to set the CS bits chain and then merge it to the data, so it has to be done manually at application level, which is not very convenient.
By doing: Audio_output_bufferA[AUDIO_OUTPUT_BUF_SIZE*buffer+2*i]= (((int32_t)Audio_buffer_2) <<8 );
I expect to fill my 32bit samples buffer with my 16 bits data, shifted to get the 24 bits SPDIF data.
I'm not a C guru, but I shouldn't set any CS, V, U bits in that process...
JMF