-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Description
Most of the initialization code was copied from the ili9341
driver. However, the commands and parameters used in initialization sequence differs a lot, especially for power and frame control even if they have same command indices. See below for examples.
Note: I'm already working on a complete rework of the initialization which has been almost finished but it will require a couple of PRs to avoid extensive code duplication. I will use this issue as tracking issue.
- Move basic communication functions to
lcd
(PR drivers/lcd: code deduplication for st7735 and ili9341 #19816) - Use a default
_set_area
function (PR drivers/lcd: code deduplication for st7735 and ili9341 #19816) - Split the driver for supported ST77xx variants
- Fix initialization for ST7735
- Fix initialization for ST7789
- Fix initialization for ST7796
Examples for the problem
For example:
Lines 143 to 146 in 123cce9
/* Frame control */ | |
command_params[0] = 0x00; | |
command_params[1] = 0x18; | |
_write_cmd(dev, LCD_CMD_FRAMECTL1, command_params, 2); |
Although the command index is the same, the number of paraemeters and their meaning differ a lot.
Another example is:
Lines 105 to 107 in 123cce9
/* PWRCTL1 */ | |
command_params[0] = _st7735_calc_pwrctl1(CONFIG_ST7735_GVDD); | |
_write_cmd(dev, LCD_CMD_PWCTRL1, command_params, 1); |
In best case, the display uses wrong gamma correction and is completely overlit and without any contrast. In worst case, it doesn't work at all or breaks down the display. See below for expected and actual results.