-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathesp-shld-m5stack.h
More file actions
211 lines (172 loc) · 9.01 KB
/
esp-shld-m5stack.h
File metadata and controls
211 lines (172 loc) · 9.01 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#ifndef _GUISLICE_CONFIG_ARD_H_
#define _GUISLICE_CONFIG_ARD_H_
// =============================================================================
// GUIslice library (example user configuration) for:
// - CPU: M5stack (ESP32)
// - Display: Integrated
// - Touch: Integrated 3-button
// - Wiring: Shield
//
// - Example display:
// - M5stack
//
// DIRECTIONS:
// - To use this example configuration, include in "GUIslice_config.h"
//
// WIRING:
// - As this config file is designed for a shield, no additional
// wiring is required to support the GUI operation
//
// =============================================================================
// - Calvin Hass
// - https://github.com/ImpulseAdventure/GUIslice
// =============================================================================
//
// The MIT License
//
// Copyright 2016-2020 Calvin Hass
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// =============================================================================
// \file GUIslice_config_ard.h
// =============================================================================
// User Configuration
// - This file can be modified by the user to match the
// intended target configuration
// =============================================================================
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// =============================================================================
// USER DEFINED CONFIGURATION
// =============================================================================
// -----------------------------------------------------------------------------
// SECTION 1: Device Mode Selection
// - The following defines the display and touch drivers
// and should not require modifications for this example config
// -----------------------------------------------------------------------------
#define DRV_DISP_M5STACK // M5stack/M5stack library
#define DRV_TOUCH_M5STACK // M5stack integrated button driver
#define DRV_TOUCH_IN_DISP // Integrated touch driver
// -----------------------------------------------------------------------------
// SECTION 2: Pinout
// -----------------------------------------------------------------------------
// M5stack: additional pins
#define TFT_LIGHT_PIN 32 // display backlight
// -----------------------------------------------------------------------------
// SECTION 3: Orientation
// -----------------------------------------------------------------------------
// Set Default rotation of the display
// - Values 0,1,2,3. Rotation is clockwise
#define GSLC_ROTATE 1
// -----------------------------------------------------------------------------
// SECTION 4: Touch Handling
// - Documentation for configuring touch support can be found at:
// https://github.com/ImpulseAdventure/GUIslice/wiki/Configure-Touch-Support
// -----------------------------------------------------------------------------
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// SECTION 4D: Additional touch configuration
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// M5stack: Long Press Detection
// NOTE: Long-press detection is only available in the latest
// M5stack library releases. Uncomment the following
// if the Btn wasReleasefor() API is available.
//
// Define duration (in ms) for a long-press button event
//#define M5STACK_TOUCH_PRESS_LONG 300
// -----------------------------------------------------------------------------
// SECTION 5: Diagnostics
// -----------------------------------------------------------------------------
// Error reporting
// - Set DEBUG_ERR to >0 to enable error reporting via the Serial connection
// - Enabling DEBUG_ERR increases FLASH memory consumption which may be
// limited on the baseline Arduino (ATmega328P) devices.
// - DEBUG_ERR 0 = Disable all error messaging
// - DEBUG_ERR 1 = Enable critical error messaging (eg. init)
// - DEBUG_ERR 2 = Enable verbose error messaging (eg. bad parameters, etc.)
// - For baseline Arduino UNO, recommended to disable this after one has
// confirmed basic operation of the library is successful.
#define DEBUG_ERR 1 // 1,2 to enable, 0 to disable
// Debug initialization message
// - By default, GUIslice outputs a message in DEBUG_ERR mode
// to indicate the initialization status, even during success.
// - To disable the messages during successful initialization,
// uncomment the following line.
//#define INIT_MSG_DISABLE
// -----------------------------------------------------------------------------
// SECTION 6: Optional Features
// -----------------------------------------------------------------------------
// Enable of optional features
// - For memory constrained devices such as Arduino, it is best to
// set the following features to 0 (to disable) unless they are
// required.
#define GSLC_FEATURE_COMPOUND 0 // Compound elements (eg. XSelNum)
#define GSLC_FEATURE_XTEXTBOX_EMBED 0 // XTextbox control with embedded color
#define GSLC_FEATURE_INPUT 1 // M5stack: built-in physical buttons
// Enable support for SD card
// - Set to 1 to enable, 0 to disable
// - Note that the inclusion of the SD library consumes considerable
// RAM and flash memory which could be problematic for Arduino models
// with limited resources.
#define GSLC_SD_EN 0
#define GSLC_FS_EN 1
// =============================================================================
// SECTION 10: INTERNAL CONFIGURATION
// - The following settings should not require modification by users
// =============================================================================
// -----------------------------------------------------------------------------
// Touch Handling
// -----------------------------------------------------------------------------
// Define the maximum number of touch events that are handled
// per gslc_Update() call. Normally this can be set to 1 but certain
// displays may require a greater value (eg. 30) in order to increase
// responsiveness of the touch functionality.
#define GSLC_TOUCH_MAX_EVT 1
// -----------------------------------------------------------------------------
// Misc
// -----------------------------------------------------------------------------
// Define buffer size for loading images from SD
// - A larger buffer will be faster but at the cost of RAM
#define GSLC_SD_BUFFPIXEL 50
// Enable support for graphics clipping (DrvSetClipRect)
// - Note that this will impact performance of drawing graphics primitives
#define GSLC_CLIP_EN 0
// Enable for bitmap transparency and definition of color to use
#define GSLC_BMP_TRANS_EN 1 // 1 = enabled, 0 = disabled
#define GSLC_BMP_TRANS_RGB 0xFF,0x00,0xFF // RGB color (default: MAGENTA)
#define GSLC_USE_FLOAT 0 // 1=Use floating pt library, 0=Fixed-point lookup tables
#define GSLC_DEV_TOUCH ""
#define GSLC_USE_PROGMEM 0
#define GSLC_LOCAL_STR 0 // 1=Use local strings (in element array), 0=External
#define GSLC_LOCAL_STR_LEN 30 // Max string length of text elements
// -----------------------------------------------------------------------------
// Debug diagnostic modes
// -----------------------------------------------------------------------------
// - Uncomment any of the following to enable specific debug modes
//#define DBG_LOG // Enable debugging log output
//#define DBG_TOUCH // Enable debugging of touch-presses
//#define DBG_FRAME_RATE // Enable diagnostic frame rate reporting
//#define DBG_DRAW_IMM // Enable immediate rendering of drawing primitives
//#define DBG_DRIVER // Enable graphics driver debug reporting
// =============================================================================
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // _GUISLICE_CONFIG_ARD_H_