-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: display: Introduce ST7565R #91320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A node is needed in tests/drivers/build_all/display/app.overlay
to build controller code in CI.
drivers/display/display_st7565r.c
Outdated
|
||
/* Configure data_cmd pin if specified */ | ||
if (config->data_cmd.port && | ||
gpio_pin_configure_dt(&config->data_cmd, GPIO_OUTPUT_INACTIVE) < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine those statement with the previous one
drivers/display/display_st7565r.c
Outdated
{ | ||
const struct st7565r_config *config = dev->config; | ||
uint8_t zero_buf[config->width]; | ||
memset(zero_buf, 0, sizeof(zero_buf)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be combined with previous statement = {0}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Width does come from a static value in the devicetree. However, since config->width is a runtime value, zero_buf is considered a variable length array, which can't be initialized with = {0}. I'll have to stick with the memset call here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review comments needs to be resolved, not just marked as resolved.
|
GENMASK() review comment addressed.
i believe my comments to date have been addressed - thanks!
@kartben @JarmouniA ping. Can it be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduces support for the Sitronix ST7565R display controller driver, a dot matrix LCD controller that communicates over SPI. This adds comprehensive driver implementation with device tree bindings for configuration and test infrastructure.
- Adds complete ST7565R driver implementation with SPI communication support
- Provides device tree bindings with configurable LCD properties (bias, power control, booster ratio)
- Includes build system integration and test overlay configuration
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
drivers/display/display_st7565r.c | Main driver implementation with initialization, display operations, and SPI communication |
drivers/display/display_st7565r.h | Command definitions and constants for ST7565R controller |
dts/bindings/display/sitronix,st7565r.yaml | Device tree binding specification with configuration properties |
drivers/display/Kconfig.st7565r | Kconfig configuration for ST7565R driver |
drivers/display/Kconfig | Integration of ST7565R Kconfig into main display configuration |
drivers/display/CMakeLists.txt | Build system integration for ST7565R driver |
tests/drivers/build_all/display/app.overlay | Test configuration overlay for build verification |
/* Specify timeout as an absolute time since system boot */ | ||
k_sleep(K_TIMEOUT_ABS_MS(config->ready_time_ms)); |
Copilot
AI
Jul 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using K_TIMEOUT_ABS_MS()
for a delay is incorrect. This function expects an absolute timestamp since boot, not a relative delay. Use K_MSEC(config->ready_time_ms)
instead for a relative delay.
/* Specify timeout as an absolute time since system boot */ | |
k_sleep(K_TIMEOUT_ABS_MS(config->ready_time_ms)); | |
/* Specify timeout as a relative delay in milliseconds */ | |
k_sleep(K_MSEC(config->ready_time_ms)); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional. ready-time-ms: time in milliseconds to wait before initializing the controller after power-on.
Commenting to have the stale label removed. |
Rebased on |
Well CI issue was the runner crashing so trying to re-run it, let's see how this goes |
Thanks, @kartben. I see that it still fails (specifically, the 'twister-build-prep' job). Something to do with |
please rebase your branch on main (and then force push) -- this will do the trick! |
(assuming that you have your fork repo named |
Introduce support for Sitronix's ST7565R display controller. Tested on JHD12864 LCD display. Signed-off-by: Giyora Haroon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate header file is not needed.
.set_pixel_format = st7565r_set_pixel_format, | ||
}; | ||
|
||
#define DT_DRV_COMPAT sitronix_st7565r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this at the beginning of the file so it's easily found.
|
||
#define DT_DRV_COMPAT sitronix_st7565r | ||
|
||
#if DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, Kconfig takes care of this with depends on DT_HAS_SITRONIX_ST7565R_ENABLED
# Copyright (c) 2025, Giyora Haroon | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
title: Sitronix ST7565R dot matrix LCD controller (SPI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Sitronix ST7565R dot matrix LCD controller (SPI) | |
title: ST7565R LCD controller (SPI) |
Non-blocking
Introduce support for Sitronix's ST7565R display controller.
Tested on JHD12864 LCD display.