Skip to content

Commit

Permalink
drivers: display: st7789v: Add ready time to startup
Browse files Browse the repository at this point in the history
Add additional property to allow a configurable delay to the display
initialization to allow the st7789v to be ready to receive commands.

Signed-off-by: Peter Johanson <[email protected]>
  • Loading branch information
petejohanson authored and kartben committed Feb 5, 2025
1 parent b83f8ed commit 16b1d3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/display/display_st7789v.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct st7789v_config {
uint8_t rgb_param[3];
uint16_t height;
uint16_t width;
uint8_t ready_time_ms;
};

struct st7789v_data {
Expand Down Expand Up @@ -409,6 +410,8 @@ static int st7789v_init(const struct device *dev)
return -ENODEV;
}

k_sleep(K_TIMEOUT_ABS_MS(config->ready_time_ms));

ret = st7789v_reset_display(dev);
if (ret < 0) {
LOG_ERR("Failed to reset display (%d)", ret);
Expand Down Expand Up @@ -496,6 +499,7 @@ static DEVICE_API(display, st7789v_api) = {
.rgb_param = DT_INST_PROP(inst, rgb_param), \
.width = DT_INST_PROP(inst, width), \
.height = DT_INST_PROP(inst, height), \
.ready_time_ms = DT_INST_PROP(inst, ready_time_ms), \
}; \
\
static struct st7789v_data st7789v_data_ ## inst = { \
Expand Down
8 changes: 8 additions & 0 deletions dts/bindings/display/sitronix,st7789v.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,13 @@ properties:
required: true
description: RGB Interface Control Parameter

ready-time-ms:
type: int
default: 40
description: |
Time it takes for the device from power up to become responsive and
accepting commands. Defaults to 40ms (found by trial and error) if not
provided.
mipi-mode:
required: true

0 comments on commit 16b1d3c

Please sign in to comment.