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

ina238: Support for ina238 power monitors #18260

Merged
merged 2 commits into from
Sep 22, 2021
Merged

ina238: Support for ina238 power monitors #18260

merged 2 commits into from
Sep 22, 2021

Conversation

ThomasDebrunner
Copy link
Member

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.

src/drivers/drv_sensor.h Outdated Show resolved Hide resolved
@ThomasDebrunner ThomasDebrunner changed the title ina23X: Support for ina23X power monitors ina238: Support for ina238 power monitors Sep 20, 2021
Copy link
Member

@davids5 davids5 left a 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.

@mrpollo
Copy link
Contributor

mrpollo commented Sep 21, 2021

@davids5 do we need to track which board variants of 5x/6x are carrying the ina238?

@davids5
Copy link
Member

davids5 commented Sep 21, 2021

@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.

@bkueng bkueng merged commit 43ece74 into master Sep 22, 2021
@bkueng bkueng deleted the ina23X branch September 22, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants