Skip to content

Commit 6974fca

Browse files
committed
New library version
1 parent 5b26af3 commit 6974fca

8 files changed

+594
-632
lines changed

.github/workflows/TestCompile.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TestCompile.yml
22
# Github workflow script to test compile all examples of an Arduino library repository.
33
#
4-
# Copyright (C) 2020 Armin Joachimsmeyer
4+
# Copyright (C) 2020-2023 Armin Joachimsmeyer
55
# https://github.com/ArminJo/Github-Actions
66
#
77

@@ -16,16 +16,16 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@master
1818

19-
# - name: Checkout custom library
20-
# uses: actions/checkout@v3
21-
# with:
22-
# repository: ArminJo/Arduino-BlueDisplay
23-
# ref: master
24-
# path: CustomLibrary_BlueDisplay # must contain string "Custom"
19+
- name: Checkout new BlueDisplay library
20+
uses: actions/checkout@v3
21+
with:
22+
repository: ArminJo/Arduino-BlueDisplay
23+
ref: master
24+
path: CustomLibrary_BD # must contain string "Custom"
25+
# Must remove BlueDisplay from REQUIRED_LIBRARIES
2526

2627
- name: Compile all examples
2728
uses: ArminJo/arduino-test-compile@master
2829
with:
29-
sketch-names: SimpleDSO.cpp
30-
build-properties: '{ "All": "-DUSE_SIMPLE_SERIAL" }'
31-
required-libraries: BlueDisplay
30+
sketch-names: SimpleDSO.ino
31+
# required-libraries: BlueDisplay

FrequencyGeneratorPage.hpp

+124-132
Large diffs are not rendered by default.

SimpleDSO.h

+37-24
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
/*
2-
* SimpleTouchScreenDSO.h
2+
* SimpleDSO.h
33
*
4-
* Copyright (C) 2015 Armin Joachimsmeyer
4+
* Copyright (C) 2015-2023 Armin Joachimsmeyer
55
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>.
721
*/
822

923
#ifndef _SIMPLE_TOUCHSCREEN_DSO_H
@@ -35,12 +49,6 @@
3549

3650
#define MILLIS_BETWEEN_INFO_OUTPUT 1000
3751

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-
4452
#define THOUSANDS_SEPARATOR '.'
4553

4654
/*
@@ -97,9 +105,9 @@
97105
/*
98106
* External attenuator values
99107
*/
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
103111
#define NUMBER_OF_CHANNEL_WITH_ACTIVE_ATTENUATOR 2
104112

105113
struct MeasurementControlStruct {
@@ -110,10 +118,10 @@ struct MeasurementControlStruct {
110118
bool isSingleShotMode;
111119

112120
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
114122

115123
// Input select
116-
uint8_t ADCInputMUXChannelIndex;
124+
uint8_t ADMUXChannel;
117125
uint8_t AttenuatorType; //ATTENUATOR_TYPE_NO_ATTENUATOR, ATTENUATOR_TYPE_SIMPLE_ATTENUATOR, ATTENUATOR_TYPE_ACTIVE_ATTENUATOR
118126
bool ChannelHasActiveAttenuator;
119127

@@ -175,15 +183,18 @@ extern struct MeasurementControlStruct MeasurementControl;
175183

176184
// values for DisplayPage
177185
// 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
185193
#endif
186194

195+
#define DSO_SUB_PAGE_MAIN 0
196+
#define DSO_SUB_PAGE_FFT 1
197+
187198
// modes for showInfoMode
188199
#define INFO_MODE_NO_INFO 0
189200
#define INFO_MODE_SHORT_INFO 1
@@ -192,7 +203,9 @@ struct DisplayControlStruct {
192203
uint8_t TriggerLevelDisplayValue; // For clearing old line of manual trigger level setting
193204
int8_t XScale; // Factor for X Data expansion(>0) 0 = no scale, 2->display 1 value 2 times etc.
194205

195-
uint8_t DisplayPage;
206+
uint8_t DisplayPage; // START, CHART, SETTINGS, MORE_SETTINGS
207+
uint8_t DisplaySubPage; // DSO_SUB_PAGE_FFT
208+
196209
bool DrawWhileAcquire;
197210
uint8_t showInfoMode;
198211

@@ -205,15 +218,15 @@ extern DisplayControlStruct DisplayControl;
205218
* Data buffer
206219
*/
207220
struct DataBufferStruct {
208-
uint8_t DisplayBuffer[REMOTE_DISPLAY_WIDTH];
221+
uint8_t DisplayBuffer[DISPLAY_WIDTH];
209222
uint8_t * DataBufferNextInPointer;
210223
uint8_t * DataBufferNextDrawPointer; // pointer to DataBuffer - for draw-while-acquire mode
211224
uint16_t DataBufferNextDrawIndex; // index in DisplayBuffer - for draw-while-acquire mode
212225
// to detect end of acquisition in interrupt service routine
213226
uint8_t * DataBufferEndPointer;
214227
// Used to synchronize ISR with main loop
215228
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
217230
uint16_t AcquisitionSize;
218231
// Pointer for horizontal scrolling
219232
uint8_t * DataBufferDisplayStart;

0 commit comments

Comments
 (0)