查看: 871|回复: 0
收起左侧

哪吒系列文章之10——MIPI屏幕TFT08006支持

[复制链接]

  离线 

  • TA的每日心情
    奋斗
    2022-6-21 08:23
  • 签到天数: 2 天

    [LV.1]

    发表于 2022-1-24 22:10:25 | 显示全部楼层 |阅读模式

    有人预言,RISC-V或将是继Intel和Arm之后的第三大主流处理器体系。欢迎访问全球首家只专注于RISC-V单片机行业应用的中文网站

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    本帖最后由 塞巴斯蒂安 于 2022-1-24 22:09 编辑

    一、屏幕简介

    TFT08006官方支持的一款MIPI屏幕,8寸,分辨率800*1280。官方套装支持触控。
    全志D1 芯片及应用-哪吒系列文章之10——MIPI屏幕TFT08006支持risc-v单片机中文社区(1)
    二、下载

    MIPI屏幕 TFT08006 patch: https://www.aw-ol.com/downloads/resources/27
    全志D1 芯片及应用-哪吒系列文章之10——MIPI屏幕TFT08006支持risc-v单片机中文社区(2) MIPI屏幕 TFT08006 patch.7z (57.13 KB, 下载次数: 0)

    MIPI屏幕 TFT08006 相关资料见:https://www.aw-ol.com/downloads/resources/28
    全志D1 芯片及应用-哪吒系列文章之10——MIPI屏幕TFT08006支持risc-v单片机中文社区(3) MIPI屏幕TFT08006相关资料.7z (8.17 MB, 下载次数: 0)

    getevent demo ,用于D1-H按键或屏幕触摸测试:https://www.aw-ol.com/downloads/resources/26
    全志D1 芯片及应用-哪吒系列文章之10——MIPI屏幕TFT08006支持risc-v单片机中文社区(4) getevent demo 用于D1-H按键或屏幕触摸测试(文件格式自已改).txt (159.23 KB, 下载次数: 0)

    三、调试方法

    1.【仅限内测v0.5*版本需要做】将 configs.patch 文件复制到 tina/device/config/chips/d1 目录下,
    1. git apply configs.patch
    复制代码
    打上patch

    2.【仅限内测v0.5*版本需要做】将 uboot下的 0001-K1-sun20iw1p1-P2-disp-add-tft08006-panel-driver.patch 文件复制到 tina/lichee/brandy-2.0/u-boot-2018 目录下,
    1. git apply 0001-K1-sun20iw1p1-P2-disp-add-tft08006-panel-driver.patch
    复制代码
    打上patch

    3.【仅限内测v0.5*版本需要做】将 kernel下的 0001-K1-sun20iw1p1-P2-disp-add-tft08006-panel-driver.patch 文件复制到 tina/lichee/linux-5.4 目录下,
    1. git apply 0001-K1-sun20iw1p1-P2-disp-add-tft08006-panel-driver.patch
    复制代码
    打上patch

    4.make kernel_menuconfig选中
    1. │ Symbol: LCD_SUPPORT_TFT08006 [=y]                                                                                                                                                                     │
    2.   │ Type  : bool                                                                                                                                                                                          │
    3.   │ Prompt: LCD support TFT08006 panel                                                                                                                                                                    │
    4.   │   Location:                                                                                                                                                                                           │
    5.   │     -> Device Drivers                                                                                                                                                                                 │
    6.   │       -> Graphics support                                                                                                                                                                             │
    7.   │         -> Frame buffer Devices                                                                                                                                                                       │
    8.   │           -> Video support for sunxi                                                                                                                                                                  │
    9.   │ (1)         -> LCD panels select                                                                                                                                                                      │
    10.   │   Defined at drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig:178                                                                                                                                     │
    11.   │   Depends on: HAS_IOMEM [=y] && FB [=y] && DISP2_SUNXI [=y]
    复制代码
    目录下其它项可以全部取消选择

    5.make menuconfig中选中:
    1. Kernel modules > Input modules >  <*> kmod-touchscreen-gt9xxnew
    复制代码

    6.触摸demo make menuconfig选中Utilities-->getevent 在设备端运行getevent,再触摸屏幕则会打印触摸的屏幕坐标值 patch压缩包里放了一个getevent_d1 demo,可以直接将其adb push 到设备下运行

    运行后触摸屏幕,如果正常会有如下打印:
    1. root@TinaLinux:/# ./getevent_d1
    2. add device 1: /dev/input/event2
    3.   name:     "gt9xxnew_ts"
    4. add device 2: /dev/input/event1
    5.   name:     "audiocodec sunxi Audio Jack"
    6. add device 3: /dev/input/event0
    7.   name:     "sunxi-keyboard"
    8. poll 4, returned 1
    9. /dev/input/event2: 0001 014a 00000001
    10. poll 4, returned 1
    11. /dev/input/event2: 0003 0035 0000016a
    12. poll 4, returned 1
    13. /dev/input/event2: 0003 0036 00000091
    14. poll 4, returned 1
    15. /dev/input/event2: 0003 0030 00000019
    16. poll 4, returned 1
    17. /dev/input/event2: 0003 0032 00000019
    18. poll 4, returned 1
    19. /dev/input/event2: 0003 0039 00000000
    20. poll 4, returned 1
    21. /dev/input/event2: 0000 0002 00000000
    22. poll 4, returned 1
    23. /dev/input/event2: 0000 0000 00000000
    24. poll 4, returned 1
    25. /dev/input/event2: 0003 0035 0000016a
    26. poll 4, returned 1
    27. /dev/input/event2: 0003 0036 00000091
    28. poll 4, returned 1
    29. /dev/input/event2: 0003 0030 00000019
    30. poll 4, returned 1
    31. /dev/input/event2: 0003 0032 00000019
    32. poll 4, returned 1
    33. /dev/input/event2: 0003 0039 00000000
    34. poll 4, returned 1
    35. /dev/input/event2: 0000 0002 00000000
    36. poll 4, returned 1
    37. /dev/input/event2: 0000 0000 00000000
    38. poll 4, returned 1
    39. /dev/input/event2: 0003 0035 0000016a
    40. poll 4, returned 1
    41. /dev/input/event2: 0003 0036 00000091
    42. poll 4, returned 1
    43. ……
    复制代码

    四、V1.0版本支持显示


    Tina D1-H V1.0版本不支持背光调节,使用当前淘宝店卖的屏幕可能点不亮,需要做如下修改:
    1. 将tina/device/config/chips/d1/configs/nezha/linux-5.4/board.dts中的lcd0节点内的lcd_pwm_freq修改为
    2. lcd_pwm_freq        = <1000>;
    复制代码
    V1.01及后续版本均可直接使用屏幕并进行背光调节。

    五、背光亮度调节的方法
    1. mount -t debugfs none /sys/kernek/debug;
    2. cd /sys/kernel/debug/dispdbg;

    3. /* 设置背光亮度为100 */
    4. echo lcd0 > name;echo setbl > command;echo 100 > param;echo 1 > start;
    5. /* 设置背光亮度为0 */
    6. echo lcd0 > name;echo setbl > command;echo 0 > param;echo 1 > start;
    复制代码
    若以上命令无法调节背光亮度,则需检查屏幕转接板的硬件: 结合屏幕转接板原理图,需将背光模块的R6接上1K电阻(注意R4的阻值≥10K或置空,R7置空)
    全志D1 芯片及应用-哪吒系列文章之10——MIPI屏幕TFT08006支持risc-v单片机中文社区(5)
    转接板原理图





    上一篇:哪吒系列文章之09——USB摄像头拍照Demo
    下一篇:哪吒系列文章之11——Tengine支持
    RISCV作者优文
    全球首家只专注于RISC-V单片机行业应用的中文网站
    回复

    使用道具 举报

    高级模式
    B Color Image Link Quote Code Smilies

    本版积分规则

    关闭

    RISC-V单片机中文网上一条 /2 下一条


    版权及免责声明|RISC-V单片机中文网 |网站地图

    GMT+8, 2024-3-29 22:24 , Processed in 0.848662 second(s), 49 queries .

    快速回复 返回顶部 返回列表