Advertisement
Guest User

Untitled

a guest
Feb 13th, 2020
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.71 KB | None | 0 0
  1. #ifndef _GUISLICE_CONFIG_ARD_H_
  2. #define _GUISLICE_CONFIG_ARD_H_
  3.  
  4. // =============================================================================
  5. // GUIslice library (example user configuration) for:
  6. //   - CPU:     Arduino UNO / MEGA / etc
  7. //   - Display: RA8875 800x480 SPI
  8. //   - Touch:   None
  9. //   - Wiring:  Custom breakout
  10. //              - Pinout:
  11. //
  12. //   - Example display:
  13. //     -
  14. //
  15. // DIRECTIONS:
  16. // - To use this example configuration, include in "GUIslice_config.h"
  17. //
  18. // WIRING:
  19. // - As this config file is designed for a breakout board, customization
  20. //   of the Pinout in SECTION 2 will be required to match your display.
  21. //
  22. // =============================================================================
  23. // - Calvin Hass
  24. // - https://github.com/ImpulseAdventure/GUIslice
  25. // =============================================================================
  26. //
  27. // The MIT License
  28. //
  29. // Copyright 2016-2019 Calvin Hass
  30. //
  31. // Permission is hereby granted, free of charge, to any person obtaining a copy
  32. // of this software and associated documentation files (the "Software"), to deal
  33. // in the Software without restriction, including without limitation the rights
  34. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  35. // copies of the Software, and to permit persons to whom the Software is
  36. // furnished to do so, subject to the following conditions:
  37. //
  38. // The above copyright notice and this permission notice shall be included in
  39. // all copies or substantial portions of the Software.
  40. //
  41. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  42. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  43. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  44. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  45. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  46. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  47. // THE SOFTWARE.
  48. //
  49. // =============================================================================
  50. // \file GUIslice_config_ard.h
  51.  
  52. // =============================================================================
  53. // User Configuration
  54. // - This file can be modified by the user to match the
  55. //   intended target configuration
  56. // =============================================================================
  57.  
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif // __cplusplus
  61.  
  62.  
  63.   // =============================================================================
  64.   // USER DEFINED CONFIGURATION
  65.   // =============================================================================
  66.  
  67.   // -----------------------------------------------------------------------------
  68.   // SECTION 1: Device Mode Selection
  69.   // - The following defines the display and touch drivers
  70.   //   and should not require modifications for this example config
  71.   // -----------------------------------------------------------------------------
  72.   #define DRV_DISP_ADAGFX           // Adafruit-GFX library
  73.   #define DRV_DISP_ADAGFX_RA8875    // Adafruit RA8875
  74.   #define DRV_TOUCH_NONE            // No touch enabled
  75.  
  76.   // Select the RA8875 display resolution:
  77.   // - RA8875_480x272 = 480x272 (4.3" display)
  78.   // - RA8875_800x480 = 800x480 (5" and 7" displays)
  79.   #define DRV_DISP_ADAGFX_RA8875_INIT RA8875_800x480
  80.  
  81.   // -----------------------------------------------------------------------------
  82.   // SECTION 2: Pinout
  83.   // -----------------------------------------------------------------------------
  84.  
  85.   // For shields, the following pinouts are typically hardcoded
  86.   #define ADAGFX_PIN_CS       10    // Display chip select
  87.   #define ADAGFX_PIN_RST      9     // Display Reset
  88.  
  89.   // SD Card
  90.   #define ADAGFX_PIN_SDCS     4     // SD card chip select (if GSLC_SD_EN=1)
  91.  
  92.  
  93.  
  94.   // -----------------------------------------------------------------------------
  95.   // SECTION 3: Orientation
  96.   // -----------------------------------------------------------------------------
  97.  
  98.   // Set Default rotation of the display
  99.   // - Values 0,1,2,3. Rotation is clockwise
  100.   #define GSLC_ROTATE     1
  101.  
  102.  
  103.   // -----------------------------------------------------------------------------
  104.   // SECTION 5: Diagnostics
  105.   // -----------------------------------------------------------------------------
  106.  
  107.   // Error reporting
  108.   // - Set DEBUG_ERR to >0 to enable error reporting via the Serial connection
  109.   // - Enabling DEBUG_ERR increases FLASH memory consumption which may be
  110.   //   limited on the baseline Arduino (ATmega328P) devices.
  111.   //   - DEBUG_ERR 0 = Disable all error messaging
  112.   //   - DEBUG_ERR 1 = Enable critical error messaging (eg. init)
  113.   //   - DEBUG_ERR 2 = Enable verbose error messaging (eg. bad parameters, etc.)
  114.   // - For baseline Arduino UNO, recommended to disable this after one has
  115.   //   confirmed basic operation of the library is successful.
  116.   #define DEBUG_ERR               1   // 1,2 to enable, 0 to disable
  117.  
  118.   // Debug initialization message
  119.   // - By default, GUIslice outputs a message in DEBUG_ERR mode
  120.   //   to indicate the initialization status, even during success.
  121.   // - To disable the messages during successful initialization,
  122.   //   uncomment the following line.
  123.   //#define INIT_MSG_DISABLE
  124.  
  125.   // -----------------------------------------------------------------------------
  126.   // SECTION 6: Optional Features
  127.   // -----------------------------------------------------------------------------
  128.  
  129.   // Enable of optional features
  130.   // - For memory constrained devices such as Arduino, it is best to
  131.   //   set the following features to 0 (to disable) unless they are
  132.   //   required.
  133.   #define GSLC_FEATURE_COMPOUND       0   // Compound elements (eg. XSelNum)
  134.   #define GSLC_FEATURE_XTEXTBOX_EMBED 0   // XTextbox control with embedded color
  135.   #define GSLC_FEATURE_INPUT          0   // Keyboard / GPIO input control
  136.  
  137.   // Enable support for SD card
  138.   // - Set to 1 to enable, 0 to disable
  139.   // - Note that the inclusion of the SD library consumes considerable
  140.   //   RAM and flash memory which could be problematic for Arduino models
  141.   //   with limited resources.
  142.   #define GSLC_SD_EN    0
  143.  
  144.  
  145.   // =============================================================================
  146.   // SECTION 10: INTERNAL CONFIGURATION
  147.   // - The following settings should not require modification by users
  148.   // =============================================================================
  149.  
  150.   // -----------------------------------------------------------------------------
  151.   // Touch Handling
  152.   // -----------------------------------------------------------------------------
  153.  
  154.   // Define the maximum number of touch events that are handled
  155.   // per gslc_Update() call. Normally this can be set to 1 but certain
  156.   // displays may require a greater value (eg. 30) in order to increase
  157.   // responsiveness of the touch functionality.
  158.   #define GSLC_TOUCH_MAX_EVT    1
  159.  
  160.   // -----------------------------------------------------------------------------
  161.   // Misc
  162.   // -----------------------------------------------------------------------------
  163.  
  164.   // Define buffer size for loading images from SD
  165.   // - A larger buffer will be faster but at the cost of RAM
  166.   #define GSLC_SD_BUFFPIXEL   50
  167.  
  168.   // Enable support for graphics clipping (DrvSetClipRect)
  169.   // - Note that this will impact performance of drawing graphics primitives
  170.   #define GSLC_CLIP_EN 1
  171.  
  172.   // Enable for bitmap transparency and definition of color to use
  173.   #define GSLC_BMP_TRANS_EN     1               // 1 = enabled, 0 = disabled
  174.   #define GSLC_BMP_TRANS_RGB    0xFF,0x00,0xFF  // RGB color (default: MAGENTA)
  175.  
  176.   #define GSLC_USE_FLOAT        0   // 1=Use floating pt library, 0=Fixed-point lookup tables
  177.  
  178.   #define GSLC_DEV_TOUCH ""
  179.   #define GSLC_USE_PROGMEM      1
  180.  
  181.   #define GSLC_LOCAL_STR        0   // 1=Use local strings (in element array), 0=External
  182.   #define GSLC_LOCAL_STR_LEN    50  // Max string length of text elements
  183.  
  184.   // -----------------------------------------------------------------------------
  185.   // Debug diagnostic modes
  186.   // -----------------------------------------------------------------------------
  187.   // - Uncomment any of the following to enable specific debug modes
  188.   //#define DBG_LOG           // Enable debugging log output
  189.   //#define DBG_TOUCH         // Enable debugging of touch-presses
  190.   //#define DBG_FRAME_RATE    // Enable diagnostic frame rate reporting
  191.   //#define DBG_DRAW_IMM      // Enable immediate rendering of drawing primitives
  192.   //#define DBG_DRIVER        // Enable graphics driver debug reporting
  193.  
  194.  
  195.   // =============================================================================
  196.  
  197. #ifdef __cplusplus
  198. }
  199. #endif // __cplusplus
  200. #endif // _GUISLICE_CONFIG_ARD_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement