-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: sensor: bosch: add support for bmp180 #73218
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
Conversation
|
Hello @jovicjakov, and thank you very much for your first pull request to the Zephyr project! |
kartben
left a comment
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.
some early comments. thanks for this new driver!
bc89237 to
c7ec360
Compare
becc776 to
ebcc7ac
Compare
my earlier comments have been addressed - thanks!
|
@MaureenHelm it does appear everything's addressed. There's a conflict resolution required but seems trivial to fix. |
@ubieda feel free to directly push to the branch to save some time :) |
ubieda
left a comment
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.
Re-approving after rebasing
|
Bulk changing the milestone from everything which did not make it to the v3.7.0 freeze deadline Please note that until rc2 only PRs containing bug fixes, docs and tests can be merged. Exceptions require approval by the release team and a vote by the TSC. |
|
@jovicjakov rebase needed |
The Bosch BMP180 is a sensor that measures pressure and temperature. Signed-off-by: Jakov Jović <[email protected]>
Add bindings for the Bosch BMP180 pressure and temperature sensor. Signed-off-by: Jakov Jović <[email protected]>
Add the new BMP180 drivers to the test suite. Signed-off-by: Jakov Jović <[email protected]>
|
rebased to resolve conflict |
|
@MaureenHelm please re-review |
|
This driver can also be used on BMP085. Maybe it can be documented somewhere since #67612 was blocked |
| val->val2 = data->temp % 10 * 100000; | ||
| break; | ||
| case SENSOR_CHAN_PRESS: | ||
| /* Pressure is calculated in steps of 1 Pa */ |
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.
CHAN PRESSURE for the Senor API should be in kPa not Pa.
| int32_t b6 = b5 - 4000; | ||
|
|
||
| x1 = (data->b2 * ((b6 * b6) >> 12)) >> 11; | ||
| x2 = (data->ac2 * b6) >> 11; |
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.
you might want to simplify from the original data-sheet example to
x1 = ((b2 * (b6 * b6)>>12))>>11;
x1 = ((b2 * b6 * b6) / pow(2,12) )/ pow(2,11)
x1 = (b2 * b6 *b6) / (pow(2,12) * pow(2,11))
final:
x1 = (b2 * b6 * b6) / 0x800000;
| } else { | ||
| p = (b7 / b4) * 2; | ||
| } | ||
|
|
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.
I wondered the if (b7< xx) statement here from the datasheet example
math wise it is exactly same only a data overflow can happen if b7 is too big
so b7/b4 *2 would always be safe and no need for a if()
|
Hi @jovicjakov , it is a pity that I missed you PR request and did my own implementation. |
This PR aims to add driver support for the Bosch BMP180 digital pressure and temperature sensor.