OpenHantek
Toggle main menu visibility
Loading...
Searching...
No Matches
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
{
36
uint8_t
step
[
HANTEK_GAIN_STEPS
][
HANTEK_CHANNEL_NUMBER
];
37
};
38
39
struct
Offsets
{
40
Steps
ls
;
41
Steps
hs
;
42
};
43
44
struct
CalibrationValues
{
45
Offsets
off
;
46
Steps
gain
;
47
Offsets
fine
;
48
};
49
50
#pragma pack( pop )
51
52
}
// namespace Hantek
HANTEK_CHANNEL_NUMBER
#define HANTEK_CHANNEL_NUMBER
Definition
definitions.h:10
HANTEK_GAIN_STEPS
#define HANTEK_GAIN_STEPS
Definition
definitions.h:9
Hantek
Definition
controlsettings.h:9
Hantek::UsedChannels
UsedChannels
The enabled channels.
Definition
definitions.h:15
Hantek::UsedChannels::USED_CH1CH2
@ USED_CH1CH2
Channel 1 and 2 are both activated.
Definition
definitions.h:19
Hantek::UsedChannels::USED_CH1
@ USED_CH1
Only channel 1 is activated.
Definition
definitions.h:17
Hantek::UsedChannels::USED_NONE
@ USED_NONE
No channels are activated.
Definition
definitions.h:16
Hantek::UsedChannels::USED_CH2
@ USED_CH2
Only channel 2 is activated.
Definition
definitions.h:18
Hantek::CalibrationValues
Definition
definitions.h:44
Hantek::CalibrationValues::off
Offsets off
Definition
definitions.h:45
Hantek::CalibrationValues::gain
Steps gain
Definition
definitions.h:46
Hantek::CalibrationValues::fine
Offsets fine
Definition
definitions.h:47
Hantek::Offsets
Definition
definitions.h:39
Hantek::Offsets::hs
Steps hs
Definition
definitions.h:41
Hantek::Offsets::ls
Steps ls
Definition
definitions.h:40
Hantek::Steps
Definition
definitions.h:35
Hantek::Steps::step
uint8_t step[HANTEK_GAIN_STEPS][HANTEK_CHANNEL_NUMBER]
Definition
definitions.h:36
hantekprotocol
definitions.h
Generated by
1.17.0