From 1466f6a4c4e01589813d7cabc7df188f8d9a05e1 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Mon, 18 Sep 2023 10:25:02 +0200 Subject: [PATCH] fixup! drivers/lcd: add init sequence option --- drivers/include/lcd.h | 10 +++++----- drivers/lcd/lcd.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/include/lcd.h b/drivers/include/lcd.h index 26da774fa882..a8602f9f79b3 100644 --- a/drivers/include/lcd.h +++ b/drivers/include/lcd.h @@ -377,17 +377,17 @@ void lcd_write_cmd(lcd_t *dev, uint8_t cmd, const uint8_t *data, * - n bytes the parameters of the command. * * If @ref LCD_DELAY is used as the command index, the command is not sent - * to the display controller, but a delay is inserted, where the length - * in the CLP tuple then defines the delay in milliseconds. + * to the display controller, but a delay is inserted, where the length in the + * CLP tuple must be 1 and the value then defines the delay in milliseconds. * * The following example shows the initialization sequence for a display * with a ST7789: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} * static const uint8_t st7789_default_init[] = { * LCD_CMD_SWRESET, 0, // Soft Reset - * LCD_DELAY, 120, // Soft Reset needs 120 ms if in Sleep In mode + * LCD_DELAY, 1, 120, // Soft Reset needs 120 ms if in Sleep In mode * LCD_CMD_SLPOUT, 0, // Sleep Out leave Sleep In state after reset - * LCD_DELAY, 120, // Sleep Out needs 120 ms + * LCD_DELAY, 1, 120, // Sleep Out needs 120 ms * LCD_CMD_VCOMS, 1, 0x20, // VCOM=0.9V * LCD_CMD_VRHS, 1, 0x0b, // VRH=4.1V * LCD_CMD_VDVS, 1, 0x20, // VDV=0V @@ -404,7 +404,7 @@ void lcd_write_cmd(lcd_t *dev, uint8_t cmd, const uint8_t *data, * LCD_CMD_DINVON, 0, // enable Inversion, reset default is off * LCD_CMD_SLPOUT, 0, // Sleep out (turn off sleep mode) * LCD_CMD_NORON, 0, // Normal display mode on - * LCD_DELAY, 1, + * LCD_DELAY, 1, 1, * LCD_CMD_DISPON, 0, // Display on * }; * diff --git a/drivers/lcd/lcd.c b/drivers/lcd/lcd.c index 7a1eb8a74319..d38792bdd5ca 100644 --- a/drivers/lcd/lcd.c +++ b/drivers/lcd/lcd.c @@ -588,9 +588,9 @@ void lcd_write_cmd_sequence(const lcd_t *dev, const uint8_t *seq, size_t seq_len uint8_t num = seq[idx++]; if (cmd == LCD_DELAY) { - /* in case of delay command, the number of parameters represents the - * delay in ms */ - ztimer_sleep(ZTIMER_MSEC, num); + /* in case of delay command, the number of parameters is 1 */ + assert(1); + ztimer_sleep(ZTIMER_MSEC, seq[idx++]); continue; }