fixup for idf 5.0
This commit is contained in:
parent
9fed1cc47b
commit
2440b9b434
|
@ -262,7 +262,7 @@ void TFT_bitmap_display(void)
|
||||||
|
|
||||||
void FT81x_init(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_level(EVE_CS, 1);
|
||||||
gpio_set_direction(EVE_PDN, GPIO_MODE_OUTPUT);
|
gpio_set_direction(EVE_PDN, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
|
|
|
@ -122,20 +122,20 @@ void GC9A01_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(GC9A01_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if GC9A01_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(GC9A01_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(GC9A01_RST, 0);
|
gpio_set_level(GC9A01_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(GC9A01_RST, 1);
|
gpio_set_level(GC9A01_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Initialization.");
|
ESP_LOGI(TAG, "Initialization.");
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ void GC9A01_init(void)
|
||||||
GC9A01_send_cmd(GC_init_cmds[cmd].cmd);
|
GC9A01_send_cmd(GC_init_cmds[cmd].cmd);
|
||||||
GC9A01_send_data(GC_init_cmds[cmd].data, GC_init_cmds[cmd].databytes&0x1F);
|
GC9A01_send_data(GC_init_cmds[cmd].data, GC_init_cmds[cmd].databytes&0x1F);
|
||||||
if (GC_init_cmds[cmd].databytes & 0x80) {
|
if (GC_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,21 +160,21 @@ static uint8_t displayType = HX8357D;
|
||||||
void hx8357_init(void)
|
void hx8357_init(void)
|
||||||
{
|
{
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(HX8357_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if HX8357_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(HX8357_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(HX8357_RST, 0);
|
gpio_set_level(HX8357_RST, 0);
|
||||||
vTaskDelay(10 / portTICK_RATE_MS);
|
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(HX8357_RST, 1);
|
gpio_set_level(HX8357_RST, 1);
|
||||||
vTaskDelay(120 / portTICK_RATE_MS);
|
vTaskDelay(120 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Initialization.");
|
ESP_LOGI(TAG, "Initialization.");
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ void hx8357_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (x & 0x80) { // If high bit set...
|
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};
|
uint8_t tmp[3] = {0};
|
||||||
|
|
||||||
/* Initialize non-SPI GPIOs */
|
/* 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_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_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);
|
gpio_set_direction(IL3820_BUSY_PIN, GPIO_MODE_INPUT);
|
||||||
|
|
||||||
/* Harware reset */
|
/* Harware reset */
|
||||||
gpio_set_level( IL3820_RST_PIN, 0);
|
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);
|
gpio_set_level( IL3820_RST_PIN, 1);
|
||||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_RATE_MS);
|
vTaskDelay(IL3820_RESET_DELAY / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
/* Software reset */
|
/* Software reset */
|
||||||
il3820_write_cmd(IL3820_CMD_SW_RESET, NULL, 0);
|
il3820_write_cmd(IL3820_CMD_SW_RESET, NULL, 0);
|
||||||
|
@ -263,14 +263,14 @@ static void il3820_waitbusy(int wait_ms)
|
||||||
{
|
{
|
||||||
int i = 0;
|
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++) {
|
for(i = 0; i < (wait_ms * 10); i++) {
|
||||||
if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) {
|
if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelay(10 / portTICK_RATE_MS);
|
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGE( TAG, "busy exceeded %dms", i*10 );
|
ESP_LOGE( TAG, "busy exceeded %dms", i*10 );
|
||||||
|
|
|
@ -91,20 +91,20 @@ void ili9341_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ILI9341_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if ILI9341_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ILI9341_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ILI9341_RST, 0);
|
gpio_set_level(ILI9341_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ILI9341_RST, 1);
|
gpio_set_level(ILI9341_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Initialization.");
|
ESP_LOGI(TAG, "Initialization.");
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void ili9341_init(void)
|
||||||
ili9341_send_cmd(ili_init_cmds[cmd].cmd);
|
ili9341_send_cmd(ili_init_cmds[cmd].cmd);
|
||||||
ili9341_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
ili9341_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,27 +74,27 @@ void ili9481_init(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ILI9481_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if ILI9481_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ILI9481_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ILI9481_RST, 0);
|
gpio_set_level(ILI9481_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ILI9481_RST, 1);
|
gpio_set_level(ILI9481_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "ILI9481 initialization.");
|
ESP_LOGI(TAG, "ILI9481 initialization.");
|
||||||
|
|
||||||
// Exit sleep
|
// Exit sleep
|
||||||
ili9481_send_cmd(0x01); /* Software reset */
|
ili9481_send_cmd(0x01); /* Software reset */
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
//Send all the commands
|
//Send all the commands
|
||||||
uint16_t cmd = 0;
|
uint16_t cmd = 0;
|
||||||
|
@ -102,7 +102,7 @@ void ili9481_init(void)
|
||||||
ili9481_send_cmd(ili_init_cmds[cmd].cmd);
|
ili9481_send_cmd(ili_init_cmds[cmd].cmd);
|
||||||
ili9481_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
ili9481_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,21 +76,21 @@ void ili9486_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ILI9486_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if ILI9486_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ILI9486_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ILI9486_RST, 0);
|
gpio_set_level(ILI9486_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ILI9486_RST, 1);
|
gpio_set_level(ILI9486_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "ILI9486 Initialization.");
|
ESP_LOGI(TAG, "ILI9486 Initialization.");
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ void ili9486_init(void)
|
||||||
ili9486_send_cmd(ili_init_cmds[cmd].cmd);
|
ili9486_send_cmd(ili_init_cmds[cmd].cmd);
|
||||||
ili9486_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
ili9486_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,27 +76,27 @@ void ili9488_init(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ILI9488_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if ILI9488_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ILI9488_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ILI9488_RST, 0);
|
gpio_set_level(ILI9488_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ILI9488_RST, 1);
|
gpio_set_level(ILI9488_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "ILI9488 initialization.");
|
ESP_LOGI(TAG, "ILI9488 initialization.");
|
||||||
|
|
||||||
// Exit sleep
|
// Exit sleep
|
||||||
ili9488_send_cmd(0x01); /* Software reset */
|
ili9488_send_cmd(0x01); /* Software reset */
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
//Send all the commands
|
//Send all the commands
|
||||||
uint16_t cmd = 0;
|
uint16_t cmd = 0;
|
||||||
|
@ -104,7 +104,7 @@ void ili9488_init(void)
|
||||||
ili9488_send_cmd(ili_init_cmds[cmd].cmd);
|
ili9488_send_cmd(ili_init_cmds[cmd].cmd);
|
||||||
ili9488_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
ili9488_send_data(ili_init_cmds[cmd].data, ili_init_cmds[cmd].databytes&0x1F);
|
||||||
if (ili_init_cmds[cmd].databytes & 0x80) {
|
if (ili_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,18 +159,18 @@ void ra8875_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialize non-SPI GPIOs
|
// Initialize non-SPI GPIOs
|
||||||
gpio_pad_select_gpio(RA8875_RST);
|
//gpio_pad_select_gpio(RA8875_RST);
|
||||||
gpio_set_direction(RA8875_RST, GPIO_MODE_OUTPUT);
|
gpio_set_direction(RA8875_RST, GPIO_MODE_OUTPUT);
|
||||||
#ifdef CONFIG_LV_DISP_PIN_BCKL
|
#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);
|
gpio_set_direction(CONFIG_LV_DISP_PIN_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Reset the RA8875
|
// Reset the RA8875
|
||||||
gpio_set_level(RA8875_RST, 0);
|
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);
|
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)
|
// Initalize RA8875 clocks (SPI must be decelerated before initializing clocks)
|
||||||
disp_spi_change_device_speed(SPI_CLOCK_SPEED_SLOW_HZ);
|
disp_spi_change_device_speed(SPI_CLOCK_SPEED_SLOW_HZ);
|
||||||
|
@ -282,21 +282,21 @@ void ra8875_sleep_in(void)
|
||||||
ra8875_configure_clocks(false);
|
ra8875_configure_clocks(false);
|
||||||
|
|
||||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x00); // Power and Display Control Register (PWRR)
|
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)
|
ra8875_write_cmd(RA8875_REG_PWRR, 0x02); // Power and Display Control Register (PWRR)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ra8875_sleep_out(void)
|
void ra8875_sleep_out(void)
|
||||||
{
|
{
|
||||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x00); // Power and Display Control Register (PWRR)
|
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);
|
ra8875_configure_clocks(true);
|
||||||
|
|
||||||
disp_spi_change_device_speed(-1);
|
disp_spi_change_device_speed(-1);
|
||||||
|
|
||||||
ra8875_write_cmd(RA8875_REG_PWRR, 0x80); // Power and Display Control Register (PWRR)
|
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)
|
uint8_t ra8875_read_cmd(uint8_t cmd)
|
||||||
|
@ -329,7 +329,7 @@ void ra8875_configure_clocks(bool high_speed)
|
||||||
vTaskDelay(1);
|
vTaskDelay(1);
|
||||||
|
|
||||||
ra8875_write_cmd(RA8875_REG_PCSR, PCSR_VAL); // Pixel Clock Setting Register (PCSR)
|
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)
|
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
|
//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_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);
|
gpio_set_direction(SH1107_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(SH1107_RST, 0);
|
gpio_set_level(SH1107_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(SH1107_RST, 1);
|
gpio_set_level(SH1107_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
//Send all the commands
|
//Send all the commands
|
||||||
uint16_t cmd = 0;
|
uint16_t cmd = 0;
|
||||||
|
@ -109,7 +109,7 @@ void sh1107_init(void)
|
||||||
sh1107_send_cmd(init_cmds[cmd].cmd);
|
sh1107_send_cmd(init_cmds[cmd].cmd);
|
||||||
sh1107_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
sh1107_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
||||||
if (init_cmds[cmd].databytes & 0x80) {
|
if (init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,16 +97,16 @@ void st7735s_init(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ST7735S_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ST7735S_RST, 0);
|
gpio_set_level(ST7735S_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ST7735S_RST, 1);
|
gpio_set_level(ST7735S_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "ST7735S initialization.");
|
ESP_LOGI(TAG, "ST7735S initialization.");
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ void st7735s_init(void)
|
||||||
st7735s_send_cmd(init_cmds[cmd].cmd);
|
st7735s_send_cmd(init_cmds[cmd].cmd);
|
||||||
st7735s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
st7735s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes&0x1F);
|
||||||
if (init_cmds[cmd].databytes & 0x80) {
|
if (init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,25 +88,25 @@ void st7789_init(void)
|
||||||
};
|
};
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//Initialize non-SPI GPIOs
|
||||||
gpio_pad_select_gpio(ST7789_DC);
|
//gpio_pad_select_gpio(ST7789_DC);
|
||||||
gpio_set_direction(ST7789_DC, GPIO_MODE_OUTPUT);
|
gpio_set_direction(ST7789_DC, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
|
#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);
|
gpio_set_direction(ST7789_RST, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ST7789_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ST7789_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Reset the display
|
//Reset the display
|
||||||
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
|
#if !defined(CONFIG_LV_DISP_ST7789_SOFT_RESET)
|
||||||
gpio_set_level(ST7789_RST, 0);
|
gpio_set_level(ST7789_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ST7789_RST, 1);
|
gpio_set_level(ST7789_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
#else
|
#else
|
||||||
st7789_send_cmd(ST7789_SWRESET);
|
st7789_send_cmd(ST7789_SWRESET);
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,7 +119,7 @@ void st7789_init(void)
|
||||||
st7789_send_cmd(st7789_init_cmds[cmd].cmd);
|
st7789_send_cmd(st7789_init_cmds[cmd].cmd);
|
||||||
st7789_send_data(st7789_init_cmds[cmd].data, st7789_init_cmds[cmd].databytes&0x1F);
|
st7789_send_data(st7789_init_cmds[cmd].data, st7789_init_cmds[cmd].databytes&0x1F);
|
||||||
if (st7789_init_cmds[cmd].databytes & 0x80) {
|
if (st7789_init_cmds[cmd].databytes & 0x80) {
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,20 +92,20 @@ void st7796s_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Initialize non-SPI GPIOs
|
//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_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);
|
gpio_set_direction(ST7796S_RST, GPIO_MODE_OUTPUT);
|
||||||
|
|
||||||
#if ST7796S_ENABLE_BACKLIGHT_CONTROL
|
#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);
|
gpio_set_direction(ST7796S_BCKL, GPIO_MODE_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
//Reset the display
|
//Reset the display
|
||||||
gpio_set_level(ST7796S_RST, 0);
|
gpio_set_level(ST7796S_RST, 0);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
gpio_set_level(ST7796S_RST, 1);
|
gpio_set_level(ST7796S_RST, 1);
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Initialization.");
|
ESP_LOGI(TAG, "Initialization.");
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void st7796s_init(void)
|
||||||
st7796s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes & 0x1F);
|
st7796s_send_data(init_cmds[cmd].data, init_cmds[cmd].databytes & 0x1F);
|
||||||
if (init_cmds[cmd].databytes & 0x80)
|
if (init_cmds[cmd].databytes & 0x80)
|
||||||
{
|
{
|
||||||
vTaskDelay(100 / portTICK_RATE_MS);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,10 +139,10 @@ static void setup_axis(gpio_num_t plus, gpio_num_t minus, gpio_num_t measure, gp
|
||||||
{
|
{
|
||||||
// Set GPIOs:
|
// Set GPIOs:
|
||||||
// - Float "ignore" and "measure"
|
// - Float "ignore" and "measure"
|
||||||
gpio_pad_select_gpio(ignore);
|
//gpio_pad_select_gpio(ignore);
|
||||||
gpio_set_direction(ignore, GPIO_MODE_DISABLE);
|
gpio_set_direction(ignore, GPIO_MODE_DISABLE);
|
||||||
gpio_set_pull_mode(ignore, GPIO_FLOATING);
|
gpio_set_pull_mode(ignore, GPIO_FLOATING);
|
||||||
gpio_pad_select_gpio(measure);
|
//gpio_pad_select_gpio(measure);
|
||||||
gpio_set_direction(measure, GPIO_MODE_DISABLE);
|
gpio_set_direction(measure, GPIO_MODE_DISABLE);
|
||||||
gpio_set_pull_mode(measure, GPIO_FLOATING);
|
gpio_set_pull_mode(measure, GPIO_FLOATING);
|
||||||
// - Set "plus" to 1, "minus" to 0
|
// - Set "plus" to 1, "minus" to 0
|
||||||
|
|
|
@ -47,7 +47,7 @@ esp_err_t ft6x06_i2c_read8(uint8_t slave_addr, uint8_t register_addr, uint8_t *d
|
||||||
|
|
||||||
i2c_master_read_byte(i2c_cmd, data_buf, I2C_MASTER_NACK);
|
i2c_master_read_byte(i2c_cmd, data_buf, I2C_MASTER_NACK);
|
||||||
i2c_master_stop(i2c_cmd);
|
i2c_master_stop(i2c_cmd);
|
||||||
esp_err_t ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_RATE_MS);
|
esp_err_t ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_PERIOD_MS);
|
||||||
i2c_cmd_link_delete(i2c_cmd);
|
i2c_cmd_link_delete(i2c_cmd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ bool ft6x36_read(lv_indev_drv_t *drv, lv_indev_data_t *data) {
|
||||||
i2c_master_read_byte(i2c_cmd, &data_xy[0], I2C_MASTER_ACK); // reads FT6X36_P1_XH_REG
|
i2c_master_read_byte(i2c_cmd, &data_xy[0], I2C_MASTER_ACK); // reads FT6X36_P1_XH_REG
|
||||||
i2c_master_read_byte(i2c_cmd, &data_xy[1], I2C_MASTER_NACK); // reads FT6X36_P1_XL_REG
|
i2c_master_read_byte(i2c_cmd, &data_xy[1], I2C_MASTER_NACK); // reads FT6X36_P1_XL_REG
|
||||||
i2c_master_stop(i2c_cmd);
|
i2c_master_stop(i2c_cmd);
|
||||||
esp_err_t ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_RATE_MS);
|
esp_err_t ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_PERIOD_MS);
|
||||||
i2c_cmd_link_delete(i2c_cmd);
|
i2c_cmd_link_delete(i2c_cmd);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Error getting X coordinates: %s", esp_err_to_name(ret));
|
ESP_LOGE(TAG, "Error getting X coordinates: %s", esp_err_to_name(ret));
|
||||||
|
@ -169,7 +169,7 @@ bool ft6x36_read(lv_indev_drv_t *drv, lv_indev_data_t *data) {
|
||||||
i2c_master_read_byte(i2c_cmd, &data_xy[2], I2C_MASTER_ACK); // reads FT6X36_P1_YH_REG
|
i2c_master_read_byte(i2c_cmd, &data_xy[2], I2C_MASTER_ACK); // reads FT6X36_P1_YH_REG
|
||||||
i2c_master_read_byte(i2c_cmd, &data_xy[3], I2C_MASTER_NACK); // reads FT6X36_P1_YL_REG
|
i2c_master_read_byte(i2c_cmd, &data_xy[3], I2C_MASTER_NACK); // reads FT6X36_P1_YL_REG
|
||||||
i2c_master_stop(i2c_cmd);
|
i2c_master_stop(i2c_cmd);
|
||||||
ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_RATE_MS);
|
ret = i2c_master_cmd_begin(TOUCH_I2C_PORT, i2c_cmd, 1000 / portTICK_PERIOD_MS);
|
||||||
i2c_cmd_link_delete(i2c_cmd);
|
i2c_cmd_link_delete(i2c_cmd);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Error getting Y coordinates: %s", esp_err_to_name(ret));
|
ESP_LOGE(TAG, "Error getting Y coordinates: %s", esp_err_to_name(ret));
|
||||||
|
|
|
@ -63,7 +63,7 @@ void stmpe610_init(void)
|
||||||
|
|
||||||
// Attempt a software reset
|
// Attempt a software reset
|
||||||
write_8bit_reg(STMPE_SYS_CTRL1, STMPE_SYS_CTRL1_RESET);
|
write_8bit_reg(STMPE_SYS_CTRL1, STMPE_SYS_CTRL1_RESET);
|
||||||
vTaskDelay(10 / portTICK_RATE_MS);
|
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
// Reset the SPI configuration, making sure auto-increment is set
|
// Reset the SPI configuration, making sure auto-increment is set
|
||||||
u8 = read_8bit_reg(STMPE_SPI_CFG);
|
u8 = read_8bit_reg(STMPE_SPI_CFG);
|
||||||
|
|
Loading…
Reference in a new issue