-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
…tep guide for STM32.
…e parameter list of lv_lcd_st7789_create().
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.
Looks good, found only 1 copy-paste issue
/* Include STM32Cube files here, e.g.: | ||
#include "stm32f7xx_hal.h" | ||
*/ |
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.
/* 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 |
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.
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.
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.
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); |
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.
As we can have other STM port files too (e.g. LTDC) let name it
void lv_port_disp_init(void); | |
void lv_port_lcd_stm32_init(void); |
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 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 |
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.
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:
- How to integrate LVGL
- clone LVGL
- lv_tick
- 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.
- LVGL's built in display controller drivers
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.
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.
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.
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.
Okay let's leave it as it is but please add link to it here
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. |
Not stale. |
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. |
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.
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.
…guide for STM32 (lvgl#5511) Co-authored-by: Zoltan Janosy <zjanosy@fishman.com>
…guide for STM32 (lvgl#5511) Co-authored-by: Zoltan Janosy <zjanosy@fishman.com>
Description of the feature or fix
A clear and concise description of what the bug or new feature is.
Notes
lv_conf_template.h
run lv_conf_internal_gen.py and update Kconfig.scripts/code-format.py
(astyle needs to be installed) and follow the Code Conventions