-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbno085_runner.h
64 lines (52 loc) · 1.76 KB
/
bno085_runner.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*******************************************************************************
* @file bno085_runner.h
* @brief BNO085 SH2 runner: init, start reports and event handling.
*******************************************************************************
* @note
* Developed using https://github.com/ceva-dsp/sh2-demo-nucleo as reference.
*******************************************************************************
*/
#ifndef NERVE__BNO085_RUNNER_H
#define NERVE__BNO085_RUNNER_H
/** Includes. *****************************************************************/
#include "diagnostics.h"
#include "sh2.h"
#include "sh2_SensorValue.h"
#include "sh2_err.h"
#include "sh2_hal_spi.h"
#include <stdio.h>
/** Definitions. **************************************************************/
#define RAD_TO_DEG (180.0 / 3.14159265358)
/** Public variables. *********************************************************/
extern float bno085_quaternion_i;
extern float bno085_quaternion_j;
extern float bno085_quaternion_k;
extern float bno085_quaternion_real;
extern float bno085_quaternion_accuracy_rad;
extern float bno085_quaternion_accuracy_deg;
extern float bno085_gyro_x;
extern float bno085_gyro_y;
extern float bno085_gyro_z;
extern float bno085_accel_x;
extern float bno085_accel_y;
extern float bno085_accel_z;
extern float bno085_lin_accel_x;
extern float bno085_lin_accel_y;
extern float bno085_lin_accel_z;
extern float bno085_gravity_x;
extern float bno085_gravity_y;
extern float bno085_gravity_z;
/** Public functions. *********************************************************/
/**
* @brief Initialize BNO085 with SH2 driver.
*/
void bno085_init(void);
/**
* @brief Reset BNO085.
*/
void bno085_reset(void);
/**
* @brief Run sensor run cycle.
*/
void bno085_run(void);
#endif