-
Notifications
You must be signed in to change notification settings - Fork 212
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
adc improvements for dma #396
Conversation
It is interesting way. Squash, please. |
cc @gernoteger |
|
You've broken git |
Sorry. I'm confused; should I quit working on this PR, and continue with #406 instead? |
This PR is preferable but it should be 1 - 2 commits rebased on master branch with no |
I fixed the git issue. Still, I'd like to tackle the issue with the lost resolution by converting samples to milliseconds. Probably this con go to a different PR, what do you think? |
src/dma/mod.rs
Outdated
@@ -1059,6 +1059,11 @@ where | |||
} | |||
} | |||
|
|||
/// Access the owned peripheral for reading | |||
pub fn peripheral(&self) -> &PERIPHERAL { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DMA code for this HAL is not mine, so I need to clarify is such access safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gernoteger I still can't merge this as this method gives unsafe access any DMA payload.
Possible solution:
b275233
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing all the work. I incorporated your suggestion nearly 1:1, only fixed a small typo in a comment
I'm afraid I don't understand what lost resolution you mean. milliseconds? time? |
When converting a sample to millivolts, with a 3.3V (or less) VRef, we have
<=3300 possible steps, while a 12Bit ADC has 4096. Probably adding a
function "sample_to_microvolts" and/or direct access to the calibration
data would help here. It's related to this PR, but somewhat orthogonal.
|
3268f3c
to
cc67977
Compare
I documented the resolution issues mentioned earlier in #412. I think we should handle this in a different PR. |
providing access to calibrated voltage conversion to approved wrappers
bors r+ |
This PR should fix adc with dma issues as mentioned in #282: "DMA Transfer consumes peripheral".
Changes:
As of now this PR is not complete; I kindly ask to review the concept before I complete the implementation, documentation and squashing.