OpenHantek
controlStructs.h
1 #pragma once
2 
3 #include "controlcode.h"
4 #include "controlcommand.h"
5 #include "types.h"
6 #include "usb/usbdevicedefinitions.h"
7 
8 #include <inttypes.h>
9 #include <memory>
10 
11 namespace Hantek {
12 struct OffsetsPerGainStep;
13 
17 enum BulkIndex {
18  COMMANDINDEX_0 = 0x03,
19  COMMANDINDEX_1 = 0x0a,
20  COMMANDINDEX_2 = 0x09,
21  COMMANDINDEX_3 = 0x01,
22  COMMANDINDEX_4 = 0x02,
23  COMMANDINDEX_5 = 0x08
24 };
25 
28  public:
31  ControlBeginCommand(BulkIndex index = COMMANDINDEX_0);
32 };
33 
36  public:
40  ConnectionSpeed getSpeed();
41 };
42 
49  ControlSetOffset(uint16_t channel1, uint16_t channel2, uint16_t trigger);
50 
54  uint16_t getChannel(ChannelID channel);
58  void setChannel(ChannelID channel, uint16_t offset);
61  uint16_t getTrigger();
64  void setTrigger(uint16_t level);
65 };
66 
76  ControlSetRelays(bool ch1Below1V = false, bool ch1Below100mV = false, bool ch1CouplingDC = false,
77  bool ch2Below1V = false, bool ch2Below100mV = false, bool ch2CouplingDC = false,
78  bool triggerExt = false);
79 
83  bool getBelow1V(ChannelID channel);
87  void setBelow1V(ChannelID channel, bool below);
91  bool getBelow100mV(ChannelID channel);
95  void setBelow100mV(ChannelID channel, bool below);
99  bool getCoupling(ChannelID channel);
103  void setCoupling(ChannelID channel, bool dc);
106  bool getTrigger();
109  void setTrigger(bool ext);
110 };
111 
114  void setDiv(uint8_t val);
115 };
116 
119  void setDiv(uint8_t val);
120 };
121 
124  void setDiv(uint8_t val);
125 };
126 
129 };
130 
132  ControlGetLimits(size_t channels);
133 };
134 }
Definition: controlStructs.h:43
Definition: controlStructs.h:112
void setTrigger(uint16_t level)
Set the trigger level.
Definition: controlStructs.cpp:49
void setTrigger(bool ext)
Set the external trigger relay.
Definition: controlStructs.cpp:110
ControlBeginCommand(BulkIndex index=COMMANDINDEX_0)
Sets the command index to the given value.
Definition: controlStructs.cpp:11
ControlSetRelays(bool ch1Below1V=false, bool ch1Below100mV=false, bool ch1CouplingDC=false, bool ch2Below1V=false, bool ch2Below100mV=false, bool ch2CouplingDC=false, bool triggerExt=false)
Sets all relay states.
Definition: controlStructs.cpp:54
bool getTrigger()
Get the external trigger relay state.
Definition: controlStructs.cpp:108
ConnectionSpeed getSpeed()
Gets the speed of the connection.
Definition: controlStructs.cpp:19
Definition: controlcommand.h:12
void setBelow100mV(ChannelID channel, bool below)
Set the below 100 mV relay for the given channel.
Definition: controlStructs.cpp:87
Definition: controlsettings.h:8
bool getCoupling(ChannelID channel)
Get the coupling relay state for the given channel.
Definition: controlStructs.cpp:94
Definition: controlStructs.h:122
Definition: controlStructs.h:67
uint16_t getTrigger()
Get the trigger level.
Definition: controlStructs.cpp:47
void setChannel(ChannelID channel, uint16_t offset)
Set the offset for the given channel.
Definition: controlStructs.cpp:37
void setBelow1V(ChannelID channel, bool below)
Set the below 1 V relay for the given channel.
Definition: controlStructs.cpp:73
bool getBelow1V(ChannelID channel)
Get the below 1 V relay state for the given channel.
Definition: controlStructs.cpp:66
The CONTROL_GETSPEED parser.
Definition: controlStructs.h:35
Definition: controlStructs.h:131
uint16_t getChannel(ChannelID channel)
Get the offset for the given channel.
Definition: controlStructs.cpp:30
Definition: controlStructs.h:117
Definition: controlStructs.h:127
Definition: controlStructs.h:27
bool getBelow100mV(ChannelID channel)
Get the below 1 V relay state for the given channel.
Definition: controlStructs.cpp:80
void setCoupling(ChannelID channel, bool dc)
Set the coupling relay for the given channel.
Definition: controlStructs.cpp:101