Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions samples/drivers/display/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,35 @@
- :ref:`ssd1306_128_shield`
- :ref:`st7789v_generic`
- :ref:`waveshare_epaper`

Changes for ls0xx Display
*************************

To run the sample on an Adafruit Sharp memory display 2.7 inch (ls0xx) on a STM32H7B0 board, ensure the following:

1. Modify the device tree snippet to match the display configuration.
2. Ensure the `buf_desc.width` is set to 400 in the sample code.

Check failure on line 56 in samples/drivers/display/README.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SphinxLint

samples/drivers/display/README.rst:56 default role used (hint: for inline literals, use double backticks) (default-role)
3. Check the return value of `display_get_capabilities()` in the sample code.

Check failure on line 57 in samples/drivers/display/README.rst

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SphinxLint

samples/drivers/display/README.rst:57 default role used (hint: for inline literals, use double backticks) (default-role)

Example device tree snippet:

.. code-block:: dts

&spi2 {
pinctrl-0 = <&spi2_sck_pb10 &spi2_miso_pc2_c &spi2_mosi_pc1>;
cs-gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
status = "okay";

ls0xx_ls027b7dh01: ls0xx@0 {
compatible = "sharp,ls0xx";
spi-max-frequency = <2000000>;
reg = <0>;
width = <400>;
height = <240>;
extcomin-gpios = <&gpioc 3 GPIO_ACTIVE_HIGH>;
extcomin-frequency = <60>; /* required if extcomin-gpios is defined */
disp-en-gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
};

};
15 changes: 13 additions & 2 deletions samples/drivers/display/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,15 @@
#endif
}

LOG_INF("Display sample for %s", display_dev->name);
display_get_capabilities(display_dev, &capabilities);
LOG_INF("Display sample for %s", display_dev->name);
if (display_get_capabilities(display_dev, &capabilities) != 0) {

Check notice on line 203 in samples/drivers/display/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

samples/drivers/display/src/main.c:203 -LOG_INF("Display sample for %s", display_dev->name); + LOG_INF("Display sample for %s", display_dev->name);
LOG_ERR("Failed to get display capabilities. Aborting sample.");
#ifdef CONFIG_ARCH_POSIX
posix_exit_main(1);
#else
return 0;
#endif
}

if (capabilities.screen_info & SCREEN_INFO_MONO_VTILED) {
rect_w = 16;
Expand Down Expand Up @@ -297,6 +304,10 @@
buf_desc.width = capabilities.x_resolution;
buf_desc.height = h_step;

if (strcmp(display_dev->name, "ls0xx") == 0) {
buf_desc.width = 400;
}

for (int idx = 0; idx < capabilities.y_resolution; idx += h_step) {
/*
* Tweaking the height value not to draw outside of the display.
Expand Down
Loading