OpenHantek
definitions.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #pragma once
4 
5 #include <QMetaType>
6 #include <QString>
7 #include <stdint.h>
8 
9 #define HANTEK_GAIN_STEPS 8
10 #define HANTEK_CHANNEL_NUMBER 2
11 
12 namespace Hantek {
15 enum class UsedChannels : uint8_t {
16  USED_NONE,
17  USED_CH1,
18  USED_CH2,
19  USED_CH1CH2,
20 };
21 
22 #pragma pack( push, 1 )
23 
24 // The strct reflects the offset layout in EEPROM
25 // All values are offset binariy bytes (0 -> 0x80)
26 // The 1st 32 bytes are already factory calibration values
27 // 16 byte offset at low speed: CH0@20mV, CH1@20mV, CH0@50mV,...,CH1@5V
28 // 16 byte offset at high speed: CH0@20mV, CH1@20mV, CH0@50mV,...,CH1@5V
29 // The next 16 bytes are written by python calibration tool
30 // 16 byte gain: CH0@20mV, CH1@20mV, CH0@50mV,...,CH1@5V
31 // The next 32 bytes are an optional fractional part of offset (*250)
32 // 16 byte offset (ls) fractional part: CH0@20mV, CH1@20mV, CH0@50mV,...,CH1@5V
33 // 16 byte offset (hs) fractional part: CH0@20mV, CH1@20mV, CH0@50mV,...,CH1@5V
34 
35 struct Steps {
37 };
38 
39 struct Offsets {
42 };
43 
48 };
49 
50 #pragma pack( pop )
51 
52 } // namespace Hantek
Definition: definitions.h:35
Only channel 2 is activated.
#define HANTEK_CHANNEL_NUMBER
Definition: definitions.h:10
Definition: controlsettings.h:9
No channels are activated.
Steps hs
Definition: definitions.h:41
Definition: definitions.h:39
Offsets fine
Definition: definitions.h:47
Steps ls
Definition: definitions.h:40
uint8_t step[HANTEK_GAIN_STEPS][HANTEK_CHANNEL_NUMBER]
Definition: definitions.h:36
Offsets off
Definition: definitions.h:45
#define HANTEK_GAIN_STEPS
Definition: definitions.h:9
Only channel 1 is activated.
Steps gain
Definition: definitions.h:46
Channel 1 and 2 are both activated.
UsedChannels
The enabled channels.
Definition: definitions.h:15
Definition: definitions.h:44