1
0
forked from me/IronOS

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,31 +7,29 @@
#ifndef CORE_DRIVERS_BMA223_HPP_
#define CORE_DRIVERS_BMA223_HPP_
#include "I2C_Wrapper.hpp"
#include "BSP.h"
#include "BMA223_defines.h"
#include "BSP.h"
#include "I2C_Wrapper.hpp"
class BMA223 {
public:
static bool detect();
static bool initalize();
//1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
uint8_t val = FRToSI2C::I2C_RegisterRead(BMA223_ADDRESS,
BMA223_INT_STATUS_3);
val >>= 4; //we dont need high values
val &= 0b11;
if(val &0b10){
return ORIENTATION_FLAT;
}else{
return static_cast<Orientation>(!val);
}
//0 = rhs
//1 =lhs
//2 & 3 == ignore
}
static void getAxisReadings(int16_t& x, int16_t& y, int16_t& z);
static bool detect();
static bool initalize();
// 1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
uint8_t val = FRToSI2C::I2C_RegisterRead(BMA223_ADDRESS, BMA223_INT_STATUS_3);
val >>= 4; // we dont need high values
val &= 0b11;
if (val & 0b10) {
return ORIENTATION_FLAT;
} else {
return static_cast<Orientation>(!val);
}
// 0 = rhs
// 1 =lhs
// 2 & 3 == ignore
}
static void getAxisReadings(int16_t &x, int16_t &y, int16_t &z);
private:
};