Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds basic DMA functionality for ESP32-C3
There is still a lot to improve here but I'd like to get this in to see if is a general fit and as a base for exploring how to implement DMA for the other supported chips - especially ESP32 and ESP32-S2 are very different in regards to DMA.
This includes DMA support for SPI. The DMA API is similar to the STM32F1XX implementation - it's unfortunately a bit hard to use but that it seems to be the only possible way to implement DMA in a safe and sound way. Maybe we find ways to improve the ease-of-use while keeping it memory safe.
Other than most HALs it also implements the SPI traits from EH with DMA. Most HALs don't do that since those are blocking and it doesn't make sense for them. For us however it enables single SPI transactions of up to 32k (in contrast for 64 bytes without DMA). Because those APIs are blocking, they should be safe and sound.
As said this PR doesn't aim for perfection - I'm sure we need to change a lot of things to make this work for the other chips - so I don't want to waste effort in polishing something that will get changed anyway (for now - at some point of time we will polish things here).
The PR is not exactly small but I think an implementation of DMA without at least one peripheral supporting it doesn't make any sense.