M5 TFT display initial commit (experimental)

This commit is contained in:
Klaus K Wilting committed 2020-03-29 19:41:33 +02:00
1 parent 62c30a1684
commit 7fcf93a655
5 files changed
+190 -143

No files matched your search

+38 -42
View File
@@ -7,33 +7,57 @@
#if (HAS_DISPLAY) == 1
#include <ss_oled.h>
#elif (HAS_DISPLAY) == 2
#include <bb_spi_lcd.h>
#else
#error Unknown display type
#include <TFT_eSPI.h>
#endif
#define DISPLAY_PAGES (7) // number of paxcounter display pages
// settings for display library
// settings for OLED display library
#if (HAS_DISPLAY) == 1
#define MY_FONT_SMALL FONT_SMALL
#define MY_FONT_NORMAL FONT_NORMAL
#define MY_FONT_LARGE FONT_LARGE
#define MY_FONT_STRETCHED FONT_STRETCHED
#define USE_BACKBUFFER 1
// setup display hardware type, default is OLED 128x64
#ifndef MY_DISPLAY_TYPE
#define MY_DISPLAY_TYPE OLED_128x64
#endif
#ifdef MY_DISPLAY_ADDR
#define OLED_ADDR MY_DISPLAY_ADDR
#else
#define OLED_ADDR -1
#endif
#ifndef MY_DISPLAY_INVERT
#define MY_DISPLAY_INVERT 0
#endif
#ifndef USW_HW_I2C
#define USE_HW_I2C 1
#endif
#ifndef OLED_FREQUENCY
#define OLED_FREQUENCY 400000L
#endif
// settings for TFT display library
#elif (HAS_DISPLAY == 2)
#define ESP32
#define MY_FONT_SMALL 1
#define MY_FONT_NORMAL 2
#define MY_FONT_LARGE 4
#define MY_FONT_STRETCHED 6
#ifndef MY_DISPLAY_FGCOLOR
#define MY_DISPLAY_FGCOLOR TFT_WHITE
#endif
#ifndef MY_DISPLAY_BGCOLOR
#define MY_DISPLAY_BGCOLOR TFT_BLACK
#endif
#endif
// setup display hardware type, default is OLED 128x64
#ifndef OLED_TYPE
#define OLED_TYPE OLED_128x64
#endif
#ifndef MY_DISPLAY_INVERT
#define MY_DISPLAY_INVERT 0
#endif
#ifndef MY_DISPLAY_FLIP
#define MY_DISPLAY_FLIP 0
@@ -46,34 +70,6 @@
#define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X
#endif
// some RGB color definitions
#define Black 0x0000 /* 0, 0, 0 */
#define Navy 0x000F /* 0, 0, 128 */
#define DarkGreen 0x03E0 /* 0, 128, 0 */
#define DarkCyan 0x03EF /* 0, 128, 128 */
#define Maroon 0x7800 /* 128, 0, 0 */
#define Purple 0x780F /* 128, 0, 128 */
#define Olive 0x7BE0 /* 128, 128, 0 */
#define LightGrey 0xC618 /* 192, 192, 192 */
#define DarkGrey 0x7BEF /* 128, 128, 128 */
#define Blue 0x001F /* 0, 0, 255 */
#define Green 0x07E0 /* 0, 255, 0 */
#define Cyan 0x07FF /* 0, 255, 255 */
#define Red 0xF800 /* 255, 0, 0 */
#define Magenta 0xF81F /* 255, 0, 255 */
#define Yellow 0xFFE0 /* 255, 255, 0 */
#define White 0xFFFF /* 255, 255, 255 */
#define Orange 0xFD20 /* 255, 165, 0 */
#define GreenYellow 0xAFE5 /* 173, 255, 47 */
#define Pink 0xF81F
#ifndef MY_DISPLAY_FGCOLOR
#define MY_DISPLAY_FGCOLOR White
#endif
#ifndef MY_DISPLAY_BGCOLOR
#define MY_DISPLAY_BGCOLOR Black
#endif
// settings for qr code generator
#define QR_VERSION 3 // 29 x 29px
#define QR_SCALEFACTOR 2 // 29 -> 58x < 64px