1
1
/*
2
- * SimpleTouchScreenDSO .h
2
+ * SimpleDSO .h
3
3
*
4
- * Copyright (C) 2015 Armin Joachimsmeyer
4
+ * Copyright (C) 2015-2023 Armin Joachimsmeyer
5
5
6
- * License: GPL v3 (http://www.gnu.org/licenses/gpl.html)
6
+ *
7
+ * This file is part of Arduino-Simple-DSO https://github.com/ArminJo/Arduino-Simple-DSO.
8
+ *
9
+ * Arduino-Simple-DSO is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
+ * See the GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
7
21
*/
8
22
9
23
#ifndef _SIMPLE_TOUCHSCREEN_DSO_H
35
49
36
50
#define MILLIS_BETWEEN_INFO_OUTPUT 1000
37
51
38
- /*
39
- * Display size
40
- */
41
- #define REMOTE_DISPLAY_HEIGHT 256 // we use 8 bit resolution and have 256 different analog values
42
- #define REMOTE_DISPLAY_WIDTH DISPLAY_HALF_VGA_WIDTH // 320
43
-
44
52
#define THOUSANDS_SEPARATOR '.'
45
53
46
54
/*
97
105
/*
98
106
* External attenuator values
99
107
*/
100
- #define ATTENUATOR_TYPE_NO_ATTENUATOR 0 // No attenuator at all. Start with aRef = VCC -> see ATTENUATOR_DETECT_PIN_0
101
- #define ATTENUATOR_TYPE_FIXED_ATTENUATOR 1 // Fixed attenuator at Channel0,1,2 assume manual AC/DC switch
102
- #define ATTENUATOR_TYPE_ACTIVE_ATTENUATOR 2 // to be developed
108
+ #define ATTENUATOR_TYPE_NO_ATTENUATOR 0 // No attenuator at all. Start with aRef = VCC -> see ATTENUATOR_DETECT_PIN_0
109
+ #define ATTENUATOR_TYPE_FIXED_ATTENUATOR 1 // Fixed attenuator at Channel0, 1, 2
110
+ #define ATTENUATOR_TYPE_ACTIVE_ATTENUATOR 2 // to be developed
103
111
#define NUMBER_OF_CHANNEL_WITH_ACTIVE_ATTENUATOR 2
104
112
105
113
struct MeasurementControlStruct {
@@ -110,10 +118,10 @@ struct MeasurementControlStruct {
110
118
bool isSingleShotMode ;
111
119
112
120
float VCC ; // Volt of VCC
113
- uint8_t ADCReference ; // DEFAULT = 1 =VCC INTERNAL = 3 = 1.1 volt
121
+ uint8_t ADCReferenceShifted ; // DEFAULT = 1 =VCC INTERNAL = 3 = 1.1 volt
114
122
115
123
// Input select
116
- uint8_t ADCInputMUXChannelIndex ;
124
+ uint8_t ADMUXChannel ;
117
125
uint8_t AttenuatorType ; //ATTENUATOR_TYPE_NO_ATTENUATOR, ATTENUATOR_TYPE_SIMPLE_ATTENUATOR, ATTENUATOR_TYPE_ACTIVE_ATTENUATOR
118
126
bool ChannelHasActiveAttenuator ;
119
127
@@ -175,15 +183,18 @@ extern struct MeasurementControlStruct MeasurementControl;
175
183
176
184
// values for DisplayPage
177
185
// using enums increases code size by 120 bytes for Arduino
178
- #define DISPLAY_PAGE_START 0 // Start GUI
179
- #define DISPLAY_PAGE_CHART 1 // Chart in analyze and running mode
180
- #define DISPLAY_PAGE_SETTINGS 2
181
- #define DISPLAY_PAGE_FREQUENCY 3
182
- #if !defined( AVR )
183
- #define DISPLAY_PAGE_MORE_SETTINGS 4
184
- #define DISPLAY_PAGE_SYST_INFO 5
186
+ #define DSO_PAGE_START 0 // Start GUI
187
+ #define DSO_PAGE_CHART 1 // Chart in analyze and running mode
188
+ #define DSO_PAGE_SETTINGS 2
189
+ #define DSO_PAGE_FREQUENCY 3
190
+ #ifndef AVR
191
+ #define DSO_PAGE_MORE_SETTINGS 4
192
+ #define DSO_PAGE_SYST_INFO 5
185
193
#endif
186
194
195
+ #define DSO_SUB_PAGE_MAIN 0
196
+ #define DSO_SUB_PAGE_FFT 1
197
+
187
198
// modes for showInfoMode
188
199
#define INFO_MODE_NO_INFO 0
189
200
#define INFO_MODE_SHORT_INFO 1
@@ -192,7 +203,9 @@ struct DisplayControlStruct {
192
203
uint8_t TriggerLevelDisplayValue ; // For clearing old line of manual trigger level setting
193
204
int8_t XScale ; // Factor for X Data expansion(>0) 0 = no scale, 2->display 1 value 2 times etc.
194
205
195
- uint8_t DisplayPage ;
206
+ uint8_t DisplayPage ; // START, CHART, SETTINGS, MORE_SETTINGS
207
+ uint8_t DisplaySubPage ; // DSO_SUB_PAGE_FFT
208
+
196
209
bool DrawWhileAcquire ;
197
210
uint8_t showInfoMode ;
198
211
@@ -205,15 +218,15 @@ extern DisplayControlStruct DisplayControl;
205
218
* Data buffer
206
219
*/
207
220
struct DataBufferStruct {
208
- uint8_t DisplayBuffer [REMOTE_DISPLAY_WIDTH ];
221
+ uint8_t DisplayBuffer [DISPLAY_WIDTH ];
209
222
uint8_t * DataBufferNextInPointer ;
210
223
uint8_t * DataBufferNextDrawPointer ; // pointer to DataBuffer - for draw-while-acquire mode
211
224
uint16_t DataBufferNextDrawIndex ; // index in DisplayBuffer - for draw-while-acquire mode
212
225
// to detect end of acquisition in interrupt service routine
213
226
uint8_t * DataBufferEndPointer ;
214
227
// Used to synchronize ISR with main loop
215
228
bool DataBufferFull ;
216
- // AcqusitionSize is REMOTE_DISPLAY_WIDTH except on last acquisition before stop then it is DATABUFFER_SIZE
229
+ // AcqusitionSize is DISPLAY_WIDTH except on last acquisition before stop then it is DATABUFFER_SIZE
217
230
uint16_t AcquisitionSize ;
218
231
// Pointer for horizontal scrolling
219
232
uint8_t * DataBufferDisplayStart ;
0 commit comments