Description
Currently I2C peripherals require two DMA channels in order to be used asynchronously, one each for Tx and Rx. These channels are never used simultaneously as Tx and Rx are separate operations, so on devices with a DMAMUX (and possibly in some limited cases on other devices if one channel happens to be usable for Tx and Rx on the same I2C peripheral) it should be possible to use the same DMA channel for both Tx and Rx. This would be very useful as async IO eats up DMA channels very quickly, and even the more powerful devices don‘t always have very many available.
Matrix comments from dirbaio:
with the current way it might be tricky to support either "single channel" or "2 channels" with the same code
perhaps you can add a single-channel new() variant, and unsafely clone the one DMA channel there