#include "xycrcb2rgb_hw.h"
#include "xil_assert.h"
#include "xstatus.h"
#define XYCC_ACT_SIZE_FIRST 32 |
Active Size (VxH) range macros Starting value for H/V
#define XYCC_ACT_SIZE_LAST 8192 |
Ending value for H/V
#define XYCC_RGBMAX_MIN_FIRST 0 |
RGBMAX, RGBMIN range macros Starting value for RGBMAX/RGBMIN
#define XYCC_RGBMAX_MIN_LAST 255 |
Ending value for RGBMAX/RGBMIN
#define XYCC_RGBOFFSET_FIRST 0 |
ROFFSET, GOFFSET, BOFFSET range macros Starting value for ROFFSET/ GOFFSET/BOFFSET
#define XYCC_RGBOFFSET_LAST 255 |
Ending value for ROFFSET/ GOFFSET/BOFFSET
#define XYCrCb2Rgb_Disable | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), \ (XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET)) & (~(XYCC_CTL_SW_EN_MASK))))
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_Enable | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), \ XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET)) | (XYCC_CTL_SW_EN_MASK))
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCRCB2RGB_H_ |
Prevent circular inclusions by using protection macros
#define XYCrCb2Rgb_IntrClear | ( | InstancePtr, | |||
IntrType | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_STATUS_OFFSET), \ (IntrType) & (XYCC_IXR_ALLINTR_MASK))
InstancePtr | is a pointer to the YCRCB2RGB core instance to be worked on. | |
IntrType | is the pending interrupts to clear/acknowledge. Use OR'ing of XYCC_IXR_*_MASK constants defined in xycrcb2rgb_hw.h to create this parameter value. |
#define XYCrCb2Rgb_IntrDisable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_IRQ_EN_OFFSET),\ XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_IRQ_EN_OFFSET)) & \ ((~(IntrType)) & (XYCC_IXR_ALLINTR_MASK)))
InstancePtr | is a pointer to the YCrCb2Rgb 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 XYCC_IXR_*_MASK bits defined in xycrcb2rgb_hw.h. |
#define XYCrCb2Rgb_IntrEnable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_IRQ_EN_OFFSET), (((IntrType) & \ (XYCC_IXR_ALLINTR_MASK)) | \ (XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_IRQ_EN_OFFSET)))))
InstancePtr | is a pointer to the YCrCb2Rgb 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 XYCC_IXR_*_MASK bits defined in xycrcb2rgb_hw.h. |
#define XYCrCb2Rgb_IntrGetPending | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_IRQ_EN_OFFSET)) & \ (XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_STATUS_OFFSET)) & \ ((u32)(XYCC_IXR_ALLINTR_MASK)))
InstancePtr | is a pointer to the YCrCb2Rgb core instance to be worked on. |
#define XYCrCb2Rgb_Max | ( | Num1, | |||
Num2 | ) | (((Num1) > (Num2)) ? (Num1) : (Num2)) |
This macro identifies maximum number from given numbers.
Num1 | is a a u32 number. | |
Num2 | is a a u32 number. |
#define XYCrCb2Rgb_RegUpdateDisable | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), \ (XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET)) & (~(XYCC_CTL_RUE_MASK))))
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_RegUpdateEnable | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), \ (XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET)) | (XYCC_CTL_RUE_MASK)))
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_Reset | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), (XYCC_CTL_RESET_MASK))
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_Start XYCrCb2Rgb_Enable |
This macro starts the YCrCb2Rgb core.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_StatusGetPending | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_ReadReg((InstancePtr)->Config.BaseAddress, \ (XYCC_STATUS_OFFSET)) & (XYCC_IXR_ALLINTR_MASK)
InstancePtr | is a pointer to the YCrCb2Rgb core instance to be worked on. |
#define XYCrCb2Rgb_Stop XYCrCb2Rgb_Disable |
This macro stops the YCrCb2Rgb core.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
#define XYCrCb2Rgb_SyncReset | ( | InstancePtr | ) |
Value:
XYCrCb2Rgb_WriteReg((InstancePtr)->Config.BaseAddress, \ (XYCC_CONTROL_OFFSET), (XYCC_CTL_AUTORESET_MASK))
On the next rising-edge of VBlank_in following a call to XYCrCb2Rgb_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.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
typedef void(*) XYCrCb2Rgb_CallBack(void *CallBackRef) |
Callback type for all interrupts except error interrupt.
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. |
typedef void(*) XYCrCb2Rgb_ErrorCallBack(void *CallBackRef, u32 ErrorMask) |
Callback type for error interrupt.
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 XYCC_IXR_*_MASK values defined in xycrcb2rgb_hw.h. |
anonymous enum |
enum XYcc_OutputRanges |
enum XYcc_Standards |
These constants specify different types of standards used to represent standard color encoding.
int XYCrCb2Rgb_CfgInitialize | ( | XYCrCb2Rgb * | InstancePtr, | |
XYCrCb2Rgb_Config * | CfgPtr, | |||
u32 | EffectiveAddr | |||
) |
This function initializes the YCrCb2Rgb core. This function must be called prior to using the YCrCb2Rgb core. Initialization of the YCrCb2Rgb includes setting up the instance data and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
CfgPtr | is a reference to a structure containing information about a specific XYCrCb2Rgb 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. |
u32 XYCrCb2Rgb_Coefficient_Translation | ( | XYCrCb2Rgb * | InstancePtr, | |
struct XYCrCb2Rgb_Coef_Inputs * | CoefIn, | |||
struct XYCrCb2Rgb_Coef_Outputs * | CoefOut, | |||
u32 | DataWidth, | |||
u32 | MWidth | |||
) |
This function translates the XYCrCb2Rgb_Coef_Inputs structure into the XYCrCb2Rgb_Coef_Outputs structure that can be used to program the core's registers. The XYCrCb2Rgb_Coef_Inputs structure uses the same values as the core's GUIs. The XYCrCb2Rgb_Coef_Outputs structure uses the values that can be programmed into the core's registers.
InstancePtr | is a pointer to the XYCrCb2Rgbb instance. | |
CoefIn | specifies a pointer to a XYCrCb2Rgb_Coef_Inputs structure to be translated. | |
CoefOut | specifies a pointer to a XYCrCb2Rgb_Coef_Outputs structure with translated values. | |
DataWidth | specifies a valid range of [8,10,12,16] that needs to be set. | |
MWidth | specifies a valid range from min(32, DataWidth + 17) |
void XYCrCb2Rgb_DisableDbgBypass | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function disables Bypass mode of the core.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_DisableDbgTestPattern | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function disables debug test pattern mode.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_EnableDbgByPass | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function sets the bypass bit of control register to switch the core to bypass mode if debug is enabled in the IP.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_EnableDbgTestPattern | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function switches the core to test-pattern generator mode if debug feature is enabled.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_GetActiveSize | ( | XYCrCb2Rgb * | InstancePtr, | |
u16 * | HSize, | |||
u16 * | VSize | |||
) |
This function gets the active H/V sizes of the YCrCb2Rgb core from active size register.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
HSize | is a pointer to 16-bit variable in which the number of Active Pixels per scanline is returned within the range [32, 8192]. | |
VSize | is a pointer to 16-bit variable in which the number of Active Lines per frame is returned within the range [32, 8192]. |
u32 XYCrCb2Rgb_GetBOffset | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function gets offset compensation value from the Blue channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_GetCoefs | ( | XYCrCb2Rgb * | InstancePtr, | |
struct XYCrCb2Rgb_Coefficients * | Coef | |||
) |
This function returns A, B, C and D coefficients.
InstancePtr | is a pointer to the XYCrCb2Rgbb instance. | |
Coef | specifies a pointer to XYCrCb2Rgb_Coefficients structure in which ACoef, BCoef, CCoef, DCoef members value will be updated within the range [0.0, 1.0]. |
u32 XYCrCb2Rgb_GetDbgFrameCount | ( | XYCrCb2Rgb * | 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.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetDbgLineCount | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function returns Line count, the number of lines processed since power-up. This is available only if the debugging feature is enabled.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetDbgPixelCount | ( | XYCrCb2Rgb * | 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.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetGOffset | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function gets offset compensation value from the Green channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetRGBMax | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function gets the maximum value on RGB channels of the output.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetRGBMin | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function gets the minimum value on RGB channels of the output.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetROffset | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function gets offset compensation value from the Red channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
u32 XYCrCb2Rgb_GetVersion | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function facilitates software identification of exact version of the YCrCb2rGB hardware (h/w).
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
void XYCrCb2Rgb_IntrHandler | ( | void * | InstancePtr | ) |
This function is the interrupt handler for the YCRCB2RGB core.
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 XYCrCb2Rgb_SetCallBack() during initialization phase.
InstancePtr | is a pointer to the XYCrCb2Rgb instance that just interrupted. |
int XYCrCb2Rgb_IsDbgByPassEnabled | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function returns the current bypass mode of the core.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
int XYCrCb2Rgb_IsDbgTestPatternEnabled | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function returns the test-pattern generator mode (enabled or not), if debug feature is enabled.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
XYCrCb2Rgb_Config* XYCrCb2Rgb_LookupConfig | ( | u16 | DeviceId | ) |
This function returns a reference to an XYCrCb2Rgb_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 xycrcb2rgb_g.c file.
DeviceId | is the unique core ID of the core for the lookup operation. |
void XYCrCb2Rgb_Select_OutputRange | ( | XYCrCb2Rgb * | InstancePtr, | |
enum XYcc_OutputRanges | Range | |||
) |
This function governs the range of outputs R, G and B by affecting the conversion coefficients as well as the clipping and clamping values.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
Range | needs to be set from the enum XYcc_OutputRanges values as: 0 = XYCC_TV_16_TO_240, 1 = XYCC_STUDIO_16_TO_235, 2 = XYCC_GRAPHICS_0_TO_255. |
void XYCrCb2Rgb_Select_Standard | ( | XYCrCb2Rgb * | InstancePtr, | |
enum XYcc_Standards | StandardSel, | |||
enum XYcc_OutputRanges | InputRange, | |||
u32 | DataWidth, | |||
struct XYCrCb2Rgb_Coef_Inputs * | CoefIn | |||
) |
This function populates an XYCrCb2Rgb_Coef_Inputs structure with the values from the selected video standard.
InstancePtr | is a pointer to the XYCrCb2Rgbb instance. | |
StandardSel | needs to be set from enum XYcc_Standards value as : 0 = XYCC_STANDARD_ITU_601_SD 1 = XYCC_STANDARD_ITU_709_NTSC 2 = XYCC_STANDARD_ITU_709_PAL 3 = XYCC_STANDARD_YUV. | |
InputRange | needs to be set from enum XYcc_OutputRanges value as: 0 = XYCC_TV_16_TO_240, 1 = XYCC_STUDIO_16_TO_235, 2 = XYCC_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 XYCrCb2Rgb_Coef_Inputs structure which is populated with the values from selected video standard. |
int XYCrCb2Rgb_SelfTest | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function reads Version register of YCRCB2RGB core and compares with zero as part of self test.
InstancePtr | is a pointer to the XCrCb2Rgb instance. |
void XYCrCb2Rgb_SetActiveSize | ( | XYCrCb2Rgb * | InstancePtr, | |
u16 | HSize, | |||
u16 | VSize | |||
) |
This function sets active H/V sizes in the active frame size register.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
HSize | specifies the number of Active Pixels per scanline that needs to be set within the range [32, 8192]. | |
VSize | specifies the number of Active Lines per frame that needs to be set within the range [32, 8192]. |
void XYCrCb2Rgb_SetBOffset | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | BOffset | |||
) |
This function sets offset compensation value on the Blue channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
BOffset | is a compensation value within the range [0, 255] to be set on the Blue channel. |
int XYCrCb2Rgb_SetCallBack | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | HandlerType, | |||
void * | CallBackFunc, | |||
void * | CallBackRef | |||
) |
This routine installs an asynchronous callback function for the given HandlerTypes.
HandlerType Callback Function Type ----------------------- --------------------------- XYCC_HANDLER_PROCSTART ProcStartCallBack. XYCC_HANDLER_FRAMEDONE FrameDoneCallBack. XYCC_HANDLER_ERROR ErrCallBack.
InstancePtr | is a pointer to the XYCrCb2Rgb 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. |
void XYCrCb2Rgb_SetCoefs | ( | XYCrCb2Rgb * | InstancePtr, | |
struct XYCrCb2Rgb_Coefficients * | Coef | |||
) |
This function sets A, B, C and D coefficients.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
Coef | specifies a pointer to XYCrCb2Rgb_Coefficients structure in which ACoef, BCoef, CCoef, DCoef members value within the range [0.0, 1.0] that needs to be set. |
void XYCrCb2Rgb_SetGOffset | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | GOffset | |||
) |
This function sets offset compensation value on the Green channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
GOffset | is a compensation value within the range [0, 255] to be set on the Green channel. |
void XYCrCb2Rgb_SetRGBMax | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | RGBMax | |||
) |
This function sets the RGB maximum value on YCrCb2Rgb channels of the output.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
RGBMax | is the maximum value within the range [0, 255] on the RGB channels of the output. |
void XYCrCb2Rgb_SetRGBMin | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | RGBMin | |||
) |
This function sets minimum value on RGB channels of the output.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
RGBMin | is the minimum value within the range [0, 255] on RGB channels of the output. |
void XYCrCb2Rgb_SetROffset | ( | XYCrCb2Rgb * | InstancePtr, | |
u32 | ROffset | |||
) |
This function sets offset compensation value on the Red channel.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. | |
ROffset | is compensation value within the range [0, 255] to be set on the Red channel. |
void XYCrCb2Rgb_Setup | ( | XYCrCb2Rgb * | InstancePtr | ) |
This function sets up double buffered active size register and enables the register update.
InstancePtr | is a pointer to the XYCrCb2Rgb instance. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.