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
Add configuration register #3
Open
tdittr
wants to merge
30
commits into
scttnlsn:master
Choose a base branch
from
tdittr:add-configuration-register
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
This removes byteorder as it is no longer needed (now provided by std). Also no longer needed is extern crate. This makes it easier to add the changes for the configuration register.
This allows users to change the way the INA219 operates.
This makes the coding style consistent.
This looks great - thanks @tdittr. Please feel free to add more types, comments, etc. like you mentioned to this PR. |
Not sure yet about the calibration calculations...
Also add reading of registers to driver
This avoids looking up the pin mappings in the datasheet every time.
Added documentation, TryFrom and nicer error
This should allow zero-cost usage of the uncalibrated device.
This makes it so that only the errors that happen in a function can also be returned and handled.
This makes the docs a bit more structured.
This should give us more confidence about future changes to not break anything.
This should make it easy to later update to the full eh1
This introduces a feature to make all the paranoid checks optional at compile time. So users who do not care can just not have the overhead.
This allows users to retry initialization, because we are now not just dropping the I2C device we were passed.
Uhm, this took a bit longer then expected 😁 but I finally finished this driver. I tested the examples with a Raspberry Pi and a real INA219, so I am pretty confident that it should work :) Happy about any feedback! |
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.
Hi,
I needed the ability to configure my INA219 so I figured I might as well add it to this crate. I was also planning to add more types for the Address-Pins, more explicit units for the different measurements and some more doc comments. Should I add that to this PR?
Thanks for starting this crate and I would be happy if you can take a look at my code. I still need to test the changes with my INA219 and will then un-draft this PR.