Merge branch 'master' into feature/st7789_soft_reset

This commit is contained in:
Carlos Diaz 2021-02-13 18:50:51 -06:00 committed by GitHub
commit ee13a029c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 144 additions and 107 deletions

29
.editorconfig Normal file
View file

@ -0,0 +1,29 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{*.md,*.rst}]
trim_trailing_whitespace = false
[{Makefile,*.mk,*.bat}]
indent_style = tab
indent_size = 2
[{*.cmake,CMakeLists.txt}]
indent_style = space
indent_size = 4
max_line_length = 120
[{*.sh,*.yml}]
indent_style = space
indent_size = 2

View file

@ -61,7 +61,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
#include <stdarg.h> #include <stdarg.h>
#endif #endif
#define TAG "FT81X" #define TAG_LOG "FT81X"
/* data structure for SPI reading that has (optional) space for inserted dummy byte */ /* data structure for SPI reading that has (optional) space for inserted dummy byte */
typedef struct _spi_read_data { typedef struct _spi_read_data {
@ -873,13 +873,13 @@ uint8_t EVE_init(void)
/* The most reliable DIO/QIO switching point is after EVE start up but before reading the ChipID. */ /* The most reliable DIO/QIO switching point is after EVE start up but before reading the ChipID. */
#if defined(DISP_SPI_TRANS_MODE_DIO) #if defined(DISP_SPI_TRANS_MODE_DIO)
ESP_LOGI(TAG, "Switching to DIO mode"); ESP_LOGI(TAG_LOG, "Switching to DIO mode");
DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */ DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */
EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_DIO); EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_DIO);
SPIInherentSendFlags = DISP_SPI_MODE_DIO | DISP_SPI_MODE_DIOQIO_ADDR; SPIInherentSendFlags = DISP_SPI_MODE_DIO | DISP_SPI_MODE_DIOQIO_ADDR;
SPIDummyReadBits = 4; /* Esp32 DMA SPI transaction dummy_bits works more like clock cycles, so in DIO 4 dummy_bits == 8 total bits */ SPIDummyReadBits = 4; /* Esp32 DMA SPI transaction dummy_bits works more like clock cycles, so in DIO 4 dummy_bits == 8 total bits */
#elif defined(DISP_SPI_TRANS_MODE_QIO) #elif defined(DISP_SPI_TRANS_MODE_QIO)
ESP_LOGI(TAG, "Switching to QIO mode"); ESP_LOGI(TAG_LOG, "Switching to QIO mode");
DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */ DELAY_MS(20); /* different boards may take a different delay but this generally seems to work */
EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_QIO); EVE_memWrite16(REG_SPI_WIDTH, SPI_WIDTH_QIO);
SPIInherentSendFlags = DISP_SPI_MODE_QIO | DISP_SPI_MODE_DIOQIO_ADDR; SPIInherentSendFlags = DISP_SPI_MODE_QIO | DISP_SPI_MODE_DIOQIO_ADDR;
@ -895,7 +895,7 @@ uint8_t EVE_init(void)
timeout++; timeout++;
if(timeout > 400) if(timeout > 400)
{ {
ESP_LOGI(TAG, "Failed to read ChipID...aborting initialization."); ESP_LOGI(TAG_LOG, "Failed to read ChipID...aborting initialization.");
return 0; return 0;
} }
} }
@ -907,7 +907,7 @@ uint8_t EVE_init(void)
timeout++; timeout++;
if(timeout > 50) /* experimental, 10 was the lowest value to get the BT815 started with, the touch-controller was the last to get out of reset */ if(timeout > 50) /* experimental, 10 was the lowest value to get the BT815 started with, the touch-controller was the last to get out of reset */
{ {
ESP_LOGI(TAG, "Failed to read CPU status...aborting initialization."); ESP_LOGI(TAG_LOG, "Failed to read CPU status...aborting initialization.");
return 0; return 0;
} }
} }

View file

@ -35,7 +35,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
#ifndef EVE_CONFIG_H_ #ifndef EVE_CONFIG_H_
#define EVE_CONFIG_H_ #define EVE_CONFIG_H_
#ifdef LV_CONFIG_INCLUDE_SIMPLE #ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h" #include "lvgl.h"
#else #else
#include "lvgl/lvgl.h" #include "lvgl/lvgl.h"

View file

@ -579,16 +579,17 @@ menu "LVGL TFT Display controller"
default 2 default 2
config LV_INVERT_DISPLAY config LV_INVERT_DISPLAY
bool "IN DEPRECATION - Invert display." bool "IN DEPRECATION - Invert display." if LV_TFT_DISPLAY_CONTROLLER_RA8875
default y if LV_PREDEFINED_DISPLAY_M5STACK default n
help help
If text is backwards on your display, try enabling this. If text is backwards on your display, try enabling this.
config LV_INVERT_COLORS config LV_INVERT_COLORS
bool "Invert colors in display" if LV_TFT_DISPLAY_CONTROLLER_ILI9341 || LV_TFT_DISPLAY_CONTROLLER_ST7735S || LV_TFT_DISPLAY_CONTROLLER_ILI9481 bool "Invert colors in display" if LV_TFT_DISPLAY_CONTROLLER_ILI9341 || LV_TFT_DISPLAY_CONTROLLER_ST7735S || LV_TFT_DISPLAY_CONTROLLER_ILI9481 || LV_TFT_DISPLAY_CONTROLLER_ST7789 || LV_TFT_DISPLAY_CONTROLLER_SSD1306 || LV_TFT_DISPLAY_CONTROLLER_SH1107 || LV_TFT_DISPLAY_CONTROLLER_HX8357
default y if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICKC default y if LV_PREDEFINED_DISPLAY_M5STACK || LV_PREDEFINED_DISPLAY_M5STICKC
help help
If the colors look inverted on your display, try enabling this. If the colors look inverted on your display, try enabling this.
If it didn't help try LVGL configuration -> Swap the 2 bytes of RGB565 color.
config LV_M5STICKC_HANDLE_AXP192 config LV_M5STICKC_HANDLE_AXP192
bool "Handle Backlight and TFT power for M5StickC using AXP192." if LV_PREDEFINED_DISPLAY_M5STICKC || LV_TFT_DISPLAY_CONTROLLER_ST7735S bool "Handle Backlight and TFT power for M5StickC using AXP192." if LV_PREDEFINED_DISPLAY_M5STICKC || LV_TFT_DISPLAY_CONTROLLER_ST7735S

View file

@ -200,8 +200,10 @@ void hx8357_init(void)
hx8357_set_rotation(1); hx8357_set_rotation(1);
#if HX8357_INVERT_DISPLAY #if HX8357_INVERT_COLORS
hx8357_send_cmd(HX8357_INVON);; hx8357_send_cmd(HX8357_INVON);
#else
hx8357_send_cmd(HX8357_INVOFF);
#endif #endif
hx8357_enable_backlight(true); hx8357_enable_backlight(true);

View file

@ -40,6 +40,7 @@ extern "C" {
#define HX8357_BCKL CONFIG_LV_DISP_PIN_BCKL #define HX8357_BCKL CONFIG_LV_DISP_PIN_BCKL
#define HX8357_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL #define HX8357_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
#define HX8357_INVERT_COLORS CONFIG_LV_INVERT_COLORS
#if CONFIG_LV_BACKLIGHT_ACTIVE_LVL #if CONFIG_LV_BACKLIGHT_ACTIVE_LVL
#define HX8357_BCKL_ACTIVE_LVL 1 #define HX8357_BCKL_ACTIVE_LVL 1
@ -47,9 +48,6 @@ extern "C" {
#define HX8357_BCKL_ACTIVE_LVL 0 #define HX8357_BCKL_ACTIVE_LVL 0
#endif #endif
// if text/images are backwards, try setting this to 1
#define HX8357_INVERT_DISPLAY CONFIG_LV_INVERT_DISPLAY
/******************* /*******************
* HX8357B/D REGS * HX8357B/D REGS

View file

@ -82,7 +82,7 @@ void sh1107_init(void)
{0xDA, {0}, 0}, // Set com pins {0xDA, {0}, 0}, // Set com pins
{0x12, {0}, 0}, // ...value {0x12, {0}, 0}, // ...value
{0xA4, {0}, 0}, // output ram to display {0xA4, {0}, 0}, // output ram to display
#if defined CONFIG_LV_INVERT_DISPLAY #if defined CONFIG_LV_INVERT_COLORS
{0xA7, {0}, 0}, // inverted display {0xA7, {0}, 0}, // inverted display
#else #else
{0xA6, {0}, 0}, // Non-inverted display {0xA6, {0}, 0}, // Non-inverted display

View file

@ -113,7 +113,7 @@ void ssd1306_init(void)
uint8_t display_mode = 0; uint8_t display_mode = 0;
#if defined CONFIG_LV_INVERT_DISPLAY #if defined CONFIG_LV_INVERT_COLORS
display_mode = OLED_CMD_DISPLAY_INVERTED; display_mode = OLED_CMD_DISPLAY_INVERTED;
#else #else
display_mode = OLED_CMD_DISPLAY_NORMAL; display_mode = OLED_CMD_DISPLAY_NORMAL;

View file

@ -65,7 +65,13 @@ void st7789_init(void)
{ST7789_CABCCTRL, {0xBE}, 1}, {ST7789_CABCCTRL, {0xBE}, 1},
{ST7789_MADCTL, {0x00}, 1}, // Set to 0x28 if your display is flipped {ST7789_MADCTL, {0x00}, 1}, // Set to 0x28 if your display is flipped
{ST7789_COLMOD, {0x55}, 1}, {ST7789_COLMOD, {0x55}, 1},
{ST7789_INVON, {0}, 0},
#if ST7789_INVERT_COLORS == 1
{ST7789_INVON, {0}, 0}, // set inverted mode
#else
{ST7789_INVOFF, {0}, 0}, // set non-inverted mode
#endif
{ST7789_RGBCTRL, {0x00, 0x1B}, 2}, {ST7789_RGBCTRL, {0x00, 0x1B}, 2},
{0xF2, {0x08}, 1}, {0xF2, {0x08}, 1},
{ST7789_GAMSET, {0x01}, 1}, {ST7789_GAMSET, {0x01}, 1},

View file

@ -26,6 +26,7 @@ extern "C"
#define ST7789_BCKL CONFIG_LV_DISP_PIN_BCKL #define ST7789_BCKL CONFIG_LV_DISP_PIN_BCKL
#define ST7789_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL #define ST7789_ENABLE_BACKLIGHT_CONTROL CONFIG_LV_ENABLE_BACKLIGHT_CONTROL
#define ST7789_INVERT_COLORS CONFIG_LV_INVERT_COLORS
#if CONFIG_LV_BACKLIGHT_ACTIVE_LVL #if CONFIG_LV_BACKLIGHT_ACTIVE_LVL
#define ST7789_BCKL_ACTIVE_LVL 1 #define ST7789_BCKL_ACTIVE_LVL 1