-
Notifications
You must be signed in to change notification settings - Fork 115
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
bsp: Fix display headers for use in C++ and update BSP constants #147
Conversation
@TTauriainenQt please, is it enough for your Qt portation? As you mention, you need to know the target format i.e. RGB565 / RGB888 / ARGB8888, we haven't got this in our BSPs. All LCDs are set to RGB565. |
Hi @espzav. We are interested about the MCU->LCD driver IC interface format so for example: Pixelformat of the display interface:
Display IC interface endianess ( see https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf page 192 )
Or combined
And then defines or functions that tell proper values for the BSP user.
|
Hi @TTauriainenQt, Thank you for your clarification. But if I go to ILI9341 driver implementation (https://github.com/espressif/esp-bsp/blob/master/components/lcd/esp_lcd_ili9341/esp_lcd_ili9341.c) I see, that the information I think that you need the It seems that we haven't got any API for setting endianness in the driver. A didn't find any info in the driver about set endianness. We are using default. This is the reason why we cannot provide this information to you from BSP. |
Hi @espzav, There is no need for additional API to set endianess from our side. We just need to know the endianess per board and Board Support Package would be logical place to store such information as it contains board specific information. Like earlier mentioned ESP_LCD_COLOR_SPACE_RGB or ESP_LCD_COLOR_SPACE_BGR info is useless for us as it does not specify the actual pixel format. Also pixel format would be something that you could define in BSP by yourself for the BSP users as ESP-IDF does not have such info. |
@TTauriainenQt That is a good point, for most of our examples we solve it in LVGL that can swap the upper and lower bytes (the config is here https://github.com/espressif/esp-bsp/blob/master/examples/display/sdkconfig.defaults#L6). Some display controllers provide an option to accept both low- and high-endian data, but there are some restrictions. Typically that it does not work for all interfaces (SPI, parallel) or for all color formats. That is why we use the default endianness and swap the bytes manually, if needed. We will add definitions of display endianess to |
Sounds good. Actually the definitions are also better for us as we can then do compile time check instead of runtime check. |
51d37c2
to
47e3006
Compare
Hello @TTauriainenQt and @tore-espressif I updated the header files. Moved to
I think, we should move these color formats definition to esp_lcd in future as a enum. The endian will be used in LVGL port in future for set the color swap in runtime instead of |
Hi @espzav, I tried your changes locally in my project. I included display.h and touch.h + modified my code to use these new defines. Thanks! For me this PR looks good. |
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.
Thank you @espzav ! Only one minor comment, otherwise LGTM!
47e3006
to
c8c2ecd
Compare
Sorry I did not notice during the review that you also reduced the drawing buffer sizes. This adds more overhead for drawing and lowers the overall performance. Was there a specific reason for this change? |
@TTauriainenQt I didn't change the size of drawing buffer. I only move all constants to header. Now, there is @tore-espressif We should think about mechanism to set the size of buffer from custommer project? What about move it to KConfig? |
Sorry, to be precise it was the maximum transfer size for the SPI bus that decreased. This limits how much we can draw at once before flushing. Example from ESP-BOX:
Original code:
In new version:
Can you return the original values or make |
Fixed display and touch headers for using with C++ and updated BSP header with LCD constants.
Closes #143, #144, #145