GUIslice  0.16.0
Embedded GUI in C
GUIslice_config.h
Go to the documentation of this file.
1 #ifndef _GUISLICE_CONFIG_H_
2 #define _GUISLICE_CONFIG_H_
3 
4 // =======================================================================
5 // GUIslice library (user configuration) selection by device
6 // - Calvin Hass
7 // - https://www.impulseadventure.com/elec/guislice-gui.html
8 // - https://github.com/ImpulseAdventure/GUIslice
9 // =======================================================================
10 //
11 // The MIT License
12 //
13 // Copyright 2016-2020 Calvin Hass
14 //
15 // Permission is hereby granted, free of charge, to any person obtaining a copy
16 // of this software and associated documentation files (the "Software"), to deal
17 // in the Software without restriction, including without limitation the rights
18 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19 // copies of the Software, and to permit persons to whom the Software is
20 // furnished to do so, subject to the following conditions:
21 //
22 // The above copyright notice and this permission notice shall be included in
23 // all copies or substantial portions of the Software.
24 //
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 // THE SOFTWARE.
32 //
33 // =======================================================================
34 // \file GUIslice_config.h
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif // __cplusplus
40 
41 // Support the loading of config settings through compiler flags
42 // - This is used to support environments such as PlatformIO
43 #ifdef USER_CONFIG_LOADED
44  // If a config file has been specified, the following will load it
45  // Otherwise, all settings must be provided via build flags
46  #ifdef USER_CONFIG_INC_FILE
47  #include USER_CONFIG_INC_FNAME
48  #endif
49 #else
50 
51 // =========================================================================================
52 // SELECT ONE OF THE FOLLOWING EXAMPLE CONFIGURATIONS OR ADD YOUR OWN
53 // - Uncomment one of the following lines
54 // - These example configurations are located in the /configs folder
55 // - To add your own, make a copy of an example config, rename it
56 // and add it to the list here.
57 // - If no line is uncommented, an error message will be reported during compilation
58 // - Refer to https://github.com/ImpulseAdventure/GUIslice/wiki/Display-Config-Table
59 // to help identify a suitable config for your MCU shield / display
60 // - Multiple configurations can be supported using the method described here:
61 // https://github.com/ImpulseAdventure/GUIslice/wiki/Arduino-Multiple-Configs
62 // =========================================================================================
63 
64 // =========================================================================================
65 // IMPORTANT: Ensure you backup any custom config files before updating GUIslice!
66 // The Arduino IDE deletes all files within the library when updating
67 // =========================================================================================
68 
69  // ---------------------------------------------------------------------------------------
70  // Add your own configs here:
71  // ---------------------------------------------------------------------------------------
72 #include "../configs/ard-adagfx-ili9341-stmpe610.h" // my-config
73 
74  // ---------------------------------------------------------------------------------------
75  // Example configs included in library /configs:
76  // ---------------------------------------------------------------------------------------
77 
78  // Arduino, ARM SAMD, Cortex M0/M4, nRF52:
79  // ------------------------------------------------------
80  //#include "../configs/ard-shld-adafruit_18_joy.h"
81  //#include "../configs/ard-shld-adafruit_28_cap.h"
82  //#include "../configs/ard-shld-adafruit_28_res.h"
83  //#include "../configs/ard-shld-eastrising_50_ra8875_res.h"
84  //#include "../configs/ard-shld-eastrising_50_ra8875_sumo_res.h"
85  //#include "../configs/ard-shld-eastrising_50_ssd1963_res.h"
86  //#include "../configs/ard-shld-eastrising_70_ra8876_gv.h"
87  //#include "../configs/ard-shld-elegoo_28_res.h"
88  //#include "../configs/ard-shld-generic1_35_touch.h"
89  //#include "../configs/ard-shld-gevino_tft.h"
90  //#include "../configs/ard-shld-ili9341_16b_touch.h"
91  //#include "../configs/ard-shld-mcufriend.h"
92  //#include "../configs/ard-shld-mcufriend_4wire.h"
93  //#include "../configs/ard-shld-mcufriend_xpt2046.h"
94  //#include "../configs/ard-shld-osmart_22_68130_touch.h"
95  //#include "../configs/ard-shld-waveshare_28_touch.h"
96  //#include "../configs/ard-shld-waveshare_40_notouch.h"
97  //#include "../configs/ard-shld-waveshare_40_xpt2046.h"
98  //#include "../configs/ard-lcdgfx-notouch.h"
99  //#include "../configs/ard-lcdgfx-stmpe610.h"
100  //#include "../configs/ard-adagfx-hx8347-xpt2046.h"
101  //#include "../configs/ard-adagfx-hx8357-ft6206.h"
102  //#include "../configs/ard-adagfx-hx8357-notouch.h"
103  //#include "../configs/ard-adagfx-hx8357-simple.h"
104  //#include "../configs/ard-adagfx-hx8357-stmpe610.h"
105  //#include "../configs/ard-adagfx-ili9341-ft6206.h"
106  //#include "../configs/ard-adagfx-ili9341-input.h"
107  //#include "../configs/ard-adagfx-ili9341-notouch.h"
108  //#include "../configs/ard-adagfx-ili9341-simple.h"
109  //#include "../configs/ard-adagfx-ili9341-stmpe610.h"
110  //#include "../configs/ard-adagfx-ili9341-xpt2046.h"
111  //#include "../configs/ard-adagfx-pcd8544-notouch.h"
112  //#include "../configs/ard-adagfx-ra8875-notouch.h"
113  //#include "../configs/ard-adagfx-ra8876-notouch.h"
114  //#include "../configs/ard-adagfx-ra8876-ft5206.h"
115  //#include "../configs/ard-adagfx-ssd1306-notouch.h"
116  //#include "../configs/ard-adagfx-st7735-notouch.h"
117  //#include "../configs/due-adagfx-ili9225-notouch.h"
118  //#include "../configs/due-adagfx-ili9341-ft6206.h"
119  //#include "../configs/due-adagfx-ili9341-urtouch.h"
120  //#include "../configs/due-adagfx-ra8875-urtouch.h"
121 
122  // ESP8266, ESP32, M5stack, TTGO:
123  // ------------------------------------------------------
124  //#include "../configs/esp-shld-m5stack.h"
125  //#include "../configs/esp-shld-ttgo_btc_ticker.h"
126  //#include "../configs/esp-tftespi-default-ft6206.h"
127  //#include "../configs/esp-tftespi-default-notouch.h"
128  //#include "../configs/esp-tftespi-default-simple.h"
129  //#include "../configs/esp-tftespi-default-stmpe610.h"
130  //#include "../configs/esp-tftespi-default-xpt2046.h"
131  //#include "../configs/esp-tftespi-default-xpt2046_int.h"
132 
133  // Teensy:
134  // ------------------------------------------------------
135  //#include "../configs/teensy-adagfx-ili9341-xpt2046.h"
136  //#include "../configs/teensy-adagfx-ili9341-xpt2046-audio.h"
137  //#include "../configs/teensy-adagfx-ili9341_t3-xpt2046.h"
138  //#include "../configs/teensy-adagfx-ili9341_t3-notouch-audio.h"
139  //#include "../configs/teensy-adagfx-ili9341_t3-xpt2046-audio.h"
140 
141  // STM32:
142  // ------------------------------------------------------
143  //#include "../configs/stm32-adagfx-mcufriend-notouch.h"
144  //#include "../configs/stm32-adagfx-mcufriend-simple.h"
145 
146  // Multi-device shields:
147  // ------------------------------------------------------
148  //#include "../configs/mult-shld-adafruit_24_feather_touch.h"
149  //#include "../configs/mult-shld-adafruit_35_feather_touch.h"
150 
151  // Raspberry Pi / LINUX:
152  // ------------------------------------------------------
153  //#include "../configs/rpi-sdl1-default-tslib.h"
154  //#include "../configs/rpi-sdl1-default-sdl.h"
155  //#include "../configs/linux-sdl1-default-mouse.h"
156 
157 #endif // USER_CONFIG_LOADED
158 
159 // =========================================================================================
160 // DETECT DEVICE PLATFORM
161 // =========================================================================================
162 
163 // Detect device platform
164 #if defined(__linux__)
165  #define GSLC_CFG_LINUX
166 #elif defined(__AVR__) && !defined(TEENSYDUINO)
167  // Note: Teensy 2 also defines __AVR__, so differentiate with TEENSYDUINO
168  #define GSLC_CFG_ARD
169 #elif defined(ARDUINO_SAMD_ZERO)
170  #define GSLC_CFG_ARD
171 #elif defined(ESP8266) || defined(ESP32)
172  #define GSLC_CFG_ARD
173 #elif defined(NRF52)
174  #define GSLC_CFG_ARD
175 #elif defined(ARDUINO_STM32_FEATHER) || defined(__STM32F1__)
176  #define GSLC_CFG_ARD
177 #elif defined(ARDUINO_ARCH_STM32) // ST Core from STMicroelectronics
178  #define GSLC_CFG_ARD
179 #elif defined(ARDUINO_ARCH_SAM) // Arduino Due
180  #define GSLC_CFG_ARD
181 #elif defined(ARDUINO_ARCH_SAMD) // M0_PRO
182  #define GSLC_CFG_ARD
183 #elif defined(__AVR__) && defined(TEENSYDUINO) // Teensy 2
184  #define GSLC_CFG_ARD
185  #define GSLC_DEV_TEENSY
186  #define GSLC_DEV_TEENSY_2
187 #elif defined(__MKL26Z64__) // Teensy LC
188  #define GSLC_CFG_ARD
189  #define GSLC_DEV_TEENSY
190  #define GSLC_DEV_TEENSY_LC
191 #elif defined(__MK20DX256__) // Teensy 3.2
192  #define GSLC_CFG_ARD
193  #define GSLC_DEV_TEENSY
194  #define GSLC_DEV_TEENSY_3_2
195 #elif defined(__MK64FX512__) // Teensy 3.5
196  #define GSLC_CFG_ARD
197  #define GSLC_DEV_TEENSY
198  #define GSLC_DEV_TEENSY_3_5
199 #elif defined(__MK66FX1M0__) // Teensy 3.6
200  #define GSLC_CFG_ARD
201  #define GSLC_DEV_TEENSY
202  #define GSLC_DEV_TEENSY_3_6
203 #elif defined(__IMXRT1062__) // Teensy 4.0
204  //#elif defined(ARDUINO_TEENSY40)
205  //#elif defined(ARDUINO_TEENSY41)
206  #define GSLC_CFG_ARD
207  #define GSLC_DEV_TEENSY
208  #define GSLC_DEV_TEENSY_4_0
209 #else
210  #warning Unknown device platform
211 #endif
212 
213 // =========================================================================================
214 // DEFAULT COMBINED CONFIGURATION FILE
215 // - If no user configuration has been selected, an error will be reported here.
216 // - Note that the include guard _GUISLICE_CONFIG_ARD_H_ and _GUISLICE_CONFIG_LINUX_H_
217 // is defined in all of the example config files, so we can test for it here
218 // to determine if one was loaded.
219 // =========================================================================================
220 
221 #ifndef USER_CONFIG_LOADED
222  #if !defined(_GUISLICE_CONFIG_ARD_H_) && !defined(_GUISLICE_CONFIG_LINUX_H_)
223  #error No config selected in GUIslice_config.h. Please uncomment/select a config.
224  #error For details: https://github.com/ImpulseAdventure/GUIslice/wiki/Select-a-Config
225  #endif
226 #endif // USER_CONFIG_LOADED
227 
228 // -----------------------------------------------------------------------------------------
229 
230 #ifdef __cplusplus
231 }
232 #endif // __cplusplus
233 #endif // _GUISLICE_CONFIG_H_