Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST7735 Fixups #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions components/tft/tftspi.c
Expand Up @@ -757,19 +757,24 @@ void TFT_display_init()
commandList(disp_spi, ST7789V_init);
}
else if (tft_disp_type == DISP_TYPE_ST7735) {
ret = disp_select();
assert(ret==ESP_OK);
commandList(disp_spi, STP7735_init);
}
else if (tft_disp_type == DISP_TYPE_ST7735R) {
ret = disp_select();
assert(ret==ESP_OK);
commandList(disp_spi, STP7735R_init);
commandList(disp_spi, Rcmd2green);
commandList(disp_spi, Rcmd3);
}
else if (tft_disp_type == DISP_TYPE_ST7735B) {
ret = disp_select();
assert(ret==ESP_OK);
commandList(disp_spi, STP7735R_init);
commandList(disp_spi, Rcmd2red);
commandList(disp_spi, Rcmd3);
uint8_t dt = 0xC0;
disp_select();
uint8_t dt = 0xC0;
disp_spi_transfer_cmd_data(TFT_MADCTL, &dt, 1);
}
else assert(0);
Expand Down
14 changes: 11 additions & 3 deletions components/tft/tftspi.h
Expand Up @@ -387,11 +387,15 @@ static const uint8_t ILI9488_init[] = {
// Initialization commands for 7735B screens
// ------------------------------------
static const uint8_t STP7735_init[] = {
17, // 18 commands in list:
#if PIN_NUM_RST
17, // 17 commands in list
#else
18, // 18 commands in list:
ST7735_SLPOUT , TFT_CMD_DELAY, // 2: Out of sleep mode, no args, w/delay
255, // 255 = 500 ms delay
#endif
TFT_CMD_PIXFMT , 1+TFT_CMD_DELAY, // 3: Set color mode, 1 arg + delay:
1, 0x06, // 18-bit color 6-6-6 color format
0x06, // 18-bit color 6-6-6 color format
10, // 10 ms delay
ST7735_FRMCTR1, 3+TFT_CMD_DELAY, // 4: Frame rate control, 3 args + delay:
0x00, // fastest refresh
Expand Down Expand Up @@ -447,9 +451,13 @@ static const uint8_t STP7735_init[] = {
// Init for 7735R, part 1 (red or green tab)
// --------------------------------------
static const uint8_t STP7735R_init[] = {
15, // 15 commands in list:
#if PIN_NUM_RST
14, // 14 commands in list
#else
15, // 15 commands in list:
ST7735_SWRESET, TFT_CMD_DELAY, // 1: Software reset, 0 args, w/delay
150, // 150 ms delay
#endif
ST7735_SLPOUT , TFT_CMD_DELAY, // 2: Out of sleep mode, 0 args, w/delay
255, // 500 ms delay
ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args:
Expand Down