Skip to content
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

WIP: Voltage Monitor improvements on Nucleo #112

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

rnestler
Copy link
Contributor

@rnestler rnestler commented Oct 5, 2021

No description provided.

rnestler and others added 5 commits October 5, 2021 20:18
/// Read the VREFINT value
pub fn read_vref_raw(&mut self) -> Option<u16> {
VRef.enable(&mut self.adc);
let val = self.adc.read(&mut VRef).ok();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should wait around 3ms between the enable and the read. But not much longer to avoid power usage. Should we do the API asynchronously?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd split enabling and reading into separate methods.

Does VRef draw significant power as well? If yes, we should probably have a dedicated task that reads the data after 3ms and turns off VRef. If not, we can collect the measurement together with the other sensor data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants