InertiaSDK

Loading...
Searching...
No Matches
CompassConfig.h
1#pragma once
2
3#include "data/config/InertialConfig.h"
4
5 namespace inertia
6{
7
8// compass overflow (-4096 situation from HMC5843 is received as 32767 independent of scaling & offset)
9#define COMPASS_OVERFLOW 32767
10
12 enum CompassRate {
13 COMPASS_RATE_0 = 0,
14 COMPASS_RATE_1 = 1,
15 COMPASS_RATE_2 = 2,
16 COMPASS_RATE_3 = 3,
17 COMPASS_RATE_4 = 4,
18 COMPASS_RATE_5 = 5,
19 COMPASS_RATE_6 = 6
20};
21
23 enum CompassGain {
24 COMPASS_GAIN_0 = 0,
25 COMPASS_GAIN_1 = 1,
26 COMPASS_GAIN_2 = 2,
27 COMPASS_GAIN_3 = 3,
28 COMPASS_GAIN_4 = 4,
29 COMPASS_GAIN_5 = 5,
30 COMPASS_GAIN_6 = 6,
31 COMPASS_GAIN_7 = 7
32};
33
35 enum CompassType {
36 COMPASS_HMC5843 = 0,
37 COMPASS_HMC5883L = 1,
38 COMPASS_RESERVED = 2,
39 COMPASS_RESERVED2 = 3
40};
41
42
43 struct INERTIA_API CompassConfig
44 : InertialConfig
45{
46 CompassRate hardwareRate;
47 CompassGain hardwareGain;
48 CompassType hardwareType;
49
50 CompassConfig();
51 CompassConfig(uint8_t const* in);
52 CompassConfig(std::wstring const& argString);
53
54#ifdef WITH_BOOST_PROGRAM_OPTIONS
55 static const po::options_description GetOptionDescription();
56#endif
57
58 static unsigned GetLength();
59 void GetBytes(std::vector<uint8_t>& out) const override;
60 ConfigType GetConfigType() const override;
61 const std::wstring ToString() const override;
62 const std::wstring ToSimpleString(uint16_t const globalRate) const;
63 double GetRangeFactor() const override;
64 uint16_t GetMaxRate() const override;
65};
66
67}
inertia
Definition FlashCommands.h:6
inertia::CompassRate
CompassRate
Definition CompassConfig.h:12
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::CompassType
CompassType
Definition CompassConfig.h:35
inertia::CompassGain
CompassGain
Definition CompassConfig.h:23