Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 9.38 KB | None | 0 0
  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-2019 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. // =========================================================================================
  42. // SELECT ONE OF THE FOLLOWING EXAMPLE CONFIGURATIONS OR ADD YOUR OWN
  43. // - Uncomment one of the following lines
  44. // - These example configurations are located in the /configs folder
  45. // - To add your own, make a copy of an example config, rename it
  46. //   and add it to the list here.
  47. // - If no line is uncommented, then the default combined configuration
  48. //   file will be used, ie. GUIslice_config_ard.h / GUIslice_config_linux.h
  49. //   which is selected at the bottom of this file
  50. // - Refer to https://github.com/ImpulseAdventure/GUIslice/wiki/Display-Config-Table
  51. //   to help identify a suitable config for your MCU shield / display
  52. // - Multiple configurations can be supported using the method described here:
  53. //   https://github.com/ImpulseAdventure/GUIslice/wiki/Arduino-Multiple-Configs
  54. // =========================================================================================
  55.  
  56. // =========================================================================================
  57. // IMPORTANT: Ensure you backup any custom config files before updating GUIslice!
  58. //            The Arduino IDE deletes all files within the library when updating
  59. // =========================================================================================
  60.  
  61.   // ---------------------------------------------------------------------------------------
  62.   // Add your own configs here:
  63.   // ---------------------------------------------------------------------------------------
  64.   //#include "../configs/my-config.h"
  65.  
  66.   // ---------------------------------------------------------------------------------------
  67.   // Example configs included in library /configs:
  68.   // ---------------------------------------------------------------------------------------
  69.  
  70.   // Arduino, ARM SAMD, Cortex M0/M4, nRF52:
  71.   // ------------------------------------------------------
  72.   //#include "../configs/ard-shld-adafruit_18_joy.h"
  73.   //#include "../configs/ard-shld-adafruit_28_cap.h"
  74.   //#include "../configs/ard-shld-adafruit_28_res.h"
  75.   //#include "../configs/ard-shld-eastrising_50_ra8875_res.h"
  76.   #include "../configs/ard-shld-eastrising_50_ra8875_sumo_res.h"
  77.   //#include "../configs/ard-shld-eastrising_50_ssd1963_res.h"  
  78.   //#include "../configs/ard-shld-elegoo_28_res.h"
  79.   //#include "../configs/ard-shld-generic1_35_touch.h"
  80.   //#include "../configs/ard-shld-ili9341_16b_touch.h"
  81.   //#include "../configs/ard-shld-mcufriend.h"
  82.   //#include "../configs/ard-shld-mcufriend_4wire.h"
  83.   //#include "../configs/ard-shld-mcufriend_xpt2046.h"
  84.   //#include "../configs/ard-shld-osmart_22_68130_touch.h"
  85.   //#include "../configs/ard-shld-waveshare_28_touch.h"
  86.   //#include "../configs/ard-shld-waveshare_40_notouch.h"
  87.   //#include "../configs/ard-shld-waveshare_40_xpt2046.h"
  88.   //#include "../configs/ard-adagfx-hx8347-xpt2046.h"
  89.   //#include "../configs/ard-adagfx-hx8357-ft6206.h"
  90.   //#include "../configs/ard-adagfx-hx8357-notouch.h"
  91.   //#include "../configs/ard-adagfx-hx8357-simple.h"
  92.   //#include "../configs/ard-adagfx-hx8357-stmpe610.h"
  93.   //#include "../configs/ard-adagfx-ili9341-ft6206.h"
  94.   //#include "../configs/ard-adagfx-ili9341-input.h"
  95.   //#include "../configs/ard-adagfx-ili9341-notouch.h"
  96.   //#include "../configs/ard-adagfx-ili9341-simple.h"
  97.   //#include "../configs/ard-adagfx-ili9341-stmpe610.h"
  98.   //#include "../configs/ard-adagfx-ili9341-xpt2046.h"
  99.   //#include "../configs/ard-adagfx-pcd8544-notouch.h"
  100.   //#include "../configs/ard-adagfx-ra8875-notouch.h"
  101.   //#include "../configs/ard-adagfx-ra8876-notouch.h"
  102.   //#include "../configs/ard-adagfx-ra8876-ft5206.h"
  103.   //#include "../configs/ard-adagfx-ssd1306-notouch.h"
  104.   //#include "../configs/ard-adagfx-st7735-notouch.h"
  105.   //#include "../configs/due-adagfx-ili9341-ft6206.h"
  106.   //#include "../configs/due-adagfx-ili9341-urtouch.h"
  107.  
  108.   // ESP8266, ESP32, M5stack, TTGO:
  109.   // ------------------------------------------------------
  110.   //#include "../configs/esp-shld-m5stack.h"
  111.   //#include "../configs/esp-shld-ttgo_btc_ticker.h"
  112.   //#include "../configs/esp-tftespi-default-ft6206.h"
  113.   //#include "../configs/esp-tftespi-default-notouch.h"
  114.   //#include "../configs/esp-tftespi-default-simple.h"
  115.   //#include "../configs/esp-tftespi-default-stmpe610.h"
  116.   //#include "../configs/esp-tftespi-default-xpt2046.h"
  117.   //#include "../configs/esp-tftespi-default-xpt2046_int.h"
  118.  
  119.   // Teensy:
  120.   // ------------------------------------------------------
  121.   //#include "../configs/teensy-adagfx-ili9341-xpt2046.h"
  122.   //#include "../configs/teensy-adagfx-ili9341-xpt2046-audio.h"
  123.   //#include "../configs/teensy-adagfx-ili9341_t3-xpt2046.h"
  124.   //#include "../configs/teensy-adagfx-ili9341_t3-xpt2046-audio.h"
  125.  
  126.   // STM32:
  127.   // ------------------------------------------------------
  128.   //#include "../configs/stm32-adagfx-mcufriend-notouch.h"
  129.   //#include "../configs/stm32-adagfx-mcufriend-simple.h"
  130.  
  131.   // Multi-device shields:
  132.   // ------------------------------------------------------
  133.   //#include "../configs/mult-shld-adafruit_24_feather_touch.h"
  134.   //#include "../configs/mult-shld-adafruit_35_feather_touch.h"
  135.  
  136.   // Raspberry Pi / LINUX:
  137.   // ------------------------------------------------------
  138.   //#include "../configs/rpi-sdl1-default-tslib.h"
  139.   //#include "../configs/rpi-sdl1-default-sdl.h"
  140.   //#include "../configs/linux-sdl1-default-mouse.h"
  141.  
  142.  
  143. // =========================================================================================
  144. // DETECT DEVICE PLATFORM
  145. // =========================================================================================
  146.  
  147. // Detect device platform
  148. #if defined(__linux__)
  149.   #define GSLC_CFG_LINUX
  150. #elif defined(__AVR__) && !defined(TEENSYDUINO)
  151.   // Note: Teensy 2 also defines __AVR__, so differentiate with TEENSYDUINO
  152.   #define GSLC_CFG_ARD
  153. #elif defined(ARDUINO_SAMD_ZERO)
  154.   #define GSLC_CFG_ARD
  155. #elif defined(ESP8266) || defined(ESP32)
  156.   #define GSLC_CFG_ARD
  157. #elif defined(NRF52)
  158.   #define GSLC_CFG_ARD
  159. #elif defined(ARDUINO_STM32_FEATHER) || defined(__STM32F1__)
  160.   #define GSLC_CFG_ARD
  161. #elif defined(ARDUINO_ARCH_STM32)  // ST Core from STMicroelectronics
  162.   #define GSLC_CFG_ARD
  163. #elif defined(ARDUINO_ARCH_SAM)   // Arduino Due
  164.   #define GSLC_CFG_ARD
  165. #elif defined(ARDUINO_ARCH_SAMD)   // M0_PRO
  166.   #define GSLC_CFG_ARD
  167. #elif defined(__AVR__) && defined(TEENSYDUINO) // Teensy 2
  168.   #define GSLC_DEV_TEENSY_2
  169.   #define GSLC_CFG_ARD
  170. #elif defined(__MKL26Z64__) // Teensy LC
  171.   #define GSLC_CFG_ARD
  172.   #define GSLC_DEV_TEENSY_LC
  173. #elif defined(__MK20DX256__) // Teensy 3.2
  174.   #define GSLC_CFG_ARD
  175.   #define GSLC_DEV_TEENSY_3_2
  176. #elif defined(__MK64FX512__) // Teensy 3.5
  177.   #define GSLC_CFG_ARD
  178.   #define GSLC_DEV_TEENSY_3_5
  179. #elif defined(__MK66FX1M0__) // Teensy 3.6
  180.   #define GSLC_CFG_ARD
  181.   #define GSLC_DEV_TEENSY_3_6
  182. #elif defined(__IMXRT1062__)
  183.   #define GSLC_CFG_ARD
  184.   #define GSLC_DEV_TEENSY_4_0
  185. #else
  186. #warning Unknown
  187.   #error "Unknown device platform"
  188. #endif
  189.  
  190. // =========================================================================================
  191. // DEFAULT COMBINED CONFIGURATION FILE
  192. // - If no user configuration has been selected, a default config will be selected here
  193. // - Note that the include guard _GUISLICE_CONFIG_ARD_H_ and _GUISLICE_CONFIG_LINUX_H_
  194. //   will prevent these from loading if any of the user configs have been loaded
  195. // =========================================================================================
  196.  
  197. #if defined(GSLC_CFG_LINUX)
  198.   #include "GUIslice_config_linux.h"
  199. #elif defined(GSLC_CFG_ARD)
  200.   #include "GUIslice_config_ard.h"
  201. #endif
  202.  
  203. // -----------------------------------------------------------------------------------------
  204.  
  205. #ifdef __cplusplus
  206. }
  207. #endif // __cplusplus
  208. #endif // _GUISLICE_CONFIG_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement