Software Drivers

xrgb2ycrcb.h File Reference

#include "xrgb2ycrcb_hw.h"
#include "xil_assert.h"
#include "xstatus.h"

Classes

struct  XRgb2YCrCb_Config
struct  XRgb2YCrCb
struct  XRgb2YCrCb_Coef_Inputs
struct  XRgb2YCrCb_Coef_Outputs

Active size range macros

#define XRGB_VSIZE_FIRST   32
#define XRGB_VSIZE_LAST   7680
#define XRGB_HSIZE_FIRST   32
#define XRGB_HSIZE_LAST   7680

Ymax range macros

#define XRGB_YMAX_FIRST   0
#define XRGB_YMAX_LAST   255

Ymin range macros

#define XRGB_YMIN_FIRST   0
#define XRGB_YMIN_LAST   255

Yoffset range macros

#define XRGB_YOFFSET_FIRST   0
#define XRGB_YOFFSET_LAST   255

Cbmax range macros

#define XRGB_CBMAX_FIRST   0
#define XRGB_CBMAX_LAST   255

Cbmin range macros

#define XRGB_CBMIN_FIRST   0
#define XRGB_CBMIN_LAST   255

Cboffset range macros

#define XRGB_CBOFFSET_FIRST   0
#define XRGB_CBOFFSET_LAST   255

Crmax range macros

#define XRGB_CRMAX_FIRST   0
#define XRGB_CRMAX_LAST   255

Crmin range macros

#define XRGB_CRMIN_FIRST   0
#define XRGB_CRMIN_LAST   255

Croffset range macros

#define XRGB_CROFFSET_FIRST   0
#define XRGB_CROFFSET_LAST   255

Handler Types

enum  { XRGB_HANDLER_PROCSTART = 1, XRGB_HANDLER_FRAMEDONE, XRGB_HANDLER_ERROR }

Standard Types

enum  XRgb_Standards {
  XRGB_STANDARD_ITU_601_SD = 0, XRGB_STANDARD_ITU_709_NTSC, XRGB_STANDARD_ITU_709_PAL, XRGB_STANDARD_YUV,
  XRGB_STANDARD_CUSTOM
}

Output Ranges

enum  XRgb_OutputRanges { XRGB_TV_16_TO_240 = 0, XRGB_STUDIO_16_TO_235, XRGB_GRAPHICS_0_TO_255 }

Defines

#define XRGB2YCRCB_H_
#define XRgb2YCrCb_Enable(InstancePtr)
#define XRgb2YCrCb_Disable(InstancePtr)
#define XRgb2YCrCb_Start   XRgb2YCrCb_Enable
#define XRgb2YCrCb_Stop   XRgb2YCrCb_Disable
#define XRgb2YCrCb_RegUpdateEnable(InstancePtr)
#define XRgb2YCrCb_RegUpdateDisable(InstancePtr)
#define XRgb2YCrCb_SyncReset(InstancePtr)
#define XRgb2YCrCb_Reset(InstancePtr)
#define XRgb2YCrCb_IntrEnable(InstancePtr, IntrType)
#define XRgb2YCrCb_IntrDisable(InstancePtr, IntrType)
#define XRgb2YCrCb_StatusGetPending(InstancePtr)
#define XRgb2YCrCb_IntrGetPending(InstancePtr)
#define XRgb2YCrCb_IntrClear(InstancePtr, IntrType)

Typedefs

typedef void(*) XRgb2YCrCb_CallBack (void *CallBackRef)
typedef void(*) XRgb2YCrCb_ErrorCallBack (void *CallBackRef, u32 ErrorMask)

Functions

XRgb2YCrCb_ConfigXRgb2YCrCb_LookupConfig (u16 DeviceId)
int XRgb2YCrCb_CfgInitialize (XRgb2YCrCb *InstancePtr, XRgb2YCrCb_Config *CfgPtr, u32 EffectiveAddr)
void XRgb2YCrCb_EnableDbgByPass (XRgb2YCrCb *InstancePtr)
int XRgb2YCrCb_IsDbgByPassEnabled (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_DisableDbgBypass (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_EnableDbgTestPattern (XRgb2YCrCb *InstancePtr)
int XRgb2YCrCb_IsDbgTestPatternEnabled (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_DisableDbgTestPattern (XRgb2YCrCb *InstancePtr)
u32 XRgb2YCrCb_GetVersion (XRgb2YCrCb *InstancePtr)
u32 XRgb2YCrCb_GetDbgFrameCount (XRgb2YCrCb *InstancePtr)
u32 XRgb2YCrCb_GetDbgLineCount (XRgb2YCrCb *InstancePtr)
u32 XRgb2YCrCb_GetDbgPixelCount (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_Setup (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetActiveSize (XRgb2YCrCb *InstancePtr, u16 HSize, u16 VSize)
void XRgb2YCrCb_GetActiveSize (XRgb2YCrCb *InstancePtr, u16 *HSize, u16 *VSize)
void XRgb2YCrCb_SetYMax (XRgb2YCrCb *InstancePtr, u32 YMax)
u32 XRgb2YCrCb_GetYMax (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetYMin (XRgb2YCrCb *InstancePtr, u32 YMin)
u32 XRgb2YCrCb_GetYMin (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCbMax (XRgb2YCrCb *InstancePtr, u32 CbMax)
u32 XRgb2YCrCb_GetCbMax (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCbMin (XRgb2YCrCb *InstancePtr, u32 CbMin)
u32 XRgb2YCrCb_GetCbMin (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCrMax (XRgb2YCrCb *InstancePtr, u32 CrMax)
u32 XRgb2YCrCb_GetCrMax (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCrMin (XRgb2YCrCb *InstancePtr, u32 CrMin)
u32 XRgb2YCrCb_GetCrMin (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetYOffset (XRgb2YCrCb *InstancePtr, u32 YOffset)
u32 XRgb2YCrCb_GetYOffset (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCbOffset (XRgb2YCrCb *InstancePtr, u32 CbOffset)
u32 XRgb2YCrCb_GetCbOffset (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCrOffset (XRgb2YCrCb *InstancePtr, u32 CrOffset)
u32 XRgb2YCrCb_GetCrOffset (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_SetCoefs (XRgb2YCrCb *InstancePtr, double ACoef, double BCoef, double CCoef, double DCoef)
void XRgb2YCrCb_GetCoefs (XRgb2YCrCb *InstancePtr, double *ACoef, double *BCoef, double *CCoef, double *DCoef)
void XRgb2YCrCb_Select_Standard (XRgb2YCrCb *InstancePtr, enum XRgb_Standards StandardSel, enum XRgb_OutputRanges InputRange, u32 DataWidth, struct XRgb2YCrCb_Coef_Inputs *CoefIn)
u32 XRgb2YCrCb_Coefficient_Translation (XRgb2YCrCb *InstancePtr, struct XRgb2YCrCb_Coef_Inputs *CoefIn, struct XRgb2YCrCb_Coef_Outputs *CoefOut, u32 Data_Width)
void XRgb2YCrCb_Select_OutputRange (XRgb2YCrCb *InstancePtr, enum XRgb_OutputRanges Range)
int XRgb2YCrCb_SelfTest (XRgb2YCrCb *InstancePtr)
void XRgb2YCrCb_IntrHandler (void *InstancePtr)
int XRgb2YCrCb_SetCallBack (XRgb2YCrCb *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)


Define Documentation

#define XRgb2YCrCb_Disable ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_CONTROL_OFFSET), \
                ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET))) & (~(XRGB_CTL_SW_EN_MASK))))
This macro disables the Rgb2YCrCb device/core.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_Disable(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_Enable ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_CONTROL_OFFSET), \
                ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET))) | (XRGB_CTL_SW_EN_MASK)))
This macro enables the Rgb2YCrCb device/core.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_Enable(XRgb2YCrCb *InstancePtr)

#define XRGB2YCRCB_H_

Prevent circular inclusions by using protection macros

#define XRgb2YCrCb_IntrClear ( InstancePtr,
IntrType   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_STATUS_OFFSET), ((IntrType) & \
                                (XRGB_IXR_ALLINTR_MASK)))
This function macro clears/acknowledges pending interrupts of the RGB2YCRCB core in the Status register. Bit positions of 1 will be cleared.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
IntrType is the pending interrupts to clear/acknowledge. Use OR'ing of XRGB_IXR_*_MASK constants defined in xrgb2ycrcb_hw.h to create this parameter value.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_IntrClear(XRgb2YCrCb *InstancePtr, u32 IntrType)

#define XRgb2YCrCb_IntrDisable ( InstancePtr,
IntrType   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_IRQ_EN_OFFSET), \
                 ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_IRQ_EN_OFFSET))) & ((~(IntrType)) & \
                                (XRGB_IXR_ALLINTR_MASK))))
This function macro disables individual interrupts of the RGB2YCRCB core by updating the IRQ_ENABLE register.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
IntrType is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XRGB_IXR_*_MASK bits defined in xrgb2ycrcb_hw.h.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_IntrDisable(XRgb2YCrCb *InstancePtr, u32 IntrType)
Any other interrupt not covered by parameter IntrType, if enabled before this macro is called, will remain enabled.

#define XRgb2YCrCb_IntrEnable ( InstancePtr,
IntrType   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_IRQ_EN_OFFSET), (((IntrType) & \
                                (XRGB_IXR_ALLINTR_MASK)) | \
                (XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                                        (XRGB_IRQ_EN_OFFSET)))))
This function macro enables individual interrupts of the RGB2YCRCB core by updating the IRQ_ENABLE register.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
IntrType is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XRGB_IXR_*_MASK bits defined in xrgb2ycrcb_hw.h.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_IntrEnable(XRgb2YCrCb *InstancePtr, u32 IntrType)
The existing enabled interrupt(s) will remain enabled.

#define XRgb2YCrCb_IntrGetPending ( InstancePtr   ) 

Value:

XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_IRQ_EN_OFFSET)) & \
                ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_STATUS_OFFSET))) & ((u32)(XRGB_IXR_ALLINTR_MASK)))
This function macro returns the pending interrupts of the RGB2YCRCB core for the interrupts that have been enabled.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
The pending interrupts of the Rgb2YCrCb core. Use XRGB_IXR_*_MASK constants defined in xrgb2ycrcb_hw.h to interpret this value. The returned value is a logical AND of the contents of the STATUS Register and the IRQ_ENABLE Register.
Note:
C-style signature: u32 XRgb2YCrCb_IntrGetPending(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_RegUpdateDisable ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_CONTROL_OFFSET), \
                ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET)))) & (~(XRGB_CTL_RUE_MASK)))
This macro disables copying from updated processor register values to the active set at the end of each AXI-Stream frame.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_RegUpdateDisable(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_RegUpdateEnable ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XRGB_CONTROL_OFFSET), \
                ((XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET))) | (XRGB_CTL_RUE_MASK)))
This macro enables copying from updated processor register values to the active set at the end of each AXI-Stream frame.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_RegUpdateEnable(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_Reset ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET), (XRGB_CTL_RESET_MASK))
This macro resets the Rgb2YCrCb core. This reset effects the core immediately, and may cause image tearing.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_Reset(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_Start   XRgb2YCrCb_Enable

This function macro enables/starts the Rgb2YCrCb core.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb instance to be worked on
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_Start(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_StatusGetPending ( InstancePtr   ) 

Value:

XRgb2YCrCb_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_STATUS_OFFSET)) & (XRgb2YCrCb_IXR_ALLINTR_MASK)
This function macro returns the pending interrupt status of the RGB2YCRCB core read from the Status register.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
The status of pending interrupts of the Rgb2YCrCb core. Use XRGB_IXR_*_MASK constants defined in xrgb2ycrcb_hw.h to interpret this value.
Note:
C-style signature: u32 XRgb2YCrCb_StatusGePending(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_Stop   XRgb2YCrCb_Disable

This function macro disables/stops the Rgb2YCrCb core.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb instance to be worked on
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_Stop(XRgb2YCrCb *InstancePtr)

#define XRgb2YCrCb_SyncReset ( InstancePtr   ) 

Value:

XRgb2YCrCb_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XRGB_CONTROL_OFFSET), (XRGB_CTL_AUTORESET_MASK))
This macro resets the Rgb2YCrCb device, but differs from XRgb_Reset() in that it automatically synchronizes to the VBlank_in input of the core to prevent tearing.

On the next rising-edge of VBlank_in following a call to XRgb2YCrCb_SyncReset(), all of the core's configuration registers and outputs will be reset, then the reset flag will be immediately released, allowing the core to immediately resume default operation.

Parameters:
InstancePtr is a pointer to the Rgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XRgb2YCrCb_SyncReset(XRgb2YCrCb *InstancePtr)

#define XRGB_CBMAX_FIRST   0

Cbmax starting value

#define XRGB_CBMAX_LAST   255

Cbmax ending value

#define XRGB_CBMIN_FIRST   0

Cbmin starting value

#define XRGB_CBMIN_LAST   255

Cbmin ending value

#define XRGB_CBOFFSET_FIRST   0

Cboffset starting value

#define XRGB_CBOFFSET_LAST   255

Cboffset ending value

#define XRGB_CRMAX_FIRST   0

Crmax starting value

#define XRGB_CRMAX_LAST   255

Crmax ending value

#define XRGB_CRMIN_FIRST   0

Crmin starting value

#define XRGB_CRMIN_LAST   255

Crmin ending value

#define XRGB_CROFFSET_FIRST   0

Croffset starting value

#define XRGB_CROFFSET_LAST   255

Croffset ending value

#define XRGB_HSIZE_FIRST   32

HSize starting value

#define XRGB_HSIZE_LAST   7680

HSize ending value

#define XRGB_VSIZE_FIRST   32

VSize starting value

#define XRGB_VSIZE_LAST   7680

VSize ending value

#define XRGB_YMAX_FIRST   0

Ymax starting value

#define XRGB_YMAX_LAST   255

Ymax ending value

#define XRGB_YMIN_FIRST   0

Ymin starting value

#define XRGB_YMIN_LAST   255

Ymax ending value

#define XRGB_YOFFSET_FIRST   0

Yoffset starting value

#define XRGB_YOFFSET_LAST   255

Yoffset ending value


Typedef Documentation

typedef void(*) XRgb2YCrCb_CallBack(void *CallBackRef)

Callback type for all interrupts except error interrupt.

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

typedef void(*) XRgb2YCrCb_ErrorCallBack(void *CallBackRef, u32 ErrorMask)

This data type defines a handler that an application defines to communicate with interrupt system to retrieve error information while processing video frame.

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.
ErrorMask is a bit mask indicating the cause of the error. Its value equals 'OR'ing one or more XRGB_IXR_*_MASK values defined in xrgb2ycrcb_hw.h.
Returns:
None.
Note:
None.


Enumeration Type Documentation

anonymous enum

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

Enumerator:
XRGB_HANDLER_PROCSTART  A processing start event interrupt type
XRGB_HANDLER_FRAMEDONE  A frame done event interrupt type
XRGB_HANDLER_ERROR  An error condition interrupt type

enum XRgb_OutputRanges

These constants specify different ranges used for studio equipment, television and computer graphics respectively.

Enumerator:
XRGB_TV_16_TO_240  16 to 240, for Television.
XRGB_STUDIO_16_TO_235  16 to 235, for Studio Equipment.
XRGB_GRAPHICS_0_TO_255  0 to 255, for Computer Graphics.

enum XRgb_Standards

These constants specify different types of standards used to represent standard color encoding.

Enumerator:
XRGB_STANDARD_ITU_601_SD  Standard ITU 601 SD.
XRGB_STANDARD_ITU_709_NTSC  Standard ITU 709 NTSC.
XRGB_STANDARD_ITU_709_PAL  Standard ITU 709 PAL.
XRGB_STANDARD_YUV  Standard YUV.
XRGB_STANDARD_CUSTOM  Standard Custom.


Function Documentation

int XRgb2YCrCb_CfgInitialize ( XRgb2YCrCb InstancePtr,
XRgb2YCrCb_Config CfgPtr,
u32  EffectiveAddr 
)

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

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CfgPtr is a reference to a structure containing information about a specific XRgb2YCrCb driver.
EffectiveAddr is the core base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the core physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.
Returns:
- XST_SUCCESS if initialization was successful.
Note:
None.

u32 XRgb2YCrCb_Coefficient_Translation ( XRgb2YCrCb InstancePtr,
struct XRgb2YCrCb_Coef_Inputs CoefIn,
struct XRgb2YCrCb_Coef_Outputs CoefOut,
u32  DataWidth 
)

This function translates the XRgb2YCrCb_Coef_Inputs structure into the XRgb2YCrCb_Coef_Outputs structure that can be used to program the core's registers. The XRgb2YCrCb_Coef_Inputs structure uses the same values as the core's GUIs. The XRgb2YCrCb_Coef_Outputs structure uses the values that can be programmed into the core's registers.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CoefIn specifies a pointer to a XRgb2YCrCb_Coef_Inputs structure to be translated.
CoefOut specifies a pointer to a XRgb2YCrCb_Coef_Outputs structure with translated values.
DataWidth specifies a valid range of [8,10,12,16] that needs to be set.
Returns:
RetVal, returns the 32-bit value with following bit information:
  • bit(0)= ACoef + BCoef > 1.0.
  • bit(1)= Y Offset outside data width range as [-2^Data_Width, (2^Data_Width)-1].
  • bit(2)= Cb Offset outside data width range as [-2^Data_Width, (2^Data_Width)-1].
  • bit(3)= Cr Offset outside data width range as [-2^Data_Width, (2^Data_Width)-1].
  • bit(4)= Y Max outside data width range as [0, (2^Data_Width)-1].
  • bit(5)= Y Min outside data width range as [0, (2^Data_Width)-1].
  • bit(6)= Cb Max outside data width range as [0, (2^Data_Width)-1].
  • bit(7)= Cb Min outside data width range as [0, (2^Data_Width)-1].
  • bit(8)= Cr Max outside data width range as [0, (2^Data_Width)-1].
  • bit(9)= Cr Min outside data width range as [0, (2^Data_Width)-1].
Note:
None.

void XRgb2YCrCb_DisableDbgBypass ( XRgb2YCrCb InstancePtr  ) 

This function disables Bypass mode.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XRgb2YCrCb_DisableDbgTestPattern ( XRgb2YCrCb InstancePtr  ) 

This function disables debug test pattern mode.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb core instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XRgb2YCrCb_EnableDbgByPass ( XRgb2YCrCb InstancePtr  ) 

This function sets the bypass bit of control register to switch the core to bypass mode if debug is enabled in the IP.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
None.
Note:
Debug functionality should be enabled.

void XRgb2YCrCb_EnableDbgTestPattern ( XRgb2YCrCb InstancePtr  ) 

This function switches the core to test-pattern generator mode if debug feature is enabled.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
None.
Note:
Debug functionality should be enabled.

void XRgb2YCrCb_GetActiveSize ( XRgb2YCrCb InstancePtr,
u16 *  HSize,
u16 *  VSize 
)

This function gets the active H/V sizes of the Rgb2YCrCb core from active size register.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
HSize is a pointer to 16-bit variable in which the number of Active Pixels per scanline is returned within the range [32, 7680].
VSize is a pointer to 16-bit variable in which the number of Active Lines per frame is returned within the range [32, 7680].
Returns:
None.
Note:
None.

u32 XRgb2YCrCb_GetCbMax ( XRgb2YCrCb InstancePtr  ) 

This function returns the maximum value on the Cb Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CbMax, maximum value within range [0, 255] of the Cb Chroma Channel.
Note:
None.

u32 XRgb2YCrCb_GetCbMin ( XRgb2YCrCb InstancePtr  ) 

This function returns the minimum value on the Cb Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CbMin, minimum value within range [0, 255] on the Cb Chroma Channel.
Note:
None.

u32 XRgb2YCrCb_GetCbOffset ( XRgb2YCrCb InstancePtr  ) 

This function returns the offset compensation value for the Cb Chroma channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CbOffset is the compensation value within range [0, 255] for the Cb Chroma channel.
Note:
None.

void XRgb2YCrCb_GetCoefs ( XRgb2YCrCb InstancePtr,
double *  ACoef,
double *  BCoef,
double *  CCoef,
double *  DCoef 
)

This function returns A, B, C and D coefficients.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
ACoef is a pointer to double variable in which A coefficient is returned within the range [0.0 to 1.0].
BCoef is a pointer to double variable in which B coefficient is returned within the range [0.0 to 1.0].
CCoef is a pointer to double variable in which C coefficient is returned within the range [0.0 to 1.0].
DCoef is a pointer to double variable in which D coefficient is returned within the range [0.0 to 1.0].
Returns:
None.
Note:
None.

u32 XRgb2YCrCb_GetCrMax ( XRgb2YCrCb InstancePtr  ) 

This function returns the maximum value on the Cr Chroma channel of the output

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CrMax, maximum value within range [0, 255] on the Cr Chroma Channel.
Note:
None.

u32 XRgb2YCrCb_GetCrMin ( XRgb2YCrCb InstancePtr  ) 

This function returns the minimum value on the Cr Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CrMin, minimum value within range [0, 255] on the Cr Chroma Channel.
Note:
None.

u32 XRgb2YCrCb_GetCrOffset ( XRgb2YCrCb InstancePtr  ) 

This function returns the offset compensation value of the Cr Chroma channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
CrOffset is the compensation value within range [0, 255] of the Cr Chroma channel.
Note:
None.

u32 XRgb2YCrCb_GetDbgFrameCount ( XRgb2YCrCb InstancePtr  ) 

This function returns the frame count, the number of frames processed since power-up. This is available only if the debugging feature is enabled.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
DbgFrameCount, number of frames processed since power-up.
Note:
The SYSDEBUG0, or Frame Throughput Monitor register indicates the number of frames processed since power-up or the last time the core was reset. The SYSDEBUG registers can be useful to identify external memory / frame buffer/ throughput bottlenecks in a video system. Debug functionality should be enabled.

u32 XRgb2YCrCb_GetDbgLineCount ( XRgb2YCrCb InstancePtr  ) 

This function returns Line count, the number of lines processed since power-up. This is available only if the debugging feature is enabled.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
DbgLineCount, number of lines processed since power-up.
Note:
The SYSDEBUG1 or Line Throughput Monitor register indicates the number of lines processed since power-up or the last time the core was reset. The SYSDEBUG registers can be useful to identify external memory / Frame buffer / throughput bottlenecks in a video system. Debug functionality should be enabled.

u32 XRgb2YCrCb_GetDbgPixelCount ( XRgb2YCrCb InstancePtr  ) 

This function returns the pixel count, the number of pixels processed since power up. This is available only if the debugging feature is enabled.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
DbgPixelCount, number of pixels processed since power-up.
Note:
The SYSDEBUG2, or Pixel Throughput Monitor register indicates the number of pixel processed since power-up or the last time the core was reset. The SYSDEBUG registers can be useful to identify external memory / Frame buffer / throughput bottlenecks in a video system. Debug functionality should be enabled.

u32 XRgb2YCrCb_GetVersion ( XRgb2YCrCb InstancePtr  ) 

This function facilitates software identification of exact version of the RGB2YCrCb hardware (h/w).

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
Version, contents of a Version register.
Note:
None.

u32 XRgb2YCrCb_GetYMax ( XRgb2YCrCb InstancePtr  ) 

This function returns the maximum value of the Luma (Y) channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
YMax, Maximum value within range [0, 255] of the Luma channel.
Note:
None.

u32 XRgb2YCrCb_GetYMin ( XRgb2YCrCb InstancePtr  ) 

This function returns the minimum value of the Luma (Y) channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
YMin, minimum value within range [0, 255] of the Luma channel.
Note:
None.

u32 XRgb2YCrCb_GetYOffset ( XRgb2YCrCb InstancePtr  ) 

This function returns the offset compensation value for the Luma (Y) channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
YOffset is compensation value within range [0, 255] for the Luma (Y) channel.
Note:
None.

void XRgb2YCrCb_IntrHandler ( void *  InstancePtr  ) 

This function is the interrupt handler for the RGB2YCRCB driver.

This handler reads the pending interrupt from the IER(IRQ_ENABLE register) or ISR (STATUS register), determines the source of the interrupts, calls according callbacks, and finally clears the interrupts.

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 XRgb2YCrCb_SetCallBack() during initialization phase.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance that just interrupted.
Returns:
None.
Note:
Interrupt interface (HasIntcIf) should be enabled.

int XRgb2YCrCb_IsDbgByPassEnabled ( XRgb2YCrCb InstancePtr  ) 

This function returns the current bypass mode of a core.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
  • TRUE if ByPass mode is enabled.
  • FALSE if ByPpass mode is not enabled.
Note:
Debug functionality should be enabled.

int XRgb2YCrCb_IsDbgTestPatternEnabled ( XRgb2YCrCb InstancePtr  ) 

This function returns the test-pattern generator mode (enabled or not), if debug feature is enabled.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
  • TRUE if Test-pattern mode is enabled.
  • FALSE if Test-pattern mode is not enabled.
Note:
Debug functionality should be enabled.

XRgb2YCrCb_Config* XRgb2YCrCb_LookupConfig ( u16  DeviceId  ) 

This function returns a reference to an XRgb2YCrCb_Config structure based on the unique core id, DeviceId. The return value will refer to an entry in the core configuration table defined in the xrgb2ycrcb_g.c file.

Parameters:
DeviceId is the unique core ID of the core for the lookup operation.
Returns:
XRgb2YCrCb_LookupConfig returns a reference to a config record in the configuration table (in xrgb2ycrcb_g.c) corresponding to DeviceId, or NULL if no match is found.
Note:
None.

void XRgb2YCrCb_Select_OutputRange ( XRgb2YCrCb InstancePtr,
enum XRgb_OutputRanges  Range 
)

This function governs the range of outputs Y, Cr and Cb by affecting the conversion coefficients as well as the clipping and clamping values.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Range needs to be set from the enum XRgb_OutputRanges values as: 0 = XRGB_TV_16_TO_240, 1 = XRGB_STUDIO_16_TO_235, 2 = XRGB_GRAPHICS_0_TO_255.
Returns:
None.
Note:
None.

void XRgb2YCrCb_Select_Standard ( XRgb2YCrCb InstancePtr,
enum XRgb_Standards  StandardSel,
enum XRgb_OutputRanges  InputRange,
u32  DataWidth,
struct XRgb2YCrCb_Coef_Inputs CoefIn 
)

This function populates an XRgb2YCrCb_Coef_Inputs structure with the values from the selected video standard.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
StandardSel needs to be set from enum XRgb_Standards value as : 0 = XRGB_STANDARD_ITU_601_SD 1 = XRGB_STANDARD_ITU_709_NTSC 2 = XRGB_STANDARD_ITU_709_PAL 3 = XRGB_STANDARD_YUV.
InputRange needs to be set from enum XRgb_OutputRanges value as: 0 = XRGB_TV_16_TO_240, 1 = XRGB_STUDIO_16_TO_235, 2 = XRGB_GRAPHICS_0_TO_255.
DataWidth specifies the valid range of [8,10,12,16] that needs to be set.
CoefIn specifies a pointer to a XRgb2YCrCb_Coef_Inputs structure which is populated with the values from selected video standard.
Returns:
None.
Note:
None.

int XRgb2YCrCb_SelfTest ( XRgb2YCrCb InstancePtr  ) 

This function reads version register of RGB2YCRCB core and compares with zero as part of self test.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
  • XST_SUCCESS if the version register read test was successful.
  • XST_FAILURE if the version register read test failed.
Note:
None.

void XRgb2YCrCb_SetActiveSize ( XRgb2YCrCb InstancePtr,
u16  HSize,
u16  VSize 
)

This function sets active H/V sizes in the active size register.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
HSize specifies the number of Active Pixels per scanline that needs to be set within the range [32, 7680].
VSize specifies the number of Active Lines per frame that needs to be set within the range [32, 7680].
Returns:
None.
Note:
None.

int XRgb2YCrCb_SetCallBack ( XRgb2YCrCb InstancePtr,
u32  HandlerType,
void *  CallBackFunc,
void *  CallBackRef 
)

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

 HandlerType              Callback Function Type
 -----------------------  --------------------------------------------------
 XRGB_HANDLER_PROCSTART   ProcStartCallBack
 XRGB_HANDLER_FRAMEDONE   FrameDoneCallBack
 XRGB_HANDLER_ERROR       ErrCallBack

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance to be worked on.
HandlerType specifies which callback is to be attached.
CallBackFunc is the address of the callback function.
CallBackRef is a user data item that will be passed to the callback function when it is invoked.
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.

void XRgb2YCrCb_SetCbMax ( XRgb2YCrCb InstancePtr,
u32  CbMax 
)

This function sets the maximum value allowed on the Cb Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CbMax specifies the maximum value within range [0, 255] of Cb Chroma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCbMin ( XRgb2YCrCb InstancePtr,
u32  CbMin 
)

This function sets the minimum value allowed on the Cb Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CbMin specifies the maximum value within range [0, 255] of Cb Chroma channel needs to set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCbOffset ( XRgb2YCrCb InstancePtr,
u32  CbOffset 
)

This function sets the offset compensation value for the Cb Chroma channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CbOffset specifies the compensation value within range [0, 255] of Cb Chroma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCoefs ( XRgb2YCrCb InstancePtr,
double  ACoef,
double  BCoef,
double  CCoef,
double  DCoef 
)

This function sets A, B, C and D coefficients.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
ACoef specifies the A coefficient value within the range [0.0 to 1.0] that needs to be set.
BCoef specifies the B coefficient value within the range [0.0 to 1.0] that needs to be set.
CCoef specifies the C coefficient value within the range [0.0 to 1.0] that needs to be set.
DCoef specifies the D coefficient value within the range [0.0 to 1.0] that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCrMax ( XRgb2YCrCb InstancePtr,
u32  CrMax 
)

This function sets the maximum value allowed on the Cr Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CrMax specifies the maximum value within range [0, 255] of Cr Chroma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCrMin ( XRgb2YCrCb InstancePtr,
u32  CrMin 
)

This function sets the minimum value allowed on the Cr Chroma channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CrMin specifies the minimum value within range [0, 255] of Cr Chroma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetCrOffset ( XRgb2YCrCb InstancePtr,
u32  CrOffset 
)

This function sets the offset compensation value for the Cr Chroma channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
CrOffset specifies the compensation value within range [0, 255] of Cr Chroma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_Setup ( XRgb2YCrCb InstancePtr  ) 

This function sets up double buffered ACTIVE_SIZE register and enables the register update.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetYMax ( XRgb2YCrCb InstancePtr,
u32  YMax 
)

This function sets the maximum value allowed on the Luma (Y) channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
YMax specifies the maximum value within range [0, 255] of Luma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetYMin ( XRgb2YCrCb InstancePtr,
u32  YMin 
)

This function sets the minimum value allowed on the Luma (Y) channel of the output.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
YMin specifies the minimum value within range [0, 255] of Luma channel that needs to be set.
Returns:
None.
Note:
None.

void XRgb2YCrCb_SetYOffset ( XRgb2YCrCb InstancePtr,
u32  YOffset 
)

This function sets the offset compensation value for the Luma (Y) channel.

Parameters:
InstancePtr is a pointer to the XRgb2YCrCb instance.
YOffset specifies the compensation value within range [0, 255] of Luma channel that needs to be set.
Returns:
None.
Note:
None.

Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.