This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Implemented multi-interrupt channel support#64
Open
peakBreaker wants to merge 4 commits intoboschsensortec:masterfrom
Open
Implemented multi-interrupt channel support#64peakBreaker wants to merge 4 commits intoboschsensortec:masterfrom
peakBreaker wants to merge 4 commits intoboschsensortec:masterfrom
Conversation
added 4 commits
June 12, 2018 15:00
After running with this version of drivers and dumping registers, I got the following result: BMI160_INT_OUT_CTRL_ADDR UINT8_C(0x53) :: 0x88
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Was stuck for a while during development for the BMI160 sensor due to using the
BMI160_INT_CHANNEL_BOTHdefine which can be found in: https://github.com/BoschSensortec/BMI160_driver/blob/44f0df94d6b000a821afd7ed31c432bc677cd723/bmi160_defs.h#L1004The define is there, however when configuring the sensor, the code for configuring both interrupt channels is lacking in the driver library. Since the current library implementation defaults to configuring interrupt channel 2 for every value other than
BMI160_INT_CHANNEL_1, it will configure interrupt channel 2 - not both - when setting int_channel toBMI160_INT_CHANNEL_BOTH. This is very misleading.This PR implements support for both interrupt channels for the sensor, and it implements a guard statement to return an error code in case an invalid configuration is provided instead of defaulting to interrupt channel 2.
After testing my fork of the library with these changes on our device I get the following value in the INT_OUT_CTRL register (0x53):
This means that the output enable for both interrupt channel 1 and 2 is set to enabled. For more details on this, see the BMI160 datasheet on page 63.