#include "xccm_hw.h"
#include "xil_assert.h"
#include "xstatus.h"
Classes | |
struct | XCcm_Config |
struct | XCcm |
struct | XCcm_Coefs |
Active Size Ranges | |
#define | XCCM_ACT_SIZE_FIRST 32 |
#define | XCCM_ACT_SIZE_LAST 7680 |
Coefficient ranges | |
#define | XCCM_COEF_FIRST -8.0 |
#define | XCCM_COEF_LAST 8.0 |
Offset ranges | |
#define | XCCM_OFFSET_FIRST 0xFFFFFF00 |
#define | XCCM_OFFSET_LAST 255 |
Clamp ranges | |
#define | XCCM_CLAMP_FIRST 0 |
#define | XCCM_CLAMP_LAST 255 |
Clip ranges | |
#define | XCCM_CLIP_FIRST 0 |
#define | XCCM_CLIP_LAST 255 |
Handler Types | |
enum | { XCCM_HANDLER_PROCSTART = 1, XCCM_HANDLER_FRAMEDONE, XCCM_HANDLER_ERROR } |
Defines | |
#define | XCCM_H_ |
#define | XCcm_Enable(InstancePtr) |
#define | XCcm_Disable(InstancePtr) |
#define | XCcm_Start XCcm_Enable |
#define | XCcm_Stop XCcm_Disable |
#define | XCcm_RegUpdateEnable(InstancePtr) |
#define | XCcm_RegUpdateDisable(InstancePtr) |
#define | XCcm_SyncReset(InstancePtr) |
#define | XCcm_Reset(InstancePtr) |
#define | XCcm_IntrEnable(InstancePtr, IntrType) |
#define | XCcm_IntrDisable(InstancePtr, IntrType) |
#define | XCcm_StatusGetPending(InstancePtr) |
#define | XCcm_IntrGetPending(InstancePtr) |
#define | XCcm_IntrClear(InstancePtr, IntrType) |
Typedefs | |
typedef void(*) | XCcm_CallBack (void *CallBackRef) |
typedef void(*) | XCcm_ErrorCallBack (void *CallBackRef, u32 ErrorMask) |
Functions | |
XCcm_Config * | XCcm_LookupConfig (u16 DeviceId) |
int | XCcm_CfgInitialize (XCcm *InstancePtr, XCcm_Config *CfgPtr, u32 EffectiveAddr) |
u32 | XCcm_GetVersion (XCcm *InstancePtr) |
void | XCcm_Setup (XCcm *InstancePtr) |
void | XCcm_EnableDbgByPass (XCcm *InstancePtr) |
int | XCcm_IsDbgByPassEnabled (XCcm *InstancePtr) |
void | XCcm_DisableDbgByPass (XCcm *InstancePtr) |
void | XCcm_EnableDbgTestPattern (XCcm *InstancePtr) |
int | XCcm_IsDbgTestPatternEnabled (XCcm *InstancePtr) |
void | XCcm_DisableDbgTestPattern (XCcm *InstancePtr) |
u32 | XCcm_GetDbgFrameCount (XCcm *InstancePtr) |
u32 | XCcm_GetDbgLineCount (XCcm *InstancePtr) |
u32 | XCcm_GetDbgPixelCount (XCcm *InstancePtr) |
void | XCcm_SetActiveSize (XCcm *InstancePtr, u16 HSize, u16 VSize) |
void | XCcm_GetActiveSize (XCcm *InstancePtr, u16 *HSize, u16 *VSize) |
void | XCcm_SetCoefMatrix (XCcm *InstancePtr, XCcm_Coefs *CoefValues) |
void | XCcm_GetCoefMatrix (XCcm *InstancePtr, XCcm_Coefs *CoefValues) |
void | XCcm_SetRgbOffset (XCcm *InstancePtr, s32 ROffset, s32 GOffset, s32 BOffset) |
void | XCcm_GetRgbOffset (XCcm *InstancePtr, s32 *ROffset, s32 *GOffset, s32 *BOffset) |
void | XCcm_SetClip (XCcm *InstancePtr, u32 Clip) |
u32 | XCcm_GetClip (XCcm *InstancePtr) |
void | XCcm_SetClamp (XCcm *InstancePtr, u32 Clamp) |
u32 | XCcm_GetClamp (XCcm *InstancePtr) |
int | XCcm_SelfTest (XCcm *InstancePtr) |
void | XCcm_IntrHandler (void *InstancePtr) |
int | XCcm_SetCallBack (XCcm *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef) |
#define XCCM_ACT_SIZE_FIRST 32 |
Active Size starting value
#define XCCM_ACT_SIZE_LAST 7680 |
Active Size ending value
#define XCCM_CLAMP_FIRST 0 |
Clamp starting value
#define XCCM_CLAMP_LAST 255 |
Clamp ending value
#define XCCM_CLIP_FIRST 0 |
Clip starting value
#define XCCM_CLIP_LAST 255 |
Clip ending value
#define XCCM_COEF_FIRST -8.0 |
Coefficient starting value
#define XCCM_COEF_LAST 8.0 |
Coefficient ending value
#define XCcm_Disable | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET))) & (~(XCCM_CTL_SW_EN_MASK))))
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCcm_Enable | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET))) | (XCCM_CTL_SW_EN_MASK)))
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCCM_H_ |
Prevent circular inclusions by using protection macros
#define XCcm_IntrClear | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_STATUS_OFFSET), ((IntrType) & (XCCM_IXR_ALLINTR_MASK)))
InstancePtr | is a pointer to the XCcm instance to be worked on. | |
IntrType | is the pending interrupts to clear/acknowledge. Use OR'ing of XCCM_IXR_*_MASK constants defined in xccm_hw.h to create this parameter value. |
#define XCcm_IntrDisable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_IRQ_EN_OFFSET), \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_IRQ_EN_OFFSET))) & ((~(IntrType)) & \ (XCCM_IXR_ALLINTR_MASK))))
InstancePtr | is a pointer to the XCcm instance to be worked on. | |
IntrType | is the type of the interrupts to disable. Use OR'ing of XCCM_IXR_*_MASK constants defined in xccm_hw.h to create this parameter value. |
#define XCcm_IntrEnable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_IRQ_EN_OFFSET), \ (((IntrType) & (XCCM_IXR_ALLINTR_MASK)) | \ (XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_IRQ_EN_OFFSET)))))
InstancePtr | is a pointer to the XCcm instance to be worked on. | |
IntrType | is the type of the interrupts to enable. Use OR'ing of XCCM_IXR_*_MASK constants defined in xccm_hw.h to create this parameter value. |
#define XCcm_IntrGetPending | ( | InstancePtr | ) |
Value:
XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_IRQ_EN_OFFSET)) & \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_STATUS_OFFSET))) & (XCCM_IXR_ALLINTR_MASK))
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCCM_OFFSET_FIRST 0xFFFFFF00 |
Offset starting value
#define XCCM_OFFSET_LAST 255 |
Offset ending value
#define XCcm_RegUpdateDisable | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET))) & (~(XCCM_CTL_RUE_MASK))))
This macro only works when the CCM core is enabled.
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCcm_RegUpdateEnable | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ ((XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET))) | (XCCM_CTL_RUE_MASK)))
This macro only works when the CCM core is enabled.
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCcm_Reset | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ (XCCM_CTL_RESET_MASK))
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCcm_Start XCcm_Enable |
This macro enables/starts the CCM core.
InstancePtr | is a pointer to the XCcm instance to be worked on |
#define XCcm_StatusGetPending | ( | InstancePtr | ) |
Value:
XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCCM_STATUS_OFFSET)) & (XCCM_IXR_ALLINTR_MASK)
InstancePtr | is a pointer to the XCcm instance to be worked on. |
#define XCcm_Stop XCcm_Disable |
This macro disables/stops the CCM core.
InstancePtr | is a pointer to the XCcm instance to be worked on |
#define XCcm_SyncReset | ( | InstancePtr | ) |
Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCCM_CONTROL_OFFSET), \ (XCCM_CTL_AUTORESET_MASK))
On the next rising-edge of SOF following a call to XCcm_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 XCcm instance to be worked on. |
typedef void(*) XCcm_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(*) XCcm_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 XCCM_IXR_*_MASK values defined in xccm_hw.h. |
anonymous enum |
int XCcm_CfgInitialize | ( | XCcm * | InstancePtr, | |
XCcm_Config * | CfgPtr, | |||
u32 | EffectiveAddr | |||
) |
This function initializes an CCM core. This function must be called prior to using an CCM core. Initialization of an CCM includes setting up the instance data and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to the XCcm instance. | |
CfgPtr | is a reference to a structure containing information about a specific XCcm instance. | |
EffectiveAddr | is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device 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. |
void XCcm_DisableDbgByPass | ( | XCcm * | InstancePtr | ) |
This function disables the Bypass mode of the CCM core.
InstancePtr | is a pointer to the XCcm instance to be worked on. |
void XCcm_DisableDbgTestPattern | ( | XCcm * | InstancePtr | ) |
This function disables debug test pattern mode in Control register of the CCM core, if Debug feature is enabled.
InstancePtr | is a pointer to the XCcm core instance to be worked on. |
void XCcm_EnableDbgByPass | ( | XCcm * | InstancePtr | ) |
This function enables the bypass mode by setting bypass bit of the Control register to switch the core to bypass mode if debug feature is enabled in the core.
InstancePtr | is a pointer to the XCcm instance to be worked on. |
void XCcm_EnableDbgTestPattern | ( | XCcm * | InstancePtr | ) |
This function enables the test-pattern mode if debug feature is enabled by setting test-pattern bit of the Control register of the CCM core.
InstancePtr | is a pointer to the XCcm instance. |
void XCcm_GetActiveSize | ( | XCcm * | InstancePtr, | |
u16 * | HSize, | |||
u16 * | VSize | |||
) |
This function gets the number of Active Pixels per Scan line and number of Active Lines per Frame from the Active Frame Size register.
InstancePtr | is a pointer to the XCcm instance. | |
HSize | is a pointer to 16-bit variable in which the number of Active Pixels per Scan Line is returned (Range is 32 to 7680). | |
VSize | is a pointer to 16-bit variable in which the number of Active Lines per Frame is returned (Range is 32 to 7680). |
u32 XCcm_GetClamp | ( | XCcm * | InstancePtr | ) |
This function returns the clamp value from the Clamp register.
InstancePtr | is a pointer to the CCM instance. |
u32 XCcm_GetClip | ( | XCcm * | InstancePtr | ) |
This function gets the clip value from Clip register of the CCM core.
InstancePtr | is a pointer to the CCM instance. |
void XCcm_GetCoefMatrix | ( | XCcm * | InstancePtr, | |
XCcm_Coefs * | CoefValues | |||
) |
This function gets the coefficient values of color correction matrix from K11 to K33 registers of the CCM core.
InstancePtr | is a pointer to the CCM instance | |
CoefValues | is a pointer to XCcm_Coefs structure which has matrix coefficients is updated with coefficient values. (Range is floating point numbers [-8, 8)). |
u32 XCcm_GetDbgFrameCount | ( | XCcm * | InstancePtr | ) |
This function gets number of frames processed since power-up or last time the core is reset.
InstancePtr | is a pointer to the XCcm instance. |
u32 XCcm_GetDbgLineCount | ( | XCcm * | InstancePtr | ) |
This function gets the number of lines processed since power-up or last time the core is reset.
InstancePtr | is a pointer to the XCcm instance. |
u32 XCcm_GetDbgPixelCount | ( | XCcm * | InstancePtr | ) |
This function gets the number of pixels processed since power-up or last time the core is reset.
InstancePtr | is a pointer to the XCcm instance. |
void XCcm_GetRgbOffset | ( | XCcm * | InstancePtr, | |
s32 * | ROffset, | |||
s32 * | GOffset, | |||
s32 * | BOffset | |||
) |
This function gets the offset compensation values of red, blue, green colors from Roffset, Goffset and Boffset registers.
InstancePtr | is a pointer to the CCM instance. | |
ROffset | is a pointer of signed 32 bit variable in which offset of red color value is returned. (Range of offset is [-256 255]). | |
GOffset | is a pointer of signed 32 bit variable in which offset of green color value is returned. (Range of offset is [-256 255]). | |
BOffset | is a pointer of signed 32 bit variable in which offset of blue color value is returned. (Range of offset is [-256 255]). |
u32 XCcm_GetVersion | ( | XCcm * | InstancePtr | ) |
This function gets the Version of the CCM core.
InstancePtr | is a pointer to the XCcm instance to be worked on. |
void XCcm_IntrHandler | ( | void * | InstancePtr | ) |
This function is the interrupt handler for the CCM core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in IRQ_ENABLE register, 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 XCcm_SetCallBack() during initialization phase. .
InstancePtr | is a pointer to the XCcm instance that just interrupted. |
int XCcm_IsDbgByPassEnabled | ( | XCcm * | InstancePtr | ) |
This function returns the current bypass mode settings from Control register of the CCM core.
InstancePtr | is a pointer to the XCcm instance. |
int XCcm_IsDbgTestPatternEnabled | ( | XCcm * | InstancePtr | ) |
This function returns the test-pattern mode (enabled or not) from Control register of the CCM core, if debug feature was enabled.
InstancePtr | is a pointer to the XCcm instance. |
XCcm_Config* XCcm_LookupConfig | ( | u16 | DeviceId | ) |
XCcm_LookupConfig returns a reference to an XCcm_Config structure based on the unique device id, DeviceId. The return value will refer to an entry in the device configuration table defined in the xccm_g.c file.
DeviceId | is the unique device ID of the device for the lookup operation. |
int XCcm_SelfTest | ( | XCcm * | InstancePtr | ) |
This function reads Version register of CCM core and compares with zero as part of self test.
InstancePtr | is a pointer to XCcm instance. |
void XCcm_SetActiveSize | ( | XCcm * | InstancePtr, | |
u16 | HSize, | |||
u16 | VSize | |||
) |
This function sets the active H/V sizes in the Active Size register.
InstancePtr | is a pointer to the XCcm instance. | |
HSize | specifies the number of Active Pixels per Scan Line that needs to be set (Range is 32 to 7680). | |
VSize | specifies the number of Active Lines per Frame that needs to be set (Range is 32 to 7680). |
int XCcm_SetCallBack | ( | XCcm * | InstancePtr, | |
u32 | HandlerType, | |||
void * | CallBackFunc, | |||
void * | CallBackRef | |||
) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XCCM_HANDLER_FRAMEDONE FrameDoneCallBack XCCM_HANDLER_PROCSTART ProcStartCallBack XCCM_HANDLER_ERROR ErrCallBack
InstancePtr | is a pointer to the Xccm 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 XCcm_SetClamp | ( | XCcm * | InstancePtr, | |
u32 | Clamp | |||
) |
This function sets the clamp value in the Clamp register.
InstancePtr | is a pointer to the CCM instance | |
Clamp | is the minimum output value which needs to be set. (Range of Clamping value is 0 to 255). |
void XCcm_SetClip | ( | XCcm * | InstancePtr, | |
u32 | Clip | |||
) |
This function sets the clip value in the Clip register of the CCM core.
InstancePtr | is a pointer to the CCM instance. | |
Clip | is the maximum output value which needs to be set. (Range of Clip value is 0 to 255). |
void XCcm_SetCoefMatrix | ( | XCcm * | InstancePtr, | |
XCcm_Coefs * | CoefValues | |||
) |
This function sets the coefficients of color correction matrix in K11 to K33 registers of the CCM core.
InstancePtr | is a pointer to the CCM instance. | |
CoefValues | is a pointer to XCcm_Coefs structure which has matrix coefficients that needs to be set. (Range is floating point numbers [-8, 8)). |
void XCcm_SetRgbOffset | ( | XCcm * | InstancePtr, | |
s32 | ROffset, | |||
s32 | GOffset, | |||
s32 | BOffset | |||
) |
This function sets the offset compensation for red, blue and green colors in corresponding Roffset, Goffset and Boffset registers of the CCM core.
InstancePtr | is a pointer to the CCM instance. | |
ROffset | specifies offset value of red color component which needs to be set. (Range of offset is [-256 255]). | |
GOffset | specifies offset value of green color component which needs to be set. (Range of offset is [-256 255]). | |
BOffset | specifies offset value of blue color component which needs to be set. (Range of offset is [-256 255]). |
void XCcm_Setup | ( | XCcm * | InstancePtr | ) |
This function sets the input/output frame size in Active Size register and enables the register update.
InstancePtr | is a pointer to the Xccm instance. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.