Format headers

This commit is contained in:
Ben V. Brown
2021-01-17 10:53:49 +11:00
parent f786901da0
commit bf5055edaa
173 changed files with 42831 additions and 47623 deletions

View File

@@ -7,33 +7,32 @@
#ifndef LIS2DH12_HPP_
#define LIS2DH12_HPP_
#include "BSP.h"
#include "I2C_Wrapper.hpp"
#include "LIS2DH12_defines.hpp"
#include "BSP.h"
class LIS2DH12 {
public:
static bool detect();
static bool initalize();
//1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
static bool detect();
static bool initalize();
// 1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
#ifdef LIS_ORI_FLIP
uint8_t val = (FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS,
LIS_INT2_SRC) >> 2);
if (val == 8)
val = 3;
else if (val == 1)
val = 1;
else if (val == 2)
val = 0;
else
val = 3;
return static_cast<Orientation>(val);
uint8_t val = (FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS, LIS_INT2_SRC) >> 2);
if (val == 8)
val = 3;
else if (val == 1)
val = 1;
else if (val == 2)
val = 0;
else
val = 3;
return static_cast<Orientation>(val);
#else
return static_cast<Orientation>((FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS,LIS_INT2_SRC) >> 2) - 1);
return static_cast<Orientation>((FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS, LIS_INT2_SRC) >> 2) - 1);
#endif
}
static void getAxisReadings(int16_t& x, int16_t& y, int16_t& z);
}
static void getAxisReadings(int16_t &x, int16_t &y, int16_t &z);
private:
};