Skip to content

Commit 02a2dc2

Browse files
committed
drivers: display: Fix Black White Red SSD16xx displays
This fixes SSD16xx tricolor displays being all red when using this driver. Signed-off-by: Camille BAUD <[email protected]>
1 parent 6b02c9f commit 02a2dc2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/display/ssd16xx.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,16 @@ static int ssd16xx_clear_cntlr_mem(const struct device *dev, uint8_t ram_cmd)
645645
return err;
646646
}
647647

648-
memset(clear_page, 0xff, sizeof(clear_page));
648+
if (config->profiles[SSD16XX_PROFILE_PARTIAL] == NULL
649+
&& ram_cmd == SSD16XX_CMD_WRITE_RED_RAM) {
650+
/* Display doesn't support partial refresh, so it either doesn't matter what is in
651+
* red Ram, or it needs to be inverted because this is a black/white/red display
652+
* and for red 0 is off, the opposite of black.
653+
*/
654+
memset(clear_page, 0x00, sizeof(clear_page));
655+
} else {
656+
memset(clear_page, 0xff, sizeof(clear_page));
657+
}
649658
for (int h = 0; h < panel_h; h++) {
650659
size_t x = config->width;
651660

0 commit comments

Comments
 (0)