1
0
forked from me/IronOS

SC7A20 tweaks (#1251)

* Clean up handling of addresses

* Update SC7A20.hpp

* Try remapped Accel readings

* Fake LIS setup?

* Refining build options
This commit is contained in:
Ben V. Brown
2022-04-03 12:37:27 +10:00
committed by GitHub
parent 0b8192b690
commit 787bc46bdc
5 changed files with 1951 additions and 2436 deletions

View File

@@ -17,7 +17,7 @@ public:
static bool initalize();
// 1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
uint8_t val = ((FRToSI2C::I2C_RegisterRead(activeAddress, SC7A20_INT2_SOURCE) >> 2) - 1);
uint8_t val = ((FRToSI2C::I2C_RegisterRead(isInImitationMode ? SC7A20_ADDRESS2 : SC7A20_ADDRESS, SC7A20_INT2_SOURCE) >> 2) - 1);
if (val == 1) {
#ifdef SC7_ORI_FLIP
return Orientation::ORIENTATION_RIGHT_HAND;
@@ -36,7 +36,7 @@ public:
static void getAxisReadings(int16_t &x, int16_t &y, int16_t &z);
private:
static uint8_t activeAddress;
static bool isInImitationMode;
};
#endif /* CORE_DRIVERS_BMA223_HPP_ */