InertiaSDK

Loading...
Searching...
No Matches
ConfigChannel.h
1#pragma once
2
3 namespace inertia
4{
5
7 enum ConfigType : unsigned {
8 CONFIG_RADIO = 0,
9 CONFIG_GLOBAL_SAMPLING,
10 CONFIG_ACCEL,
11 CONFIG_COMPASS,
12 CONFIG_TRIPLE_AXIS,
13 CONFIG_STATUS,
14 CONFIG_HEARTBEAT,
15 CONFIG_TEMPERATURE,
16 CONFIG_CORR,
17 CONFIG_LOGGING,
18 CONFIG_IMA,
19 CONFIG_RTC,
20 CONFIG_SINGLE_AXIS,
21 CONFIG_GYRO,
22 CONFIG_QUAD_AXIS,
23 CONFIG_ADC,
24 CONFIG_DETECTION,
25 CONFIG_ADC2,
26 CONFIG_ACCEL_EXT,
27 CONFIG_COMPASS_EXT,
28 CONFIG_DUAL_AXIS,
29 CONFIG_VMON_BOARD,
30 CONFIG_OTHER_AXIS,
31 CONFIG_LAST,
32 CONFIG_CUSTOM,
33 CONFIG_IGNORE = 0xff
34};
35
36
38 enum ChannelDataType {
39 CHANNEL_SIGNED = 0,
40 CHANNEL_UNSIGNED = 1,
41 CHANNEL_FIXEDPOINT = 2
42};
43
44
46 struct INERTIA_API Channel
47{
48 uint8_t wordSize;
49 unsigned nValues;
50 ConfigType configType; // type of config, independent of channel
51 uint8_t instanceMask; // instanceMask bitfield (0 when not used)
52 uint8_t sensorID; // sensorID (e.g. accel or gyro for TripleAxisConfig), or group (for ADC2Config)
53 uint8_t disabledAxes; // mask to indicate which axes are disabled
54 uint32_t modulo; // can be set for custom channels
55 uint8_t sensorResolution;
56
57 ChannelDataType dataType;
58 unsigned fixedPointQ;
59 std::vector<double> conversionFactors;
60
61 Channel(uint8_t const _wordSize = 16, unsigned const _nValues = 0, ConfigType const _configType = CONFIG_IGNORE,
62 uint8_t const _instanceMask = 0, uint8_t const _sensorID = 0, uint8_t const disabledAxes = 0);
63 Channel(std::wstring const& argString);
64
65 bool operator== (Channel const& rhs) const;
66
67#ifdef WITH_BOOST_PROGRAM_OPTIONS
68 static const po::options_description GetOptionDescription();
69#endif
70
71 int Size() const;
72 const std::wstring ToString() const;
73};
74
75}
inertia
Definition FlashCommands.h:6
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::CONFIG_SINGLE_AXIS
@ CONFIG_SINGLE_AXIS
Single Axis Configuration, see SingleAxisConfig.
Definition ConfigChannel.h:20
inertia::CONFIG_DUAL_AXIS
@ CONFIG_DUAL_AXIS
Dual Axis Configuration, see DualAxisConfig.
Definition ConfigChannel.h:28
inertia::CONFIG_ADC2
@ CONFIG_ADC2
ADC2 Configuration, see ADC2Config.
Definition ConfigChannel.h:25
inertia::CONFIG_RTC
@ CONFIG_RTC
RTC Configuration, see RTCConfig.
Definition ConfigChannel.h:19
inertia::CONFIG_TRIPLE_AXIS
@ CONFIG_TRIPLE_AXIS
Triple Axis Configuration, see TripleAxisConfig.
Definition ConfigChannel.h:12
inertia::CONFIG_IMA
@ CONFIG_IMA
IMA Configuration, see IMAConfig.
Definition ConfigChannel.h:18
inertia::CONFIG_RADIO
@ CONFIG_RADIO
Radio Configuration, see RadioConfig.
Definition ConfigChannel.h:8
inertia::CONFIG_ACCEL_EXT
@ CONFIG_ACCEL_EXT
Extended Acceleration Configuration, see AccelConfigExt.
Definition ConfigChannel.h:26
inertia::CONFIG_CUSTOM
@ CONFIG_CUSTOM
Custom Configuration.
Definition ConfigChannel.h:32
inertia::CONFIG_DETECTION
@ CONFIG_DETECTION
Detection Configuration, see DetectionConfig.
Definition ConfigChannel.h:24
inertia::CONFIG_STATUS
@ CONFIG_STATUS
Status Configuration, see StatusConfig.
Definition ConfigChannel.h:13
inertia::CONFIG_GYRO
@ CONFIG_GYRO
Gyroscope Configuration, see GyroConfig.
Definition ConfigChannel.h:21
inertia::CONFIG_GLOBAL_SAMPLING
@ CONFIG_GLOBAL_SAMPLING
Global Sampling Configuration, see GlobalSamplingConfig.
Definition ConfigChannel.h:9
inertia::CONFIG_TEMPERATURE
@ CONFIG_TEMPERATURE
Temperature Configuration, see TemperatureConfig.
Definition ConfigChannel.h:15
inertia::CONFIG_VMON_BOARD
@ CONFIG_VMON_BOARD
V-Mon Board Configuration, see VmonBoardConfig.
Definition ConfigChannel.h:29
inertia::CONFIG_COMPASS_EXT
@ CONFIG_COMPASS_EXT
Extended Compass Configuration, not used.
Definition ConfigChannel.h:27
inertia::CONFIG_LOGGING
@ CONFIG_LOGGING
Logging Configuration, see LoggingConfig.
Definition ConfigChannel.h:17
inertia::CONFIG_LAST
@ CONFIG_LAST
Valid sensor configurations before this.
Definition ConfigChannel.h:31
inertia::CONFIG_HEARTBEAT
@ CONFIG_HEARTBEAT
Heartbeat Configuration, see HeartBeatConfig.
Definition ConfigChannel.h:14
inertia::CONFIG_OTHER_AXIS
@ CONFIG_OTHER_AXIS
Other Axis Configuration, see OtherAxisConfig.
Definition ConfigChannel.h:30
inertia::CONFIG_QUAD_AXIS
@ CONFIG_QUAD_AXIS
Quad Axis Configuration, see QuadAxisConfig.
Definition ConfigChannel.h:22
inertia::CONFIG_IGNORE
@ CONFIG_IGNORE
Ignore Configuration.
Definition ConfigChannel.h:33
inertia::CONFIG_COMPASS
@ CONFIG_COMPASS
Compass Configuration, see CompassConfig.
Definition ConfigChannel.h:11
inertia::CONFIG_CORR
@ CONFIG_CORR
Correlation Configuration, see CorrelationConfig.
Definition ConfigChannel.h:16
inertia::CONFIG_ACCEL
@ CONFIG_ACCEL
Acceleration Configuration, see AccelConfig.
Definition ConfigChannel.h:10
inertia::CONFIG_ADC
@ CONFIG_ADC
ADC Configuration, see ADCConfig.
Definition ConfigChannel.h:23
inertia::ChannelDataType
ChannelDataType
Definition ConfigChannel.h:38
inertia::CHANNEL_FIXEDPOINT
@ CHANNEL_FIXEDPOINT
Fixed floating point.
Definition ConfigChannel.h:41
inertia::CHANNEL_SIGNED
@ CHANNEL_SIGNED
Signed.
Definition ConfigChannel.h:39
inertia::CHANNEL_UNSIGNED
@ CHANNEL_UNSIGNED
Unsigned.
Definition ConfigChannel.h:40