Modify the screen backlight driver

Modify the copied driver file

Here the aw9364 backlight driver is used as an example:

Initialization

In the aw9364_init function, GPIO output initialization is performed on the control pin LCD_BACKLIGHT_CONTROL_PIN, and low is output at the same time (backlight off).

Set backlight brightness

In the callback function backligt_set, the brightness percentage passed down from the upper layer is converted according to the brightness levels supported by the backlight IC, and then passed to the sif_aw9364_set_backlight function to set the brightness.

Read backlight brightness

In the callback function backligt_get, the variable aw9364_bl is used to return the brightness, because this backlight chip does not support reading the brightness level.