搜索

451

主题

663

帖子

5297

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5297
QQ
发表于 2023-4-4 10:18:27 2602 浏览 0 回复

UIS7862 oled屏如何设置背光

[QUESTION]
oled屏如何设置背光

[ANSWER]

uboot阶段:

需要删除对sprd_bl.c的编译,在lcd驱动里面添加set_brightiness的接口,具体参考如下:
  1. /bsp/bootloader/u-boot15/configs/uis7862s_xxx_defconfig
  2. + #define CONFIG_BACKLIGHT_DSI

  3. /bsp/bootloader/u-boot15/board/spreadtrum/uis7862s_XXX/Makefile
  4. - 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
  5. + 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

  6. + ifndef CONFIG_BACKLIGHT_DSI
  7. + obj-y +=sprd_bl.o
  8. + endif
复制代码

添加set_brightness控制接口
  1. /bsp/bootloader/u-boot15/drivers/video/sprd/lcd/lcd_xxx_xxx_xxx.c  

  2. static int xxx_set_brightness(int brightness)
  3. {
  4.   unsigned char set_bl_seq[] = {0x51,0x0F,0XFF};
  5.   struct sprd_dsi *dsi = &dsi_device;
  6.   set_bl_seq[1]= brightness >> 4 & 0x0F;
  7.   set_bl_seq[2]= brightness;
  8.   mipi_dsi_gen_write(dsi, &set_bl_seq[0], 3);
  9. return 0;

  10. }

  11. static struct panel_ops xxx_ops = {
  12. ++  .set_brightness = xxx_set_brightness,

  13. }


  14. kernel阶段:

  15. /bsp/kernel/kernel4.14/arch/arm64/boot/dts/sprd/uis7862s-xxxx.dts

  16. --  pwm_backlight: backlight {
  17. -- compatible = "sprd,sharkl5pro-backlight";
  18. -- pwms = <&pwms 0 40000>;
  19. -- pwm-names = "backlight";
  20. -- sprd,max-brightness-level = <880>;
  21. -- default-brightness-level = <115>;
  22. -- sprd,brightness-scale = <1023>;
  23. -- };

  24. -- &panel {
  25. -- sprd,backlight = <&pwm_backlight>;
  26. -- };


  27. /bsp/kernel/kernel4.14/arch/arm64/configs/sprd_sharkl5Pro_defconfig

  28. -- CONFIG_BACKLIGHT_PWM=y
  29. ++ #CONFIG_BACKLIGHT_PWM=y
复制代码



手机微信同号:13682654092
回复

使用道具 举报

返回列表
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


登录或注册
快速回复 返回顶部 返回列表