Skip to content
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: Proposal of LCD API #136

Merged
merged 1 commit into from
Mar 6, 2023
Merged

bsp: Proposal of LCD API #136

merged 1 commit into from
Mar 6, 2023

Conversation

tore-espressif
Copy link
Collaborator

@tore-espressif tore-espressif commented Feb 22, 2023

This PR allows LCD initialization without LVGL. The API is in a separate file bsp/lcd.h to indicate that it is not needed in usual usacases.

I'd like to discuss few issues before I implement it for all BSPs:

  1. Is it OK (at least for now) to omit the deinit functions? EDIT: Seems to be OK for now
  2. Should we extend the backlight_init function with variable LEDC channels and timers? (the user can, after all, implement his own backlight control)

Any ideas welcome!

Related #121

Copy link
Collaborator

@espzav espzav left a comment

Choose a reason for hiding this comment

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

@tore-espressif Thank you! Great work! Some comments left.

esp_wrover_kit/include/bsp/display.h Outdated Show resolved Hide resolved
esp_wrover_kit/include/bsp/display.h Outdated Show resolved Hide resolved
esp_wrover_kit/include/bsp/display.h Outdated Show resolved Hide resolved
@tore-espressif
Copy link
Collaborator Author

tore-espressif commented Feb 23, 2023

@espzav Changes compared to the initial proposal:

  • Backlight is now initialized (but not turned on)
  • Display is reset and initialized (but not turned on)
  • new_display function does not need any parameter
  • removed esp_timer dependency from BSPs (probably a leftover before we moved to esp_lvgl_port
  • Add backlight control to Korvo 2 BSP

TODOs:

  • Check backlight function on Korvo 2
  • Use same draw_buffer_size macros across BSPs EDIT: Let's do this later so the MR does not get too big

@tore-espressif tore-espressif force-pushed the bsp/graphic_lib_support branch from 9eab7b3 to f294043 Compare February 27, 2023 12:50
@tore-espressif tore-espressif marked this pull request as ready for review February 27, 2023 12:50
@tore-espressif
Copy link
Collaborator Author

@TTauriainenQt PTAL!

@TT-Qt
Copy link

TT-Qt commented Feb 27, 2023

Hi @tore-espressif,

I did not find a way to set callback function for on_color_trans_done with this API proposal. Is that supported here somehow?

@espzav
Copy link
Collaborator

espzav commented Feb 27, 2023

Hi @TTauriainenQt,
here is the example of usage:

static bool _flush_ready_callback(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_io_event_data_t *edata, void *user_ctx)
{
    ....
    return false;
}

...

esp_lcd_panel_handle_t lcd_panel;
esp_lcd_panel_io_handle_t lcd_io;
err = bsp_display_new(&lcd_panel, &lcd_io);

/* Register done callback */
const esp_lcd_panel_io_callbacks_t cbs = {
    .on_color_trans_done = _flush_ready_callback,
};
esp_lcd_panel_io_register_event_callbacks(lcd_io, &cbs, NULL);

...

@TT-Qt
Copy link

TT-Qt commented Feb 28, 2023

Ok, thank you! Pull request looks good to me.

Copy link
Collaborator

@espzav espzav left a comment

Choose a reason for hiding this comment

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

@tore-espressif Thank you for this PR! Great work! Thank you for fix some minor issues in other BSPs. Some notes:

  1. Same as LCD should be new function for touch init. Do you plan it in next PR?
  2. The EV board is missing the bsp_display_new function.
  3. Did you test all on hardware?

Thanks!

esp32_s3_lcd_ev_board/esp32_s3_lcd_ev_board.c Outdated Show resolved Hide resolved
@tore-espressif tore-espressif force-pushed the bsp/graphic_lib_support branch from f294043 to e74b365 Compare March 6, 2023 08:07
@tore-espressif
Copy link
Collaborator Author

@tore-espressif Thank you for this PR! Great work! Thank you for fix some minor issues in other BSPs. Some notes:

  1. Same as LCD should be new function for touch init. Do you plan it in next PR?
  2. The EV board is missing the bsp_display_new function.
  3. Did you test all on hardware?

Thanks!

@espzav Thank you very much for the review!

  1. Touch will be done it another PR, so this one isn't too big
  2. I'll leave the EV board for follow-up MR, I don't understand the RGB driver enough, yet
  3. Tested on Korvo-2, Kaluga, Wrover and USB-OTG. All work OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants