// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef _IOT_LCD_H_ #define _IOT_LCD_H_ /*This is the Adafruit subclass graphics file*/ #include "string.h" #include "stdio.h" #include "driver/gpio.h" #include "driver/spi_master.h" #include "esp_partition.h" #include "freertos/semphr.h" #define LCD_TFTWIDTH 240 #define LCD_TFTHEIGHT 320 #define LCD_INVOFF 0x20 #define LCD_INVON 0x21 #define LCD_CASET 0x2A #define LCD_PASET 0x2B #define LCD_RAMWR 0x2C #define LCD_MADCTL 0x36 // Color definitions #define COLOR_BLACK 0x0000 /* 0, 0, 0 */ #define COLOR_NAVY 0x000F /* 0, 0, 128 */ #define COLOR_DARKGREEN 0x03E0 /* 0, 128, 0 */ #define COLOR_DARKCYAN 0x03EF /* 0, 128, 128 */ #define COLOR_MAROON 0x7800 /* 128, 0, 0 */ #define COLOR_PURPLE 0x780F /* 128, 0, 128 */ #define COLOR_OLIVE 0x7BE0 /* 128, 128, 0 */ #define COLOR_LIGHTGREY 0xC618 /* 192, 192, 192 */ #define COLOR_DARKGREY 0x7BEF /* 128, 128, 128 */ #define COLOR_BLUE 0x001F /* 0, 0, 255 */ #define COLOR_GREEN 0x07E0 /* 0, 255, 0 */ #define COLOR_CYAN 0x07FF /* 0, 255, 255 */ #define COLOR_RED 0xF800 /* 255, 0, 0 */ #define COLOR_MAGENTA 0xF81F /* 255, 0, 255 */ #define COLOR_YELLOW 0xFFE0 /* 255, 255, 0 */ #define COLOR_WHITE 0xFFFF /* 255, 255, 255 */ #define COLOR_ORANGE 0xFD20 /* 255, 165, 0 */ #define COLOR_GREENYELLOW 0xAFE5 /* 173, 255, 47 */ #define COLOR_PINK 0xF81F #define COLOR_SILVER 0xC618 #define COLOR_GRAY 0x8410 #define COLOR_LIME 0x07E0 #define COLOR_TEAL 0x0410 #define COLOR_FUCHSIA 0xF81F #define COLOR_ESP_BKGD 0xD185 #define MAKEWORD(b1, b2, b3, b4) ((uint32_t) ((b1) | ((b2) << 8) | ((b3) << 16) | ((b4) << 24))) typedef enum { LCD_MOD_ILI9341 = 0, LCD_MOD_ST7789 = 1, LCD_MOD_AUTO_DET = 3, } lcd_model_t; /** * @brief struct to map GPIO to LCD pins */ typedef struct { lcd_model_t lcd_model; int8_t pin_num_miso; /*!