MI PANEL API


1. API LIST

The panel module provides the following APIs:

Name of API Function
MI_PANEL_Init Initialize panel module
MI_PANEL_DeInit Deinitialize panel module
MI_PANEL_GetTotalNum Get total number of panel parameters
MI_PANEL_SetPowerOn Set panel power on
MI_PANEL_GetPowerOn Get panel power status
MI_PANEL_SetBacklight Set backlight enable
MI_PANEL_GetBacklight Get backlight enable status
MI_PANEL_SetBacklightLevel Set backlight brightness value
MI_PANEL_GetBacklightLevel Get backlight brightness value
MI_PANEL_SetSscConfig Set spread spectrum related configuration
MI_PANEL_SetMipiDsiConfig Set MIPI related configuration
MI_PANEL_SetTimingConfig Set Timing related configuration
MI_PANEL_SetDrvCurrentConfig Set driving current configuration
MI_PANEL_SetOutputPattern Set panel output pattern
MI_PANEL_SetPanelParam Set panel information
MI_PANEL_GetPanelParam Get current panel configuration information
MI_PANEL_GetTimingConfig Get Timing related configuration information
MI_PANEL_InitDev Initialize panel device
MI_PANEL_DeInitDev De-initialize panel device

1.1. MI_PANEL_Init

  • Function

    Initialize panel module

  • Syntax

    MI_S32 MI_PANEL_Init(MI_PANEL_IntfType_e eIntfType);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Related API

    MI_PANEL_DeInit


1.2. MI_PANEL_DeInit

  • Function

    Deinitialize panel module

  • Syntax

    MI_S32 MI_PANEL_DeInit(void);
    
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Related API

    MI_PANEL_Init


1.3. MI_PANEL_GetTotalNum

  • Function

    Get total number of panel parameters

  • Syntax

    MI_S32 MI_PANEL_GetTotalNum(MI_U32 *pu32TotalNum);
    
  • Parameter

    Parameter Name Description Input/Output
    pu32TotalNum Total number of panel parameters received by the pointer Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    Not supported yet


1.4. MI_PANEL_SetPowerOn

  • Function

    Set panel power on

  • Syntax

    MI_S32 MI_PANEL_SetPowerOn(MI_PANEL_IntfType_e eIntfType , MI_PANEL_PowerConfig_t *pstPowerCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstPowerCfg Panel power enable status Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    • Before setting the panel power enable, initialize panel first.

    • Currently not supported, it is recommended that the app directly control GPIO.

  • Related API

    MI_PANEL_GetPowerOn


1.5. MI_PANEL_GetPowerOn

  • Function

    Get panel power enable status

  • Syntax

    MI_S32 MI_PANEL_GetPowerOn(MI_PANEL_IntfType_e eIntfType , MI_PANEL_PowerConfig_t *pstPowerCfg);
    
  • Syntax

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstPowerCfg Panel power enable status received by the pointer Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    • Currently not supported, it is recommended that the app directly control GPIO.
  • Related API

    MI_PANEL_SetPowerOn


1.6. MI_PANEL_SetBacklight

  • Function

    Set panel backlight enable

  • Syntax

    MI_S32 MI_PANEL_SetBacklight(MI_PANEL_IntfType_e eIntfType , MI_PANEL_BackLightConfig_t *pstBackLightCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstBackLightCfg Panel backlight enable status Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    Currently not supported, it is recommended that the app directly control PWM.

  • Related API

    MI_PANEL_GetBacklight


1.7. MI_PANEL_GetBacklight

  • Function

    Get panel backlight enable status

  • Syntax

    MI_S32 MI_PANEL_GetBacklight(MI_PANEL_IntfType_e eIntfType , MI_PANEL_BackLightConfig_t *pstBackLightCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstBackLightCfg Panel backlight enable status received by the pointer Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    Currently not supported, it is recommended that the app directly control PWM.

  • Related API

    MI_PANEL_SetBacklight


1.8. MI_PANEL_SetBacklightLevel

  • Function

    Set backlight brightness value

  • Syntax

    MI_S32 MI_PANEL_SetBacklightLevel(MI_PANEL_IntfType_e eIntfType , MI_PANEL_BackLightConfig_t *pstBackLightCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstBackLightCfg Backlight brightness value Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    • Before calling this function, set the panel backlight enable first.

    • Currently not supported, it is recommended that the app directly control PWM.

  • Related API

    MI_PANEL_GetBacklightLevel


1.9. MI_PANEL_GetBacklightLevel

  • Function

    Get panel backlight brightness value

  • Syntax

    MI_S32 MI_PANEL_GetBacklightLevel(MI_PANEL_IntfType_e eIntfType , MI_PANEL_BackLightConfig_t *pstBackLightCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstBackLightCfg Panel backlight brightness value received by the pointer Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    • Before calling this function, set the backlight brightness value first.

    • Currently not supported, it is recommended that the app directly control PWM.

  • Related API

    MI_PANEL_SetBacklightLevel


1.10. MI_PANEL_SetSscConfig

  • Function

    Set spread spectrum related configuration

  • Syntax

    MI_S32 MI_PANEL_SetSscConfig(MI_PANEL_IntfType_e eIntfType , MI_PANEL_SscConfig_t *pstSscCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstSscCfg Spread spectrum related configuration Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so


1.11. MI_PANEL_SetMipiDsiConfig

  • Function

    Set MIPI interface related configuration

  • Syntax

    MI_S32 MI_PANEL_SetMipiDsiConfig(MI_PANEL_IntfType_e eIntfType , MI_PANEL_MipiDsiConfig_t *pstMipiDsiCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstMipiDsiCfg MIPI interface related configuration Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    This function is for use with MIPI panel only. To use this function, MI_PANEL_SetPanelParam must be called as well.


1.12. MI_PANEL_SetTimingConfig

  • Function

    Set Timing related configuration

  • Syntax

    MI_S32 MI_PANEL_SetTimingConfig(MI_PANEL_IntfType_e eIntfType , MI_PANEL_TimingConfig_t *pstTimingCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstTimingCfg Timing related configuration Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Related API

    MI_PANEL_GetTimingConfig


1.13. MI_PANEL_SetDrvCurrentConfig

  • Function

    Set driving capability related configuration

  • Syntax

    MI_S32 MI_PANEL_SetDrvCurrentConfig(MI_PANEL_IntfType_e eIntfType , MI_PANEL_DrvCurrentConfig_t *pstDrvCurrentCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstDrvCurrentCfg Driving capability related configuration Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so


1.14. MI_PANEL_SetOutputPattern

  • Function

    Set output pattern

  • Syntax

    MI_S32 MI_PANEL_SetOutputPattern(MI_PANEL_IntfType_e eIntfType , MI_PANEL_TestPatternConfig_t *pstTestPatternCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstTestPatternCfg Output pattern related configuration Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    For debugging (against LVDS at the present)


1.15. MI_PANEL_SetPanelParam

  • Function

    Set panel information

  • Syntax

    MI_S32 MI_PANEL_SetPanelParam(MI_PANEL_IntfType_e eIntfType , MI_PANEL_ParamConfig_t *pstParamCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstParamCfg Panel parameter information Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Related API

    MI_PANEL_GetPanelParam


1.16. MI_PANEL_GetPanelParam

  • Function

    Get panel parameter

  • Syntax

    MI_S32 MI_PANEL_GetPanelParam(MI_PANEL_IntfType_e eIntfType , MI_PANEL_ParamConfig_t *pstParamCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstParamCfg Panel parameter information Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    MI_PANEL_SetPanelParam must be called first

  • Related API

    MI_PANEL_SetPanelParam


1.17. MI_PANEL_GetTimingConfig

  • Function

    Get Timing related configuration

  • Syntax

    MI_S32 MI_PANEL_GetTimingConfig(MI_PANEL_IntfType_e eIntfType , MI_PANEL_TimingConfig_t *pstTimingCfg);
    
  • Parameter

    Parameter Name Description Input/Output
    eIntfType PANEL type Input
    pstTimingCfg Timing related configuration Output
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Related API

    MI_PANEL_SetTimingConfig


1.18. MI_PANEL_InitDev

  • Function

    Initialize panel module

  • Syntax

    MI_S32 MI_PANEL_InitDev(MI_PANEL_InitParam_t *pstInitParam);
    
  • Parameter

    Parameter Name Description Input/Output
    pstInitParam Initialization Parameter Input
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    For Version 2.09 and above, we recommend using this interface to replace the original MI_PANEL_Init interface.

  • Related API

    MI _PANEL_DeInitDev


1.19. MI_PANEL_DeInitDev

  • Function

    Deinitialize panel module

  • Syntax

    MI_S32 MI_PANEL_DeInitDev(void);
    
  • Return Value

    • Zero: Successful

    • Non-zero: Failed, see error code for details

  • Requirement

    • Header: mi_panel.h, mi_panel_datatype.h

    • Library: libmi_panel.a / libmi_panel.so

  • Note

    For Version 2.09 and above, we recommend using this interface to replace the original MI_PANEL_DeInit interface.

  • Related API

    MI_PANEL_InitDev


2. PANEL DATA TYPE

The table below lists the PANEL related data types:

Data type Description
MI_PANEL_PowerConfig_t Define panel power enable status structure
MI_PANEL_BackLightConfig_t Define panel backlight structure
MI_PANEL_SscConfig_t Define panel spread spectrum configuration structure
MI_PANEL_MipiDsiConfig_t Define MIPI interface configuration structure
MI_PANEL_MipiDsiLaneMode_e Define MIPI interface Lane mode enumeration
MI_PANEL_MipiDsiFormat_e Define MIPI interface Format enumeration
MI_PANEL_MipiDsiCtrlMode_e Define MIPI interface Ctrl Mode enumeration
MI_PANEL_TimingConfig_t Define panel Timing information structure
MI_PANEL_DrvCurrentConfig_t Define driving capability configuration structure
MI_PANEL_TestPatternConfig_t Define output pattern information structure
MI_PANEL_ParamConfig_t Define panel parameter information structure
MI_PANEL_IntfType_e Define Link type enumeration
MI_PANEL_AspectRatio_e Define Aspect Ratio enumeration
MI_PANEL_TiBitMode_e Define TiBit Mode enumeration
MI_PANEL_OutputFormatBitMode_e Define Output Format Bit Mode enumeration
MI_PANEL_OutputTimingMode_e Define panel output timing change mode enumeration
MI_PANEL_InitParam_t Define the initialized parameter of PANEL device

NOTE: This section includes most of the key data types. For data types not listed here, please refer to mi_panel_datatype.h.


2.1. MI_PANEL_PowerConfig_t

  • Description

    Define panel power enable status structure

  • Definition

    typedef struct
    
    {
    
        MI_BOOL bEn;
    
    }MI_PANEL_PowerConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_SetPowerOn

    MI_PANEL_GetPowerOn


2.2. MI_PANEL_BackLightConfig_t


2.3. MI_PANEL_SscConfig_t

  • Description

    Define panel spread spectrum configuration structure

  • Definition

    typedef struct
    
    {
    
        MI_BOOL bEn;
    
        MI_U16 u16Freq;
    
        MI_U16 u16Ratio;
    
    }MI_PANEL_SscConfig_t;
    
  • Member

    Member Description
    bEn Panel spread spectrum function enable status
    u16Freq Modulation rate
    u16Ratio Modulation depth
  • Note

    u16Freq should be greater than 15KHz.

  • Related Data Type and Interface

    MI_PANEL_SetSscConfig


2.4. MI_PANEL_MipiDsiConfig_t

  • Description

    Define MIPI interface configuration structure

  • Definition

    typedef struct
    
    {
    
        MI_U8 u8HsTrail;
    
        MI_U8 u8HsPrpr;
    
        MI_U8 u8HsZero;
    
        MI_U8 u8ClkHsPrpr;
    
        MI_U8 u8ClkHsExit;
    
        MI_U8 u8ClkTrail;
    
        MI_U8 u8ClkZero;
    
        MI_U8 u8ClkHsPost;
    
        MI_U8 u8DaHsExit;
    
        MI_U8 u8ContDet;
    
        MI_U8 u8Lpx;
    
        MI_U8 u8TaGet;
    
        MI_U8 u8TaSure;
    
        MI_U8 u8TaGo;
    
        MI_U16 u16Hactive;
    
        MI_U16 u16Hpw;
    
        MI_U16 u16Hbp;
    
        MI_U16 u16Hfp;
    
        MI_U16 u16Vactive;
    
        MI_U16 u16Vpw;
    
        MI_U16 u16Vbp;
    
        MI_U16 u16Vfp;
    
        MI_U16 u16Bllp;
    
        MI_U16 u16Fps;
    
        MI_PANEL_MipiDsiLaneMode_e enLaneNum;
    
        MI_PANEL_MipiDsiFormat_e enformat;
    
        MI_PANEL_MipiDsiCtrlMode_e enCtrl;
    
        MI_U8 *pu8CmdBuf;
    
        MI_U32 u32CmdBufSize;
    
        MI_U8 u8SyncCalibrate;
    
        MI_U16 u16VirHsyncSt;
    
        MI_U16 u16VirHsyncEnd;
    
        MI_U16 u16VsyncRef;
    
        MI_U16 u16DataClkSkew;
    
        MI_U8 u8PolCh0;
    
        MI_U8 u8PolCh1;
    
        MI_U8 u8PolCh2;
    
        MI_U8 u8PolCh3;
    
        MI_U8 u8PolCh4;
    
    }MI_PANEL_MipiDsiConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_MipiDsiLaneMode_e

    MI_PANEL_MipiDsiFormat_e

    MI_PANEL_MipiDsiCtrlMode_e

    MI_PANEL_SetMipiDsiConfig


2.5. MI_PANEL_MipiDsiLaneMode_e

  • Description

    Define MIPI interface Lane mode enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_MIPI_DSI_LANE_NONE = 0,
    
        E_MI_PNL_MIPI_DSI_LANE_1 = 1,
    
        E_MI_PNL_MIPI_DSI_LANE_2 = 2,
    
        E_MI_PNL_MIPI_DSI_LANE_3 = 3,
    
        E_MI_PNL_MIPI_DSI_LANE_4 = 4,
    
    } MI_PANEL_MipiDsiLaneMode_e;
    
  • Related Data Type and Interface

    MI_PANEL_MipiDsiConfig_t

    MI_PANEL_SetMipiDsiConfig


2.6. MI_PANEL_MipiDsiFormat_e

  • Description

    Define MIPI interface Format enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_MIPI_DSI_RGB565 = 0,
    
        E_MI_PNL_MIPI_DSI_RGB666 = 1,
    
        E_MI_PNL_MIPI_DSI_LOOSELY_RGB666 = 2,
    
        E_MI_PNL_MIPI_DSI_RGB888 = 3,
    
    } MI_PANEL_MipiDsiFormat_e;
    
  • Related Data Type and Interface

    MI_PANEL_MipiDsiConfig_t

    MI_PANEL_SetMipiDsiConfig


2.7. MI_PANEL_MipiDsiCtrlMode_e

  • Description

    Define MIPI interface Ctrl Mode enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_MIPI_DSI_CTRL_CMD_MODE = 0,
    
        E_MI_PNL_MIPI_DSI_CTRL_SYNC_PULSE = 1,
    
        E_MI_PNL_MIPI_DSI_CTRL_SYNC_EVENT = 2,
    
        E_MI_PNL_MIPI_DSI_BURST_MODE = 3,
    
    } MI_PANEL_MipiDsiCtrlMode_e;
    
  • Related Data Type and Interface

    MI_PANEL_MipiDsiConfig_t

    MI_PANEL_SetMipiDsiConfig


2.8. MI_PANEL_TimingConfig_t

  • Description

    Define panel Timing information structure

  • Definition

    typedef struct
    
    {
    
        MI_U16 u16HSyncWidth;
    
        MI_U16 u16HSyncBackPorch;
    
        MI_U16 u16HSyncFrontPorch;
    
        MI_U16 u16VSyncWidth;
    
        MI_U16 u16VSyncBackPorch;
    
        MI_U16 u16VSyncFrontPorch;
    
        MI_U16 u16HStart;
    
        MI_U16 u16VStart;
    
        MI_U16 u16Height;
    
        MI_U16 u16Width;
    
        MI_U16 u16Htotal;
    
        MI_U16 u16Vtotal;
    
        MI_U16 u16Dclk;
    
    }MI_PANEL_TimingConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_SetTimingConfig

    MI_PANEL_GetTimingConfig


2.9. MI_PANEL_DrvCurrentConfig_t

  • Description

    Define driving capability configuration structure

  • Definition

    typedef struct
    
    {
    
        MI_U16 u16DrvCurrent;
    
    }MI_PANEL_DrvCurrentConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_SetDrvCurrentConfig


2.10. MI_PANEL_TestPatternConfig_t

  • Description

    Define output pattern structure

  • Definition

    typedef struct
    
    {
    
        MI_BOOL bEn;
    
        MI_U16 u16R;
    
        MI_U16 u16G;
    
        MI_U16 u16B;
    
    }MI_PANEL_TestPatternConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_SetOutputPattern


2.11. MI_PANEL_ParamConfig_t

  • Description

    Define panel parameter structure

  • Definition

    typedef struct
    
    {
    
        const char *pPanelName; ///< PanelName
    
        MI_U8 u8Dither; ///< PANEL_DITHER, keep the setting
    
        MI_PANEL_IntfType_e eIntfType; ///< PANEL_LINK
    
        ///////////////////////////////////////////////
    
        // Board related setting
    
        ///////////////////////////////////////////////
    
        MI_U8 u8DualPort; ///< VOP_21[8], MOD_4A[1], PANEL_DUAL_PORT, refer to
        u8DoubleClk
    
        MI_U8 u8SwapPort; ///< MOD_4A[0], PANEL_SWAP_PORT, refer to "LVDS
        output app note" A/B channel swap
    
        MI_U8 u8SwapOdd_ML; ///< PANEL_SWAP_ODD_ML
    
        MI_U8 u8SwapEven_ML; ///< PANEL_SWAP_EVEN_ML
    
        MI_U8 u8SwapOdd_RB; ///< PANEL_SWAP_ODD_RB
    
        MI_U8 u8SwapEven_RB; ///< PANEL_SWAP_EVEN_RB
    
        MI_U8 u8SwapLVDS_POL; ///< MOD_40[5], PANEL_SWAP_LVDS_POL, for
        differential P/N swap
    
        MI_U8 u8SwapLVDS_CH; ///< MOD_40[6], PANEL_SWAP_LVDS_CH, for pair
        swap
    
        MI_U8 u8PDP10BIT; ///< MOD_40[3], PANEL_PDP_10BIT,for pair swap
    
        MI_U8 u8LVDS_TI_MODE; ///< MOD_40[2], PANEL_LVDS_TI_MODE, refer to
        "LVDS output app note"
    
        ///////////////////////////////////////////////
    
        // For TTL Only
    
        ///////////////////////////////////////////////
    
        MI_U8 u8DCLKDelay; ///< PANEL_DCLK_DELAY
    
        MI_U8 u8InvDCLK; ///< MOD_4A[4], PANEL_INV_DCLK
    
        MI_U8 u8InvDE; ///< MOD_4A[2], PANEL_INV_DE
    
        MI_U8 u8InvHSync; ///< MOD_4A[12], PANEL_INV_HSYNC
    
        MI_U8 u8InvVSync; ///< MOD_4A[3], PANEL_INV_VSYNC
    
        ///////////////////////////////////////////////
    
        // Output driving current setting
    
        ///////////////////////////////////////////////
    
        // driving current setting (0x00=4mA, 0x01=6mA, 0x02=8mA, 0x03=12mA)
    
        MI_U8 u8DCKLCurrent; ///< define PANEL_DCLK_CURRENT
    
        MI_U8 u8DECurrent; ///< define PANEL_DE_CURRENT
    
        MI_U8 u8ODDDataCurrent; ///< define PANEL_ODD_DATA_CURRENT
    
        MI_U8 u8EvenDataCurrent; ///< define PANEL_EVEN_DATA_CURRENT
    
        ///////////////////////////////////////////////
    
        // panel on/off timing
    
        ///////////////////////////////////////////////
    
        MI_U16 u16OnTiming1; ///< time between panel & data while turn on power
    
        MI_U16 u16OnTiming2; ///< time between data & back light while turn on
        power
    
        MI_U16 u16OffTiming1; ///< time between back light & data while turn off
        power
    
        MI_U16 u16OffTiming2; ///< time between data & panel while turn off power
    
        ///////////////////////////////////////////////
    
        // panel timing spec.
    
        ///////////////////////////////////////////////
    
        // sync related
    
        MI_U16 u16HSyncWidth; ///< VOP_01[7:0], PANEL_HSYNC_WIDTH
    
        MI_U16 u16HSyncBackPorch; ///< PANEL_HSYNC_BACK_PORCH, no register
        setting, provide value for query only
    
        MI_U16 u16VSyncWidth; ///< define PANEL_VSYNC_WIDTH
    
        MI_U16 u16VSyncBackPorch; ///< define PANEL_VSYNC_BACK_PORCH
    
        // DE related
    
        MI_U16 u16HStart; ///< VOP_04[11:0], PANEL_HSTART, DE H Start
        (PANEL_HSYNC_WIDTH + PANEL_HSYNC_BACK_PORCH)
    
        MI_U16 u16VStart; ///< VOP_06[11:0], PANEL_VSTART, DE V Start
    
        MI_U16 u16Width; ///< PANEL_WIDTH, DE width (VOP_05[11:0] = HEnd =
        HStart + Width - 1)
    
        MI_U16 u16Height; ///< PANEL_HEIGHT, DE height (VOP_07[11:0], = Vend =
        VStart + Height - 1)
    
        // DClk related
    
        MI_U16 u16MaxHTotal; ///< PANEL_MAX_HTOTAL. Reserved for future using.
    
        MI_U16 u16HTotal; ///< VOP_0C[11:0], PANEL_HTOTAL
    
        MI_U16 u16MinHTotal; ///< PANEL_MIN_HTOTAL. Reserved for future using.
    
        MI_U16 u16MaxVTotal; ///< PANEL_MAX_VTOTAL. Reserved for future using.
    
        MI_U16 u16VTotal; ///< VOP_0D[11:0], PANEL_VTOTAL
    
        MI_U16 u16MinVTotal; ///< PANEL_MIN_VTOTAL. Reserved for future using.
    
        MI_U16 u16MaxDCLK; ///< PANEL_MAX_DCLK. Reserved for future using.
    
        MI_U16 u16DCLK; ///< LPLL_0F[23:0], PANEL_DCLK
    
        MI_U16 u16MinDCLK; ///< PANEL_MIN_DCLK. Reserved for future using.
    
        ///< spread spectrum
    
        MI_U16 u16SpreadSpectrumStep; ///< move to board define, no use now.
    
        MI_U16 u16SpreadSpectrumSpan; ///< move to board define, no use now.
    
        MI_U8 u8DimmingCtl; ///< Initial Dimming Value
    
        MI_U8 u8MaxPWMVal; ///< Max Dimming Value
    
        MI_U8 u8MinPWMVal; ///< Min Dimming Value
    
        MI_U8 u8DeinterMode; ///< define PANEL_DEINTER_MODE, no use now
    
        MI_PANEL_AspectRatio_e ePanelAspectRatio; ///< Panel Aspect Ratio,
        provide information to upper layer application for aspect ratio setting.
    
        MI_U16 u16LVDSTxSwapValue;
    
        MI_PANEL_TiBitMode_e eTiBitMode; ///< MOD_4B[1:0], refer to "LVDS
        output app note"
    
        MI_PANEL_OutputFormatBitMode_e eOutputFormatBitMode;
    
        MI_U8 u8SwapOdd_RG; ///< define PANEL_SWAP_ODD_RG
    
        MI_U8 u8SwapEven_RG; ///< define PANEL_SWAP_EVEN_RG
    
        MI_U8 u8SwapOdd_GB; ///< define PANEL_SWAP_ODD_GB
    
        MI_U8 u8SwapEven_GB; ///< define PANEL_SWAP_EVEN_GB
    
        /**
    
        * Others
    
        */
    
        MI_U8 u8DoubleClk; ///< LPLL_03[7], define Double Clock,LVDS dual mode
    
        MI_U32 u32MaxSET; ///< define PANEL_MAX_SET
    
        MI_U32 u32MinSET; ///< define PANEL_MIN_SET
    
        MI_PANEL_OutputTimingMode_e eOutTimingMode; ///<Define which panel
        output timing change mode is used to change VFreq for same panel
    
        MI_U8 u8NoiseDith; ///< PAFRC mixed with noise dither disable
    
    }MI_PANEL_ParamConfig_t;
    
  • Related Data Type and Interface

    MI_PANEL_IntfType_e

    MI_PANEL_AspectRatio_e

    MI_PANEL_TiBitMode_e

    MI_PANEL_OutputFormatBitMode_e

    MI_PANEL_OutputTimingMode_e

    MI_PANEL_GetPanelParam


2.12. MI_PANEL_IntfType_e

  • Description

    Define panel Interface Type enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_INTF_TTL, ///< TTL type
    
        E_MI_PNL_INTF_LVDS, ///< LVDS type
    
        E_MI_PNL_INTF_RSDS, ///< RSDS type
    
        E_MI_PNL_INTF_MINILVDS, ///< TCON
    
        E_MI_PNL_INTF_ANALOG_MINILVDS, ///< Analog TCON
    
        E_MI_PNL_INTF_DIGITAL_MINILVDS, ///< Digital TCON
    
        E_MI_PNL_INTF_MFC, ///< Ursa (TTL output to Ursa)
    
        E_MI_PNL_INTF_DAC_I, ///< DAC output
    
        E_MI_PNL_INTF_DAC_P, ///< DAC output
    
        E_MI_PNL_INTF_PDPLVDS, ///< For PDP(Vsync use Manually MODE)
    
        E_MI_PNL_INTF_EXT, ///< EXT LPLL TYPE
    
        E_MI_PNL_INTF_MIPI_DSI, ///< Mipi DSI
    
        E_MI_PNL_INTF_BT656, //BT656 interface
    
        E_MI_PNL_INTF_BT601, ///< BT601
    
        E_MI_PNL_INTF_BT1120, ///< BT1120
    
        E_MI_PNL_INTF_MCU_TYPE, ///< MCU Type
    
        E_MI_PNL_INTF_SRGB, ///< sRGB
    
        E_MI_PNL_INTF_TTL_SPI_IF, ///< TTL with SPI init interface
    
    }MI_PANEL_IntfType_e;
    
  • Related Data Type and Interface

    MI_PANEL_ParamConfig_t

    MI_PANEL_GetPanelParam


2.13. MI_PANEL_AspectRatio_e

  • Description

    Define panel Aspect Ratio enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_ASPECT_RATIO_4_3 = 0, ///< set aspect ratio to 4 : 3
    
        E_MI_PNL_ASPECT_RATIO_WIDE, ///< set aspect ratio to 16 : 9
    
        E_MI_PNL_ASPECT_RATIO_OTHER, ///< resvered for other aspect ratio
        other than 4:3/ 16:9
    
    }MI_PANEL_AspectRatio_e;
    
  • Related Data Type and Interface

    MI_PANEL_ParamConfig_t

    MI_PANEL_GetPanelParam


2.14. MI_PANEL_TiBitMode_e

  • Description

    Define panel TiBit Mode enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_TI_10BIT_MODE = 0,
    
        E_MI_PNL_TI_8BIT_MODE = 2,
    
        E_MI_PNL_TI_6BIT_MODE = 3,
    
    } MI_PANEL_TiBitMode_e;
    
  • Related Data Type and Interface

    MI_PANEL_ParamConfig_t

    MI_PANEL_GetPanelParam


2.15. MI_PANEL_OutputFormatBitMode_e

  • Description

    Define panel output format Bit Mode enumeration

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_OUTPUT_10BIT_MODE = 0, //default is 10bit, becasue 8bit panel
        can use 10bit config and 8bit config.
    
        E_MI_PNL_OUTPUT_6BIT_MODE = 1, //but 10bit panel(like PDP panel) can
        only use 10bit config.
    
        E_MI_PNL_OUTPUT_8BIT_MODE = 2, //and some PDA panel is 6bit.
    
        E_MI_PNL_OUTPUT_565BIT_MODE = 3,
    
    } MI_PANEL_OutputFormatBitMode_e;
    
  • Related Data Type and Interface

    MI_PANEL_ParamConfig_t

    MI_PANEL_GetPanelParam


2.16. MI_PANEL_OutputTimingMode_e

  • Description

    Define panel output timing change mode

  • Definition

    typedef enum
    
    {
    
        E_MI_PNL_CHG_DCLK = 0, ///<change output DClk to change Vfreq.
    
        E_MI_PNL_CHG_HTOTAL = 1, ///<change H total to change Vfreq.
    
        E_MI_PNL_CHG_VTOTAL = 2, ///<change V total to change Vfreq.
    
    } MI_PANEL_OutputTimingMode_e;
    
  • Related Data Type and Interface

    MI_PANEL_ParamConfig_t

    MI_PANEL_GetPanelParam


2.17. MI_PANEL_InitParam_t

  • Description

    Define panel device initialization parameter

  • Definition

    typedef struct MI_PANEL_InitParam_s
    
    {
    
        MI_PANEL_IntfType_e eIntfType;  ///PANEL Interface Type enumerate .
    
    } MI_PANEL_InitParam_t;
    
  • Related Data Type and Interface

    MI_PANEL_InitDev


3. PANEL ERROR CODE

Error Code Macro Definition Description
0xA00B2011 MI_ERR_PANEL_INVALID_PARAM Invalid parameter
0xA00B2006 MI_ERR_PANEL_NULL_PTR Null pointer
0xA00B2001 MI_ERR_PANEL_INVALID_DEVID Invalid device ID
0xA00B2018 MI_ERR_PANEL_DRV_FAILED PANEL driving failed
0xA00B2015 MI_ERR_PANEL_NOT_INIT PANEL not initialized
0xA00B2008 MI_ERR_PANEL_NOT_SUPPORT Unsupported operation

4. PROCFS Introduction

4.1. cat

  • Debug Information

    # cat /proc/mi_modules/mi_panel/mi_panel0
    

  • Debug Information Analysis

    Record timing-related and mipi-dsi-related information configured by user, which can be used to check if user settings are correct and facilitate debugging.

  • Parameter Description

    Parameter Description
    PANEL_NAME Panel name
    LINK_TYPE Link type(TTL, LVDS, BT656, B61120, MIPI-DSI...)
    tgen timing H_Total Number of row scans in one unit time
    V_Total Number of column scans in one unit time
    Width Panel size
    Height
    H_Start Start position of image row direction and field direction
    V_Start
    hbp hsync back porch
    hspw hsync width
    hfp hsync front porch
    vbp vsync back porch
    vspw vsync width
    vfp vsync front porch
    dclk Pixel clk
    fdclk Fix dclk
    fps Frame rate
    tgen polarity INV_DCLK Dclk polarity inversion
    INV_DE DE signal polarity inversion
    InvHSync Hsync signal polarity inversion
    InvVSync Vsync signal polarity inversion
    tgen ssc SSC_Step Spread spectrum amplitude
    SSC_Span Spread spectrum frequency range
    tgen rgb swap chnR Channel R swap
    chnG Channel G swap
    chnB Channel B swap
    ML_swap MSB/LSB swap
    tgen out format OutPutFormat Panel output format bit mode
    srgb RgbDtype RGB data type
    OddLine RGB delta mode of Odd Line
    EvenLine RGB delta mode of Even Line
    ttl backlight ctrl PwGpioNum Power GPIO number
    PwmNum PWM number
    DutyVal PWM duty cycle
    DlyTmPw2Data Power delay time
    DlyTmData2Bl PWM delay time
    PeriodVal PWM period

4.2. echo

Function
Dynamically set Timing-related properties
Command echo settiming [IntfType] [param] [value] > /proc/mi_modules/mi_panel/mi_panel0
Parameter Description [IntfType] Link type, 0: TTL; 1: MIPI-DSI; 2: SPI_TTL
[param] Timing property to be set dynamically, can be hstart/width/hbp/hpw/htotal/vstart/height/vbp/vpw/vtotal
[value] Corresponding value
Example echo settiming 0 width 800 > /proc/mi_modules/mi_panel/mi_panel0
Function
Dynamically set MIPI-related properties
Command echo setmipidsi [IntfType] [param] [value] > /proc/mi_modules/mi_panel/mi_panel0
Parameter Description [IntfType] Link type, 0: TTL; 1: MIPI-DSI; 2: SPI_TTL
[param] MIPI property to be set dynamically, can be width/hpw/hbp/hfp/sssheight/vpw/vbp/vfp/lanenum/format/ctlmode
[value] Corresponding value
Example echo setmipidsi 1 width 800 > /proc/mi_modules/mi_panel/mi_panel0
Function
Set test pattern
Command echo pattern [IntfType] [R] [G] [B] > /proc/mi_modules/mi_panel/mi_panel0
Parameter Description [IntfType] Link type, 0: TTL; 1: MIPI-DSI; 2: SPI_TTL
[R] R component value of the test pattern
[G] G component value of the test pattern
[B] B component value of the test pattern
Example echo pattern 0 10 10 10 > /proc/mi_modules/mi_panel/mi_panel0
Function
Dynamically set Spread Spectrum
Command echo setssc [IntfType] [status] [span] [step] > /proc/mi_modules/mi_panel/mi_panel0
Parameter Description [IntfType] Link type, 0: TTL; 1: MIPI-DSI; 2: SPI_TTL
[status] Enable or disable Spread Spectrum.
[span] Spread spectrum frequency range
[step] Spread spectrum amplitude
Example echo setssc 0 enable 100 100 > /proc/mi_modules/mi_panel/mi_panel0
Function
Dump mipi cmd buf
Command echo dumpcmd > /proc/mi_modules/mi_panel/mi_panel0
Parameter Description NA
Example echo dumpcmd > /proc/mi_modules/mi_panel/mi_panel0