Skyward boardcore
Loading...
Searching...
No Matches
BMX160Config.h
Go to the documentation of this file.
1/* Copyright (c) 2020 Skyward Experimental Rocketry
2 * Author: Davide Mor
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25namespace Boardcore
26{
27
32{
36 enum class FifoMode
37 {
38 DISABLED,
40 HEADER
41 };
42
50 {
51
52 DISABLED,
53 PIN_INT1,
54 PIN_INT2,
55 };
56
61 {
62 G_2 = 0x3,
63 G_4 = 0x5,
64 G_8 = 0x8,
65 G_16 = 0xC
66 };
67
71 enum class GyroscopeRange
72 {
73 DEG_2000 = 0x0,
74 DEG_1000 = 0x1,
75 DEG_500 = 0x2,
76 DEG_250 = 0x3,
77 DEG_125 = 0x4
78 };
79
84 {
85 DEG,
86 RAD
87 };
88
98 enum class OutputDataRate
99 {
100 HZ_0_78125 = 0x01,
101 HZ_1_5625 = 0x02,
102 HZ_3_125 = 0x03,
103 HZ_6_25 = 0x04,
104 HZ_12_5 = 0x05,
105 HZ_25 = 0x06,
106 HZ_50 = 0x07,
107 HZ_100 = 0x08,
108 HZ_200 = 0x09,
109 HZ_400 = 0x0A,
110 HZ_800 = 0x0B,
111 HZ_1600 = 0x0C,
112 HZ_3200 = 0x0D,
113 };
114
123 {
124 NORMAL = 0x20,
125 OSR2 = 0x10,
126 OSR4 = 0x00,
127 };
128
134 enum class IntMode
135 {
136 PUSH_PULL,
137 OPEN_DRAIN,
138 };
139
147 uint8_t fifoWatermark = -1;
148
166
184
195
206
211
216
221
226
229
233
238
240
243
245};
246
247} // namespace Boardcore
This file includes all the types the logdecoder script will decode.
BMX160 Configuration.
uint8_t fifoWatermark
Fifo watermark to use, in multiples of 4.
uint8_t fifoGyroscopeDownsampling
Fifo gyroscope downsampling (between 0 and 15).
bool fifoGyroscopeFiltered
Should the fifo use gyroscope filtered data?
BandwidthParameter accelerometerBandwidth
bool fifoAccelerometerFiltered
Should the fifo use accelerometer filtered data?
AccelerometerRange
Range of the accelerometer expressed in ±g.
AccelerometerRange accelerometerRange
uint8_t fifoAccelerationDownsampling
Fifo accelerometer downsampling (between 0 and 15).
BandwidthParameter
Bandwidth parameter.
OutputDataRate magnetometerRate
int temperatureDivider
Divide the temperature sampling rate.
GyroscopeRange
Gyroscope range expressed in °/sec.
@ DEG_2000
Gyroscope range 2000°/sec.
@ DEG_500
Gyroscope range 500°/sec.
@ DEG_125
Gyroscope range 125°/sec.
@ DEG_250
Gyroscope range 250°/sec.
@ DEG_1000
Gyroscope range 1000°/sec.
IntMode
Interrupt pin mode.
@ PUSH_PULL
Push-pull behaviour.
@ OPEN_DRAIN
Open drain behaviour.
OutputDataRate accelerometerDataRate
BandwidthParameter gyroscopeBandwidth
bool enableCompensation
Enable magnetometer data compensation.
FifoInterruptPin
Fifo interrupt mode.
@ DISABLED
The interrupts are completely disabled.
@ PIN_INT2
Interrupts are enabled on pin 1.
@ PIN_INT1
Interrupts are enabled on pin 2.
GyroscopeMeasureUnit
Gyroscope measure unit (degrees or radiants).
GyroscopeRange gyroscopeRange
uint8_t magnetometerRepetitionsZ
Repetitions for the Z axis.
FifoInterruptPin fifoInterrupt
GyroscopeMeasureUnit gyroscopeUnit
OutputDataRate gyroscopeDataRate
uint8_t magnetometerRepetitionsXY
Repetitions for the XY axis.
OutputDataRate
Output Data Rate expressed in Hz.
@ HZ_1600
Output Data Rate of 1600Hz.
@ HZ_50
Output Data Rate of 50Hz.
@ HZ_6_25
Output Data Rate of 25/4Hz = 6.25.
@ HZ_1_5625
Output Data Rate of 25/16Hz = 1.5625.
@ HZ_3_125
Output Data Rate of 25/8Hz = 3.125.
@ HZ_100
Output Data Rate of 100Hz.
@ HZ_200
Output Data Rate of 200Hz.
@ HZ_12_5
Output Data Rate of 25/2Hz = 12.5.
@ HZ_3200
Output Data Rate of 3200Hz.
@ HZ_25
Output Data Rate of 25Hz.
@ HZ_0_78125
Output Data Rate of 25/32Hz = 0.78125.
@ HZ_400
Output Data Rate of 400Hz.
@ HZ_800
Output Data Rate of 800Hz.
FifoMode
Fifo operationg mode.
@ DISABLED
The fifo is completely disabled.
@ HEADER
Sensors can have different odr.
@ HEADERLESS
Sensors MUST have the same odr.