-
Notifications
You must be signed in to change notification settings - Fork 0
/
Orion.h
130 lines (108 loc) · 3.19 KB
/
Orion.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#ifndef __ORION_H__
#define __ORION_H__
#include <stdbool.h>
#ifndef NAN
#define NAN (float)0xFFFFFFFF
#endif
#ifndef NULL
#define NULL (void*)0x00
#endif
#ifndef PI
#define PI (float)3.1415926535897932384626433832795
#endif
#define decPlace float
#ifdef _MSC_VER
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE inline __attribute__((__always_inline__))
#elif defined(__CLANG__)
#if __has_attribute(__always_inline__)
#define INLINE inline __attribute__((__always_inline__))
#else
#define INLINE inline
#endif
#else
#define INLINE inline
#endif
extern "C"
{
void SetPanic(_Bool value);
void SetPanicCallback(void(*panicFunctionCallback)(void));
void Panic();
}
/**
* Block of code to determine board type
*/
#ifdef __arm__
#ifdef CORE_TEENSY
#define __TEENSY__
#if defined(__AT90USB162__)
#define __TEENSY_1_0__
#elif defined(__ATMEGA32U4__)
#define __TEENSY_2_0__
#elif defined(__MKL26Z64__)
#define __TEENSY_LC__
#elif defined(__MK20DX128__)
#define __TEENSY_3_0__
#elif defined(__MK20DX256__)
#define __TEENSY_3_1__
#define __TEENSY_3_2__
#elif defined(__MK64FX512__)
#define __TEENSY_3_5__
#elif defined(__MK66FX1M0__)
#define __TEENSY_3_6__
#elif defined(__IMXRT1062__)
#if defined(BUILTIN_SDCARD)
#define __TEENSY_4_1__
#else
#define __TEENSY_4_0__
#endif
#endif
#endif
#endif
#define __BME280__ 0x000001
#define __BNO055__ 0x000002
#define __SD__ 0x000101
#define __GPS__ 0x0010000
#define __MTK3339__ 0x010001
#define __CAMERA__ 0x010100
#define __OV5642__ 0x010101
#define __TEMPERATURE__ 0x000001
#define __HUMIDITY__ 0x000002
#define __PRESSURE__ 0x000003
#define __ALTITUDE__ 0x000004
#define __ROTATIONAL_ANGLE__ 0x000005
#define __ROTATIONAL_ANGLE_X__ 0x000006
#define __ROTATIONAL_ANGLE_Y__ 0x000007
#define __ROTATIONAL_ANGLE_Z__ 0x000008
#define __ANGULAR_VELOCITY__ 0x000009
#define __ANGULAR_VELOCITY_X__ 0x00000A
#define __ANGULAR_VELOCITY_Y__ 0x00000B
#define __ANGULAR_VELOCITY_Z__ 0x00000C
#define __GRAVITATIONAL_ACCELERATION__ 0x00000D
#define __GRAVITATIONAL_ACCELERATION_X__ 0x00000E
#define __GRAVITATIONAL_ACCELERATION_Y__ 0x00000F
#define __GRAVITATIONAL_ACCELERATION_Z__ 0x000010
#define __LINEAR_ACCELERATION__ 0x000011
#define __LINEAR_ACCELERATION_X__ 0x000012
#define __LINEAR_ACCELERATION_Y__ 0x000013
#define __LINEAR_ACCELERATION_Z__ 0x000014
#define __LINEAR_VELOCITY__ 0x000015
#define __LINEAR_VELOCITY_X__ 0x000016
#define __LINEAR_VELOCITY_Y__ 0x000017
#define __LINEAR_VELOCITY_Z__ 0x000018
#define __LINEAR_DISPLACEMENT__ 0x00000019
#define __LINEAR_DISPLACEMENT_X__ 0x00001A
#define __LINEAR_DISPLACEMENT_Y__ 0x00001B
#define __LINEAR_DISPLACEMENT_Z__ 0x00001C
#define __MAGNETISM__ 0x00001D
#define __MAGNETISM_X__ 0x00001E
#define __MAGNETISM_Y__ 0x00001F
#define __MAGNETISM_Z__ 0x000020
#define __LATITUDE__ 0x000021
#define __LONGITUDE__ 0x000022
#define __AXIS__ 0x10000
#define __X_AXIS__ 0x10001
#define __Y_AXIS__ 0x10002
#define __Z_AXIS__ 0x10003
#endif//__ORION_H__