Skip to content

High-accuracy ODR mode support#2

Draft
5t0n3 wants to merge 10 commits intostm32duino:mainfrom
SCRT-Capstone-2025-26:feat/upstream-high-accuracy
Draft

High-accuracy ODR mode support#2
5t0n3 wants to merge 10 commits intostm32duino:mainfrom
SCRT-Capstone-2025-26:feat/upstream-high-accuracy

Conversation

@5t0n3
Copy link
Copy Markdown

@5t0n3 5t0n3 commented Mar 16, 2026

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_CFG register changing how the ODR register values are interpreted, I also changed the ODRs internal to ISM6HG256XSensor to be stored as floats, to be converted to register value as necessary (so as to not lose information on writes to HAODR_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 for HAODR_SEL_[1:0] = 2 were omitted) so I fixed those as well.

@5t0n3 5t0n3 marked this pull request as draft March 16, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant