-
Notifications
You must be signed in to change notification settings - Fork 214
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
DMA Transfer consumes peripheral #282
Comments
Reading more into it, I understand I could instead hand the dma unsafe { &*ADC1::ptr() as *const _ as u32 } But wouldn't it be more elegant for that to happen inside the dma module and not in the application code? |
The idea is to implement the necessary abstraction and traits to the Adc HAL type, and pass it to the |
I just had a look: as of now (0.10.1) the Adc traits seem to be implemented for at least ADC1; nevertheless, the adc hal types are consumed themselves. This renders the calibration data inaccessible, as can be seen in the adc_dma example. A way to fix this special issue could be to expose a reference to the peripheral. This allows us to use for example adc.sample_to_millivolts() wherever the sampled values are consumed. |
396: adc improvements for dma r=burrbull a=gernoteger This PR should fix adc with dma issues as mentioned in #282: "DMA Transfer consumes peripheral". Changes: - DMA Transfer exposes a reference to the peripheral, currently only for PeripheralToMemory - the ADC provides a closure similar to sample_to_millivolts - a demonstration of its use in the adc_dma_rtic example. As of now this PR is not complete; I kindly ask to review the concept before I complete the implementation, documentation and squashing. Co-authored-by: gernot <[email protected]>
Right now there aren't really any examples of both DMA and peripherals using this HAL, so I might be doing something wrong.
I'm able to both build a DMA
Transfer
and initiate a peripheral such as the adc using this HAL, but not both at the same time.I haven't dug too much into the
DMA
implementation but I don't think it would need ownership of the peripheral.The text was updated successfully, but these errors were encountered: