summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-12-12 10:34:48 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2019-12-12 10:34:48 +0100
commitc3286ffc8c50e75cbddafb988738cd9566d5a023 (patch)
tree7c75b18f6b4bd70f3af6126267cea33646b92bad /src
parent16a0da9855bead4d70771bf6a5fbea3e28f36369 (diff)
mpu9250: Add nineAxis function
Diffstat (limited to 'src')
-rw-r--r--src/driver/mpu9250.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/driver/mpu9250.cc b/src/driver/mpu9250.cc
index e8f407e..58796c5 100644
--- a/src/driver/mpu9250.cc
+++ b/src/driver/mpu9250.cc
@@ -218,6 +218,15 @@ void MPU9250::getRawMagnet(int *x, int *y, int *z)
// mpu9250.dfa
+void MPU9250::nineAxis()
+{
+ gyroStandby = false;
+ AGWakeup();
+ MagWakeup();
+ setAccelEnable(true, true, true);
+ setGyroEnable(true, true, true);
+}
+
void MPU9250::sleep()
{
AGSleep();
@@ -229,6 +238,7 @@ void MPU9250::standby()
setGyroStandby(true);
MagSleep();
setAccelEnable(false, false, false);
+ // TODO setGyroEnable false/true?
}
void MPU9250::lowPowerAccelOnly(unsigned char rate)
@@ -241,6 +251,7 @@ void MPU9250::lowPowerAccelOnly(unsigned char rate)
txbuf[1] = 1<<5;
i2c.xmit(address, 2, txbuf, 0, rxbuf);
setGyroEnable(false, false, false);
+ // TODO setAccelEnable true?
}
void MPU9250::accelOnly()
@@ -249,6 +260,7 @@ void MPU9250::accelOnly()
AGWakeup();
MagSleep();
setGyroEnable(false, false, false);
+ // TODO setAccelEnable true?
}
void MPU9250::gyroOnly()
@@ -257,6 +269,7 @@ void MPU9250::gyroOnly()
AGWakeup();
MagSleep();
setAccelEnable(false, false, false);
+ // TODO setGyroEnable true?
}
void MPU9250::magnetOnly()