Solar refactor#120
Merged
Merged
Conversation
When performing a one shot conversion we write to the config mode register to trigger a conversion, then we check the cvrf bit to see if the conversion is ready to read or not.
The read_avg_power_and_voltage function will now trigger a read and then wait for it to be finished before updating the state. This will make sure that all the readings are synchronized. In order to do this, the mode must be set to triggered conversions when calling ina226Start.
Previously I wasn't understanding the register naming conventions so I wasn't writing/reading to the correct locations. This should fix that. Also removed whitespaces at EOL.
Initializing the sample for readability mainly. Removed whitespace at EOL. Moved the sleep call before polling so as to not poll uneccesarily.
Switch From Continuous to Triggered Conversions Using CVRF
wjeffreys96
pushed a commit
that referenced
this pull request
Jul 18, 2025
I thought the `bugfix/cvrf_oneshot_read_avg_power` merge was going in to master, I missed that it ended up here instead. Into master we go!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I thought the
bugfix/cvrf_oneshot_read_avg_powermerge was going in to master, I missed that it ended up here instead. Into master we go!