PANEL

The Panel driver provides API to control I2C based display bridge driver present in the board. The display bridge can be a DPI/DSI based bridge that can convert DPI/DSI signals to HDMI output or any other output format.

Features Supported

  • Configurable I2C address for bridge.

  • Configurable I2C address for specific GPIO pin control for bridge.

SysConfig Features

Note

It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.

  • Option to specify I2C address for the bridge and bridge pin control.

Panel Bridge I2C Control
  • Configuration for SII9022A bridge.

Panel SII9022A Bridge Configuration

Features NOT Supported

  • DSI bridge.

Example Usage

Include the below file to access the APIs

//! [include]
#include <board/panel/panel_i2c.h>

BridgeSii9022a_Object gBridgeSii9022aObj =
{
    .modeInfo = {
        .standard = FVID2_STD_1080P_60,
        .modeCode = 16,
        .pixClk = 14850,
        .vFreq = 60,
        .pixels = 2200,
        .lines = 1125,
        .embSyncPrms = {
            .hBitToHSync = 88,
            .field2Offset = 0,
            .hWidth = 44,
            .vBitToVSync = 4,
            .vWidth = 5.
        },
        .extSyncPrms = {
            .deDelay = 192,
            .deTop = 41,
            .deCnt = 1920,
            .deLine = 1080,
        }
    }
};

/* PANEL Driver handles - opened during Board_panelOpen() */
Panel_Handle gPanelHandle[CONFIG_PANEL_NUM_INSTANCES];

Panel_Params gPanelParams[CONFIG_PANEL_NUM_INSTANCES] =
{
    {
        .bridgeParams = {
            .deviceI2cInstId = HDMI_I2C_CONFIG,
            .deviceI2cAddr = 0x3B,
            .inpClk = 0U,
            .hotPlugGpioIntrLine = 0U,
            .clkEdge = FALSE,
            .outputFormat = BRIDGE_SII9022A_HDMI_RGB,
        },
        .vidOutParams = {
            .standard = FVID2_STD_1080P_60,
            .videoDataFormat = FVID2_DF_RGB24_888,
            .videoIfMode = FVID2_VIFM_SCH_DS_AVID_VSYNC,
            .videoIfWidth = FVID2_VIFW_24BIT,
        }
    },
};

Panel_PinCtrl gPinCtrlConfig[CONFIG_PANEL_NUM_INSTANCES] =
{
    {
        .pinCtrlI2cInstance = HDMI_I2C_CONFIG,
        .pinCtrlI2cAddr = 0x23,
        .numPins = 1,
        .pinConf = {
           {
                .pinIoNum = 21,
                .pinType  = TCA6424_MODE_OUTPUT,
                .pinVal   = TCA6424_OUT_STATE_HIGH,
           }
        },
    },
};

/* PANEL Config */
Panel_Config gPanelConfig[CONFIG_PANEL_NUM_INSTANCES] =
{
    {
        .panelType = CONFIG_PANEL_TYPE_I2C,
        .fxns = &gPanelBridgeSii9022aFxns,
        .object = (void *)&gBridgeSii9022aObj,
        .pinConfig = &gPinCtrlConfig[0],

    },
};

uint32_t gPanelConfigNum = CONFIG_PANEL_NUM_INSTANCES;

//! [include]

Instance Open Example

//! [open]
    gPanelHandle[CONFIG_PANEL0] = NULL;
    gPanelHandle[CONFIG_PANEL0] = Panel_open(CONFIG_PANEL0, &gPanelParams[CONFIG_PANEL0]);
    if (!gPanelHandle[CONFIG_PANEL0])
    {
        DebugP_assert(FALSE);
    }
//! [open]

Instance Close Example

//! [close]
    Panel_close(gPanelHandle[CONFIG_PANEL0]);
//! [close]

API Reference

Unnamed Group

CONFIG_PANEL_TYPE_I2C

Panel type supported.

CONFIG_PANEL_TYPE_DSI
CONFIG_PANEL_TYPE_INVALID

Panel driver implementation callbacks

typedef int32_t (*Panel_OpenFxn)(Panel_Config *config, Panel_Params *params)

Driver implementation to open a specific panel driver.

Typically this callback is hidden from the end application and is implemented when a new type of panel device needs to be implemented.

Param config:

[in] Panel configuration for the specific panel device

Param params:

[in] User controllable parameters when opening the panel device

Return:

SystemP_SUCCESS on success, else failure

typedef void (*Panel_CloseFxn)(Panel_Config *config, Panel_Params *params)

Driver implementation to close a specific panel driver.

Typically this callback is hidden from the end application and is implemented when a new type of panel device needs to be implemented.

Param config:

[in] Panel configuration for the specific panel device.

Param params:

[in] User controllable parameters when opening the panel device.

Return:

SystemP_SUCCESS on success, else failure.

typedef int32_t (*Panel_ControlFxn)(Panel_Config *config, Panel_Params *params, uint32_t cmd, void *cmdArgs)

Driver implementation to control panel using a specific panel driver.

Typically this callback is hidden from the end application and is implemented when a new type of panel device needs to be implemented.

Param config:

[in] Panel configuration for the specific panel device.

Param params:

[in] User controllable parameters.

Param cmd:

[in] Specific command to panel control.

Param cmdArgs:

[in] Pointer to arguments associated with command.

Return:

SystemP_SUCCESS on success, else failure

typedef int32_t (*Panel_ResetFxn)(Panel_Config *config, Panel_Params *params)

Driver implementation to soft reset the panel.

Typically this callback is hidden from the end application and is implemented when a new type of panel device needs to be implemented.

Param config:

[in] Panel configuration for the specific panel device.

Param params:

[in] User controllable parameters when opening the panel device.

Return:

SystemP_SUCCESS on success, else failure.

Defines

PANEL_INVALID_VALUE
PANEL_MAX_NUM_PINS_CTRL

Max number pins configured for panel pin control.

Typedefs

typedef void *Panel_Handle

Handle to the FLash driver returned by Panel_open()

Functions

Panel_Handle Panel_open(uint32_t instanceId, Panel_Params *params)

Open panel driver.

Global variables Panel_Config gPanelConfig[] and uint32_t gPanelConfigNum is instantiated by SysCfg to describe the panel configuration based on user selection in SysCfg.

Parameters:
  • instanceId – [in] Index within Panel_Config gPanelConfig[] denoting the panel driver to open.

  • params – [in] Open parameters.

Returns:

Handle to panel driver which should be used in subsequent API call.

Returns:

NULL in case of failure.

void Panel_close(Panel_Handle handle)

Close panel driver.

Parameters:

handle – [in] Panel driver handle from Panel_open.

Panel_Handle Panel_getHandle(uint32_t instanceId)

Get handle to panel driver.

Parameters:

instanceId – [in] Index within Panel_Config gPanelConfig[].

Returns:

Handle to panel driver.

Returns:

NULL in case of failure.

int32_t Panel_control(Panel_Handle handle, uint32_t cmd, void *cmdArgs)

Control Panel operation using panel specific commands.

Commands can be refered from specific panel interface layer.

Parameters:
  • handle – [in] Panel driver handle from Panel_open.

  • cmd – [in] Input command to control panel.

  • cmdArgs – [in] Pointer to command arguments.

Returns:

SystemP_SUCCESS on success, else failure.

int32_t Panel_reset(Panel_Handle handle)

Do a reset of the panel.

Parameters:

handle – [in] Panel driver handle from Panel_open.

Returns:

SystemP_SUCCESS on success, else failure.

uint32_t Panel_getPanelInterfaceIndex(uint32_t panelType)

Return panel index based on type of panel.

Parameters:

panelType – [in] Panel type.

Returns:

Panel driver instance index corresponding to the panel type.

void Panel_init(void)

This function initializes the Panel module.

void Panel_deinit(void)

This function de-initializes the Panel module.

struct Panel_BridgeParams
#include <panel.h>

Bridge configuration parameters.

Public Members

uint32_t deviceI2cInstId

I2C device instance ID to use.

uint32_t deviceI2cAddr

I2C device address for each device

uint32_t inpClk

input clock.

uint32_t hotPlugGpioIntrLine

Hot plug GPIO interrupt line no - if supported by bridge.

uint32_t clkEdge

Specifies the clock edge to be used to latch data on. FALSE spacifies to latch on falling edge, raising edge otherwise.

uint32_t outputFormat
struct Panel_vidOutputParams
#include <panel.h>

Configuration paramters for bridge encoder.

Public Members

uint32_t standard

Video standard. For valid values see Fvid2_Standard.

uint32_t videoIfMode

Select the video mode, like Embedded sync, different type of Discrete sync modes. For valid values see Fvid2_VideoIfMode.

uint32_t videoIfWidth

videoIfWidth

:

Video Interface width , valid options are

FVID2_VIFW_8BIT,

FVID2_VIFW_10BIT,

FVID2_VIFW_16BIT,

FVID2_VIFW_24BIT,

For valid values see Fvid2_VideoIfWidth

.

.

uint32_t videoDataFormat

RGB or YUV data format. valid values are given below

For valid values see

Fvid2_DataFormat. For Sil9022a bridge following data formats are supported videoDataFormat

:

Output Data format, valid options are

FVID2_DF_YUV422I_YUYV,

FVID2_DF_RGB24_888,

struct Panel_PinConfig
#include <panel.h>

Panel pin control data.

Public Members

uint32_t pinIoNum

Port number for the pin.

uint32_t pinType

Pin type : OUTPUT or INPUT

uint32_t pinVal

Pin set value : HIGH, LOW

struct Panel_PinCtrl
#include <panel.h>

Configuration paramters for panel pin control.

Public Members

uint32_t pinCtrlI2cInstance

I2C instance for pinCtrl

uint32_t pinCtrlI2cAddr

I2C address for pinCtrl

uint32_t numPins

Number of pins to be controlled for Panel

Panel_PinConfig pinConf[PANEL_MAX_NUM_PINS_CTRL]

Pin data for pin control

TCA6424_Config ioExpConfig

IO expander config

struct Panel_Params
#include <panel.h>

Parameters passed during Panel_open()

Public Members

Panel_BridgeParams bridgeParams
Panel_vidOutputParams vidOutParams
struct Panel_Fxns
#include <panel.h>

Driver implementation callbacks.

Public Members

Panel_OpenFxn openFxn

Panel driver implementation specific callback

Panel_CloseFxn closeFxn

Panel driver implementation specific callback

Panel_ControlFxn controlFxn

Panel driver implementation specific callback

Panel_ResetFxn resetFxn

Panel driver implementation specific callback

struct Panel_Config
#include <panel.h>

Panel driver configuration, these are filled by SysCfg based on the panel device that is selected.

Public Members

uint32_t panelType

Type of Panel interface

Panel_Fxns *fxns

Panel device implementation functions

void *object

Panel driver object, used to maintain driver implementation state

void *inputParams

Pointer to Panel params used for Panel config

Panel_PinCtrl *pinConfig

Pointer to Panel pin control structure

SemaphoreP_Object lockSem

Semaphore to protect the panel layer calls per instance.