v_sdirxss
Vitis Drivers API Documentation
xv_sdirxss.h File Reference

Overview

This is main header file of the Xilinx SDI RX Subsystem driver.

SDI RX Subsystem Overview

Video Subsystem is a collection of IP cores bounded together by software to provide an abstract view of the processing pipe. It hides all the complexities of programming the underlying cores from end user.

Subsystem Driver Features

Video Subsystem supports following features

  • AXI Stream Input/Output interface
  • 2 pixel-wide video interface
  • 10 bits per component
  • YCbCr 4:2:2 color space
  • Up to 4k2k 60Hz resolution (12G) at both Input and Output interface
  • Interlaced input support (1080i 50Hz/60Hz)
MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00 jsr 07/17/17 Initial release.

Data Structures

struct  XV_SdiRxSs_Log
 This typedef contains the logging mechanism for debug. More...
 
struct  XV_SdiRxSs_SubCore
 Sub-Core Configuration Table. More...
 
struct  XV_SdiRxSs_Config
 This typedef contains configuration information for the SDI RX core. More...
 
struct  XV_SdiRxSs
 The XV_SdiRxSs driver instance data. More...
 

Macros

#define XV_SDIRXSS_H_
 Prevent circular inclusions by using protection macros. More...
 
#define XV_SdiRxSs_GetVersion(InstancePtr)
 This macro reads the RX version. More...
 

Typedefs

typedef void(* XV_SdiRxSs_Callback )(void *CallbackRef)
 Callback type for interrupt. More...
 

Functions

XV_SdiRxSs_ConfigXV_SdiRxSs_LookupConfig (u32 DeviceId)
 This function looks for the device configuration based on the unique device ID. More...
 
int XV_SdiRxSs_CfgInitialize (XV_SdiRxSs *InstancePtr, XV_SdiRxSs_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the video subsystem and included sub-cores. More...
 
void XV_SdiRxSS_SdiRxIntrHandler (XV_SdiRxSs *InstancePtr)
 This function calls the interrupt handler for SDI RX. More...
 
void XV_SdiRxSs_StreamFlowEnable (XV_SdiRxSs *InstancePtr)
 This function enables the AXIS and video bridges. More...
 
void XV_SdiRxSs_StreamFlowDisable (XV_SdiRxSs *InstancePtr)
 This function disables the AXIS and video bridges. More...
 
void XV_SdiRxSs_Start (XV_SdiRxSs *InstancePtr, XV_SdiRx_SearchMode Mode)
 This function starts the SDI RX stream detection. More...
 
void XV_SdiRxSs_Stop (XV_SdiRxSs *InstancePtr)
 This function stops the SDI RX stream detection. More...
 
void XV_SdiRxSs_SetYCbCr444_RGB_10bit (XV_SdiRxSs *InstancePtr)
 This function enable the YUV444/RGB 10bit support SDI RX SS video stream. More...
 
void XV_SdiRxSs_ClearYCbCr444_RGB_10bit (XV_SdiRxSs *InstancePtr)
 This function disable the YUV444/RGB 10bit support SDI RX SS video stream. More...
 
int XV_SdiRxSs_SetCallback (XV_SdiRxSs *InstancePtr, u32 HandlerType, void *CallbackFunc, void *CallbackRef)
 This function installs an asynchronous callback function for the given HandlerType: More...
 
void XV_SdiRxSs_ReportCoreInfo (XV_SdiRxSs *InstancePtr)
 This function reports list of cores included in Video Processing Subsystem. More...
 
void XV_SdiRxSs_ReportInfo (XV_SdiRxSs *InstancePtr)
 This function prints the SDI RX SS information. More...
 
void XV_SdiRxSs_ReportDebugInfo (XV_SdiRxSs *InstancePtr)
 This function prints the SDI RX SS debug information. More...
 
u32 XV_SdiRxSs_WaitforPayLoad (XV_SdiRxSs *InstancePtr)
 This function is used to wait for the payload valid bit to be set. More...
 
XVidC_VideoStream * XV_SdiRxSs_GetVideoStream (XV_SdiRxSs *InstancePtr, u8 StreamId)
 This function returns the pointer to SDI RX SS video stream. More...
 
int XV_SdiRxSs_IsStreamUp (XV_SdiRxSs *InstancePtr)
 This function checks if the video stream is up. More...
 
void XV_SdiRxSs_IntrEnable (XV_SdiRxSs *InstancePtr, u32 IntrMask)
 This function is used to configure the SDI RX interrupts that are to be handled by the application. More...
 
void XV_SdiRxSs_IntrDisable (XV_SdiRxSs *InstancePtr, u32 IntrMask)
 This function is used to configure the SDI RX interrupts that are to be handled by the application. More...
 
u32 XV_SdiRxSs_SelfTest (XV_SdiRxSs *InstancePtr)
 This function performs self test on SDI Rx Subsystem sub-cores. More...
 
void XV_SdiRxSs_LogReset (XV_SdiRxSs *InstancePtr)
 This function will reset the driver's logging mechanism. More...
 
void XV_SdiRxSs_LogWrite (XV_SdiRxSs *InstancePtr, XV_SdiRxSs_LogEvent Evt, u8 Data)
 This function will insert an event in the driver's logginc mechanism. More...
 
u16 XV_SdiRxSs_LogRead (XV_SdiRxSs *InstancePtr)
 This function will read the last event from the log. More...
 
void XV_SdiRxSs_LogDisplay (XV_SdiRxSs *InstancePtr)
 This function will print the entire log. More...
 
void XV_SdiRxSs_HandleNoPayload (XV_SdiRxSs *InstancePtr, u8 enable)
 This function disables handling for no payload case. More...
 

Bitmasks for interrupt callbacks

Please refer to SDI Rx driver for details of the bitmasks.

The application should use the XV_SDIRXSS_IER* masks in the call back functions to decode the exact cause of interrupt and handle it accordingly.

#define XV_SDIRXSS_IER_VIDEO_LOCK_MASK   XV_SDIRX_IER_VIDEO_LOCK_MASK
 
#define XV_SDIRXSS_IER_VIDEO_UNLOCK_MASK   XV_SDIRX_IER_VIDEO_UNLOCK_MASK
 
#define XV_SDIRXSS_IER_OVERFLOW_MASK   XV_SDIRX_IER_OVERFLOW_MASK
 
#define XV_SDIRXSS_IER_UNDERFLOW_MASK   XV_SDIRX_IER_UNDERFLOW_MASK
 
#define XV_SDIRXSS_IER_VSYNC_MASK   XV_SDIRX_IER_VSYNC_MASK
 
#define XV_SDIRXSS_IER_ALLINTR_MASK   XV_SDIRX_IER_ALLINTR_MASK
 
enum  XV_SdiRxSs_LogEvent {
  XV_SDIRXSS_LOG_EVT_NONE = 1, XV_SDIRXSS_LOG_EVT_SDIRX_INIT, XV_SDIRXSS_LOG_EVT_START, XV_SDIRXSS_LOG_EVT_STOP,
  XV_SDIRXSS_LOG_EVT_RESET, XV_SDIRXSS_LOG_EVT_STREAMUP, XV_SDIRXSS_LOG_EVT_STREAMDOWN, XV_SDIRXSS_LOG_EVT_OVERFLOW,
  XV_SDIRXSS_LOG_EVT_UNDERFLOW, XV_SDIRXSS_LOG_EVT_STREAMSTART, XV_SDIRXSS_LOG_EVT_SETSTREAM, XV_SDIRXSS_LOG_EVT_DUMMY
}
 This typedef contains the enum for various logging events. More...
 
enum  XV_SdiRxSs_HandlerType {
  XV_SDIRXSS_HANDLER_STREAM_DOWN = 1, XV_SDIRXSS_HANDLER_STREAM_UP, XV_SDIRXSS_HANDLER_OVERFLOW, XV_SDIRXSS_HANDLER_UNDERFLOW,
  XV_SDIRXSS_HANDLER_VSYNC
}
 These constants specify different types of handler and used to differentiate interrupt requests from peripheral. More...
 

Macro Definition Documentation

#define XV_SdiRxSs_GetVersion (   InstancePtr)
Value:
XV_SdiRxSs_ReadReg((InstancePtr)->Config.BaseAddress, \
(XV_SDIRXSS_VER_OFFSET))

This macro reads the RX version.

Parameters
InstancePtris a pointer to the XV_SdiRX core instance.
Returns
None.
#define XV_SDIRXSS_H_

Prevent circular inclusions by using protection macros.

Typedef Documentation

typedef void(* XV_SdiRxSs_Callback)(void *CallbackRef)

Callback type for interrupt.

Parameters
CallbackRefis 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.
Returns
None.
Note
None.

Enumeration Type Documentation

These constants specify different types of handler and used to differentiate interrupt requests from peripheral.

Enumerator
XV_SDIRXSS_HANDLER_STREAM_DOWN 

Handler for stream down event.

XV_SDIRXSS_HANDLER_STREAM_UP 

Handler for stream up event.

XV_SDIRXSS_HANDLER_OVERFLOW 

Handler for over flow event.

XV_SDIRXSS_HANDLER_UNDERFLOW 

Handler for under flow event.

XV_SDIRXSS_HANDLER_VSYNC 

Handler for vsync event.

This typedef contains the enum for various logging events.

Enumerator
XV_SDIRXSS_LOG_EVT_NONE 

Log event none.

XV_SDIRXSS_LOG_EVT_SDIRX_INIT 

Log event SDIRX Init.

XV_SDIRXSS_LOG_EVT_START 

Log event SDIRXSS Start.

XV_SDIRXSS_LOG_EVT_STOP 

Log event SDIRXSS Stop.

XV_SDIRXSS_LOG_EVT_RESET 

Log event SDIRXSS Reset.

XV_SDIRXSS_LOG_EVT_STREAMUP 

Log event Stream Up.

XV_SDIRXSS_LOG_EVT_STREAMDOWN 

Log event Stream Down.

XV_SDIRXSS_LOG_EVT_OVERFLOW 

Log event Over flow.

XV_SDIRXSS_LOG_EVT_UNDERFLOW 

Log event Under flow.

XV_SDIRXSS_LOG_EVT_STREAMSTART 

Log event Stream Start.

XV_SDIRXSS_LOG_EVT_SETSTREAM 

Log event SDIRXSS Setstream.

XV_SDIRXSS_LOG_EVT_DUMMY 

Dummy Event should be last.

Function Documentation

int XV_SdiRxSs_CfgInitialize ( XV_SdiRxSs InstancePtr,
XV_SdiRxSs_Config CfgPtr,
UINTPTR  EffectiveAddr 
)

This function initializes the video 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
InstancePtris a pointer to the Subsystem instance to be worked on.
CfgPtrpoints to the configuration structure associated with the subsystem instance.
EffectiveAddris 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 else XST_FAILURE

References XV_SdiRxSs_Config::BaseAddress, XV_SdiRxSs::Config, XV_SdiRxSs_Config::DeviceId, XV_SdiRxSs::IsReady, XV_SdiRxSs::SdiRxPtr, and XV_SdiRxSs_SubcoreInitSdiRx().

Referenced by main(), and SdiRxSs_SelfTestExample().

void XV_SdiRxSs_ClearYCbCr444_RGB_10bit ( XV_SdiRxSs InstancePtr)

This function disable the YUV444/RGB 10bit support SDI RX SS video stream.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None

References XV_SdiRxSs::SdiRxPtr.

XVidC_VideoStream* XV_SdiRxSs_GetVideoStream ( XV_SdiRxSs InstancePtr,
u8  StreamId 
)

This function returns the pointer to SDI RX SS video stream.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
StreamIdspecifies which video stream's pointer to be returned
Returns
XVidC_VideoStream pointer
Note
None.

References XV_SdiRxSs::SdiRxPtr.

void XV_SdiRxSs_HandleNoPayload ( XV_SdiRxSs InstancePtr,
u8  enable 
)

This function disables handling for no payload case.

Parameters
InstancePtris a pointer to the XV_SdiRxSs core instance.
enableis to enable/disable the Handling of nopayload case
Returns
None

References XV_SdiRxSs::SdiRxPtr.

void XV_SdiRxSs_IntrDisable ( XV_SdiRxSs InstancePtr,
u32  IntrMask 
)

This function is used to configure the SDI RX interrupts that are to be handled by the application.

Refer to xv_sdirxss_hw.h for interrupt masks.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
IntrMaskIndicates Mask for disabling interrupts.
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr.

Referenced by main().

void XV_SdiRxSs_IntrEnable ( XV_SdiRxSs InstancePtr,
u32  IntrMask 
)

This function is used to configure the SDI RX interrupts that are to be handled by the application.

Refer to xv_sdirxss_hw.h for interrupt masks.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
IntrMaskIndicates Mask for enable interrupts.
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr.

Referenced by main().

int XV_SdiRxSs_IsStreamUp ( XV_SdiRxSs InstancePtr)

This function checks if the video stream is up.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
  • TRUE if stream is up.
  • FALSE if stream is down.
Note
None.

References XV_SdiRxSs::IsStreamUp.

u16 XV_SdiRxSs_LogRead ( XV_SdiRxSs InstancePtr)

This function will read the last event from the log.

Parameters
InstancePtris a pointer to the XV_SdiRxSs core instance.
Returns
The log data.
Note
None.

References XV_SdiRxSs_Log::DataBuffer, XV_SdiRxSs_Log::HeadIndex, XV_SdiRxSs::Log, and XV_SdiRxSs_Log::TailIndex.

Referenced by XV_SdiRxSs_LogDisplay().

void XV_SdiRxSs_LogReset ( XV_SdiRxSs InstancePtr)

This function will reset the driver's logging mechanism.

Parameters
InstancePtris a pointer to the xv_sdirxss core instance.
Returns
None.
Note
None.

References XV_SdiRxSs_Log::HeadIndex, XV_SdiRxSs::Log, and XV_SdiRxSs_Log::TailIndex.

void XV_SdiRxSs_LogWrite ( XV_SdiRxSs InstancePtr,
XV_SdiRxSs_LogEvent  Evt,
u8  Data 
)

This function will insert an event in the driver's logginc mechanism.

Parameters
InstancePtris a pointer to the XV_SdiRxSs core instance.
Evtis the event type to log.
Datais the associated data for the event.
Returns
None.
Note
None.

References XV_SdiRxSs_Log::DataBuffer, XV_SdiRxSs_Log::HeadIndex, XV_SdiRxSs::Log, XV_SdiRxSs_Log::TailIndex, and XV_SDIRXSS_LOG_EVT_DUMMY.

Referenced by XV_SdiRxSs_Start(), XV_SdiRxSs_Stop(), and XV_SdiRxSs_SubcoreInitSdiRx().

XV_SdiRxSs_Config* XV_SdiRxSs_LookupConfig ( u32  DeviceId)

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

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

Parameters
DeviceIdis 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

Referenced by main(), and SdiRxSs_SelfTestExample().

void XV_SdiRxSs_ReportCoreInfo ( XV_SdiRxSs InstancePtr)

This function reports list of cores included in Video Processing Subsystem.

Parameters
InstancePtris a pointer to the Subsystem instance.
Returns
None

References XV_SdiRxSs::SdiRxPtr.

Referenced by XV_SdiRxSs_ReportInfo().

void XV_SdiRxSs_ReportDebugInfo ( XV_SdiRxSs InstancePtr)

This function prints the SDI RX SS debug information.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr.

Referenced by DebugInfo().

void XV_SdiRxSs_ReportInfo ( XV_SdiRxSs InstancePtr)

This function prints the SDI RX SS information.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr, and XV_SdiRxSs_ReportCoreInfo().

Referenced by Info().

void XV_SdiRxSS_SdiRxIntrHandler ( XV_SdiRxSs InstancePtr)

This function calls the interrupt handler for SDI RX.

Parameters
InstancePtris a pointer to the SDI RX Subsystem

References XV_SdiRxSs::SdiRxPtr.

Referenced by main().

int XV_SdiRxSs_SetCallback ( XV_SdiRxSs InstancePtr,
u32  HandlerType,
void *  CallbackFunc,
void *  CallbackRef 
)

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

HandlerType                     Callback Function Type
-----------------------         ---------------------------------------------
(XV_SDIRXSS_HANDLER_STREAM_DOWN)         StreamDownCallback
(XV_SDIRXSS_HANDLER_STREAM_UP)           StreamUpCallback
(XV_SDIRXSS_HANDLER_OVERFLOW)           OverFlowCallback
(XV_SDIRXSS_HANDLER_UNDERFLOW)           UnderFlowCallback
(XV_SDIRXSS_HANDLER_VSYNC)                 VsyncCallback
Parameters
InstancePtris a pointer to the SDI RX Subsystem instance.
HandlerTypespecifies the type of handler.
CallbackFuncis the address of the callback function.
CallbackRefis a user data item that will be passed to the callback function when it is invoked.
Returns
  • XST_SUCCESS if callback function installed successfully.
  • 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 XV_SdiRxSs::OverFlowCallback, XV_SdiRxSs::OverFlowRef, XV_SdiRxSs::StreamDownCallback, XV_SdiRxSs::StreamDownRef, XV_SdiRxSs::StreamUpCallback, XV_SdiRxSs::StreamUpRef, XV_SdiRxSs::UnderFlowCallback, XV_SdiRxSs::UnderFlowRef, XV_SdiRxSs::VsyncCallback, XV_SdiRxSs::VsyncRef, XV_SDIRXSS_HANDLER_OVERFLOW, XV_SDIRXSS_HANDLER_STREAM_DOWN, XV_SDIRXSS_HANDLER_STREAM_UP, XV_SDIRXSS_HANDLER_UNDERFLOW, and XV_SDIRXSS_HANDLER_VSYNC.

Referenced by main().

void XV_SdiRxSs_SetYCbCr444_RGB_10bit ( XV_SdiRxSs InstancePtr)

This function enable the YUV444/RGB 10bit support SDI RX SS video stream.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None

References XV_SdiRxSs::SdiRxPtr.

void XV_SdiRxSs_Start ( XV_SdiRxSs InstancePtr,
XV_SdiRx_SearchMode  Mode 
)

This function starts the SDI RX stream detection.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Modespecifies the mode of SDI modes searching operation.
  • 0 = XV_SDIRX_SINGLESEARCHMODE_HD
  • 1 = XV_SDIRX_SINGLESEARCHMODE_SD
  • 2 = XV_SDIRX_SINGLESEARCHMODE_3G
  • 4 = XV_SDIRX_SINGLESEARCHMODE_6G
  • 5 = XV_SDIRX_SINGLESEARCHMODE_12GI
  • 6 = XV_SDIRX_SINGLESEARCHMODE_12GF
  • 10 = XV_SDIRX_MULTISEARCHMODE where the supported modes will be enabled by XV_SdiRx_EnableMode function
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr, XV_SDIRXSS_LOG_EVT_START, and XV_SdiRxSs_LogWrite().

void XV_SdiRxSs_Stop ( XV_SdiRxSs InstancePtr)

This function stops the SDI RX stream detection.

Parameters
InstancePtris a pointer to the Subsystem instance to be worked on.
Returns
None

References XV_SdiRxSs::SdiRxPtr, XV_SDIRXSS_LOG_EVT_STOP, and XV_SdiRxSs_LogWrite().

void XV_SdiRxSs_StreamFlowDisable ( XV_SdiRxSs InstancePtr)

This function disables the AXIS and video bridges.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr.

void XV_SdiRxSs_StreamFlowEnable ( XV_SdiRxSs InstancePtr)

This function enables the AXIS and video bridges.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
None.
Note
None.

References XV_SdiRxSs::SdiRxPtr.

u32 XV_SdiRxSs_WaitforPayLoad ( XV_SdiRxSs InstancePtr)

This function is used to wait for the payload valid bit to be set.

This has to be called from application based on the callback indication of the video lock interrupt handler.

Parameters
InstancePtrpointer to XV_SdiRxSs instance
Returns
  • XST_FAILURE if the payload valid bits are not set.
  • XST_SUCCESS if ST352 registers are read and loaded to Rx structures
Note
None.

References XV_SdiRxSs::SdiRxPtr.