| dsi2rx Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Typedefs | Functions
Overview

## Data Structures
struct | XDsi2Rx_Config
| The configuration structure for DSI Controller This structure passes the hardware building information to the driver. More...
struct | XDsi2Rx_ConfigParameters
| The structure to read DSI controller & Configurable Parameters. More...
struct | XDsi2Rx
| The XDsi2Rx driver instance data. More...

## Typedefs
typedef void(* | XDsi2Rx_Callback )(void *CallbackRef, u32 Mask)
| Callback type for all interrupts defined. More...

## Functions
XDsi2Rx_Config * | XDsi2Rx_LookupConfig (UINTPTR BaseAddress)
| Look up the hardware configuration for a device instance. More...
u32 | XDsi2Rx_CfgInitialize (XDsi2Rx *InstancePtr, XDsi2Rx_Config *Config, UINTPTR EffectiveAddr)
| Initialize the XDsi2Rx instance provided by the caller based on the given Config structure. More...
u32 | XDsi2Rx_Activate (XDsi2Rx *InstancePtr, XDsi2Rx_Selection Flag)
| This function will enable/disable the IP Core to start processing. More...
void | XDsi2Rx_Reset (XDsi2Rx *InstancePtr)
| This function will do a reset of the IP. More...
u32 | XDsi2Rx_DefaultConfigure (XDsi2Rx *InstancePtr)
| This function will configure protocol reg with video mode, Blank packet mode, Blank packet Type, End of Transmisstion packet. More...
u32 | XDsi2Rx_SelfTest (XDsi2Rx *InstancePtr)
| Runs a self-test on the driver/device. More...
void | XDsi2Rx_GetConfigParams (XDsi2Rx *InstancePtr, XDsi2Rx_ConfigParameters *ConfigInfo)
| this function will get the information from the gui settings and other protocol control register values like pixel mode, pixel format. More...
s32 | XDsi2Rx_SetCallback (XDsi2Rx *InstancePtr, u32 HandleType, void *CallbackFunc, void *CallbackRef)
| This routine installs an asynchronous callback function for the given HandlerType: More...
void | XDsi2Rx_InterruptEnable (XDsi2Rx *InstancePtr, u32 Mask)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...
void | XDsi2Rx_InterruptDisable (XDsi2Rx *InstancePtr, u32 Mask)
| This function will disable the interrupts present in the interrupt mask passed onto the function. More...
u32 | XDsi2Rx_InterruptGetEnabled (XDsi2Rx *InstancePtr)
| This function will get the interrupt mask set (enabled) in the DSI core. More...
u32 | XDsi2Rx_InterruptGetStatus (XDsi2Rx *InstancePtr)
| This function will get the list of interrupts Invoked in the Interrupt Status Register of the DSI core. More...
void | XDsi2Rx_InterruptClear (XDsi2Rx *InstancePtr, u32 Mask)
| This function will clear the interrupts set in the Interrupt Status Register of the DSI core. More...
void | XDsi2Rx_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the DSI core. More...

## Typedef Documentation

typedef void(* XDsi2Rx_Callback)(void *CallbackRef, u32 Mask)

Callback type for all interrupts defined.

Parameters

  CallBackRef | is a callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked.
  Mask | is a bit mask indicating the cause of the event. For current core version, this parameter is "OR" of 0 or more XDSI2RX_ISR_*_MASK constants defined in xdsi_hw.h.

Returns
  None.

Note
  None.

## Function Documentation

u32 XDsi2Rx_Activate | ( | XDsi2Rx * | InstancePtr,
|  | XDsi2Rx_Selection | Flag
| ) |  |

This function will enable/disable the IP Core to start processing.

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on.
  Flag | will be used to indicate Enable or Disable action.

Returns
  - XST_SUCCESS On enabling/disabling the core.

- XST_INVALID_PARAM if user passes invalid parameter.

Note
  None.

References XDsi2Rx::IsReady.

u32 XDsi2Rx_CfgInitialize | ( | XDsi2Rx * | InstancePtr,
|  | XDsi2Rx_Config * | CfgPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

Initialize the XDsi2Rx instance provided by the caller based on the given Config structure.

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on.
  CfgPtr | is the device configuration structure containing information about a specific DSI.
  EffectiveAddr | is the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.

Returns
  - XST_SUCCESS Initialization was successful.
  - XST_FAILURE Initialization was unsuccessful.

Note
  None.

References XDsi2Rx_Config::BaseAddr, XDsi2Rx::Config, XDsi2Rx::IsReady, and XDsi2Rx::UnSupportedDataTypeCallback.

u32 XDsi2Rx_DefaultConfigure | ( | XDsi2Rx * | InstancePtr | ) |

This function will configure protocol reg with video mode, Blank packet mode, Blank packet Type, End of Transmisstion packet.

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on.

Returns
  - XST_SUCCESS On enabling the core.

Note
  None.

References XDsi2Rx::IsReady, and XDsi2Rx::PixelMode.

void XDsi2Rx_GetConfigParams | ( | XDsi2Rx * | InstancePtr,
|  | XDsi2Rx_ConfigParameters * | ConfigInfo
| ) |  |

this function will get the information from the gui settings and other protocol control register values like pixel mode, pixel format.

Parameters

  instanceptr | is the xdsi2rx instance to operate on
  configinfo | is going to be filled up by this function and returned to the caller.

Returns
  none.

Note
  none.

References XDsi2Rx_Config::BaseAddr, XDsi2Rx_ConfigParameters::Config, XDsi2Rx::Config, and XDsi2Rx_ConfigParameters::PixelMode.

void XDsi2Rx_InterruptClear | ( | XDsi2Rx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will clear the interrupts set in the Interrupt Status Register of the DSI core.

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on
  Mask | is Interrupt Mask with bits set for corresponding interrupt to be cleared in the Interrupt Status register

Returns
  None

Note
  None

Referenced by XDsi2Rx_IntrHandler().

void XDsi2Rx_InterruptDisable | ( | XDsi2Rx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will disable the interrupts present in the interrupt mask passed onto the function.

Parameters

  InstancePtr | is the XDsi instance to operate on
  Mask | is the interrupt mask which need to be enabled in core

Returns
  None

Note
  None

void XDsi2Rx_InterruptEnable | ( | XDsi2Rx * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function will enable the interrupts present in the interrupt mask passed onto the function.

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on
  Mask | is the interrupt mask which need to be enabled in core

Returns
  None

Note
  None

u32 XDsi2Rx_InterruptGetEnabled | ( | XDsi2Rx * | InstancePtr | ) |

This function will get the interrupt mask set (enabled) in the DSI core.

Parameters

  InstancePtr | is the XDsi instance to operate on

Returns
  Interrupt Mask with bits set for corresponding interrupt in Interrupt enable register

Note
  None

u32 XDsi2Rx_InterruptGetStatus | ( | XDsi2Rx * | InstancePtr | ) |

This function will get the list of interrupts Invoked in the Interrupt Status Register of the DSI core.

Parameters

  InstancePtr | is the XDsi instance to operate on

Returns
  Interrupt Mask with bits set for corresponding interrupt in Interrupt Status register

Note
  None

Referenced by XDsi2Rx_IntrHandler().

void XDsi2Rx_IntrHandler | ( | void * | InstancePtr | ) |

This function is the interrupt handler for the DSI core.

This handler reads the Invoked interrupt from the Interrupt Status register determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in Interrupt Enable register and finally clears the interrupts.

The application is responsible for connecting this function to the interrupt system. Application beyond this core is also responsible for providing callbacks to handle interrupts and installing the callbacks using XDsi2Rx_SetCallback() during initialization phase.

Parameters

  InstancePtr | is a pointer to the XDsi2Rx core instance.

Returns
  None.

Note
  Interrupt should be enabled to execute interrupt handler.

References XDsi2Rx::IsReady, XDsi2Rx::UnsupportDataTypeRef, XDsi2Rx::UnSupportedDataTypeCallback, XDsi2Rx_InterruptClear(), and XDsi2Rx_InterruptGetStatus().

XDsi2Rx_Config * XDsi2Rx_LookupConfig | ( | UINTPTR | BaseAddress | ) |

Look up the hardware configuration for a device instance.

Parameters

  BaseAddress | is the unique device ID of the device to lookup for

Returns
  The reference to the configuration record in the configuration table (in xdsi2rx_g.c) corresponding to the BaseAddress or if not found, a NULL pointer is returned.

Note
  None

void XDsi2Rx_Reset | ( | XDsi2Rx * | InstancePtr | ) |

This function will do a reset of the IP.

Register ISR gets reset. Internal FIFO(command queue) gets flushed. FSM stops processing further packets. Controller gracefully ends by waiting for the current sub-block in operation to complete its task and mark next byte as LP byte to end the transfer. Once soft reset is released, controller start from VSS packet. (that is new video frame)

Parameters

  InstancePtr | is the XDsi2Rx instance to operate on.

Returns
  None.

Note
  None.

u32 XDsi2Rx_SelfTest | ( | XDsi2Rx * | InstancePtr | ) |

Runs a self-test on the driver/device.

This test checks if the Pixel mode has been set.

Parameters

  InstancePtr | is a pointer to the XDsi2Rx instance.

Returns
  - XST_SUCCESS if self-test was successful
  - XST_FAILURE if the read value was not equal to GUI parameter

Note
  None

References XDsi2Rx_Config::BaseAddr, XDsi2Rx::Config, and XDsi2Rx::IsReady.

s32 XDsi2Rx_SetCallback | ( | XDsi2Rx * | InstancePtr,
|  | u32 | HandleType,
|  | void * | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

This routine installs an asynchronous callback function for the given HandlerType:

    HandlerType                     Invoked by this driver when:
    -----------------------  --------------------------------------------------
    XDSI2RX_HANDLER_UNSUPPORT_DATATYPE      Unsupported data type
    XDSI2RX_HANDLER_CRC_ERROR               CRC error
    XDSI2RX_HANDLER_ECC1_BIT_ERROR  ECC 1 bit error
    XDSI2RX_HANDLER_ECC2_BIT_ERROR  ECC 2 bit error
    XDSI2RX_HANDLER_SOT_SYNC_ERR_LANE1      SOT sync error on line 1
    XDSI2RX_HANDLER_SOT_ERR_LANE1           SOT error on line 1
    XDSI2RX_HANDLER_SOT_SYNC_ERR_LANE2      SOT sync error on line 2
    XDSI2RX_HANDLER_SOT_ERR_LANE2           SOT error on line 2
    XDSI2RX_HANDLER_SOT_SYNC_ERR_LANE3      SOT sync error on line 3
    XDSI2RX_HANDLER_SOT_ERR_LANE3           SOT error on line 3
    XDSI2RX_HANDLER_SOT_SYNC_ERR_LANE4      SOT sync error on line 4
    XDSI2RX_HANDLER_SOT_ERR_LANE4           SOT error on line 4
    XDSI2RX_HANDLER_STOP_STATE              STOP state
    XDSI2RX_HANDLER_LM_ASYNC_FIFO_FULL      Long msg asyn fifo full.
    XDSI2RX_HANDLER_STREAM_ASYNC_FIFO_FULL stream async fifo full
    XDSI2RX_HANDLER_GSP_FIFO_NE             generic short packet fifo not empty
    XDSI2RX_HANDLER_GSP_FIFO_FULL           generic short packet fifo full
    XDSI2RX_HANDLER_FRAME_STARTED           frame started

Parameters

  InstancePtr | is the XDsi instance to operate on
  HandleType | is the type of call back to be registered.
  CallbackFunc | is the pointer to a call back funtion which is called when a particular event occurs.
  CallbackRef | is a void pointer to data to be referenced to by the CallbackFunc

Returns
  - XST_SUCCESS when handler is installed.

- XST_INVALID_PARAM when HandlerType is invalid.

Note
  Invoking this function for a handler that already has been installed replaces it with the new handler.

References XDsi2Rx::IsReady, XDsi2Rx::UnsupportDataTypeRef, and XDsi2Rx::UnSupportedDataTypeCallback.