-
Notifications
You must be signed in to change notification settings - Fork 2
/
dso.h
112 lines (93 loc) · 2.07 KB
/
dso.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
dso.h: structuresand dinitions specific to the Hantek 6022 'scope.
Copyright (C) 2018 P G Duesbury: based on Open6022-QT by G Carmix.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef DSO_H
#define DSO_H
#include "HT6022.h"
typedef enum DSO_TDIV
{
TDIV_20NS,
TDIV_50NS,
TDIV_100NS,
TDIV_200NS,
TDIV_500NS,
TDIV_1US,
TDIV_2US,
TDIV_5US,
TDIV_10US,
TDIV_20US,
TDIV_50US,
TDIV_100US,
TDIV_200US,
TDIV_500US,
TDIV_1MS,
TDIV_2MS,
TDIV_5MS,
TDIV_10MS,
TDIV_20MS,
TDIV_50MS,
TDIV_100MS
} DSO_TDIV;
typedef enum
{
AUTO,
NORMAL,
SINGLE,
HOLD
} DSO_MODE_TypeDef;
typedef enum
{
STOP,
RUN
} DSO_STATUS_TypeDef;
typedef struct
{
HT6022_SRTypeDef SR ;
double Tdiv;
double Ts;
int SubSample;
HT6022_DataSizeTypeDef MemDepth;
} ComboSampleTypeDef;
typedef struct DSO_SET
{
DSO_STATUS_TypeDef Status;
DSO_MODE_TypeDef Mode;
int ChTrigger;
int ChAdd;
int TriggerDelay;
int SubSample;
int DisplayDepth;
int MemDepth;
int Pos;
double Ts; // as displayed; takes account of subsampling
double Tdiv;
double VTrigger;
double TriggerOffset; // offset between trigger delay display and sampled data
} DSO_SET;
typedef struct DSO_CHANNEL
{
double VScale;
double Vdiv;
double VOffset;
double Zero;
int16_t index;
HT6022_IRTypeDef VRange;
bool Enabled;
bool Inv;
bool Glitch;
} DSO_CHANNEL;
extern HT6022_DeviceTypeDef Device;
extern DSO_CHANNEL Channel1, Channel2;
extern DSO_SET Dso;
#endif // DSO_H