v_sditxss
Vitis Drivers API Documentation
xv_sditxss.c File Reference

Overview

This is the main file for Xilinx SDI TX core.

Please see xv_sditxss.h for more details of the driver.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00 jsr 07/17/17 Initial release. 2.00 kar 01/25/18 Second release. jsr 02/23/2018 Added YUV420 color format support jsr 03/02/2018 Added core settings API 2.1 jsr 07/03/2018 Corrected 720x480_60_I to be 720x486_60_I for SD mode 2.2 jsr 10/01/2018 Programming the Field register for 720x480_60_I SD mode 3.0 vve 10/03/18 Add support for ST352 in C Stream

Functions

void XV_SdiTxSS_SdiTxIntrHandler (XV_SdiTxSs *InstancePtr)
 This function calls the interrupt handler for SDI TX. More...
 
int XV_SdiTxSs_CfgInitialize (XV_SdiTxSs *InstancePtr, XV_SdiTxSs_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the video subsystem and included sub-cores. More...
 
int XV_SdiTxSs_SetCallback (XV_SdiTxSs *InstancePtr, u32 HandlerType, void *CallbackFunc, void *CallbackRef)
 This function installs an asynchronous callback function for the given HandlerType: More...
 
void XV_SdiTxSs_Stop (XV_SdiTxSs *InstancePtr)
 This macro disables the SDI TX peripheral. More...
 
void XV_SdiTxSs_ST352CSwitch3GA (XV_SdiTxSs *InstancePtr)
 This function enables the ST352 value to be used from DS2 instead of DS3 register in C stream of the SDI TX Ss core. More...
 
void XV_SdiTxSs_ST352CStreamEnable (XV_SdiTxSs *InstancePtr)
 This function enables the insertion of ST352 in C stream of the SDI TX Ss core. More...
 
int XV_SdiTxSs_SetColorFormat (XV_SdiTxSs *InstancePtr, XVidC_ColorFormat ColorFormat)
 This function Set the video format of the SDI TX Ss core. More...
 
void XV_SdiTxSs_StreamStart (XV_SdiTxSs *InstancePtr)
 This function starts the SDI TX stream. More...
 
void XV_SdiTxSs_StreamConfig (XV_SdiTxSs *InstancePtr)
 This function configures SDI TX stream. More...
 
u32 * XV_SdiTxSs_GetPayloadId (XV_SdiTxSs *InstancePtr, u8 StreamId)
 This function returns the pointer to SDI TX SS video stream payload ID. More...
 
XSdiVid_Transport * XV_SdiTxSs_GetTransport (XV_SdiTxSs *InstancePtr)
 This function returns the pointer to SDI TX SS video transport. More...
 
XVidC_VideoStream * XV_SdiTxSs_GetVideoStream (XV_SdiTxSs *InstancePtr, u8 StreamId)
 This function returns the pointer to SDI TX SS video stream. More...
 
void XV_SdiTxSs_SetVideoStream (XV_SdiTxSs *InstancePtr, XVidC_VideoStream VidStream)
 This function Sets the SDI TX SS video stream. More...
 
void XV_SdiTxSs_ReportDetectedError (XV_SdiTxSs *InstancePtr)
 This function reports stream errors detected. More...
 
void XV_SdiTxSs_ReportInfo (XV_SdiTxSs *InstancePtr)
 This function prints the SDI TX SS information. More...
 
void XV_SdiTxSs_ReportDebugInfo (XV_SdiTxSs *InstancePtr, u32 VtcFlag)
 This function prints the SDI TX SS debug information. More...
 
void XV_SdiTxSs_ReportStreamInfo (XV_SdiTxSs *InstancePtr)
 This function prints the SDI TX SS stream information. More...
 
int XV_SdiTxSs_IsStreamUp (XV_SdiTxSs *InstancePtr)
 This function checks if the video stream is up. More...
 
void XV_SdiTxSs_IntrEnable (XV_SdiTxSs *InstancePtr, u32 IntrMask)
 This function is used to configure the SDI TX interrupts that are to be handled by the application. More...
 
void XV_SdiTxSs_IntrDisable (XV_SdiTxSs *InstancePtr, u32 IntrMask)
 This function is used to configure the SDI TX interrupts that are to be handled by the application. More...
 
void XV_SdiTxSs_SetEotf (XV_SdiTxSs *InstancePtr, XVidC_Eotf Eotf, XVidC_ColorStd Colorimetry)
 This function is used to update the Eotf and colorimetry fields of stream video structure. More...
 
u32 XV_SdiTxSs_GetPayload (XV_SdiTxSs *InstancePtr, XVidC_VideoMode VideoMode, XSdiVid_TransMode SdiMode, u8 DataStream)
 This function calculates the final ST352 payload value for all SDI modes with given video mode and SDI data stream number. More...
 
u32 XV_SdiTxSs_SetStream (XV_SdiTxSs *InstancePtr, XV_SdiTx_StreamSelId SelId, u32 Data, u8 StreamId)
 This function sets the SDI TXSs stream parameters. More...
 
void XV_SdiTxSs_SetCoreSettings (XV_SdiTxSs *InstancePtr, XV_SdiTxSs_CoreSelId SelId, u8 Data)
 This function sets the SDI TXSS core settings. More...
 
void XV_SdiTxSs_SetYCbCr444_RGB_10bit (XV_SdiTxSs *InstancePtr)
 This function enable the YUV444/RGB 10bit support SDI TX SS video stream. More...
 
void XV_SdiTxSs_ClearYCbCr444_RGB_10bit (XV_SdiTxSs *InstancePtr)
 This function disable the YUV444/RGB 10bit support SDI TX SS video stream. More...
 

Variables

XV_SdiTxSs_SubCores XV_SdiTxSs_SubCoreRepo [XPAR_XV_SDITXSS_NUM_INSTANCES]
 Define Driver instance of all sub-core included in the design. More...
 

Function Documentation

int XV_SdiTxSs_CfgInitialize ( XV_SdiTxSs InstancePtr,
XV_SdiTxSs_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_SdiTxSs_Config::BaseAddress, XV_SdiTxSs::Config, XV_SdiTxSs_Config::DeviceId, XV_SdiTxSs::IsReady, XV_SdiTxSs::SdiTxPtr, XV_SdiTxSs::VtcPtr, XV_SdiTxSs_SubcoreInitSdiTx(), and XV_SdiTxSs_SubcoreInitVtc().

Referenced by main(), and SdiTxSs_SelfTestExample().

void XV_SdiTxSs_ClearYCbCr444_RGB_10bit ( XV_SdiTxSs InstancePtr)

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

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None

References XV_SdiTxSs::SdiTxPtr.

u32 XV_SdiTxSs_GetPayload ( XV_SdiTxSs InstancePtr,
XVidC_VideoMode  VideoMode,
XSdiVid_TransMode  SdiMode,
u8  DataStream 
)

This function calculates the final ST352 payload value for all SDI modes with given video mode and SDI data stream number.

Parameters
InstancePtris a pointer to the XV_SdiTxSs core instance.
VideoModeis a variable of type XVidC_VideoMode.
SdiModeis a variable of type XSdiVid_TransMode.
DataStreamis the stream number for which payload is calculated.
Returns
XST_SUCCESS / XST_FAILURE.
Note
None.

References XV_SdiTxSs::SdiTxPtr.

u32* XV_SdiTxSs_GetPayloadId ( XV_SdiTxSs InstancePtr,
u8  StreamId 
)

This function returns the pointer to SDI TX SS video stream payload ID.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
StreamIdspecifies which of the pointer of PayloadId to be returned
Returns
u32 pointer
Note
None.

References XV_SdiTxSs::SdiTxPtr.

Referenced by StartTxAfterRx().

XSdiVid_Transport* XV_SdiTxSs_GetTransport ( XV_SdiTxSs InstancePtr)

This function returns the pointer to SDI TX SS video transport.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
XSdiVid_Transport pointer
Note
None.

References XV_SdiTxSs::SdiTxPtr.

Referenced by StartTxAfterRx().

XVidC_VideoStream* XV_SdiTxSs_GetVideoStream ( XV_SdiTxSs InstancePtr,
u8  StreamId 
)

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

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

References XV_SdiTxSs::SdiTxPtr.

Referenced by StartTxAfterRx().

void XV_SdiTxSs_IntrDisable ( XV_SdiTxSs InstancePtr,
u32  IntrMask 
)

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

Refer to xv_sditxss_hw.h for interrupt masks.

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

References XV_SdiTxSs::SdiTxPtr.

Referenced by main().

void XV_SdiTxSs_IntrEnable ( XV_SdiTxSs InstancePtr,
u32  IntrMask 
)

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

Refer to xv_sditxss_hw.h for interrupt masks.

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

References XV_SdiTxSs::SdiTxPtr.

Referenced by main().

int XV_SdiTxSs_IsStreamUp ( XV_SdiTxSs InstancePtr)

This function checks if the video stream is up.

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

References XV_SdiTxSs::IsStreamUp.

void XV_SdiTxSs_ReportDebugInfo ( XV_SdiTxSs InstancePtr,
u32  VtcFlag 
)

This function prints the SDI TX SS debug information.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
VtcFlagspecifies if VTC block is currently stable or not.
Returns
None.
Note
A known issue on the VTC causes it to require a stable clock before the registers may be access. VtcFlag is used to decide whether VTC can be read or not.

References XV_SdiTxSs::SdiTxPtr, and XV_SdiTxSs::VtcPtr.

Referenced by DebugInfo().

void XV_SdiTxSs_ReportDetectedError ( XV_SdiTxSs InstancePtr)

This function reports stream errors detected.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None.
Note
None.

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_ReportInfo ( XV_SdiTxSs InstancePtr)

This function prints the SDI TX SS information.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None.
Note
None.

References XV_SdiTxSs::SdiTxPtr.

Referenced by Info().

void XV_SdiTxSs_ReportStreamInfo ( XV_SdiTxSs InstancePtr)

This function prints the SDI TX SS stream information.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None.
Note
None.

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSS_SdiTxIntrHandler ( XV_SdiTxSs InstancePtr)

This function calls the interrupt handler for SDI TX.

Parameters
InstancePtris a pointer to the SDI TX Subsystem

References XV_SdiTxSs::SdiTxPtr.

Referenced by main().

int XV_SdiTxSs_SetCallback ( XV_SdiTxSs InstancePtr,
u32  HandlerType,
void *  CallbackFunc,
void *  CallbackRef 
)

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

HandlerType                     Callback Function Type
-----------------------         ---------------------------------------------
(XV_SDITXSS_HANDLER_GTREADY)                    GtReadyCallback
(XV_SDITXSS_HANDLER_OVERFLOW)                   OverFlowCallback
(XV_SDITXSS_HANDLER_UNDERFLOW)          UnderFlowCallback
(XV_SDITXSS_HANDLER_CEALIGN)                    CeAlignErrCallback
(XV_SDITXSS_HANDLER_AXI4SVIDLOCK)               Axi4sVidLockCallback
Parameters
InstancePtris a pointer to the SDI TX 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_SdiTxSs::Axi4sVidLockCallback, XV_SdiTxSs::Axi4sVidLockRef, XV_SdiTxSs::CeAlignErrCallback, XV_SdiTxSs::CeAlignErrRef, XV_SdiTxSs::GtReadyCallback, XV_SdiTxSs::GtReadyRef, XV_SdiTxSs::OverFlowCallback, XV_SdiTxSs::OverFlowRef, XV_SdiTxSs::UnderFlowCallback, XV_SdiTxSs::UnderFlowRef, XV_SDITXSS_HANDLER_AXI4SVIDLOCK, XV_SDITXSS_HANDLER_CEALIGN, XV_SDITXSS_HANDLER_GTREADY, XV_SDITXSS_HANDLER_OVERFLOW, and XV_SDITXSS_HANDLER_UNDERFLOW.

Referenced by main().

int XV_SdiTxSs_SetColorFormat ( XV_SdiTxSs InstancePtr,
XVidC_ColorFormat  ColorFormat 
)

This function Set the video format of the SDI TX Ss core.

Parameters
InstancePtris a pointer to the XV_SdiTxSs core instance.
ColorFormatis a variable of type XVidC_ColorFormat.
Returns
None.
Note
None.

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_SetCoreSettings ( XV_SdiTxSs InstancePtr,
XV_SdiTxSs_CoreSelId  SelId,
u8  Data 
)

This function sets the SDI TXSS core settings.

Parameters
InstancePtris a pointer to the XV_SdiTxSs core instance.
SelIdspecifies which parameter of the stream to be set.
  • 0 = XV_SDITXSS_CORESELID_INSERTCRC
  • 1 = XV_SDITXSS_CORESELID_INSERTST352
  • 2 = XV_SDITXSS_CORESELID_ST352OVERWRITE
  • 3 = XV_SDITXSS_CORESELID_INSERTSYNCBIT
  • 4 = XV_SDITXSS_CORESELID_SDBITREPBYPASS
  • 5 = XV_SDITXSS_CORESELID_USEANCIN
  • 6 = XV_SDITXSS_CORESELID_INSERTLN
  • 7 = XV_SDITXSS_CORESELID_INSERTEDH
Dataspecifies what data to be set for the selected parameter.
Returns
Note
None.

References XV_SdiTxSs::SdiTxPtr.

Referenced by main().

void XV_SdiTxSs_SetEotf ( XV_SdiTxSs InstancePtr,
XVidC_Eotf  Eotf,
XVidC_ColorStd  Colorimetry 
)

This function is used to update the Eotf and colorimetry fields of stream video structure.

If SDI TX is already streaming, then this function updates the payload registers.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Eotfis a variable of type XVidC_Eotf
Colorimetryis a variable of type XVidC_ColorStd
Returns
None.
Note
None.

References XV_SdiTxSs::IsStreamUp, and XV_SdiTxSs::SdiTxPtr.

u32 XV_SdiTxSs_SetStream ( XV_SdiTxSs InstancePtr,
XV_SdiTx_StreamSelId  SelId,
u32  Data,
u8  StreamId 
)

This function sets the SDI TXSs stream parameters.

Parameters
InstancePtris a pointer to the XV_SdiTxSs core instance.
SelIdspecifies which parameter of the stream to be set.
  • 0 = XV_SDITX_STREAMSELID_VMID
  • 1 = XV_SDITX_STREAMSELID_COLORFORMAT
  • 2 = XV_SDITX_STREAMSELID_BPC
  • 3 = XV_SDITX_STREAMSELID_PPC
  • 4 = XV_SDITX_STREAMSELID_ASPECTRATIO
  • 5 = XV_SDITX_STREAMSELID_STANDARD
  • 6 = XV_SDITX_STREAMSELID_STREAMINTERLACE
  • 7 = XV_SDITX_STREAMSELID_CHANNEL
Dataspecifies what data to be set for the selected parameter.
StreamIdspecifies which of the streams to be set.
Returns
  • XST_SUCCESS on successful Set stream
  • XST_FAILURE if TimingPtr is not derived
Note
None.

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_SetVideoStream ( XV_SdiTxSs InstancePtr,
XVidC_VideoStream  VidStream 
)

This function Sets the SDI TX SS video stream.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
VidStreamspecifies the settings for the video stream
Returns
XVidC_VideoStream pointer
Note
None.

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_SetYCbCr444_RGB_10bit ( XV_SdiTxSs InstancePtr)

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

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None

References XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_ST352CStreamEnable ( XV_SdiTxSs InstancePtr)

This function enables the insertion of ST352 in C stream of the SDI TX Ss core.

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

References XV_SdiTxSs::Config, XV_SdiTxSs_Config::InsertCSTRST352, and XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_ST352CSwitch3GA ( XV_SdiTxSs InstancePtr)

This function enables the ST352 value to be used from DS2 instead of DS3 register in C stream of the SDI TX Ss core.

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

References XV_SdiTxSs::Config, XV_SdiTxSs_Config::InsertCSTRST352, and XV_SdiTxSs::SdiTxPtr.

void XV_SdiTxSs_Stop ( XV_SdiTxSs InstancePtr)

This macro disables the SDI TX peripheral.

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

References XV_SdiTxSs::IsStreamUp, XV_SdiTxSs::SdiTxPtr, XV_SDITXSS_LOG_EVT_STOP, and XV_SdiTxSs_LogWrite().

Referenced by RxStreamDownCallback().

void XV_SdiTxSs_StreamConfig ( XV_SdiTxSs InstancePtr)

This function configures SDI TX stream.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None.
Note
None.

References XV_SdiTxSs::Config, XV_SdiTxSs::MaxDataStreams, XV_SdiTxSs::SdiTxPtr, and XV_SdiTxSs_LogWrite().

Referenced by StartTxAfterRx().

void XV_SdiTxSs_StreamStart ( XV_SdiTxSs InstancePtr)

This function starts the SDI TX stream.

Parameters
InstancePtrpointer to XV_SdiTxSs instance
Returns
None.
Note
None.

References XV_SdiTxSs::Config, XV_SdiTxSs::SdiTxPtr, XV_SdiTxSs::VtcPtr, XV_SDITXSS_LOG_EVT_STREAMSTART, and XV_SdiTxSs_LogWrite().

Variable Documentation

XV_SdiTxSs_SubCores XV_SdiTxSs_SubCoreRepo[XPAR_XV_SDITXSS_NUM_INSTANCES]

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