Skip to content

feat(st7789): Updated documentation. Added code example and step-by-step guide for STM32 #5511

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

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

zjanosy
Copy link
Contributor

@zjanosy zjanosy commented Jan 27, 2024

Description of the feature or fix

A clear and concise description of what the bug or new feature is.

Notes

Copy link
Collaborator

@PGNetHun PGNetHun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, found only 1 copy-paste issue

Comment on lines +13 to +15
/* Include STM32Cube files here, e.g.:
#include "stm32f7xx_hal.h"
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Include STM32Cube files here, e.g.:
#include "stm32f7xx_hal.h"
*/
#if defined STM32F3
#include "stm32f3xx_hal.h"
#elif defined STM32F4
#include "stm32f4xx_hal.h"
#elif defined STM32F7
#include "stm32f7xx_hal.h"
#elif defined STM32H7
#include "stm32xxx_hal.h" /*Include your hal header */
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this code has not been tested on other platforms than the STM32F746. We can add these headers, but what if there are subtle differences between those? Since this is an example, I think it is reasonable to expect that the users will adapt it to their platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case can we add it as an example to one of our lv_port_stm32* repos and link it in the docs?

* GLOBAL PROTOTYPES
**********************/
/* Initialize low level display driver */
void lv_port_disp_init(void);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we can have other STM port files too (e.g. LTDC) let name it

Suggested change
void lv_port_disp_init(void);
void lv_port_lcd_stm32_init(void);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been copied from lv_port_disp_template.c. Since 99% of the users will only use a single display, it does not really matter if the templates use the same function name (actually, it makes sense). But since this is just a template, the users can change it if there is any conflict.

PB10 GPIO_Output DC LCD_DCX
==== ============= ======= ==========

Step-by-step instructions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need such a detailed guide here?

I think we should explain only the LVGL related things and not general topic (such as clock config). For such a detailed and specific configuration we should have a blog post or YouTube video instead that we can link from here.

I suggest updating this file instead where we explain:

  1. How to integrate LVGL
    • clone LVGL
    • lv_tick
  2. STM devices can be used with
    • LVGL's built in display controller drivers
      • 1-2 paragraph of description about what to configure in Cube IDE (note that STm devices can be used with outher IDEs as well)
      • link to lv_port_stm32_lcd
    • X-CUBE-DISPLAY (just one paragraph)
    • LTDC: 1-2 paragraphs.

I hope we can have an official collaboration with ST in the future. However, until that I would like focus on our Official partners.

For example it would be nice to have the same description for ESP as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is very useful to provide a step-by-step guide like this, because the difficult part is not how to integrate LVGL, but how to configure the hardware. While this could be a blog post or YouTube video, including it in the LVGL documentation will immediately help novice users with their LVGL project, saving the hassle of searching the Internet for solutions (which may be outdated and may not be correct). Having this guide would have saved me days of work... :-)

The reason for making the guide so detailed is that leaving out any of these steps (e.g., clock or DMA configuration) will make LVGL perform sub-optimally. And that would cause user complaints of LVGL in general or discarding LVGL alltogether.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay let's leave it as it is but please add link to it here

@PGNetHun PGNetHun changed the title feat(st7789): Updated documentation. Added code example and step-by-s… feat(st7789): Updated documentation. Added code example and step-by-step guide for STM32 Feb 7, 2024
@lvgl-bot
Copy link

We need some feedback on this pull request.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

@lvgl-bot lvgl-bot added the stale label Feb 23, 2024
@kisvegabor
Copy link
Member

Not stale.

@lvgl-bot lvgl-bot removed the stale label Feb 25, 2024
@lvgl-bot
Copy link

We need some feedback on this pull request.

Now we mark this as "stale" because there was no activity here for 14 days.

Remove the "stale" label or comment else this will be closed in 7 days.

@lvgl-bot lvgl-bot added the stale label Mar 12, 2024
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we take the best possible approach, but we can update the examples at any time later. It will be quite valuable for the users as it is so I suggest merging this PR.

@kisvegabor kisvegabor merged commit 63842f8 into lvgl:master Mar 12, 2024
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…guide for STM32 (lvgl#5511)

Co-authored-by: Zoltan Janosy <zjanosy@fishman.com>
HongChao6 pushed a commit to HongChao6/lvgl that referenced this pull request Oct 18, 2024
…guide for STM32 (lvgl#5511)

Co-authored-by: Zoltan Janosy <zjanosy@fishman.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants