High-accuracy ODR mode support#2
Draft
5t0n3 wants to merge 10 commits intostm32duino:mainfrom
Draft
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
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.
Summary
This PR adds support for the high-accuracy ODR mode specified in section 6.3 of the ISM6HG256X datasheet.
The existing library mode-setting functions simply error on trying to configure high-accuracy ODR mode. This made some sense, since the gyro and accelerometer have to be powered off when high-accuracy mode is configured (which was not possible in the previous structure).
In applications where consistency of sample/output rate is necessary, this mode may be useful.
Due to the
HAODR_CFGregister changing how the ODR register values are interpreted, I also changed the ODRs internal toISM6HG256XSensorto be stored as floats, to be converted to register value as necessary (so as to not lose information on writes toHAODR_CFG).Some of the enumeration to float conversions for data rates relating to the high-accuracy ODRs were also incorrect (
HAODR_SEL_[1:0]= 2 was treated as 3, and the constants forHAODR_SEL_[1:0]= 2 were omitted) so I fixed those as well.