Description
Is your feature request related to a problem?
Certain uses cases require a complex test signal to be sent to a DAC and read a 'distorted' analog signal back using an ADC.
Depending on the analysis to be performed (eg. delay), it is required to have the internal (digital) delay between the output and input signal under control.
Describe the solution you'd like.
A function in the I2S driver that is able to start (enable) the rx and tx channels synchronously. Therefor if the dout would be externally connected to din instead of the DAC and ADC, the received data would be identical to the data sent. (first sample in the tx-data will be the first sample in the rx-data).
Even better would be a function that allows to specify the exact offset between sent and received data. This would allow to compensate the delays of the DAC and ADC as well.
Describe alternatives you've considered.
No response
Additional context.
If the peripheral module does not directly support this, it might be possible to loop-back the dout data to din using an unused pin (to prevent the real dout pin to output unwanted signals) and generate a synchronization signal in the driver to get the matching samples in output and input. Before the synchronization signal ends, the driver would then need to switch the dout and din to the correct pins without disabling/re-enabling the channels.