Skip to content

Instantly share code, notes, and snippets.

@reefwing
Created April 2, 2023 08:11
Show Gist options
  • Save reefwing/29e44f4f89aa17359e9f22dfc44300c7 to your computer and use it in GitHub Desktop.
Save reefwing/29e44f4f89aa17359e9f22dfc44300c7 to your computer and use it in GitHub Desktop.
void ReefwingLSM9DS1::setMagODR(MagODR rate) {
if (rate > ODR_80Hz) {
enableFastODR(true);
switch(rate) {
case MagODR::ODR_155Hz: // OM = 11, mode = ULTRA
setMagOperatingMode(ULTRA);
break;
case MagODR::ODR_300Hz: // OM = 10, mode = HIGH
setMagOperatingMode(HIGH);
break;
case MagODR::ODR_560Hz: // OM = 01, mode = MEDIUM
setMagOperatingMode(MEDIUM);
break;
case MagODR::ODR_1000Hz: // OM = 00 (OM default), mode = LOW
setMagOperatingMode(LOW);
break;
}
}
else {
enableFastODR(false);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment