-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBno055Interface.h
41 lines (35 loc) · 1.14 KB
/
Bno055Interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Created by volundr on 7/19/16.
//
#ifndef BNO055_BNO055INTERFACE_H
#define BNO055_BNO055INTERFACE_H
#include "UartInterface.h"
#include "bno055DataSheet.h"
#include "bno055DataStructures.h"
namespace bno055 {
enum availableVec3sToQuery {
ACCELERATION = ACC_DATA_X_LSB,
MAGNETOMETER = MAG_DATA_X_LSB,
GYROSCOPE = GYR_DATA_X_LSB,
EULER_ORIENT = EUL_Heading_LSB,
LINEAR_ACCEL = LIA_Data_X_LSB,
GRAVITY_VEC = GRV_Data_X_LSB,
};
enum availableVec4sToQuery {
QUATERNION_ORIENT = QUA_Data_w_LSB,
};
class Bno055Interface {
UartInterface uart;
bool hasInit = false;
bool write(uint8_t regAddr, uint8_t length, uint8_t* data);
bool writeByte(uint8_t regAddr, uint8_t data);
public:
bool init(const char* bno055File);
bool isLive();
bool queryImuData(ImuData_16* out);
bool queryVec3(Vec3_16* vec3Out, availableVec3sToQuery regBegin);
bool queryVec4(Vec4_16* vec4Out, availableVec4sToQuery regBegin);
bool queryChunk_16(int16_t* out, int start, size_t length);
};
}
#endif //BNO055_BNO055INTERFACE_H