InertiaSDK

Loading...
Searching...
No Matches
SensorSpecificSettings.h
1#pragma once
2
3#include "data/config/AbstractConfig.h"
4
5 namespace inertia
6{
7 enum ValueType : unsigned;
8
10 enum SingleAxisSensors : uint8_t {
11 BAROMETER_LPS25H = 0,
12 TEMP_MPU9250,
13 NEXODAQ_CHANNEL,
14 BAROMETER_LPS27HH,
15 TEMP_ICM42605,
16 TEMP_LSM6DSR,
17 TEMP_LSM6DSV320X,
18 TEMP_ICM45686,
19 SINGLE_AXIS_LAST,
20 NEXODAQ_USER_GPIO,
21 NEXODAQ_MONITOR
22};
23
24
26 enum DualAxisSensors : uint8_t {
27 DUAL_AXIS_LAST = 0
28};
29
30
32 enum TripleAxisSensors : uint8_t {
33 ACCEL_MPU9250 = 0,
34 GYRO_MPU9250,
35 COMPASS_AK8963,
36 ACCELHG_H3LIS331DL,
37 TRIPLE_TESTSENS,
38 ACCEL_ICM42605,
39 GYRO_ICM42605,
40 COMPASS_LIS3MDL,
41 ACCEL_LSM6DSR,
42 GYRO_LSM6DSR,
43 ACCEL_LSM6DSV320X,
44 GYRO_LSM6DSV320X,
45 ACCELHG_LSM6DSV320X,
46 ACCEL_ICM45686,
47 GYRO_ICM45686,
48 TRIPLE_AXIS_LAST
49};
50
51
53 enum QuadAxisSensors : uint8_t {
54 QUATERNION_MPU9250 = 0,
55 QUATERNION_SOFTWARE,
56 QUAD_AXIS_LAST
57};
58
59
61 enum OtherAxisSensors : uint8_t {
62 OTHER_POWER_MGMT = 0,
63 OTHER_INPUT_OUTPUT,
64 OTHER_GPS,
65 OTHER_SCHEDULER,
66 OTHER_VL53L8CX = 10,
67 OTHER_AXIS_LAST
68};
69
70
71 struct INERTIA_API SpecificSensorSettings
72{
73 protected:
74 SpecificSensorSettings();
75
76 public:
77 virtual void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const = 0;
78 virtual const std::wstring ToString() const = 0;
79
80 static ValueType GetType(Channel const& channel);
81 static ValueType GetType(ConfigType const configType, unsigned const sensorID);
82 static std::vector<unsigned> GetSensorIDs(ValueType const valueType);
83 static ConfigType GetConfigType(ValueType const valueType);
84 static std::wstring SensorIdToName(ConfigType const configType, unsigned const sensorID, unsigned const subID = 0);
85};
86
87 typedef std::shared_ptr<SpecificSensorSettings> SpecificSensorSettingsPtr;
88
89
91 enum SensorMode {
92 SENSOR_MODE_NORMAL = 0,
93 SENSOR_MODE_LOW_POWER = 1,
94 SENSOR_MODE_SELF_TEST = 2,
95 SENSOR_MODE_WAKE_ON_MOTION = 3,
96 SENSOR_MODE_GYRO_TEMP_COMP = 4,
97 SENSOR_MODE_AUTO_ZERO = 4
98};
99
101 enum SensorWakeOnMotionMode {
102 WOM_MODE_NORMAL = 0,
103 WOM_MODE_LOW_POWER = 1
104};
105
107 enum BaroDifferentialMode {
108 BARO_ABSOLUTE_MEASUREMENT = 0,
109 BARO_DIFFERENCE_MEASUREMENT = 1
110};
111
113 enum AccelHighPassFilter {
114 ACCEL_HPF_48 = 0,
115 ACCEL_HPF_96 = 1,
116 ACCEL_HPF_192 = 2,
117 ACCEL_HPF_384 = 3
118};
119
121 enum AccelCompare {
122 ACCEL_COMPARE_DISABLED = 0,
123 ACCEL_COMPARE_CHANNEL_A_HIGH = 1,
124 ACCEL_COMPARE_CHANNEL_A_LOW = 2,
125 ACCEL_COMPARE_CHANNEL_B_HIGH = 3,
126 ACCEL_COMPARE_CHANNEL_B_LOW = 4
127};
128
130 enum AccelCompareMode {
131 ACCEL_COMPARE_AND = 0,
132 ACCEL_COMPARE_OR = 1
133};
134
135
136 struct INERTIA_API BarometerSpecificSettings
137 : SpecificSensorSettings
138{
139 SensorMode sensorMode; // only normal (0), low-power (1), wake on motion (3) and auto-zero mode (4)
140 BaroDifferentialMode diffMode;
141 SensorWakeOnMotionMode womMode;
142 uint16_t womThreshold;
143 bool interpolation;
144
145 BarometerSpecificSettings();
146 BarometerSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
147 BarometerSpecificSettings(std::wstring const& argString);
148
149#ifdef WITH_BOOST_PROGRAM_OPTIONS
150 static const po::options_description GetOptionDescription();
151#endif
152
153 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
154 const std::wstring ToString() const override;
155};
156
157
158 struct INERTIA_API TemperatureMPUSpecificSettings
159 : SpecificSensorSettings
160{
161 TemperatureMPUSpecificSettings();
162 TemperatureMPUSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
163 TemperatureMPUSpecificSettings(std::wstring const& argString);
164
165#ifdef WITH_BOOST_PROGRAM_OPTIONS
166 static const po::options_description GetOptionDescription();
167#endif
168
169 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
170 const std::wstring ToString() const override;
171};
172
173
174 struct INERTIA_API AccelSpecificSettings
175 : SpecificSensorSettings
176{
177 SensorMode sensorMode; // only normal (0), low-power (1), self-test (2) and wake on motion (3)
178 uint16_t selfTestX;
179 uint16_t selfTestY;
180 uint16_t selfTestZ;
181 SensorWakeOnMotionMode womMode;
182 uint16_t womThreshold;
183
184 AccelSpecificSettings();
185 AccelSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
186 AccelSpecificSettings(std::wstring const& argString);
187
188#ifdef WITH_BOOST_PROGRAM_OPTIONS
189 static const po::options_description GetOptionDescription();
190#endif
191
192 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
193 const std::wstring ToString() const override;
194};
195
196
197 struct INERTIA_API GyroSpecificSettings
198 : SpecificSensorSettings
199{
200 SensorMode sensorMode; // only normal (0) and selftest (2)
201 bool tempCompensation;
202 uint16_t selfTestX;
203 uint16_t selfTestY;
204 uint16_t selfTestZ;
205
206 GyroSpecificSettings();
207 GyroSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
208 GyroSpecificSettings(std::wstring const& argString);
209
210#ifdef WITH_BOOST_PROGRAM_OPTIONS
211 static const po::options_description GetOptionDescription();
212#endif
213
214 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
215 const std::wstring ToString() const override;
216};
217
218
219 struct INERTIA_API CompassSpecificSettings
220 : SpecificSensorSettings
221{
222 SensorMode sensorMode; // only normal (0) and selftest (2)
223
224 CompassSpecificSettings();
225 CompassSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
226 CompassSpecificSettings(std::wstring const& argString);
227
228#ifdef WITH_BOOST_PROGRAM_OPTIONS
229 static const po::options_description GetOptionDescription();
230#endif
231
232 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
233 const std::wstring ToString() const override;
234};
235
236
237 struct INERTIA_API AccelHighGSpecificSettings
238 : SpecificSensorSettings
239{
240 SensorMode sensorMode; // only normal (0), low-power (1) and wake on motion (3)
241 AccelHighPassFilter highPassFilter;
242 bool enableHPF;
243 bool restoreCalibration;
244 SensorWakeOnMotionMode womMode;
245 AccelCompare compareX;
246 AccelCompare compareY;
247 AccelCompare compareZ;
248 bool channelAEnable;
249 bool channelBEnable;
250 AccelCompareMode channelAMode;
251 AccelCompareMode channelBMode;
252 uint8_t channelAThreshold;
253 uint8_t channelBThreshold;
254 uint8_t channelADuration;
255 uint8_t channelBDuration;
256
257 AccelHighGSpecificSettings();
258 AccelHighGSpecificSettings(uint8_t const* in, const unsigned offset, const unsigned _length);
259 AccelHighGSpecificSettings(std::wstring const& argString);
260
261#ifdef WITH_BOOST_PROGRAM_OPTIONS
262 static const po::options_description GetOptionDescription();
263#endif
264
265 void GetBytes(std::vector<uint8_t>& out, const size_t bitfieldOffset) const override;
266 const std::wstring ToString() const override;
267};
268
269}
inertia
Definition FlashCommands.h:6
inertia::ValueType
ValueType
Definition ChannelSpec.h:7
inertia::QuadAxisSensors
QuadAxisSensors
Definition SensorSpecificSettings.h:53
inertia::QUATERNION_SOFTWARE
@ QUATERNION_SOFTWARE
Quaternion configuration ID.
Definition SensorSpecificSettings.h:55
inertia::QUATERNION_MPU9250
@ QUATERNION_MPU9250
Quaternion configuration ID.
Definition SensorSpecificSettings.h:54
inertia::AccelCompare
AccelCompare
Definition SensorSpecificSettings.h:121
inertia::TripleAxisSensors
TripleAxisSensors
Definition SensorSpecificSettings.h:32
inertia::TRIPLE_TESTSENS
@ TRIPLE_TESTSENS
Test sensor.
Definition SensorSpecificSettings.h:37
inertia::GYRO_LSM6DSR
@ GYRO_LSM6DSR
Gyroscope configuration ID.
Definition SensorSpecificSettings.h:42
inertia::GYRO_LSM6DSV320X
@ GYRO_LSM6DSV320X
Gyroscope configuration ID.
Definition SensorSpecificSettings.h:44
inertia::ACCEL_LSM6DSV320X
@ ACCEL_LSM6DSV320X
Accelerometer configuration ID.
Definition SensorSpecificSettings.h:43
inertia::GYRO_MPU9250
@ GYRO_MPU9250
Gyroscope configuration ID.
Definition SensorSpecificSettings.h:34
inertia::GYRO_ICM42605
@ GYRO_ICM42605
Gyroscope configuration ID.
Definition SensorSpecificSettings.h:39
inertia::COMPASS_AK8963
@ COMPASS_AK8963
Compass configuration ID.
Definition SensorSpecificSettings.h:35
inertia::ACCEL_LSM6DSR
@ ACCEL_LSM6DSR
Accelerometer configuration ID.
Definition SensorSpecificSettings.h:41
inertia::GYRO_ICM45686
@ GYRO_ICM45686
Gyroscope configuration ID.
Definition SensorSpecificSettings.h:47
inertia::COMPASS_LIS3MDL
@ COMPASS_LIS3MDL
Compass configuration ID.
Definition SensorSpecificSettings.h:40
inertia::ACCELHG_H3LIS331DL
@ ACCELHG_H3LIS331DL
High-G Accelerometer configuration ID.
Definition SensorSpecificSettings.h:36
inertia::ACCELHG_LSM6DSV320X
@ ACCELHG_LSM6DSV320X
High-G Accelerometer configuration ID.
Definition SensorSpecificSettings.h:45
inertia::ACCEL_MPU9250
@ ACCEL_MPU9250
Accelerometer configuration ID.
Definition SensorSpecificSettings.h:33
inertia::ACCEL_ICM45686
@ ACCEL_ICM45686
Accelerometer configuration ID.
Definition SensorSpecificSettings.h:46
inertia::ACCEL_ICM42605
@ ACCEL_ICM42605
Accelerometer configuration ID.
Definition SensorSpecificSettings.h:38
inertia::SensorWakeOnMotionMode
SensorWakeOnMotionMode
Definition SensorSpecificSettings.h:101
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::SpecificSensorSettingsPtr
std::shared_ptr< SpecificSensorSettings > SpecificSensorSettingsPtr
Pointer to a SpecificSensorSettings.
Definition SensorSpecificSettings.h:87
inertia::SensorMode
SensorMode
Definition SensorSpecificSettings.h:91
inertia::OtherAxisSensors
OtherAxisSensors
Definition SensorSpecificSettings.h:61
inertia::OTHER_INPUT_OUTPUT
@ OTHER_INPUT_OUTPUT
Input/Output (I/O) configuration ID.
Definition SensorSpecificSettings.h:63
inertia::OTHER_POWER_MGMT
@ OTHER_POWER_MGMT
Power Management configuration ID.
Definition SensorSpecificSettings.h:62
inertia::OTHER_SCHEDULER
@ OTHER_SCHEDULER
Scheduler configuration ID.
Definition SensorSpecificSettings.h:65
inertia::OTHER_VL53L8CX
@ OTHER_VL53L8CX
ToF configuration ID.
Definition SensorSpecificSettings.h:66
inertia::OTHER_GPS
@ OTHER_GPS
GPS configuration ID.
Definition SensorSpecificSettings.h:64
inertia::DualAxisSensors
DualAxisSensors
Definition SensorSpecificSettings.h:26
inertia::AccelHighPassFilter
AccelHighPassFilter
Definition SensorSpecificSettings.h:113
inertia::BaroDifferentialMode
BaroDifferentialMode
Definition SensorSpecificSettings.h:107
inertia::SingleAxisSensors
SingleAxisSensors
Definition SensorSpecificSettings.h:10
inertia::TEMP_LSM6DSV320X
@ TEMP_LSM6DSV320X
Temperature configuration ID.
Definition SensorSpecificSettings.h:17
inertia::TEMP_ICM45686
@ TEMP_ICM45686
Temperature configuration ID.
Definition SensorSpecificSettings.h:18
inertia::BAROMETER_LPS27HH
@ BAROMETER_LPS27HH
Barometer configuration ID.
Definition SensorSpecificSettings.h:14
inertia::TEMP_MPU9250
@ TEMP_MPU9250
Temperature configuration ID.
Definition SensorSpecificSettings.h:12
inertia::NEXODAQ_MONITOR
@ NEXODAQ_MONITOR
internal ID
Definition SensorSpecificSettings.h:21
inertia::TEMP_ICM42605
@ TEMP_ICM42605
Temperature configuration ID.
Definition SensorSpecificSettings.h:15
inertia::NEXODAQ_CHANNEL
@ NEXODAQ_CHANNEL
NexoDAQ Channel configuration ID.
Definition SensorSpecificSettings.h:13
inertia::TEMP_LSM6DSR
@ TEMP_LSM6DSR
Temperature configuration ID.
Definition SensorSpecificSettings.h:16
inertia::NEXODAQ_USER_GPIO
@ NEXODAQ_USER_GPIO
internal ID
Definition SensorSpecificSettings.h:20
inertia::BAROMETER_LPS25H
@ BAROMETER_LPS25H
Barometer configuration ID.
Definition SensorSpecificSettings.h:11
inertia::AccelCompareMode
AccelCompareMode
Definition SensorSpecificSettings.h:130
inertia::Channel
Definition ConfigChannel.h:47