Skip to content

[embassy-stm32] Allow one DMA channel to be used for both I2C Rx and Tx on devices with a DMAMUX #2383

Open
@barnabywalters

Description

@barnabywalters

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions