Edit online

LVDS

3 Mar 2025
Read time: 5 minute(s)

调试 LVDS 屏,使用 simple-panel 驱动,在 menuconfig 界面配置屏规格书中的时序和规格参数即可。配置流程如下:

在 Luban-Lite 根目录下执行 me,进入 menuconfig 的功能配置界面。

  1. 选择显示接口:
    Board options  --->
        [*] Using Display Engine (DE)
            Display Parameter  --->
                select Display interface (Display LVDS interface)  --->
                LVDS interface options  --->
    
  2. 配置下列接口参数:
    Board options  --->
      Graphics Support  --->
          Graphics support
              [*] Display Support
                  select Display interface (Display LVDS interface)  --->
                  LVDS interface options  --->
                      lvds mode (vesa-24)  --->
                      lvds link mode (single link 1)  --->
    
  3. 配置屏参数:
    Board options  --->
        Graphics Support  --->
            Graphics support
                [*] Display Support
                    select Display interface (Display LVDS interface)  --->
                    LVDS interface options  --->
                    Display Panels  --->
                        ArtInChip Panel Drivers (ArtInChip simple panel)  --->
                        display timing of simple panel  --->
    
  4. 配置 LVDS Link 通道顺序和极性

    根据原理图修改配置文件 ``bsp/artinchip/drv/display/disp_conf.h``

    使用硬件设计指南的推荐设计,不需要修改下列参数

    注: 显示接口参数详解可参考 Luban-Lite SDK 指南 Display 使用指南章节
    /* lvds link swap enable, swap lvds link0 and link1 */
        #define AIC_LVDS_LINK_SWAP_EN   0
    
        /**
        * lvds channel output order
        *
        * default LVDS_LANES(LVDS_D3, LVDS_CK, LVDS_D2, LVDS_D1, LVDS_D0)
        *
        * link 0 default D3         CK         D2         D1         D0
        *                PD26/PD27  PD24/PD25  PD22/PD23  PD20/PD21  PD18/PD19
        *
        * link 1 default D3         CK         D2         D1         D0
        *                PD16/PD17  PD14/PD15  PD12/PD13  PD10/PD11  PD8/PD9
        *
        *
        * link 0 example LVDS_LANES(LVDS_D2, LVDS_CK, LVDS_D3, LVDS_D1, LVDS_D0)
        *
        *                D2         CK         D3         D1         D0
        *                PD26/PD27  PD24/PD25  PD22/PD23  PD20/PD21  PD18/PD19
        *
        * link1 example is the same as link0
        */
        #define AIC_LVDS_LINK0_LANES      LVDS_LANES(LVDS_D3, LVDS_CK, LVDS_D2, LVDS_D1, LVDS_D0)
        #define AIC_LVDS_LINK1_LANES      LVDS_LANES(LVDS_D3, LVDS_CK, LVDS_D2, LVDS_D1, LVDS_D0)
    
        /**
        * lvds channel polarities
        *
        * link 0 default 0b00000
        *                PD26/PD27  PD24/PD25  PD22/PD23  PD20/PD21  PD18/PD19
        *                N/P        N/P        N/P        N/P        N/P
        *
        * link 1 default 0b00000
        *                PD16/PD17  PD14/PD15  PD12/PD13  PD10/PD11  PD8/PD9
        *                N/P        N/P        N/P        N/P        N/P
        *
        *
        * link 0 example 0b01010
        *                PD26/PD27  PD24/PD25  PD22/PD23  PD20/PD21  PD18/PD19
        *                N/P        P/N        N/P        P/N        N/P
        *
        * link1 example is the same as link0
        */
        #define AIC_LVDS_LINK0_POL        0b00000
        #define AIC_LVDS_LINK1_POL        0b00000
  5. 编辑 pinmux.c 文件配置引脚。

    以 demo128-nand 工程为例,在 target/d21x/demo128-nand/pinmux.c 中添加以下配置:

    LVDS 有三组引脚配置,根据使用的模式进行选择,以下为 LVDS 引脚组合:

    #ifdef AIC_LVDS_LINK_0 // lvds link mode = single link 0
            {3, PIN_PULL_DIS, 3, "PD.18"},
            {3, PIN_PULL_DIS, 3, "PD.19"},
            {3, PIN_PULL_DIS, 3, "PD.20"},
            {3, PIN_PULL_DIS, 3, "PD.21"},
            {3, PIN_PULL_DIS, 3, "PD.22"},
            {3, PIN_PULL_DIS, 3, "PD.23"},
            {3, PIN_PULL_DIS, 3, "PD.24"},
            {3, PIN_PULL_DIS, 3, "PD.25"},
            {3, PIN_PULL_DIS, 3, "PD.26"},
            {3, PIN_PULL_DIS, 3, "PD.27"},
        #endif#ifdef AIC_LVDS_LINK_1 // lvds link mode = single link 1
            {3, PIN_PULL_DIS, 3, "PD.8"},
            {3, PIN_PULL_DIS, 3, "PD.9"},
            {3, PIN_PULL_DIS, 3, "PD.10"},
            {3, PIN_PULL_DIS, 3, "PD.11"},
            {3, PIN_PULL_DIS, 3, "PD.12"},
            {3, PIN_PULL_DIS, 3, "PD.13"},
            {3, PIN_PULL_DIS, 3, "PD.14"},
            {3, PIN_PULL_DIS, 3, "PD.15"},
            {3, PIN_PULL_DIS, 3, "PD.16"},
            {3, PIN_PULL_DIS, 3, "PD.17"},
        #endif#if defined(AIC_LVDS_DOUBLE_SCREEN) || defined(AIC_LVDS_DUAL_LINK) // lvds link mode = double screen / dual link
            {3, PIN_PULL_DIS, 3, "PD.8"},
            {3, PIN_PULL_DIS, 3, "PD.9"},
            {3, PIN_PULL_DIS, 3, "PD.10"},
            {3, PIN_PULL_DIS, 3, "PD.11"},
            {3, PIN_PULL_DIS, 3, "PD.12"},
            {3, PIN_PULL_DIS, 3, "PD.13"},
            {3, PIN_PULL_DIS, 3, "PD.14"},
            {3, PIN_PULL_DIS, 3, "PD.15"},
            {3, PIN_PULL_DIS, 3, "PD.16"},
            {3, PIN_PULL_DIS, 3, "PD.17"},
            {3, PIN_PULL_DIS, 3, "PD.18"},
            {3, PIN_PULL_DIS, 3, "PD.19"},
            {3, PIN_PULL_DIS, 3, "PD.20"},
            {3, PIN_PULL_DIS, 3, "PD.21"},
            {3, PIN_PULL_DIS, 3, "PD.22"},
            {3, PIN_PULL_DIS, 3, "PD.23"},
            {3, PIN_PULL_DIS, 3, "PD.24"},
            {3, PIN_PULL_DIS, 3, "PD.25"},
            {3, PIN_PULL_DIS, 3, "PD.26"},
            {3, PIN_PULL_DIS, 3, "PD.27"},
        #endif