fixup for idf 5.0
This commit is contained in:
parent
9fed1cc47b
commit
2440b9b434
16 changed files with 82 additions and 82 deletions
|
@ -262,7 +262,7 @@ void TFT_bitmap_display(void)
|
|||
|
||||
void FT81x_init(void)
|
||||
{
|
||||
gpio_pad_select_gpio(EVE_PDN);
|
||||
//gpio_pad_select_gpio(EVE_PDN);
|
||||
gpio_set_level(EVE_CS, 1);
|
||||
gpio_set_direction(EVE_PDN, GPIO_MODE_OUTPUT);
|
||||
|
||||
|
|
|
@ -122,20 +122,20 @@ void GC9A01_init(void)
|
|||
#endif
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(GC9A01_DC);
|
||||
//gpio_pad_select_gpio(GC9A01_DC);
|
||||
gpio_set_direction(GC9A01_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(GC9A01_RST);
|
||||
//gpio_pad_select_gpio(GC9A01_RST);
|
||||
gpio_set_direction(GC9A01_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if GC9A01_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(GC9A01_BCKL);
|
||||
//gpio_pad_select_gpio(GC9A01_BCKL);
|
||||
gpio_set_direction(GC9A01_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
//Reset the display
|
||||
gpio_set_level(GC9A01_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(GC9A01_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "Initialization.");
|
||||
|
||||
|
@ -145,7 +145,7 @@ void GC9A01_init(void)
|
|||
GC9A01_send_cmd(GC_init_cmds[cmd].cmd);
|
||||
GC9A01_send_data(GC_init_cmds[cmd].data, GC_init_cmds[cmd].databytes&0x1F);
|
||||
if (GC_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -160,21 +160,21 @@ static uint8_t displayType = HX8357D;
|
|||
void hx8357_init(void)
|
||||
{
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(HX8357_DC);
|
||||
//gpio_pad_select_gpio(HX8357_DC);
|
||||
gpio_set_direction(HX8357_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(HX8357_RST);
|
||||
//gpio_pad_select_gpio(HX8357_RST);
|
||||
gpio_set_direction(HX8357_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if HX8357_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(HX8357_BCKL);
|
||||
//gpio_pad_select_gpio(HX8357_BCKL);
|
||||
gpio_set_direction(HX8357_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(HX8357_RST, 0);
|
||||
vTaskDelay(10 / portTICK_RATE_MS);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(HX8357_RST, 1);
|
||||
vTaskDelay(120 / portTICK_RATE_MS);
|
||||
vTaskDelay(120 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "Initialization.");
|
||||
|
||||
|
@ -194,7 +194,7 @@ void hx8357_init(void)
|
|||
}
|
||||
}
|
||||
if (x & 0x80) { // If high bit set...
|
||||
vTaskDelay(numArgs * 5 / portTICK_RATE_MS); // numArgs is actually a delay time (5ms units)
|
||||
vTaskDelay(numArgs * 5 / portTICK_PERIOD_MS); // numArgs is actually a delay time (5ms units)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -196,18 +196,18 @@ void il3820_init(void)
|
|||
uint8_t tmp[3] = {0};
|
||||
|
||||
/* Initialize non-SPI GPIOs */
|
||||
gpio_pad_select_gpio(IL3820_DC_PIN);
|
||||
//gpio_pad_select_gpio(IL3820_DC_PIN);
|
||||
gpio_set_direction(IL3820_DC_PIN, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(IL3820_RST_PIN);
|
||||
//gpio_pad_select_gpio(IL3820_RST_PIN);
|
||||
gpio_set_direction(IL3820_RST_PIN, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(IL3820_BUSY_PIN);
|
||||
//gpio_pad_select_gpio(IL3820_BUSY_PIN);
|
||||
gpio_set_direction(IL3820_BUSY_PIN, GPIO_MODE_INPUT);
|
||||
|
||||
/* Harware reset */
|
||||
gpio_set_level( IL3820_RST_PIN, 0);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_RATE_MS);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_PERIOD_MS);
|
||||
gpio_set_level( IL3820_RST_PIN, 1);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_RATE_MS);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_PERIOD_MS);
|
||||
|
||||
/* Software reset */
|
||||
il3820_write_cmd(IL3820_CMD_SW_RESET, NULL, 0);
|
||||
|
@ -263,14 +263,14 @@ static void il3820_waitbusy(int wait_ms)
|
|||
{
|
||||
int i = 0;
|
||||
|
||||
vTaskDelay(10 / portTICK_RATE_MS); // 10ms delay
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS); // 10ms delay
|
||||
|
||||
for(i = 0; i < (wait_ms * 10); i++) {
|
||||
if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
vTaskDelay(10 / portTICK_RATE_MS);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
ESP_LOGE( TAG, "busy exceeded %dms", i*10 );
|
||||
|
|
|
@ -91,20 +91,20 @@ void ili9341_init(void)
|
|||
#endif
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ILI9341_DC);
|
||||
//gpio_pad_select_gpio(ILI9341_DC);
|
||||
gpio_set_direction(ILI9341_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ILI9341_RST);
|
||||
//gpio_pad_select_gpio(ILI9341_RST);
|
||||
gpio_set_direction(ILI9341_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if ILI9341_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ILI9341_BCKL);
|
||||
//gpio_pad_select_gpio(ILI9341_BCKL);
|
||||
gpio_set_direction(ILI9341_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
//Reset the display
|
||||
gpio_set_level(ILI9341_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ILI9341_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "Initialization.");
|
||||
|
||||
|
@ -114,7 +114,7 @@ void ili9341_init(void)
|
|||
ili9341_send_cmd(ili_init_cmds[cmd].cmd);
|
||||
ili9341_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -74,27 +74,27 @@ void ili9481_init(void)
|
|||
};
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ILI9481_DC);
|
||||
//gpio_pad_select_gpio(ILI9481_DC);
|
||||
gpio_set_direction(ILI9481_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ILI9481_RST);
|
||||
//gpio_pad_select_gpio(ILI9481_RST);
|
||||
gpio_set_direction(ILI9481_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if ILI9481_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ILI9481_BCKL);
|
||||
//gpio_pad_select_gpio(ILI9481_BCKL);
|
||||
gpio_set_direction(ILI9481_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(ILI9481_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ILI9481_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "ILI9481 initialization.");
|
||||
|
||||
// Exit sleep
|
||||
ili9481_send_cmd(0x01); /* Software reset */
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
//Send all the commands
|
||||
uint16_t cmd = 0;
|
||||
|
@ -102,7 +102,7 @@ void ili9481_init(void)
|
|||
ili9481_send_cmd(ili_init_cmds[cmd].cmd);
|
||||
ili9481_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -76,21 +76,21 @@ void ili9486_init(void)
|
|||
#endif
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ILI9486_DC);
|
||||
//gpio_pad_select_gpio(ILI9486_DC);
|
||||
gpio_set_direction(ILI9486_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ILI9486_RST);
|
||||
//gpio_pad_select_gpio(ILI9486_RST);
|
||||
gpio_set_direction(ILI9486_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if ILI9486_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ILI9486_BCKL);
|
||||
//gpio_pad_select_gpio(ILI9486_BCKL);
|
||||
gpio_set_direction(ILI9486_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(ILI9486_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ILI9486_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "ILI9486 Initialization.");
|
||||
|
||||
|
@ -100,7 +100,7 @@ void ili9486_init(void)
|
|||
ili9486_send_cmd(ili_init_cmds[cmd].cmd);
|
||||
ili9486_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -76,27 +76,27 @@ void ili9488_init(void)
|
|||
};
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ILI9488_DC);
|
||||
//gpio_pad_select_gpio(ILI9488_DC);
|
||||
gpio_set_direction(ILI9488_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ILI9488_RST);
|
||||
//gpio_pad_select_gpio(ILI9488_RST);
|
||||
gpio_set_direction(ILI9488_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if ILI9488_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ILI9488_BCKL);
|
||||
//gpio_pad_select_gpio(ILI9488_BCKL);
|
||||
gpio_set_direction(ILI9488_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(ILI9488_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ILI9488_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "ILI9488 initialization.");
|
||||
|
||||
// Exit sleep
|
||||
ili9488_send_cmd(0x01); /* Software reset */
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
//Send all the commands
|
||||
uint16_t cmd = 0;
|
||||
|
@ -104,7 +104,7 @@ void ili9488_init(void)
|
|||
ili9488_send_cmd(ili_init_cmds[cmd].cmd);
|
||||
ili9488_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -159,18 +159,18 @@ void ra8875_init(void)
|
|||
#endif
|
||||
|
||||
// Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(RA8875_RST);
|
||||
//gpio_pad_select_gpio(RA8875_RST);
|
||||
gpio_set_direction(RA8875_RST, GPIO_MODE_OUTPUT);
|
||||
#ifdef CONFIG_LV_DISP_PIN_BCKL
|
||||
gpio_pad_select_gpio(CONFIG_LV_DISP_PIN_BCKL);
|
||||
//gpio_pad_select_gpio(CONFIG_LV_DISP_PIN_BCKL);
|
||||
gpio_set_direction(CONFIG_LV_DISP_PIN_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
// Reset the RA8875
|
||||
gpio_set_level(RA8875_RST, 0);
|
||||
vTaskDelay(DIV_ROUND_UP(100, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(100, portTICK_PERIOD_MS));
|
||||
gpio_set_level(RA8875_RST, 1);
|
||||
vTaskDelay(DIV_ROUND_UP(100, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(100, portTICK_PERIOD_MS));
|
||||
|
||||
// Initalize RA8875 clocks (SPI must be decelerated before initializing clocks)
|
||||
disp_spi_change_device_speed(SPI_CLOCK_SPEED_SLOW_HZ);
|
||||
|
@ -282,21 +282,21 @@ void ra8875_sleep_in(void)
|
|||
ra8875_configure_clocks(false);
|
||||
|
||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x00); // Power and Display Control Register (PWRR)
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_PERIOD_MS));
|
||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x02); // Power and Display Control Register (PWRR)
|
||||
}
|
||||
|
||||
void ra8875_sleep_out(void)
|
||||
{
|
||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x00); // Power and Display Control Register (PWRR)
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_PERIOD_MS));
|
||||
|
||||
ra8875_configure_clocks(true);
|
||||
|
||||
disp_spi_change_device_speed(-1);
|
||||
|
||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x80); // Power and Display Control Register (PWRR)
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_PERIOD_MS));
|
||||
}
|
||||
|
||||
uint8_t ra8875_read_cmd(uint8_t cmd)
|
||||
|
@ -329,7 +329,7 @@ void ra8875_configure_clocks(bool high_speed)
|
|||
vTaskDelay(1);
|
||||
|
||||
ra8875_write_cmd(RA8875_REG_PCSR, PCSR_VAL); // Pixel Clock Setting Register (PCSR)
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_RATE_MS));
|
||||
vTaskDelay(DIV_ROUND_UP(20, portTICK_PERIOD_MS));
|
||||
}
|
||||
|
||||
static void ra8875_set_window(unsigned int xs, unsigned int xe, unsigned int ys, unsigned int ye)
|
||||
|
|
|
@ -92,16 +92,16 @@ void sh1107_init(void)
|
|||
};
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(SH1107_DC);
|
||||
//gpio_pad_select_gpio(SH1107_DC);
|
||||
gpio_set_direction(SH1107_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(SH1107_RST);
|
||||
//gpio_pad_select_gpio(SH1107_RST);
|
||||
gpio_set_direction(SH1107_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(SH1107_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(SH1107_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
//Send all the commands
|
||||
uint16_t cmd = 0;
|
||||
|
@ -109,7 +109,7 @@ void sh1107_init(void)
|
|||
sh1107_send_cmd(init_cmds[cmd].cmd);
|
||||
sh1107_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
||||
if (init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -97,16 +97,16 @@ void st7735s_init(void)
|
|||
};
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ST7735S_DC);
|
||||
//gpio_pad_select_gpio(ST7735S_DC);
|
||||
gpio_set_direction(ST7735S_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ST7735S_RST);
|
||||
//gpio_pad_select_gpio(ST7735S_RST);
|
||||
gpio_set_direction(ST7735S_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
//Reset the display
|
||||
gpio_set_level(ST7735S_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ST7735S_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "ST7735S initialization.");
|
||||
|
||||
|
@ -116,7 +116,7 @@ void st7735s_init(void)
|
|||
st7735s_send_cmd(init_cmds[cmd].cmd);
|
||||
st7735s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
||||
if (init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -88,25 +88,25 @@ void st7789_init(void)
|
|||
};
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ST7789_DC);
|
||||
//gpio_pad_select_gpio(ST7789_DC);
|
||||
gpio_set_direction(ST7789_DC, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
|
||||
gpio_pad_select_gpio(ST7789_RST);
|
||||
//gpio_pad_select_gpio(ST7789_RST);
|
||||
gpio_set_direction(ST7789_RST, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
#if ST7789_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ST7789_BCKL);
|
||||
//gpio_pad_select_gpio(ST7789_BCKL);
|
||||
gpio_set_direction(ST7789_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
|
||||
//Reset the display
|
||||
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
|
||||
gpio_set_level(ST7789_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ST7789_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
#else
|
||||
st7789_send_cmd(ST7789_SWRESET);
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ void st7789_init(void)
|
|||
st7789_send_cmd(st7789_init_cmds[cmd].cmd);
|
||||
st7789_send_data(st7789_init_cmds[cmd].data, st7789_init_cmds[cmd].databytes&0x1F);
|
||||
if (st7789_init_cmds[cmd].databytes & 0x80) {
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
|
@ -92,20 +92,20 @@ void st7796s_init(void)
|
|||
#endif
|
||||
|
||||
//Initialize non-SPI GPIOs
|
||||
gpio_pad_select_gpio(ST7796S_DC);
|
||||
//gpio_pad_select_gpio(ST7796S_DC);
|
||||
gpio_set_direction(ST7796S_DC, GPIO_MODE_OUTPUT);
|
||||
gpio_pad_select_gpio(ST7796S_RST);
|
||||
//gpio_pad_select_gpio(ST7796S_RST);
|
||||
gpio_set_direction(ST7796S_RST, GPIO_MODE_OUTPUT);
|
||||
|
||||
#if ST7796S_ENABLE_BACKLIGHT_CONTROL
|
||||
gpio_pad_select_gpio(ST7796S_BCKL);
|
||||
//gpio_pad_select_gpio(ST7796S_BCKL);
|
||||
gpio_set_direction(ST7796S_BCKL, GPIO_MODE_OUTPUT);
|
||||
#endif
|
||||
//Reset the display
|
||||
gpio_set_level(ST7796S_RST, 0);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
gpio_set_level(ST7796S_RST, 1);
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
ESP_LOGI(TAG, "Initialization.");
|
||||
|
||||
|
@ -117,7 +117,7 @@ void st7796s_init(void)
|
|||
st7796s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes & 0x1F);
|
||||
if (init_cmds[cmd].databytes & 0x80)
|
||||
{
|
||||
vTaskDelay(100 / portTICK_RATE_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
cmd++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue