InertiaSDK

Loading...
Searching...
No Matches
ADC2Config.h
1#pragma once
2
3#include "data/config/GenericConfig.h"
4
5 namespace inertia
6{
7
9 enum ADCDescriptorType
10{
11 ADC_DESCRIPTOR_GROUP = 0,
12 ADC_DESCRIPTOR_INPUT = 1
13};
14
16 enum ADCInputMode {
17 MODE_SINGLE_ENDED = 0,
18 MODE_DIFFERENTIAL,
19 MODE_DIGITAL
20};
21
22
23 struct INERTIA_API ADCGroupDescriptor
24{
25 ADCDescriptorType type;
26 bool enableSampling;
27 bool enableTransmit;
28 bool enableLogging;
29 bool adoptMod;
30 uint8_t samplingChannel;
31 uint16_t mod;
32 uint8_t wordSize;
33 uint16_t reserved;
34
35 ADCGroupDescriptor();
36 ADCGroupDescriptor(uint8_t const* in);
37 ADCGroupDescriptor(std::wstring const& argString);
38
39#ifdef WITH_BOOST_PROGRAM_OPTIONS
40 static const po::options_description GetOptionDescription();
41#endif
42
43 void GetBytes(std::vector<uint8_t>& out) const;
44 const std::wstring ToString() const;
45 const std::wstring ToSimpleString(uint16_t const globalRate) const;
46};
47
48
49 struct INERTIA_API ADCInputDescriptor
50{
51 ADCDescriptorType type;
52 uint8_t samplingChannel;
53 uint8_t channelPosition; // position in channel
54 uint8_t inputADCIndex;
55 int32_t offset;
56 float scale;
57 ADCInputMode mode;
58 uint32_t reserved;
59 bool adoptOffset, adoptScale;
60
61 ADCInputDescriptor();
62 ADCInputDescriptor(uint8_t const* in);
63 ADCInputDescriptor(std::wstring const& argString);
64
65#ifdef WITH_BOOST_PROGRAM_OPTIONS
66 static const po::options_description GetOptionDescription();
67#endif
68
69 void GetBytes(std::vector<uint8_t>& out) const;
70 const std::wstring ToString() const;
71 const std::wstring ToSimpleString() const;
72};
73
74
75 struct INERTIA_API ADC2Config
76 : GenericConfig
77{
78 std::vector<ADCGroupDescriptor> groups;
79 std::vector<ADCInputDescriptor> inputs;
80
81 ADC2Config();
82 ADC2Config(uint8_t const* in);
83 ADC2Config(std::wstring const& argString);
84
85#ifdef WITH_BOOST_PROGRAM_OPTIONS
86 static const po::options_description GetOptionDescription();
87#endif
88
89 void GetBytes(std::vector<uint8_t>& out) const override;
90 ConfigType GetConfigType() const override;
91 const std::wstring ToString() const override;
92 const ChannelMap GetChannelMap() const;
93};
94
95}
inertia
Definition FlashCommands.h:6
inertia::ADCInputMode
ADCInputMode
Definition ADC2Config.h:16
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::ADCDescriptorType
ADCDescriptorType
Definition ADC2Config.h:10
inertia::ChannelMap
std::map< unsigned, Channel > ChannelMap
Map with Channel information per samplingChannel.
Definition platform.h:58