| dsitxss Vitis Drivers API Documentation

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

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Overview

## Data Structures
struct | DsiTxSsSubCore
| Sub-Core Configuration Table. More...
struct | XDsiTxSs_Config
| MIPI DSI Tx Subsystem configuration structure. More...
struct | XDsiTxSs
| The XDsiTxSs driver instance data. More...

## Macros
#define | XDSITXSS_HW_H_
| Prevent circular inclusions by using protection macros. More...
#define | XDSITXSS_HANDLER_UNSUPPORT_DATATYPE XDSI_HANDLER_UNSUPPORT_DATATYPE
| MIPI DSI Tx Subsystem core DSI system interrupt handlers User will register specific interrupts handler and enable interrupts by below defining macros. More...

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

## Enumerations
enum | XDsiSS_Selection
| Subsystem Enable/Disable. More...
enum | XDsiSS_Subcore
| Sub-Core Enable/Disable. More...

## Functions
s32 | XDsiTxSs_CfgInitialize (XDsiTxSs *InstancePtr, XDsiTxSs_Config *CfgPtr, UINTPTR EffectiveAddr)
| This function initializes the MIPI DSI TX subsystem and included sub-cores. More...
u32 | XDsiTxSs_DefaultConfigure (XDsiTxSs *InstancePtr)
| This function is used to configure the DSI default parameters that are to be handled by the application. More...
int | XDsiTxSs_Activate (XDsiTxSs *InstancePtr, XDsiSS_Subcore core, u8 Flag)
| This function is used to activate the DSI Subsystem. More...
void | XDsiTxSs_Reset (XDsiTxSs *InstancePtr)
| This function is used to reset the DSI Subsystem. More...
void | XDsiTxSs_ReportCoreInfo (XDsiTxSs *InstancePtr)
| This function reports list of cores included in DSI TX Subsystem. More...
int | XDsiTxSs_SetDSIMode (XDsiTxSs *InstancePtr, XDsi_DsiModeType mode)
int | XDsiTxSs_SendCmdModePacket (XDsiTxSs *InstancePtr)
void | XDsiTxSs_SendShortPacket (XDsiTxSs *InstancePtr)
| This function will send the short packet to controller Generic Short Packet Register and fill up the structure passed from caller. More...
void | XDsiTxSs_GetConfigParams (XDsiTxSs *InstancePtr)
| This function will get the information from the GUI settings. More...
u32 | XDsiTxSs_IsControllerReady (XDsiTxSs *InstancePtr)
| This function will get the information from the GUI settings. More...
u32 | XDsiTxSs_GetPixelFormat (XDsiTxSs *InstancePtr)
| This function is used to get pixel format. More...
u32 | XDsiTxSs_GetCmdQVacancy (XDsiTxSs *InstancePtr)
| This function is used to get Command queue Vacancy. More...
s32 | XDsiTxSs_SetVideoInterfaceTiming (XDsiTxSs *InstancePtr, XDsi_VideoMode VideoMode, XVidC_VideoMode Resolution, u16 BurstPacketSize)
| This function Set Timing mode and Resolution. More...
s32 | XDsiTxSs_SetCustomVideoInterfaceTiming (XDsiTxSs *InstancePtr, XDsi_VideoMode VideoMode, XDsi_VideoTiming *Timing)
| This function Set Timning mode and Resolution as per user inputs. More...
XDsiTxSs_Config * | XDsiTxSs_LookupConfig (u32 DeviceId)
| This function looks for the device configuration based on the unique device ID. More...
u32 | XDsiTxSs_SelfTest (XDsiTxSs *InstancePtr)
| This function performs self test on MIPI DSI Tx Subsystem sub-cores. More...
u32 | XDsiTxSs_SetCallback (XDsiTxSs *InstancePtr, u32 HandlerType, void *CallbackFunc, void *CallbackRef)
| This routine installs an asynchronous callback function for the given HandlerType: More...
void | XDsiTxSs_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the MIPI DSI Tx Subsystem. More...
void | XDsiTxSs_SetGlobalInterrupt (void *InstancePtr)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...
void | XDsiTxSs_InterruptEnable (void *InstancePtr, u32 Mask)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...

## Variables
XDsiTxSs_SubCores | DsiTxSsSubCores [XPAR_XDSITXSS_NUM_INSTANCES]
| < Define Driver instance of all sub-core included in the design More...

## Macro Definition Documentation

#define XDSITXSS_HANDLER_UNSUPPORT_DATATYPE XDSI_HANDLER_UNSUPPORT_DATATYPE

MIPI DSI Tx Subsystem core DSI system interrupt handlers User will register specific interrupts handler and enable interrupts by below defining macros.

Referenced by DsiTxSs_IntrExample(), and SetupInterruptSystem().

#define XDSITXSS_HW_H_

Prevent circular inclusions by using protection macros.

## Typedef Documentation

typedef void(* XDsiTxSs_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 XDSITXSS_ISR_*_MASK constants defined in xdsitxss_hw.h.

Returns
  None.

Note
  None.

## Enumeration Type Documentation

enum XDsiSS_Selection

Subsystem Enable/Disable.

enum XDsiSS_Subcore

Sub-Core Enable/Disable.

## Function Documentation

int XDsiTxSs_Activate | ( | XDsiTxSs * | InstancePtr,
|  | XDsiSS_Subcore | core,
|  | u8 | Flag
| ) |  |

This function is used to activate the DSI Subsystem.

Internally it activates the DPHY and DSI. Enable/Disable IP core to start processing

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.
  core | is used to denote the subcore of subsystem
  Flag | is used to denote whether to enable or disable the subsystem

Returns
  XST_SUCCESS is returned if subcore(DSI/DPHY) was successfully enabled or disabled XST_INVALID_PARAM is returned if subsystem core is not found

Note
  None.

References XDsiTxSs::Config, and XDsiTxSs::DsiPtr.

Referenced by DsiTxSs_VideoTestExample().

s32 XDsiTxSs_CfgInitialize | ( | XDsiTxSs * | InstancePtr,
|  | XDsiTxSs_Config * | CfgPtr,
|  | UINTPTR | EffectiveAddr
| ) |  |

This function initializes the MIPI DSI TX subsystem and included sub-cores.

This function must be called prior to using the subsystem. Initialization includes setting up the instance data for top level as well as all included sub-core therein, and ensuring the hardware is in a known stable state

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.
  CfgPtr | points to the configuration structure associated with the subsystem instance.
  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 if initialization is successful
  - XST_FAILURE if initialization is failure

Note
  None.

References XDsiTxSs_Config::BaseAddr, XDsiTxSs::Config, XDsiTxSs::DsiPtr, and XDsiTxSs::IsReady.

Referenced by DsiTxSs_IntrExample(), DsiTxSs_SelfTestExample(), and DsiTxSs_VideoTestExample().

u32 XDsiTxSs_DefaultConfigure | ( | XDsiTxSs * | InstancePtr | ) |

This function is used to configure the DSI default parameters that are to be handled by the application.

It will configure protocol register with video mode, bllp mode,eotp

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.

Returns
  - XST_SUCCESS on successful configuration of parameters
  - XST_FAILURE on failure scenraio

Note
  None.

References XDsiTxSs::DsiPtr.

u32 XDsiTxSs_GetCmdQVacancy | ( | XDsiTxSs * | InstancePtr | ) |

This function is used to get Command queue Vacancy.

Parameters

  InstancePtr | is a pointer to the DSITxSs Instance to be worked on.

Returns
  Number of command queue entries can be safely written to Command queue FIFO, before it goes full.

Note
  None

References XDsiTxSs::DsiPtr.

void XDsiTxSs_GetConfigParams | ( | XDsiTxSs * | InstancePtr | ) |

This function will get the information from the GUI settings.

Parameters

  InstancePtr | is the XDsi instance to operate on

Returns
  None

Note
  None.

References XDsiTxSs::ConfigInfo, and XDsiTxSs::DsiPtr.

u32 XDsiTxSs_GetPixelFormat | ( | XDsiTxSs * | InstancePtr | ) |

This function is used to get pixel format.

Parameters

  InstancePtr | is a pointer to the DsiTxSs Instance to be worked on.

Returns
  0x0E – Packed RGB565 0x1E- packed RGB666 0x2E – Loosely packed RGB666 0x3E- Packed RGB888 0x0B- Compressed Pixel Stream

Note
  None

References XDsiTxSs::DsiPtr.

void XDsiTxSs_InterruptEnable | ( | void * | InstancePtr,
|  | u32 | Mask
| ) |  |

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

Parameters

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

Returns
  None

References XDsiTxSs::DsiPtr.

Referenced by DsiTxSs_IntrExample().

void XDsiTxSs_IntrHandler | ( | void * | InstancePtr | ) |

This function is the interrupt handler for the MIPI DSI Tx Subsystem.

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

Parameters

  InstancePtr | is a pointer to the XDsiTxSs core instance that just interrupted.

Returns
  None.

Note
  None.

References XDsiTxSs::DsiPtr.

Referenced by DsiTxSs_IntrExample(), and SetupInterruptSystem().

u32 XDsiTxSs_IsControllerReady | ( | XDsiTxSs * | InstancePtr | ) |

This function will get the information from the GUI settings.

Parameters

  InstancePtr | is the XDsiTxss instance to operate on

Returns
  Controller ready status

Note
  None.

References XDsiTxSs::DsiPtr.

XDsiTxSs_Config * XDsiTxSs_LookupConfig | ( | u32 | DeviceId | ) |

This function looks for the device configuration based on the unique device ID.

The table XDsiTxSs_ConfigTable[] contains the configuration information for each instance of the device in the system.

Parameters

  DeviceId | is the unique device ID of the device being looked up

Returns
  A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found

Note
  None.

Referenced by DsiTxSs_IntrExample(), DsiTxSs_SelfTestExample(), and DsiTxSs_VideoTestExample().

void XDsiTxSs_ReportCoreInfo | ( | XDsiTxSs * | InstancePtr | ) |

This function reports list of cores included in DSI TX Subsystem.

Parameters

  InstancePtr | is a pointer to the DSI TX Subsystem instance.

Returns
  None

Note
  None.

References XDsiTxSs::Config, XDsiTxSs_Config::DphyInfo, XDsiTxSs::DsiPtr, and DsiTxSsSubCore::IsPresent.

void XDsiTxSs_Reset | ( | XDsiTxSs * | InstancePtr | ) |

This function is used to reset the DSI Subsystem.

Internally it resets the DPHY and DSI

Parameters

  InstancePtr | is a pointer to the Subsystem instance to be worked on.

Returns
  None

Note
  None.

References XDsiTxSs::Config, XDsiTxSs::DsiPtr, and XDsiTxSs_Config::IsDphyRegIntfcPresent.

Referenced by DsiTxSs_VideoTestExample().

u32 XDsiTxSs_SelfTest | ( | XDsiTxSs * | InstancePtr | ) |

This function performs self test on MIPI DSI Tx Subsystem sub-cores.

Parameters

  InstancePtr | is a pointer to the XDsiTxSs core instance.

Returns
  - XST_SUCCESS if self test passed.
  - XST_FAILURE if self test failed.

Note
  None.

References XDsiTxSs::Config, XDsiTxSs_Config::DphyInfo, XDsiTxSs::DsiPtr, and DsiTxSsSubCore::IsPresent.

Referenced by DsiTxSs_IntrExample(), DsiTxSs_SelfTestExample(), and DsiTxSs_VideoTestExample().

int XDsiTxSs_SendCmdModePacket | ( | XDsiTxSs * | InstancePtr | ) |

- This function will send the short packet to controller in command mode
- Generic Short Packet Register and fill up the structure passed from caller.
- Parameters

    InstancePtr | is the XDsiTxSs instance to operate on

- Returns
    - XST_SUCCESS on successful packet transmission
    - XST_FAILURE on failure in packet transmission
- Note
    None.

References XDsiTxSs::CmdPkt, and XDsiTxSs::DsiPtr.

void XDsiTxSs_SendShortPacket | ( | XDsiTxSs * | InstancePtr | ) |

This function will send the short packet to controller Generic Short Packet Register and fill up the structure passed from caller.

like to turn on/off peripheral, change color mode

Parameters

  InstancePtr | is the XDsiTxSs instance to operate on

Returns
  None

Note
  None.

References XDsiTxSs::DsiPtr, and XDsiTxSs::SpktData.

u32 XDsiTxSs_SetCallback | ( | XDsiTxSs * | InstancePtr,
|  | u32 | HandlerType,
|  | void * | CallbackFunc,
|  | void * | CallbackRef
| ) |  |

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

    HandlerType                     Invoked by this driver when:
    -----------------------  --------------------------------------------------
    XDSI_HANDLER_UNSUPPORT_DATATYPE Un support data type detected
    XDSI_HANDLER_PIXELDATA_UNDERRUN Byte    Stream FIFO starves for Pixel during
                                     HACT transmission
    XDSI_HANDLER_OTHERERROR  Any other type of interrupt has occured like
                            Stream Line Buffer Full, Incorrect Lanes, etc
    XDSI_HANDLER_CMDQ_FIFOFULL      Command queue FIFO Full

Parameters

  InstancePtr | is the XDsi instance to operate on
  HandlerType | 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 XDsiTxSs::DsiPtr, and XDsiTxSs::IsReady.

Referenced by DsiTxSs_IntrExample(), and SetupInterruptSystem().

s32 XDsiTxSs_SetCustomVideoInterfaceTiming | ( | XDsiTxSs * | InstancePtr,
|  | XDsi_VideoMode | VideoMode,
|  | XDsi_VideoTiming * | Timing
| ) |  |

This function Set Timning mode and Resolution as per user inputs.

Parameters

  InstancePtr | is the XDsi instance to operate on
  VideoMode | Specifies mode of Interfacing
  Timing | Video Timing parameters

Returns
  - XST_SUCCESS is return Video interfacing was successfully set
  - XST_INVALID_PARAM indicates an invalid parameter was specified.

Note
  None

References XDsiTxSs::DsiPtr.

Referenced by DsiTxSs_VideoTestExample().

int XDsiTxSs_SetDSIMode | ( | XDsiTxSs * | InstancePtr,
|  | XDsi_DsiModeType | mode
| ) |  |

- This function sets the mode to send short packet.
- Parameters

    InstancePtr | is the XDsiTxSs instance to operate on

- Parameters

    mode | is the DSI mode (video or command) to operate on

- Returns
    None
- Note
    None.

References XDsiTxSs::DsiPtr.

void XDsiTxSs_SetGlobalInterrupt | ( | void * | InstancePtr | ) |

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

Parameters

  InstancePtr | is the XDsiTxSs instance to operate on

Returns
  None

Note
  None.

References XDsiTxSs::DsiPtr.

Referenced by SetupInterruptSystem().

s32 XDsiTxSs_SetVideoInterfaceTiming | ( | XDsiTxSs * | InstancePtr,
|  | XDsi_VideoMode | VideoMode,
|  | XVidC_VideoMode | Resolution,
|  | u16 | BurstPacketSize
| ) |  |

This function Set Timing mode and Resolution.

As per user resolution selection it will get populate Periperal Timing Parameters from video common Library

Parameters

  InstancePtr | is the XDsi instance to operate on
  VideoMode | Specifies mode of Interfacing
  Resolution | sets the resolution
  BurstPacketSize | sets the packet size

Returns
  - XST_SUCCESS is return Video interfacing set was successful
  - XST_INVALID_PARAM indicates an invalid parameter was specified.

Note
  None.

References XDsiTxSs::DsiPtr.

## Variable Documentation

XDsiTxSs_SubCores DsiTxSsSubCores[XPAR_XDSITXSS_NUM_INSTANCES]

< Define Driver instance of all sub-core included in the design