Skip to content

drivers/st7735: faulty driver initialization #19818

@gschorcht

Description

@gschorcht

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.

Examples for the problem

For example:

/* Frame control */
command_params[0] = 0x00;
command_params[1] = 0x18;
_write_cmd(dev, LCD_CMD_FRAMECTL1, command_params, 2);

Bildschirmfoto vom 2023-07-10 00-09-02
Bildschirmfoto vom 2023-07-10 00-07-51

Although the command index is the same, the number of paraemeters and their meaning differ a lot.

Another example is:

/* PWRCTL1 */
command_params[0] = _st7735_calc_pwrctl1(CONFIG_ST7735_GVDD);
_write_cmd(dev, LCD_CMD_PWCTRL1, command_params, 1);

Bildschirmfoto vom 2023-07-10 00-31-02

Bildschirmfoto vom 2023-07-10 00-31-14

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.

Steps to reproduce the issue

Expected results

IMG_20230711_115701

Actual results

IMG_20230711_115741

Versions

Metadata

Metadata

Labels

Area: driversArea: Device driversState: WIPState: The PR is still work-in-progress and its code is not in its final presentable form yetType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)Type: trackingThe issue tracks and organizes the sub-tasks of a larger effort

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions