-
Notifications
You must be signed in to change notification settings - Fork 7k
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
drivers: sensor: Add driver for TI INA23x #35753
Conversation
@carlescufi, @sambhurst I'm on vacation for about 2 weeks, but I'm happy to review this PR afterwards. |
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.
Please add to the tests/drivers/build_all/sensor
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.
lets remove the sample as it doesn't do anything interesting
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.
Thanks for this addition, please check comments
f05c700
to
b21fa83
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.
LGTM
@galak when you have time, could you take another look at this pull request? Thanks |
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.
As the sample was removed, the commit message should be adjusted.
9d111f8
to
c579784
Compare
@galak I've made the changes you've requested.
Are there any further changes you think I need to make? Thank you |
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.
This review is limited mainly to the DT portions.
I've made the changes you've requested. Are there any further changes you think I need to make? Thank you |
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.
Thanks. My comments are addressed.
Moving the BIT macros from <sys/util.h> to <sys/util_macro.h> allows the BIT macros to be used in device trees. Testing: twister -T tests/drivers/build_all/sensor/ Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This driver supports the TI INA230 and INA231 Bidirectional Current and Power Monitors. The devices work on the I2C interface and are created from DT nodes with a compatible property matching "ti,ina23x". The following datasheets were referenced while developing the driver: https://www.ti.com/product/INA230 https://www.ti.com/product/INA231 Twister passed: twister -T tests/drivers/build_all/sensor/ Testing was performed on the stm32g071b_disco board with the following: Load: ~170 ohms Voltage: 5V Measured Values: Voltage: 5.1 V Current: 0.032 A Power: 0.157 W Signed-off-by: Sam Hurst <sbh1187@gmail.com>
This driver supports the TI INA230 and INA231 Bidirectional Current
and Power Monitors. The devices work on the I2C interface and are
created from DT nodes with a compatible property matching "ti,ina23x".
The following datasheets were referenced while developing the driver:
https://www.ti.com/product/INA230
https://www.ti.com/product/INA231
Testing was performed on the stm32g071b_disco board:
twister --west-flash --device-testing --device-serial /dev/ttyACM0
-p stm32g071b_disco -T samples/sensor/ina23x
Signed-off-by: Sam Hurst sbh1187@gmail.com