v_sditx
Xilinx SDK Drivers API Documentation
xv_sditx.c File Reference

Overview

This is the main file for Xilinx SDI TX core.

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

MODIFICATION HISTORY:
Ver   Who    Date     Changes

1.00 jsr 07/17/17 Initial release.

Functions

int XV_SdiTx_CfgInitialize (XV_SdiTx *InstancePtr, XV_SdiTx_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the SDI TX core. More...
 
void XV_SdiTx_Reset (XV_SdiTx *InstancePtr)
 This function clears the SDI TX core registers and sets them to the defaults. More...
 
void XV_SdiTx_ClearPayloadId (XV_SdiTx *InstancePtr)
 This function clears the SDI TX PayloadId. More...
 
u32 XV_SdiTx_SetStream (XV_SdiTx *InstancePtr, XV_SdiTx_StreamSelId SelId, u32 Data, u8 StreamId)
 This function sets the SDI TX stream parameters. More...
 
void XV_SdiTx_SetCoreSettings (XV_SdiTx *InstancePtr, XV_SdiTx_CoreSelId SelId, u8 Data)
 This function sets the SDI TX core settings. More...
 
u8 XV_SdiTx_GetPayloadFrameRate (XVidC_FrameRate FrameRateValid, XSdiVid_BitRate BitRate)
 This function calculates the equivalent payload nibble for Framerate. More...
 
u8 XV_SdiTx_GetPayloadIsInterlaced (XVidC_VideoFormat VideoFormat)
 This function calculates the equivalent payload bit for given VideoFormat. More...
 
u8 XV_SdiTx_GetPayloadAspectRatio (XVidC_AspectRatio AspectRatio)
 This function calculates the equivalent payload bit for given AspectRatio. More...
 
u32 XV_SdiTx_GetPayloadByte1 (u16 VActiveValid, XSdiVid_TransMode SdiMode, u8 *Data)
 This function calculates the 2nd byte of the Payload packet for all SDI modes. More...
 
u32 XV_SdiTx_GetPayload (XV_SdiTx *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...
 
void XV_SdiTx_SetPayloadId (XV_SdiTx *InstancePtr, u8 DataStream, u32 Payload)
 This function sets the payload id to be sent out by the TX core. More...
 
void XV_SdiTx_SetPayloadLineNum (XV_SdiTx *InstancePtr, XV_SdiTx_PayloadLineNum1 Field1LineNum, XV_SdiTx_PayloadLineNum2 Field2LineNum, u8 Field2En)
 This function sets the line number of which the HANC space will be inserted with ST 352 packets. More...
 
void XV_SdiTx_StreamStart (XV_SdiTx *InstancePtr)
 This function starts the TX SDI stream. More...
 
void XV_SdiTx_StartSdi (XV_SdiTx *InstancePtr, XSdiVid_TransMode SdiMode, XSdiVid_BitRate IsFractional, XV_SdiTx_MuxPattern MuxPattern)
 This function starts the SDI TX core. More...
 
int XV_SdiTx_StopSdi (XV_SdiTx *InstancePtr)
 This function disables the SDI TX core. More...
 
void XV_SdiTx_ClearDetectedError (XV_SdiTx *InstancePtr)
 This function clears the detected error flag and counter. More...
 
void XV_SdiTx_ReportDetectedError (XV_SdiTx *InstancePtr)
 This function reports the detected error by the TX core. More...
 
void XV_SdiTx_VidBridgeEnable (XV_SdiTx *InstancePtr)
 This function enables the video bridge. More...
 
void XV_SdiTx_VidBridgeDisable (XV_SdiTx *InstancePtr)
 This function disables the video bridge. More...
 
void XV_SdiTx_Axi4sBridgeVtcEnable (XV_SdiTx *InstancePtr)
 This function enables the AXI4S Bridge. More...
 
void XV_SdiTx_Axi4sBridgeVtcDisable (XV_SdiTx *InstancePtr)
 This function disables the AXI4S Bridge. More...
 
void XV_SdiTx_SetVidBridgeMode (XV_SdiTx *InstancePtr, XSdiVid_TransMode Mode)
 This function sets the video bridge mode. More...
 
void XV_SdiTx_DebugInfo (XV_SdiTx *InstancePtr, XV_SdiTx_DebugSelId SelId)
 This function prints stream and timing information on STDIO/Uart console. More...
 

Function Documentation

◆ XV_SdiTx_Axi4sBridgeVtcDisable()

void XV_SdiTx_Axi4sBridgeVtcDisable ( XV_SdiTx InstancePtr)

This function disables the AXI4S Bridge.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_Axi4sBridgeVtcEnable()

void XV_SdiTx_Axi4sBridgeVtcEnable ( XV_SdiTx InstancePtr)

This function enables the AXI4S Bridge.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_CfgInitialize()

int XV_SdiTx_CfgInitialize ( XV_SdiTx InstancePtr,
XV_SdiTx_Config CfgPtr,
UINTPTR  EffectiveAddr 
)

This function initializes the SDI TX core.

This function must be called prior to using the SDI TX core. Initialization of the SDI TX includes setting up the instance data and ensuring the hardware is in a quiescent state.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
CfgPtrpoints to the configuration structure associated with the SDI TX core.
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 XV_SdiTx_CfgInitialize was successful.
  • XST_FAILURE if SDI TX initialization failed
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx::GtRstDoneCallback.

Referenced by XV_SdiTxSelfTestExample().

◆ XV_SdiTx_ClearDetectedError()

void XV_SdiTx_ClearDetectedError ( XV_SdiTx InstancePtr)

This function clears the detected error flag and counter.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_ClearPayloadId()

void XV_SdiTx_ClearPayloadId ( XV_SdiTx InstancePtr)

This function clears the SDI TX PayloadId.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
Returns
None
Note
This is required after a reset or init.

Referenced by XV_SdiTx_Reset().

◆ XV_SdiTx_DebugInfo()

void XV_SdiTx_DebugInfo ( XV_SdiTx InstancePtr,
XV_SdiTx_DebugSelId  SelId 
)

This function prints stream and timing information on STDIO/Uart console.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
SelIdspecifies which debug information to be printed out
Returns
None.
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, XV_SdiTx::Stream, XV_SdiTx::Transport, XV_SdiTx_Stream::Video, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_GetPayload()

u32 XV_SdiTx_GetPayload ( XV_SdiTx 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_SdiTx 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_SdiTx_Stream::CAssignment, XV_SdiTx::Stream, XV_SdiTx_Stream::Video, and XV_SdiTx_GetPayloadByte1().

◆ XV_SdiTx_GetPayloadAspectRatio()

u8 XV_SdiTx_GetPayloadAspectRatio ( XVidC_AspectRatio  AspectRatio)

This function calculates the equivalent payload bit for given AspectRatio.

Parameters
AspectRatiois a variable of type XVidC_AspectRatio.
Returns
  • returns 0 for 4x3 aspect ratio
  • returns 1 for 16x9 aspect ratio
Note
None.

◆ XV_SdiTx_GetPayloadByte1()

u32 XV_SdiTx_GetPayloadByte1 ( u16  VActiveValid,
XSdiVid_TransMode  SdiMode,
u8 *  Data 
)

This function calculates the 2nd byte of the Payload packet for all SDI modes.

Parameters
VideoModeis a variable of type XVidC_VideoMode.
SdiModeis a variable to the XSdiVid_TransMode.
Datais a pointer to populate the Byte1 of ST352 payload.
Returns
  • returns 8-bit value
Note
None.

Referenced by XV_SdiTx_GetPayload().

◆ XV_SdiTx_GetPayloadFrameRate()

u8 XV_SdiTx_GetPayloadFrameRate ( XVidC_FrameRate  FrameRateValid,
XSdiVid_BitRate  BitRate 
)

This function calculates the equivalent payload nibble for Framerate.

Parameters
FrameRateis a variable of type XVidC_FrameRate.
BitRateis a variable of type XSdiVid_BitRate.
Returns
  • returns 4-bit value
Note
None.

◆ XV_SdiTx_GetPayloadIsInterlaced()

u8 XV_SdiTx_GetPayloadIsInterlaced ( XVidC_VideoFormat  VideoFormat)

This function calculates the equivalent payload bit for given VideoFormat.

Parameters
VideoFormatis a variable of type XVidC_VideoFormat.
Returns
  • returns 1-bit value
Note
None.

◆ XV_SdiTx_ReportDetectedError()

void XV_SdiTx_ReportDetectedError ( XV_SdiTx InstancePtr)

This function reports the detected error by the TX core.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_Reset()

void XV_SdiTx_Reset ( XV_SdiTx InstancePtr)

This function clears the SDI TX core registers and sets them to the defaults.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
Returns
None
Note
This is required after a reset or init.

References XV_SdiTx_ClearPayloadId().

◆ XV_SdiTx_SetCoreSettings()

void XV_SdiTx_SetCoreSettings ( XV_SdiTx InstancePtr,
XV_SdiTx_CoreSelId  SelId,
u8  Data 
)

This function sets the SDI TX core settings.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
SelIdspecifies which parameter of the stream to be set.
  • 0 = XV_SDITX_CORESELID_INSERTCRC
  • 1 = XV_SDITX_CORESELID_INSERTST352
  • 2 = XV_SDITX_CORESELID_ST352OVERWRITE
  • 3 = XV_SDITX_CORESELID_INSERTSYNCBIT
  • 4 = XV_SDITX_CORESELID_SDBITREPBYPASS
  • 5 = XV_SDITX_CORESELID_USEANCIN
  • 6 = XV_SDITX_CORESELID_INSERTLN
  • 7 = XV_SDITX_CORESELID_INSERTEDH
Dataspecifies what data to be set for the selected parameter.
Returns
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_SetPayloadId()

void XV_SdiTx_SetPayloadId ( XV_SdiTx InstancePtr,
u8  DataStream,
u32  Payload 
)

This function sets the payload id to be sent out by the TX core.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
DataStreamspecifies the stream which ST352 payload id is to be inserted.
Payloadspecfies the data to be sent out as ST352 payload id.
Returns
None.
Note
None.

References XV_SdiTx_WriteReg.

◆ XV_SdiTx_SetPayloadLineNum()

void XV_SdiTx_SetPayloadLineNum ( XV_SdiTx InstancePtr,
XV_SdiTx_PayloadLineNum1  Field1LineNum,
XV_SdiTx_PayloadLineNum2  Field2LineNum,
u8  Field2En 
)

This function sets the line number of which the HANC space will be inserted with ST 352 packets.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
Field1LineNumspecifies the field 1 line number of which ST352 packets are to be inserted
Field2LineNumspecifies the field 2 line number of which ST352 packets are to be inserted
Field2Enspecifies whether the TX core will send out ST352 packets in field 2 line number or not.
Returns
None.
Note
None.

◆ XV_SdiTx_SetStream()

u32 XV_SdiTx_SetStream ( XV_SdiTx InstancePtr,
XV_SdiTx_StreamSelId  SelId,
u32  Data,
u8  StreamId 
)

This function sets the SDI TX stream parameters.

Parameters
InstancePtris a pointer to the XV_SdiTx 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.

◆ XV_SdiTx_SetVidBridgeMode()

void XV_SdiTx_SetVidBridgeMode ( XV_SdiTx InstancePtr,
XSdiVid_TransMode  Mode 
)

This function sets the video bridge mode.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
Modespecifies the SDI bridge mode.
Returns
None.
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, XV_SdiTx::Transport, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_StartSdi()

void XV_SdiTx_StartSdi ( XV_SdiTx InstancePtr,
XSdiVid_TransMode  SdiMode,
XSdiVid_BitRate  IsFractional,
XV_SdiTx_MuxPattern  MuxPattern 
)

This function starts the SDI TX core.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
SdiModespecifies the SDI mode of the SDI TX.
IsFractionalspecifies the bitrate of the SDI TX.
MuxPatternspecifies the data stream interleaving pattern to be used.
Returns
None.
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_StopSdi()

int XV_SdiTx_StopSdi ( XV_SdiTx InstancePtr)

This function disables the SDI TX core.

Parameters
InstancePtris a pointer to the XV_SdiTx core instance.
Returns
  • XST_SUCCESS if register write is successfule for SDI stop
  • XST_FAILURE if SDI stop write is failed
Note
None.

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

Referenced by XV_SdiTx_SelfTest().

◆ XV_SdiTx_StreamStart()

void XV_SdiTx_StreamStart ( XV_SdiTx InstancePtr)

This function starts the TX SDI stream.

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

◆ XV_SdiTx_VidBridgeDisable()

void XV_SdiTx_VidBridgeDisable ( XV_SdiTx InstancePtr)

This function disables the video bridge.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.

◆ XV_SdiTx_VidBridgeEnable()

void XV_SdiTx_VidBridgeEnable ( XV_SdiTx InstancePtr)

This function enables the video bridge.

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

References XV_SdiTx_Config::BaseAddress, XV_SdiTx::Config, and XV_SdiTx_ReadReg.