v_voip_packetizer56
Xilinx SDK Drivers API Documentation
xpacketizer56.h File Reference

Overview

This is the main header file for VoIP ST2022-6 Packetizer core.

VoIP ST2022-6 Packetizer core is used for Packetized incoming SDI to AXI4-Stream in to ST2022-6 compliant RTP Packet

The VoIP ST2022-6 Packetizer has 3 main Interface

  • AXI4-Stream Interface for accepting Incoming SDI to AXI4-Stream Packet
  • AXI4-Stream Interface for transmitting RTP Packet <RTP Header | Payload>
  • AXI4-Lite interface for processor, controls the VoIP ST2022-6 Packetizer.

VoIP ST2022-6 Packetizer Performs Following Operation

  • Packetized SDI to AXI4-Stream Packet into ST2022-6 RTP Packet
  • Add user configured RTP Header into RTP Packet Header

Software Initialization & Configuration

The application needs to do following steps in order for preparing the VoIP ST2022-6 Packetizer core to be ready.

  • Call XPacketizer56_LookupConfig using a device ID to find the core configuration.
  • Call XPacketizer56_CfgInitialize to initialize the device and the driver instance associated with it.

This driver provides interrupt handlers

  • XPacketizer56_IntrHandler, for handling the interrupts from the VoIP ST2022-6 Packetizer core

Application developer needs to register interrupt handler with the processor, within their examples. Whenever processor calls registered application's interrupt handler associated with interrupt id, application's interrupt handler needs to call appropriate peripheral interrupt handler reading peripherals Status register.

This driver provides XPacketizer56_SetCallback API to register functions with VoIP ST2022-6 Packetizer core instance.

Virtual Memory

Threads

Asserts

Building the driver

The VoIP ST2022-6 Packetizer driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00 mmo 02/12/16 Initial release.

 

Data Structures

struct  XPacketizer56_Config
 This typedef contains configuration information for the VoIP ST2022-6 Packetizer core. More...
 
struct  XPacketizer56_Stream
 This typedef contains Incoming SDI to AXI4-Stream Information. More...
 
struct  XPacketizer56_ModuleStatistic
 This typedef contains Incoming Frame Count and Outgoing Packet Count Information. More...
 
struct  XPacketizer56
 The VoIP ST2022-6 Packetizer driver instance data. More...
 

Macros

#define XPACKETIZER56_H_
 Prevent circular inclusions by using protection macros. More...
 

Typedefs

typedef void(* XPacketizer56_Callback )(void *CallbackRef)
 Callback type for VoIP ST2022-6 Packetizer event interrupt. More...
 

Enumerations

Handler Types
enum  XPacketizer56_HandlerType
 These constants specify different types of handler and used to differentiate interrupt requests from peripheral. More...
 
Timestamp Reference (Video Header)
enum  XPacketizer56_TimestampRef
 These constants specify specify the VoIP ST2022-6 Packetizer Timestamp Reference in the Video Header. More...
 
Video Bit Rate
enum  XPacketizer56_RXBITRATE
 These constants specify specify the VoIP ST2022-6 Packetizer Video Bit Rate either is an Integer (148.5 MHz or 74.25 MHz) or Non-Integer (148.35 MHz or 74.175 MHz) More...
 
3G-SDI Level
enum  XPacketizer56_3G_LEVEL
 These constants specify specify the VoIP ST2022-6 Packetizer Incoming SDI to AXI4-Stream is a SDI-3G Level A or Level B. More...
 
SDI Mode
enum  XPacketizer56_SDIMode
 These constants specify specify the VoIP ST2022-6 Packetizer Incoming SDI to AXI4-Stream SDI Mode, SD-SDI or HD-SDI or 3G-SDI. More...
 
ST2022-6 Packetizer Module Enable/Disable
enum  XPacketizer56_ModEn
 These constants specify specify the VoIP ST2022-6 Packetizer Module Enable or Disable. More...
 
ST2022-6 Packetizer Operating Mode
enum  XPacketizer56_LosslessMode
 These constants specify specify the VoIP ST2022-6 Packetizer Operating Mode, Normal Mode or Lossless Mode. More...
 

Functions

XPacketizer56_ConfigXPacketizer56_LookupConfig (u16 DeviceId)
 This function returns a reference to an XPacketizer56_Config structure based on the core id, DeviceId. More...
 
int XPacketizer56_CfgInitialize (XPacketizer56 *InstancePtr, XPacketizer56_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the VoIP ST2022-6 Packetizer core. More...
 
void XPacketizer56_IntrHandler (void *InstancePtr)
 This function is the interrupt handler for the VoIP ST2022-6 Packetizer driver. More...
 
int XPacketizer56_SetCallback (XPacketizer56 *InstancePtr, XPacketizer56_HandlerType HandlerType, void *CallbackFunc, void *CallbackRef)
 This function installs an asynchronous callback function for the given HandlerType: More...
 
XPacketizer56_Stream XPacketizer56_MediaDatagramInfo (XPacketizer56 *InstancePtr)
 This function Writes the RTP-Media Header into the VoIP ST2022-6 Register. More...
 
void XPacketizer56_ModEnable (XPacketizer56 *InstancePtr)
 This function Enable or Disable the Module based on User Configured Structure of ModuleEnable. More...
 
void XPacketizer56_LosslessEnable (XPacketizer56 *InstancePtr)
 This function Sets the Operating Mode based on User Configure Value in VoIP ST2022-6 Packetizer Structure of LoslessMode LoslessMode : XPACKETIZER56_NORMAL : Normal Mode XPACKETIZER56_LOSSLESS : Lossless Mode. More...
 
void XPacketizer56_RegClear (XPacketizer56 *InstancePtr)
 This function Clears all the VoIP ST2022-6 Packetizer Register Space. More...
 
void XPacketizer56_VidFormat (XPacketizer56 *InstancePtr)
 This function Writes the Video Format into the VoIP ST2022-6 Register. More...
 
void XPacketizer56_RTPMediaHeader (XPacketizer56 *InstancePtr)
 This function Writes the RTP-Media Header into the VoIP ST2022-6 Register. More...
 
void XPacketizer56_SetChannel (XPacketizer56 *InstancePtr)
 This function Sets the Channel Number Information which will be added in to TUSER Master AXI4-Stream of the Module. More...
 
void XPacketizer56_SetSSRC (XPacketizer56 *InstancePtr)
 This function Sets the RTP-SSRC Header. More...
 

Macro Definition Documentation

#define XPACKETIZER56_H_

Prevent circular inclusions by using protection macros.

Typedef Documentation

typedef void(* XPacketizer56_Callback)(void *CallbackRef)

Callback type for VoIP ST2022-6 Packetizer event 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 specify the VoIP ST2022-6 Packetizer Incoming SDI to AXI4-Stream is a SDI-3G Level A or Level B.

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

These constants specify specify the VoIP ST2022-6 Packetizer Operating Mode, Normal Mode or Lossless Mode.

These constants specify specify the VoIP ST2022-6 Packetizer Module Enable or Disable.

These constants specify specify the VoIP ST2022-6 Packetizer Video Bit Rate either is an Integer (148.5 MHz or 74.25 MHz) or Non-Integer (148.35 MHz or 74.175 MHz)

These constants specify specify the VoIP ST2022-6 Packetizer Incoming SDI to AXI4-Stream SDI Mode, SD-SDI or HD-SDI or 3G-SDI.

These constants specify specify the VoIP ST2022-6 Packetizer Timestamp Reference in the Video Header.

Function Documentation

int XPacketizer56_CfgInitialize ( XPacketizer56 InstancePtr,
XPacketizer56_Config CfgPtr,
UINTPTR  EffectiveAddr 
)

This function initializes the VoIP ST2022-6 Packetizer core.

This function must be called prior to using the VoIP ST2022-6 Packetizer core. Initialization of the VoIP ST2022-6 Packetizer includes setting up the instance data, and ensuring the hardware is in a quiescent state.

Parameters
InstancePtris a pointer to the VoIP ST2022-6 Packetizer core instance.
CfgPtrpoints to the configuration structure associated with the HDMI RX 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 XPacketizer56_CfgInitialize was successful.
Note
None.

References XPacketizer56::DatagramMismatchCallback, XPacketizer56::IsDatagramMismatchCallbackSet, and XPacketizer56_RegClear().

void XPacketizer56_IntrHandler ( void *  InstancePtr)

This function is the interrupt handler for the VoIP ST2022-6 Packetizer driver.

This handler reads the pending interrupt from VoIP ST2022-6 Packetizer, determines the source of the interrupts, clears the interrupts and calls callbacks accordingly.

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 XPacketizer56_SetCallback() during initialization phase. An example delivered with this driver demonstrates how this could be done.

Parameters
InstancePtris a pointer to the XPacketizer56 instance that just interrupted.
Returns
None.
Note
None.

References XPacketizer56_ReadReg.

XPacketizer56_Config* XPacketizer56_LookupConfig ( u16  DeviceId)

This function returns a reference to an XPacketizer56_Config structure based on the core id, DeviceId.

The return value will refer to an entry in the device configuration table defined in the xpacketizer56_g.c file.

Parameters
DeviceIdis the unique core ID of the ST2022-6 Packetizer core for the lookup operation.
Returns
XPacketizer56_LookupConfig returns a reference to a config record in the configuration table (in xpacketizer56_g.c) corresponding to DeviceId, or NULL if no match is found.
Note
None.
void XPacketizer56_LosslessEnable ( XPacketizer56 InstancePtr)

This function Sets the Operating Mode based on User Configure Value in VoIP ST2022-6 Packetizer Structure of LoslessMode LoslessMode : XPACKETIZER56_NORMAL : Normal Mode XPACKETIZER56_LOSSLESS : Lossless Mode.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.

XPacketizer56_Stream XPacketizer56_MediaDatagramInfo ( XPacketizer56 InstancePtr)

This function Writes the RTP-Media Header into the VoIP ST2022-6 Register.

Parameters
InstancePtris a pointer to the XPacketizer56 core instance.
Returns
None.
Note
None.
void XPacketizer56_ModEnable ( XPacketizer56 InstancePtr)

This function Enable or Disable the Module based on User Configured Structure of ModuleEnable.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.

void XPacketizer56_RegClear ( XPacketizer56 InstancePtr)

This function Clears all the VoIP ST2022-6 Packetizer Register Space.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.

Referenced by XPacketizer56_CfgInitialize().

void XPacketizer56_RTPMediaHeader ( XPacketizer56 InstancePtr)

This function Writes the RTP-Media Header into the VoIP ST2022-6 Register.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.

int XPacketizer56_SetCallback ( XPacketizer56 InstancePtr,
XPacketizer56_HandlerType  HandlerType,
void *  CallbackFunc,
void *  CallbackRef 
)

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

HandlerType                 Callback Function Type
-------------------------   -----------------------------------------------
Parameters
InstancePtris a pointer to the VoIP ST2022-6 Packetizer core 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 XPacketizer56::DatagramMismatchCallback, XPacketizer56::DatagramMismatchRef, and XPacketizer56::IsDatagramMismatchCallbackSet.

void XPacketizer56_SetChannel ( XPacketizer56 InstancePtr)

This function Sets the Channel Number Information which will be added in to TUSER Master AXI4-Stream of the Module.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.

void XPacketizer56_SetSSRC ( XPacketizer56 InstancePtr)

This function Sets the RTP-SSRC Header.

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

References XPacketizer56_WriteReg.

void XPacketizer56_VidFormat ( XPacketizer56 InstancePtr)

This function Writes the Video Format into the VoIP ST2022-6 Register.

This register is valid if the core is set to obtained video format from the Register space.

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

References XPacketizer56_ReadReg, and XPacketizer56_WriteReg.