-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
ina238: Support for ina238 power monitors #18260
Conversation
2f454e0
to
3d2fc3b
Compare
3d2fc3b
to
2e6f6c9
Compare
09031e4
to
4c43f32
Compare
4c43f32
to
47b64f7
Compare
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.
@ThomasDebrunner - This looks good to go.
@davids5 do we need to track which board variants of 5x/6x are carrying the ina238? |
@mrpollo because it can be independent of the board., it is more of a question of "What I have plugged in?" Then the user has to set the params for their configuration. |
Implements a driver for the INA237, INA238 and INA239 power modules
Describe problem solved by this pull request
For newer 12S power modules, different chip choices are available. PX4 already contains a driver for the INA228 chip. The INA23X chips differ in that they have less resolution and are cheaper.
Describe your solution
INA23X are very similar to INA228, so this driver is based on the INA228 driver. Constants and the math are different, and the results registers are a different bit-width, so different readout. I implemented this as a standalone driver rather than making the existing INA228 driver too complicated. This way, people can just integrate the driver for the hardware they have.
Describe possible alternatives
Make the INA228 into a general purpose TI-power module driver, with either params to choose the right registers and math or even autodetect.
Test data / coverage
Tested on Skynode
Additional context
Like the INA228 driver, this needs param
SENS_EN_INA23X
do be set to 1 to be launched.