Hello @mick
Here are a few tips to implement bidirectional audio data exchange between two audio codecs with an STM32H745:
- Configure I2S or SPI peripherals for communication with each codec.
- Use circular buffers (ring buffers) to store received and transmit data. One buffer for each direction.
- In I2S/SPI RX interrupts, store received data into the corresponding RX buffer.
- In I2S/SPI TX interrupts, send data from the corresponding TX buffer.
- In the main loop:
- Read data from codec 1 RX buffer, process it, and write to codec 2 TX buffer.
- Read data from codec 2 RX buffer, process it, and write to codec 1 TX buffer.
- For processing, you can do simple re-transmission, mixing, filtering etc. depending on your needs.
- Handle synchronization properly between tasks to avoid data corruption.
This approach allows implementing a straightforward full duplex bidirectional exchange between the codecs. Let me know if you have any other questions!
Also you can check this post it's not updated but it can help you start.
Hope this helps you. If you're question is answered please mark this answer as best answer to be diffused.
Best Regards.
II