-
Notifications
You must be signed in to change notification settings - Fork 8.2k
sensors: test: Add attribute support to sensor emulator backend #65278
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
Merged
carlescufi
merged 7 commits into
zephyrproject-rtos:main
from
yperess:peress/sensor_tests
Jan 16, 2024
Merged
sensors: test: Add attribute support to sensor emulator backend #65278
carlescufi
merged 7 commits into
zephyrproject-rtos:main
from
yperess:peress/sensor_tests
Jan 16, 2024
Conversation
This file contains hidden or 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
9510cf2 to
fe57778
Compare
MaureenHelm
requested changes
Nov 17, 2023
fe57778 to
93bbbdb
Compare
93bbbdb to
67ef4d3
Compare
alevkoy
reviewed
Nov 21, 2023
ae49646 to
00b9683
Compare
Contributor
Author
|
Removed C++ |
teburd
previously approved these changes
Dec 12, 2023
alevkoy
previously approved these changes
Dec 12, 2023
Contributor
Author
|
@henrikbrixandersen @MaureenHelm any chance to get another review pass before the end of the year? This is a blocker for us to use upstream drivers |
tristan-google
previously approved these changes
Dec 22, 2023
MaureenHelm
reviewed
Jan 11, 2024
00b9683 to
be22b89
Compare
Contributor
Author
|
The push above is just a rebase so that the |
28f9c45
be22b89 to
28f9c45
Compare
Update the backend for sensor emulators to include a function for setting the offset as well as a function to query an attribute's metadata such as bounds and increment size. Additionally, add backend support for setting the _xyz channel values. Make the appropriate test changes to accomodate. Signed-off-by: Yuval Peress <[email protected]>
The logic in the driver was not aligned to the datasheet. Also, temperature reading was not being done in fetch, but in channel_get. There was also some extra conversions from SI->register->SI when setting the range, this was causing the register value calculation to produce an incorrect scale in some cases. Tests were added to cover these cases. Signed-off-by: Yuval Peress <[email protected]>
Add support for getting the following attribute values: - SENSOR_ATTR_OFFSET - SENSOR_ATTR_SAMPLING_FREQUENCY - SENSOR_ATTR_FULL_SCALE Signed-off-by: Yuval Peress <[email protected]>
Adding a hook for tests to inject a mock transport and migrating the accel test to test bmi160 specific things. The old version of the test which checks for read values is now covered by the generic test in the sensor build_all target. Signed-off-by: Yuval Peress <[email protected]>
Rename the test directory to more accuratly reflect what's being tested. Signed-off-by: Yuval Peress <[email protected]>
The range map was sorted wrong since the function bmi160_range_to_reg_val() that uses it checks for the user value less than the range component of the bmi160_range struct. This means that no matter what range is set, the value will always end up 2000dps. Signed-off-by: Yuval Peress <[email protected]>
As an example, when the gyro range is set to 250 deg/sec the scale was set to 133 where it really should be 133.160058662. This leads to a 0.12% error in the value returned. By separating the numerator and denominator, we're able to drastically reduce the error. Signed-off-by: Yuval Peress <[email protected]>
28f9c45 to
915f68c
Compare
alevkoy
approved these changes
Jan 12, 2024
tristan-google
approved these changes
Jan 12, 2024
MaureenHelm
approved these changes
Jan 15, 2024
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.
Uh oh!
There was an error while loading. Please reload this page.