De-duplicate peripheral DMA APIs #2035
Dominaezzz
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I see the benefits (and share the opinion it will somewhat degrade ease-of-use) One thing I wonder about: while currently code looks somewhat duplicated, different drivers do some "special-massaging" to get DMA to work reliably. I guess supporting that depends a bit on how much of the code we want/can to move to the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Similar to #1550 I also want to de-duplicate the peripheral APIs that initiate DMA transfers.
Something along the lines of converting this
to become this
The concept of "one shot" and "circular" transfers belongs to the DMA hardware/driver. All peripherals really care about is if it should use DMA or CPU.
This does mean that drivers will no longer own DMA channels, but the transfer object will.
Of course, for convenience wrappers that hold on to both the driver and the DMA channel can be made.
There are a couple reasons why I think this is beneficial:
dma
/dma_circular
stuff on all drivers.'static
bound requirement on DMA buffers? #1245 would be easier to make since only the channel APIs would be affected.read_double_buffered
would be much easier.A downside to this is some simplicity and ease of use is lost (which is often the price of flexibility), as some more steps are required to perform a DMA transfer. This can mostly be solved with some wrappers where it makes sense.
Beta Was this translation helpful? Give feedback.
All reactions