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

Add drivers configuration file #24

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

C47D
Copy link
Collaborator

@C47D C47D commented Jan 21, 2021

This PR is intended to enable driver using a header file, we will also need to update the Kconfig files, so the users can enable drivers by the menuconfig tool. The CMakeLists.txt file will also need to be updated.

Any suggestions @kisvegabor @embeddedt ?

@embeddedt
Copy link
Member

I apologize for my forgetfulness, but the long-term plan is to eventually merge this and lv_drivers together, right?

@C47D
Copy link
Collaborator Author

C47D commented Jan 21, 2021

That's no problem @embeddedt, the plan for this repo is to have lv_drivers as a submodule and provide the necessary code so the drivers can be used on the ESP32.
On the other PR I tried to move all the platform dependent code into one place, so we can work towards generic drivers.

@C47D
Copy link
Collaborator Author

C47D commented Jan 21, 2021

I have a proof of concept here, where the user_data field of lv_disp_drv_t is used to pass user callbacks, so the driver can use them, like here:

void ili9341_reset(lv_disp_drv_t *drv)
{
    driver_generic_t *driver = (driver_generic_t *) drv->user_data;
    
	/* Reset the display */
    if (driver->hw_reset) {
        driver->hw_reset(drv);
    } else {
        /* Software reset when no hw_reset user callback is available */
        ili9341_send_cmd(drv, ILI9341_CMD_SWRESET);
        driver->delay_ms(drv, 5);
    }
}

The user callbacks should be responsible of sending the data to the display, it's just an approach, nothing is decided yet.

@kisvegabor
Copy link
Member

@C47D

I have a proof of concept here, where the user_data field of lv_disp_drv_t is used to pass user callbacks, so the driver can use them, like here:

I like the idea of adding the low level driver/interface callbacks to user_data.
I assume in the end you have also imagined somehing like this:

driver_generic_t ili9341_driver = {...};
lv_disp_drv_t disp_drv;
/* `flush_cb`, `rounder_cb`, `set_px_cb`, and `user_data` correctly*/
lv_drv_ili9341_create(&disp_drv, &ili9341_driver, /*other params if required?*/);

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