-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsure how to enable DMA interrupts #852
Comments
I see two issues with your code:
|
@jannic thank you so much for taking a look at this! So, if the interrupt is triggered the transfer is done? The busy loop was an attempt at being sure of that. In general, it's confusing what's necessary to re-enqueue the buffers once the transfer is complete, the doc comments of Do both channels need interrupts enabled? With the way the configuration works, my assumption was that the transfer would be the thing to enable an interrupt for, not the channels. Should I maybe be using the lower-level DMA API here? It feels like this higher-level API is maybe not what I want |
Sorry, I don't have a complete example available, and don't know the DMA interrupts well enough to quickly write one.
And yes, both channels need interrupts enabled, because they will be used alternately by the double buffering transfer. |
I'm working on a library (my first serious embedded project) which needs to write to a PIO FIFO continuously. I'm trying to do this with DMA, using an interrupt to re-enqueue the buffers whenever a write finishes, but I'm unsure how to enable an interrupt for a double-buffered DMA transfer in the way I would with, say, a, ADC or PWM. The documentation is a bit confusing and from what I understand some features it mentions are maybe not actually implemented?
I'm initializing DMA like this:
With the buffers (BITSTREAM and TX_BUF) being
[u32; N]
and 'tx' being the PIO FIFO.Do you think this should work as is? Is there something I'm missing? Here's the repo for context: https://github.com/FayCarsons/cosmic-unicorn-rs, the file in question is
src/cosmic_unicorn.rs
Any help at all would be deeply appreciated!!!!!
The text was updated successfully, but these errors were encountered: