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