|
发表于 2023-4-4 10:18:27
2604 浏览 0 回复
UIS7862 oled屏如何设置背光
[QUESTION]
oled屏如何设置背光
[ANSWER]
uboot阶段:
需要删除对sprd_bl.c的编译,在lcd驱动里面添加set_brightiness的接口,具体参考如下:
- /bsp/bootloader/u-boot15/configs/uis7862s_xxx_defconfig
- + #define CONFIG_BACKLIGHT_DSI
- /bsp/bootloader/u-boot15/board/spreadtrum/uis7862s_XXX/Makefile
- - obj-y := uis7862s_1h10.o sdio_cfg.o sprd_kp.o modem_entry.o pinmap.o ldo_sleep.o sprd_bl.o regulator_init.o lcd_printf.o sprd_uart_matrix_cfg.o
- + obj-y := uis7862s_1h10.o sdio_cfg.o sprd_kp.o modem_entry.o pinmap.o ldo_sleep.o regulator_init.o lcd_printf.o sprd_uart_matrix_cfg.o
- + ifndef CONFIG_BACKLIGHT_DSI
- + obj-y +=sprd_bl.o
- + endif
复制代码
添加set_brightness控制接口
- /bsp/bootloader/u-boot15/drivers/video/sprd/lcd/lcd_xxx_xxx_xxx.c
- static int xxx_set_brightness(int brightness)
- {
- unsigned char set_bl_seq[] = {0x51,0x0F,0XFF};
- struct sprd_dsi *dsi = &dsi_device;
- set_bl_seq[1]= brightness >> 4 & 0x0F;
- set_bl_seq[2]= brightness;
- mipi_dsi_gen_write(dsi, &set_bl_seq[0], 3);
- return 0;
- }
- static struct panel_ops xxx_ops = {
- ++ .set_brightness = xxx_set_brightness,
- }
- kernel阶段:
- /bsp/kernel/kernel4.14/arch/arm64/boot/dts/sprd/uis7862s-xxxx.dts
- -- pwm_backlight: backlight {
- -- compatible = "sprd,sharkl5pro-backlight";
- -- pwms = <&pwms 0 40000>;
- -- pwm-names = "backlight";
- -- sprd,max-brightness-level = <880>;
- -- default-brightness-level = <115>;
- -- sprd,brightness-scale = <1023>;
- -- };
- -- &panel {
- -- sprd,backlight = <&pwm_backlight>;
- -- };
- /bsp/kernel/kernel4.14/arch/arm64/configs/sprd_sharkl5Pro_defconfig
- -- CONFIG_BACKLIGHT_PWM=y
- ++ #CONFIG_BACKLIGHT_PWM=y
复制代码
|
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|