InertiaSDK

Loading...
Searching...
No Matches
AccelConfig.h
1#pragma once
2
3#include "data/config/InertialConfig.h"
4
5 namespace inertia
6{
7
9 enum AccelType {
10 ACCEL_LIS3LV02 = 0,
11 ACCEL_LIS3DH = 1,
12 ACCEL_RESERVED = 2,
13 ACCEL_RESERVED2 = 3
14};
15
17 enum AccelRateLis3LV02 {
18 ACCEL_RATE_40 = 0,
19 ACCEL_RATE_160 = 1,
20 ACCEL_RATE_640 = 2,
21 ACCEL_RATE_2560 = 3
22};
23
25 enum AccelRateLis3DH {
26 ACCEL_RATE_DOWN = 0,
27 ACCEL_RATE_DOWN_LP = 1,
28 ACCEL_RATE_1 = 2,
29 ACCEL_RATE_1_LP = 3,
30 ACCEL_RATE_10 = 4,
31 ACCEL_RATE_10_LP = 5,
32 ACCEL_RATE_25 = 6,
33 ACCEL_RATE_25_LP = 7,
34 ACCEL_RATE_50 = 8,
35 ACCEL_RATE_50_LP = 9,
36 ACCEL_RATE_100 = 10,
37 ACCEL_RATE_100_LP = 11,
38 ACCEL_RATE_200 = 12,
39 ACCEL_RATE_200_LP = 13,
40 ACCEL_RATE_400 = 14,
41 ACCEL_RATE_400_LP = 15,
42 ACCEL_RATE_RESERVED1 = 16,
43 ACCEL_RATE_1600_LP = 17,
44 ACCEL_RATE_1250 = 18,
45 ACCEL_RATE_5000_LP = 19
46};
47
49 enum AccelRangeLis3DH {
50 ACCEL_RANGE_2G = 0,
51 ACCEL_RANGE_4G = 1,
52 ACCEL_RANGE_8G = 2,
53 ACCEL_RANGE_16G = 3
54};
55
56
57 struct INERTIA_API AccelConfig
58 : InertialConfig
59{
60 AccelRateLis3LV02 hardwareRate0;
61 AccelRateLis3DH hardwareRate1;
62 bool hardwareScale0; // for Lis3LV02
63 AccelRangeLis3DH hardwareScale1; // for Lis3DH
64 AccelType hardwareType;
65
66 AccelConfig();
67 AccelConfig(uint8_t const* in);
68 AccelConfig(std::wstring const& argString);
69
70#ifdef WITH_BOOST_PROGRAM_OPTIONS
71 static const po::options_description GetOptionDescription();
72#endif
73
74 static unsigned GetLength();
75 void GetBytes(std::vector<uint8_t>& out) const override;
76 ConfigType GetConfigType() const override;
77 const std::wstring ToString() const override;
78 const std::wstring ToSimpleString(uint16_t const globalRate) const;
79 double GetRangeFactor() const override;
80 uint16_t GetMaxRate() const override;
81};
82
83}
inertia
Definition FlashCommands.h:6
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::AccelRateLis3LV02
AccelRateLis3LV02
Definition AccelConfig.h:17
inertia::AccelRangeLis3DH
AccelRangeLis3DH
Definition AccelConfig.h:49
inertia::AccelRateLis3DH
AccelRateLis3DH
Definition AccelConfig.h:25
inertia::AccelType
AccelType
Definition AccelConfig.h:9