ccm: Ccm_v6_1

| ccm Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions
Ccm_v6_1

## Data Structures
struct | XCcm_Config
| This typedef contains configuration information for a CCM core. More...
struct | XCcm
| The XCcm driver instance data structure. More...
struct | XCcm_Coefs
| This typedef contains matrix coefficients of Color Correction Matrix(CCM) core which can be accessed for setting coefficients by using XCcm_SetCoefMatrix and for getting coefficient values by using XCcm_GetCoefMatrix. More...

## Macros
#define | XCCM_H_
| Prevent circular inclusions by using protection macros. More...
#define | XCcm_Enable(InstancePtr)
| This macro enables the CCM core. More...
#define | XCcm_Disable(InstancePtr)
| This macro disables the CCM core. More...
#define | XCcm_Start XCcm_Enable
| This macro enables/starts the CCM core. More...
#define | XCcm_Stop XCcm_Disable
| This macro disables/stops the CCM core. More...
#define | XCcm_RegUpdateEnable(InstancePtr)
| This macro commits all the register value changes made so far by the software to the CCM core instance. More...
#define | XCcm_RegUpdateDisable(InstancePtr)
| This macro prevents the CCM core instance from committing recent changes made so far by the software. More...
#define | XCcm_SyncReset(InstancePtr)
| This macro resets a CCM core at the end of the frame being processed. More...
#define | XCcm_Reset(InstancePtr)
| This macro resets a CCM core. More...
#define | XCcm_IntrEnable(InstancePtr, IntrType)
| This macro enables individual interrupts of the CCM core by updating the IRQ_ENABLE register. More...
#define | XCcm_IntrDisable(InstancePtr, IntrType)
| This macro disables individual interrupts of the CCM core by updating the IRQ_ENABLE register. More...
#define | XCcm_StatusGetPending(InstancePtr)
| This macro returns the pending interrupt status of the CCM core by reading from Status register. More...
#define | XCcm_IntrGetPending(InstancePtr)
| This macro returns the pending interrupts of the CCM core for the interrupts that have been enabled. More...
#define | XCcm_IntrClear(InstancePtr, IntrType)
| This macro clears/acknowledges pending interrupts of the CCM core in the Status register. More...
#define | XCCM_HW_H_
| Prevent circular inclusions by using protection macros. More...
#define | XCcm_In32 Xil_In32
| Input operation. More...
#define | XCcm_Out32 Xil_Out32
| Output operation. More...
#define | XCcm_ReadReg(BaseAddress, RegOffset) XCcm_In32((BaseAddress) + (u32)(RegOffset))
| This macro reads the given register. More...
#define | XCcm_WriteReg(BaseAddress, RegOffset, Data) XCcm_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data))
| This macro writes the given register. More...

## Typedefs
typedef void(* | XCcm_CallBack )(void *CallBackRef)
| Callback type for all interrupts except error interrupt. More...
typedef void(* | XCcm_ErrorCallBack )(void *CallBackRef, u32 ErrorMask)
| Callback type for Error interrupt. More...

## Functions
int | XCcm_CfgInitialize (XCcm *InstancePtr, XCcm_Config *CfgPtr, u32 EffectiveAddr)
| This function initializes an CCM core. More...
void | XCcm_Setup (XCcm *InstancePtr)
| This function sets the input/output frame size in Active Size register and enables the register update. More...
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. More...
int | XCcm_IsDbgByPassEnabled (XCcm *InstancePtr)
| This function returns the current bypass mode settings from Control register of the CCM core. More...
void | XCcm_DisableDbgByPass (XCcm *InstancePtr)
| This function disables the Bypass mode of the CCM core. More...
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. More...
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. More...
void | XCcm_DisableDbgTestPattern (XCcm *InstancePtr)
| This function disables debug test pattern mode in Control register of the CCM core, if Debug feature is enabled. More...
u32 | XCcm_GetVersion (XCcm *InstancePtr)
| This function gets the Version of the CCM core. More...
u32 | XCcm_GetDbgFrameCount (XCcm *InstancePtr)
| This function gets number of frames processed since power-up or last time the core is reset. More...
u32 | XCcm_GetDbgLineCount (XCcm *InstancePtr)
| This function gets the number of lines processed since power-up or last time the core is reset. More...
u32 | XCcm_GetDbgPixelCount (XCcm *InstancePtr)
| This function gets the number of pixels processed since power-up or last time the core is reset. More...
void | XCcm_SetActiveSize (XCcm *InstancePtr, u16 HSize, u16 VSize)
| This function sets the active H/V sizes in the Active Size register. More...
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. More...
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. More...
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. More...
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. More...
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. More...
void | XCcm_SetClip (XCcm *InstancePtr, u32 Clip)
| This function sets the clip value in the Clip register of the CCM core. More...
u32 | XCcm_GetClip (XCcm *InstancePtr)
| This function gets the clip value from Clip register of the CCM core. More...
void | XCcm_SetClamp (XCcm *InstancePtr, u32 Clamp)
| This function sets the clamp value in the Clamp register. More...
u32 | XCcm_GetClamp (XCcm *InstancePtr)
| This function returns the clamp value from the Clamp register. More...
XCcm_Config * | XCcm_LookupConfig (u16 DeviceId)
| XCcm_LookupConfig returns a reference to an XCcm_Config structure based on the unique device id, DeviceId. More...
int | XCcm_SelfTest (XCcm *InstancePtr)
| This function reads Version register of CCM core and compares with zero as part of self test. More...
void | XCcm_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the CCM core. More...
int | XCcm_SetCallBack (XCcm *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef)
| This routine installs an asynchronous callback function for the given HandlerType. More...

## Handler Types
enum | { XCCM_HANDLER_PROCSTART = 1, XCCM_HANDLER_FRAMEDONE, XCCM_HANDLER_ERROR }
| These constants specify different types of handler and used to differentiate interrupt requests from core. More...

## Active Size Ranges
#define | XCCM_ACT_SIZE_FIRST 32
| Active Size starting value. More...
#define | XCCM_ACT_SIZE_LAST 7680
| Active Size ending value. More...

## Coefficient ranges
#define | XCCM_COEF_FIRST -8.0
| Coefficient starting value. More...
#define | XCCM_COEF_LAST 8.0
| Coefficient ending value. More...

## Offset ranges
#define | XCCM_OFFSET_FIRST 0xFFFFFF00
| Offset starting value. More...
#define | XCCM_OFFSET_LAST 255
| Offset ending value. More...

## Clamp ranges
#define | XCCM_CLAMP_FIRST 0
| Clamp starting value. More...
#define | XCCM_CLAMP_LAST 255
| Clamp ending value. More...

## Clip ranges
#define | XCCM_CLIP_FIRST 0
| Clip starting value. More...
#define | XCCM_CLIP_LAST 255
| Clip ending value. More...

## Registers offsets
#define | XCCM_CONTROL_OFFSET 0x000
| Control offset. More...
#define | XCCM_STATUS_OFFSET 0x004
| Status offset. More...
#define | XCCM_ERROR_OFFSET 0x008
| Error offset. More...
#define | XCCM_IRQ_EN_OFFSET 0x00C
| IRQ Enable offset. More...
#define | XCCM_VERSION_OFFSET 0x010
| Version offset. More...
#define | XCCM_SYSDEBUG0_OFFSET 0x014
| System Debug 0 offset. More...
#define | XCCM_SYSDEBUG1_OFFSET 0x018
| System Debug 1 offset. More...
#define | XCCM_SYSDEBUG2_OFFSET 0x01C
| System Debug 2 offset. More...
#define | XCCM_ACTIVE_SIZE_OFFSET 0x020
| Active Size (V x H) offset. More...
#define | XCCM_K11_OFFSET 0x100
| K11 Coefficient offset. More...
#define | XCCM_K12_OFFSET 0x104
| K12 Coefficient offset. More...
#define | XCCM_K13_OFFSET 0x108
| K13 Coefficient offset. More...
#define | XCCM_K21_OFFSET 0x10C
| K21 Coefficient offset. More...
#define | XCCM_K22_OFFSET 0x110
| K22 Coefficient offset. More...
#define | XCCM_K23_OFFSET 0x114
| K23 Coefficient offset. More...
#define | XCCM_K31_OFFSET 0x118
| K31 Coefficient offset. More...
#define | XCCM_K32_OFFSET 0x11C
| K32 Coefficient offset. More...
#define | XCCM_K33_OFFSET 0x120
| K33 Coefficient offset. More...
#define | XCCM_ROFFSET_OFFSET 0x124
| Red Offset offset. More...
#define | XCCM_GOFFSET_OFFSET 0x128
| Green Offset offset. More...
#define | XCCM_BOFFSET_OFFSET 0x12C
| Blue Offset offset. More...
#define | XCCM_CLIP_OFFSET 0x130
| Clip Offset offset. More...
#define | XCCM_CLAMP_OFFSET 0x134
| Clamp Offset offset. More...

## Control register bit masks
#define | XCCM_CTL_SW_EN_MASK 0x00000001
| Enable mask. More...
#define | XCCM_CTL_RUE_MASK 0x00000002
| Register Update Enable mask. More...
#define | XCCM_CTL_BPE_MASK 0x00000010
| Bypass Enable mask. More...
#define | XCCM_CTL_TPE_MASK 0x00000020
| Test Pattern Enable mask. More...
#define | XCCM_CTL_AUTORESET_MASK 0x40000000
| Software Auto Reset mask. More...
#define | XCCM_CTL_RESET_MASK 0x80000000
| Software Reset mask. More...

## Interrupt register bit masks. It is applicable for
Status and IRQ_ENABLE Registers
#define | XCCM_IXR_PROCS_STARTED_MASK 0x00000001
| Process Started mask. More...
#define | XCCM_IXR_EOF_MASK 0x00000002
| End-Of-Frame mask. More...
#define | XCCM_IXR_SE_MASK 0x00010000
| Slave Error mask. More...
#define | XCCM_IXR_ALLINTR_MASK 0x00010003
| Interrupt all error mask (ORing of all interrupt mask) More...

## Error register bit masks
#define | XCCM_ERR_EOL_EARLY_MASK 0x00000001
| End of Line Early mask. More...
#define | XCCM_ERR_EOL_LATE_MASK 0x00000002
| End of Line Late mask. More...
#define | XCCM_ERR_SOF_EARLY_MASK 0x00000004
| Start of Frame Early mask. More...
#define | XCCM_ERR_SOF_LATE_MASK 0x00000008
| Start of Frame Late mask. More...

## Version register bit masks and shifts
#define | XCCM_VER_REV_NUM_MASK 0x000000FF
| Version Revision Number mask. More...
#define | XCCM_VER_PID_MASK 0x00000F00
| Version Patch ID mask. More...
#define | XCCM_VER_REV_MASK 0x0000F000
| Version Revision mask. More...
#define | XCCM_VER_MINOR_MASK 0x00FF0000
| Version Minor mask. More...
#define | XCCM_VER_MAJOR_MASK 0xFF000000
| Version Major mask. More...
#define | XCCM_VER_INTERNAL_SHIFT 0x00000008
| Version Internal shift. More...
#define | XCCM_VER_REV_SHIFT 0x0000000C
| Version Revision shift. More...
#define | XCCM_VER_MINOR_SHIFT 0x00000010
| Version Minor shift. More...
#define | XCCM_VER_MAJOR_SHIFT 0x00000018
| Version Major shift. More...

## Active Size register masks and shift
#define | XCCM_ACTSIZE_NUM_PIXEL_MASK 0x00001FFF
| Number of Active pixels per scan line (horizontal) mask. More...
#define | XCCM_ACTSIZE_NUM_LINE_MASK 0x1FFF0000
| Number of Active lines per frame (vertical) mask. More...
#define | XCCM_ACTSIZE_NUM_LINE_SHIFT 16
| Shift for number of lines. More...

## Matrix coefficient masks and shifts
#define | XCCM_COEF_MASK 0x0003FFFF
| Matrix Coefficient mask. More...
#define | XCCM_COEF_DECI_MASK 0x0001C000
| Mask of Decimal part. More...
#define | XCCM_COEFF_FRAC_MASK 0x00003FFF
| Mask of Fractional part. More...
#define | XCCM_COEF_SHIFT 14
| Coefficient shift. More...
#define | XCCM_COEF_SIGN_MASK 0x20000
| Mask for sign bit. More...

## Offsets masks and shifts
#define | XCCM_OFFSET_MASK 0x0001FFFF
| Offset mask for Red, Green Blue Offset registers. More...
#define | XCCM_OFFSET_SIGN_SHIFT 15
| Shift for signed bit. More...

## Clip and Clamp masks
#define | XCCM_CLIP_MASK 0x0000FFFF
| Clip register mask. More...
#define | XCCM_CLAMP_MASK 0x0000FFFF
| Clamp register mask. More...

## General purpose macros
#define | XCCM_SIGN_MUL -1
| Macro for sign multiplication. More...
#define | XCCM_MAX_VALUE 0xFFFFFFFF
| 32 bit maximum value More...
#define | XCCM_SIGNBIT_MASK

## Macros for backward compatibility
#define | CCM_CONTROL XCCM_CONTROL_OFFSET
#define | CCM_STATUS XCCM_STATUS_OFFSET
#define | CCM_ERROR XCCM_ERROR_OFFSET
#define | CCM_IRQ_EN XCCM_IRQ_EN_OFFSET
#define | CCM_VERSION XCCM_VERSION_OFFSET
#define | CCM_SYSDEBUG0 XCCM_SYSDEBUG0_OFFSET
#define | CCM_SYSDEBUG1 XCCM_SYSDEBUG1_OFFSET
#define | CCM_SYSDEBUG2 XCCM_SYSDEBUG2_OFFSET
#define | CCM_ACTIVE_SIZE XCCM_ACTIVE_SIZE_OFFSET
#define | CCM_K11 XCCM_K11_OFFSET
#define | CCM_K12 XCCM_K12_OFFSET
#define | CCM_K13 XCCM_K13_OFFSET
#define | CCM_K21 XCCM_K21_OFFSET
#define | CCM_K22 XCCM_K22_OFFSET
#define | CCM_K23 XCCM_K23_OFFSET
#define | CCM_K31 XCCM_K31_OFFSET
#define | CCM_K32 XCCM_K32_OFFSET
#define | CCM_K33 XCCM_K33_OFFSET
#define | CCM_ROFFSET XCCM_ROFFSET_OFFSET
#define | CCM_GOFFSET XCCM_GOFFSET_OFFSET
#define | CCM_BOFFSET XCCM_BOFFSET_OFFSET
#define | CCM_CLIP XCCM_CLIP_OFFSET
#define | CCM_CLAMP XCCM_CLAMP_OFFSET
#define | CCM_CTL_EN_MASK XCCM_CTL_SW_EN_MASK
#define | CCM_CTL_RUE_MASK XCCM_CTL_RUE_MASK
#define | CCM_RST_RESET XCCM_CTL_RESET_MASK
#define | CCM_RST_AUTORESET XCCM_CTL_AUTORESET_MASK
#define | CCM_In32 XCcm_In32
#define | CCM_Out32 XCcm_Out32
#define | XCCM_ReadReg XCcm_ReadReg
#define | XCCM_WriteReg XCcm_WriteReg

## Interrupt Enable and Status Registers Offsets
#define | XCCM_ISR_OFFSET XCCM_STATUS_OFFSET
| Interrupt status register generates a interrupt if the corresponding bits of interrupt enable register bits are set. More...
#define | XCCM_IER_OFFSET XCCM_IRQ_EN_OFFSET
| Interrupt enable Offset. More...

## Macro Definition Documentation

#define XCCM_ACT_SIZE_FIRST 32

Active Size starting value.

Referenced by XCcm_SetActiveSize().

#define XCCM_ACT_SIZE_LAST 7680

Active Size ending value.

Referenced by XCcm_SetActiveSize().

#define XCCM_ACTIVE_SIZE_OFFSET 0x020

Active Size (V x H) offset.

Referenced by XCcm_GetActiveSize(), XCcm_SetActiveSize(), and XCcm_Setup().

#define XCCM_ACTSIZE_NUM_LINE_MASK 0x1FFF0000

Number of Active lines per frame (vertical) mask.

Referenced by XCcm_GetActiveSize(), and XCcm_Setup().

#define XCCM_ACTSIZE_NUM_LINE_SHIFT 16

Shift for number of lines.

Referenced by XCcm_GetActiveSize(), XCcm_SetActiveSize(), and XCcm_Setup().

#define XCCM_ACTSIZE_NUM_PIXEL_MASK 0x00001FFF

Number of Active pixels per scan line (horizontal) mask.

Referenced by XCcm_GetActiveSize(), and XCcm_Setup().

#define XCCM_BOFFSET_OFFSET 0x12C

Blue Offset offset.

Referenced by XCcm_GetRgbOffset(), and XCcm_SetRgbOffset().

#define XCCM_CLAMP_FIRST 0

Clamp starting value.

#define XCCM_CLAMP_LAST 255

Clamp ending value.

Referenced by XCcm_SetClamp().

#define XCCM_CLAMP_MASK 0x0000FFFF

Clamp register mask.

Referenced by XCcm_GetClamp(), and XCcm_SetClamp().

#define XCCM_CLAMP_OFFSET 0x134

Clamp Offset offset.

Referenced by XCcm_GetClamp(), and XCcm_SetClamp().

#define XCCM_CLIP_FIRST 0

Clip starting value.

#define XCCM_CLIP_LAST 255

Clip ending value.

Referenced by XCcm_SetClip().

#define XCCM_CLIP_MASK 0x0000FFFF

Clip register mask.

Referenced by XCcm_GetClip(), and XCcm_SetClip().

#define XCCM_CLIP_OFFSET 0x130

Clip Offset offset.

Referenced by XCcm_GetClip(), and XCcm_SetClip().

#define XCCM_COEF_DECI_MASK 0x0001C000

Mask of Decimal part.

#define XCCM_COEF_FIRST -8.0

Coefficient starting value.

Referenced by XCcm_SetCoefMatrix().

#define XCCM_COEF_LAST 8.0

Coefficient ending value.

Referenced by XCcm_SetCoefMatrix().

#define XCCM_COEF_MASK 0x0003FFFF

Matrix Coefficient mask.

#define XCCM_COEF_SHIFT 14

Coefficient shift.

#define XCCM_COEF_SIGN_MASK 0x20000

Mask for sign bit.

#define XCCM_COEFF_FRAC_MASK 0x00003FFF

Mask of Fractional part.

#define XCCM_CONTROL_OFFSET 0x000

Control offset.

Referenced by XCcm_DisableDbgByPass(), XCcm_DisableDbgTestPattern(), XCcm_EnableDbgByPass(), XCcm_EnableDbgTestPattern(), XCcm_IsDbgByPassEnabled(), and XCcm_IsDbgTestPatternEnabled().

#define XCCM_CTL_AUTORESET_MASK 0x40000000

Software Auto Reset mask.

#define XCCM_CTL_BPE_MASK 0x00000010

Bypass Enable mask.

Referenced by XCcm_DisableDbgByPass(), XCcm_EnableDbgByPass(), and XCcm_IsDbgByPassEnabled().

#define XCCM_CTL_RESET_MASK 0x80000000

Software Reset mask.

#define XCCM_CTL_RUE_MASK 0x00000002

Register Update Enable mask.

#define XCCM_CTL_SW_EN_MASK 0x00000001

Enable mask.

#define XCCM_CTL_TPE_MASK 0x00000020

Test Pattern Enable mask.

Referenced by XCcm_DisableDbgTestPattern(), XCcm_EnableDbgTestPattern(), and XCcm_IsDbgTestPatternEnabled().

#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))))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_CTL_SW_EN_MASK
#define XCCM_CTL_SW_EN_MASK
Enable mask.
Definition: xccm_hw.h:97
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro disables the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_Disable(XCcm *InstancePtr)

#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)))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_CTL_SW_EN_MASK
#define XCCM_CTL_SW_EN_MASK
Enable mask.
Definition: xccm_hw.h:97
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro enables the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_Enable(XCcm *InstancePtr)

#define XCCM_ERR_EOL_EARLY_MASK 0x00000001

End of Line Early mask.

#define XCCM_ERR_EOL_LATE_MASK 0x00000002

End of Line Late mask.

#define XCCM_ERR_SOF_EARLY_MASK 0x00000004

Start of Frame Early mask.

#define XCCM_ERR_SOF_LATE_MASK 0x00000008

Start of Frame Late mask.

#define XCCM_ERROR_OFFSET 0x008

Error offset.

#define XCCM_GOFFSET_OFFSET 0x128

Green Offset offset.

Referenced by XCcm_GetRgbOffset(), and XCcm_SetRgbOffset().

#define XCCM_H_

Prevent circular inclusions by using protection macros.

#define XCCM_HW_H_

Prevent circular inclusions by using protection macros.

#define XCCM_IER_OFFSET XCCM_IRQ_EN_OFFSET

Interrupt enable Offset.

#define XCcm_In32 Xil_In32

Input operation.

#define XCcm_IntrClear | ( |  | InstancePtr,
|  |  | IntrType
| ) |  |

Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \
(XCCM_STATUS_OFFSET), ((IntrType) & (XCCM_IXR_ALLINTR_MASK)))
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293
XCCM_STATUS_OFFSET
#define XCCM_STATUS_OFFSET
Status offset.
Definition: xccm_hw.h:69
XCCM_IXR_ALLINTR_MASK
#define XCCM_IXR_ALLINTR_MASK
Interrupt all error mask (ORing of all interrupt mask)
Definition: xccm_hw.h:118

This macro clears/acknowledges pending interrupts of the CCM core in the Status register.

Bit positions to 1 will be cleared.

Parameters

  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.

Returns
  None.

Note
  C-style signature: void XCcm_IntrClear(XCcm *InstancePtr, u32 IntrType)

Referenced by XCcm_IntrHandler().

#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))))
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_IRQ_EN_OFFSET
#define XCCM_IRQ_EN_OFFSET
IRQ Enable offset.
Definition: xccm_hw.h:71
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293
XCCM_IXR_ALLINTR_MASK
#define XCCM_IXR_ALLINTR_MASK
Interrupt all error mask (ORing of all interrupt mask)
Definition: xccm_hw.h:118

This macro disables individual interrupts of the CCM core by updating the IRQ_ENABLE register.

Parameters

  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.

Returns
  None.

Note
  Any other interrupt not covered by parameter IntrType, if enabled before this macro is called, will remain enabled. C-style signature: void XCcm_IntrDisable(XCcm *InstancePtr, u32 IntrType)

#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)))))
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_IRQ_EN_OFFSET
#define XCCM_IRQ_EN_OFFSET
IRQ Enable offset.
Definition: xccm_hw.h:71
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293
XCCM_IXR_ALLINTR_MASK
#define XCCM_IXR_ALLINTR_MASK
Interrupt all error mask (ORing of all interrupt mask)
Definition: xccm_hw.h:118

This macro enables individual interrupts of the CCM core by updating the IRQ_ENABLE register.

Parameters

  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.

Returns
  None.

Note
  The existing enabled interrupt(s) will remain enabled. C-style signature: void XCcm_IntrEnable(XCcm *InstancePtr, u32 IntrType)

#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))
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_IRQ_EN_OFFSET
#define XCCM_IRQ_EN_OFFSET
IRQ Enable offset.
Definition: xccm_hw.h:71
XCCM_STATUS_OFFSET
#define XCCM_STATUS_OFFSET
Status offset.
Definition: xccm_hw.h:69
XCCM_IXR_ALLINTR_MASK
#define XCCM_IXR_ALLINTR_MASK
Interrupt all error mask (ORing of all interrupt mask)
Definition: xccm_hw.h:118

This macro returns the pending interrupts of the CCM core for the interrupts that have been enabled.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  The pending interrupts of the CCM. Use XCCM_IXR_*_MASK constants defined in xccm_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 XCcm_IntrGetPending(XCcm *InstancePtr)

Referenced by XCcm_IntrHandler().

#define XCCM_IRQ_EN_OFFSET 0x00C

IRQ Enable offset.

#define XCCM_ISR_OFFSET XCCM_STATUS_OFFSET

Interrupt status register generates a interrupt if the corresponding bits of interrupt enable register bits are set.

Interrupt status offset

#define XCCM_IXR_ALLINTR_MASK 0x00010003

Interrupt all error mask (ORing of all interrupt mask)

#define XCCM_IXR_EOF_MASK 0x00000002

End-Of-Frame mask.

Referenced by XCcm_IntrHandler().

#define XCCM_IXR_PROCS_STARTED_MASK 0x00000001

Process Started mask.

Referenced by XCcm_IntrHandler().

#define XCCM_IXR_SE_MASK 0x00010000

Slave Error mask.

Referenced by XCcm_IntrHandler().

#define XCCM_K11_OFFSET 0x100

K11 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K12_OFFSET 0x104

K12 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K13_OFFSET 0x108

K13 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K21_OFFSET 0x10C

K21 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K22_OFFSET 0x110

K22 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K23_OFFSET 0x114

K23 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K31_OFFSET 0x118

K31 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K32_OFFSET 0x11C

K32 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_K33_OFFSET 0x120

K33 Coefficient offset.

Referenced by XCcm_GetCoefMatrix(), and XCcm_SetCoefMatrix().

#define XCCM_MAX_VALUE 0xFFFFFFFF

32 bit maximum value

#define XCCM_OFFSET_FIRST 0xFFFFFF00

Offset starting value.

Referenced by XCcm_SetRgbOffset().

#define XCCM_OFFSET_LAST 255

Offset ending value.

Referenced by XCcm_SetRgbOffset().

#define XCCM_OFFSET_MASK 0x0001FFFF

Offset mask for Red, Green Blue Offset registers.

#define XCCM_OFFSET_SIGN_SHIFT 15

Shift for signed bit.

Referenced by XCcm_GetRgbOffset().

#define XCcm_Out32 Xil_Out32

Output operation.

#define XCcm_ReadReg | ( |  | BaseAddress,
|  |  | RegOffset
| ) |  | XCcm_In32((BaseAddress) + (u32)(RegOffset))

This macro reads the given register.

Parameters

  BaseAddress | is the Xilinx base address of the CCM core.
  RegOffset | is the register offset of the register.

Returns
  The 32-bit value of the register.

Note
  C-style signature: u32 XCcm_ReadReg(u32 BaseAddress, u32 RegOffset)

Referenced by XCcm_DisableDbgByPass(), XCcm_DisableDbgTestPattern(), XCcm_EnableDbgByPass(), XCcm_EnableDbgTestPattern(), XCcm_GetActiveSize(), XCcm_GetClamp(), XCcm_GetClip(), XCcm_GetCoefMatrix(), XCcm_GetDbgFrameCount(), XCcm_GetDbgLineCount(), XCcm_GetDbgPixelCount(), XCcm_GetRgbOffset(), XCcm_GetVersion(), XCcm_IsDbgByPassEnabled(), XCcm_IsDbgTestPatternEnabled(), and XCcm_SelfTest().

#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))))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_CTL_RUE_MASK
#define XCCM_CTL_RUE_MASK
Register Update Enable mask.
Definition: xccm_hw.h:98
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro prevents the CCM core instance from committing recent changes made so far by the software.

When disabled, changes to other configuration registers are stored, but do not effect the behavior of the core.

This macro only works when the CCM core is enabled.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_RegUpdateDisable(XCcm *InstancePtr)

Referenced by XCcm_Setup().

#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)))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_CTL_RUE_MASK
#define XCCM_CTL_RUE_MASK
Register Update Enable mask.
Definition: xccm_hw.h:98
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro commits all the register value changes made so far by the software to the CCM core instance.

This macro only works when the CCM core is enabled.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_RegUpdateEnable(XCcm *InstancePtr)

Referenced by XCcm_Setup().

#define XCcm_Reset | ( |  | InstancePtr | ) |

Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \
(XCCM_CONTROL_OFFSET), \
(XCCM_CTL_RESET_MASK))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCCM_CTL_RESET_MASK
#define XCCM_CTL_RESET_MASK
Software Reset mask.
Definition: xccm_hw.h:108
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro resets a CCM core.

This reset effects the core immediately and may cause image tearing.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_Reset(XCcm *InstancePtr)

Referenced by XCcm_CfgInitialize().

#define XCCM_ROFFSET_OFFSET 0x124

Red Offset offset.

Referenced by XCcm_GetRgbOffset(), and XCcm_SetRgbOffset().

#define XCCM_SIGN_MUL -1

Macro for sign multiplication.

#define XCcm_Start XCcm_Enable

This macro enables/starts the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on

Returns
  None.

Note
  C-style signature: void XCcm_Start(XCcm *InstancePtr)

#define XCCM_STATUS_OFFSET 0x004

Status offset.

#define XCcm_StatusGetPending | ( |  | InstancePtr | ) |

Value:
XCcm_ReadReg((InstancePtr)->Config.BaseAddress, \
(XCCM_STATUS_OFFSET)) & (XCCM_IXR_ALLINTR_MASK)
XCcm_ReadReg
#define XCcm_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xccm_hw.h:275
XCCM_STATUS_OFFSET
#define XCCM_STATUS_OFFSET
Status offset.
Definition: xccm_hw.h:69
XCCM_IXR_ALLINTR_MASK
#define XCCM_IXR_ALLINTR_MASK
Interrupt all error mask (ORing of all interrupt mask)
Definition: xccm_hw.h:118

This macro returns the pending interrupt status of the CCM core by reading from Status register.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  The pending interrupts of the CCM. Use XCCM_IXR_*_MASK constants defined in xccm_hw.h to interpret this value.

Note
  C-style signature: u32 XCcm_StatusGetPending(XCcm *InstancePtr)

#define XCcm_Stop XCcm_Disable

This macro disables/stops the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on

Returns
  None.

Note
  C-style signature: void XCcm_Stop(XCcm *InstancePtr)

#define XCcm_SyncReset | ( |  | InstancePtr | ) |

Value:
XCcm_WriteReg((InstancePtr)->Config.BaseAddress, \
(XCCM_CONTROL_OFFSET), \
(XCCM_CTL_AUTORESET_MASK))
XCCM_CONTROL_OFFSET
#define XCCM_CONTROL_OFFSET
Control offset.
Definition: xccm_hw.h:68
XCCM_CTL_AUTORESET_MASK
#define XCCM_CTL_AUTORESET_MASK
Software Auto Reset mask.
Definition: xccm_hw.h:105
XCcm_WriteReg
#define XCcm_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the given register.
Definition: xccm_hw.h:293

This macro resets a CCM core at the end of the frame being processed.

It enables core automatically synchronizes to the SOF of the core to prevent image tearing. This macro is differ from XCcm_Reset().

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.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  C-style signature: void XCcm_SyncReset(XCcm *InstancePtr)

#define XCCM_SYSDEBUG0_OFFSET 0x014

System Debug 0 offset.

Referenced by XCcm_GetDbgFrameCount().

#define XCCM_SYSDEBUG1_OFFSET 0x018

System Debug 1 offset.

Referenced by XCcm_GetDbgLineCount().

#define XCCM_SYSDEBUG2_OFFSET 0x01C

System Debug 2 offset.

Referenced by XCcm_GetDbgPixelCount().

#define XCCM_VER_INTERNAL_SHIFT 0x00000008

Version Internal shift.

#define XCCM_VER_MAJOR_MASK 0xFF000000

Version Major mask.

#define XCCM_VER_MAJOR_SHIFT 0x00000018

Version Major shift.

#define XCCM_VER_MINOR_MASK 0x00FF0000

Version Minor mask.

#define XCCM_VER_MINOR_SHIFT 0x00000010

Version Minor shift.

#define XCCM_VER_PID_MASK 0x00000F00

Version Patch ID mask.

#define XCCM_VER_REV_MASK 0x0000F000

Version Revision mask.

#define XCCM_VER_REV_NUM_MASK 0x000000FF

Version Revision Number mask.

#define XCCM_VER_REV_SHIFT 0x0000000C

Version Revision shift.

#define XCCM_VERSION_OFFSET 0x010

Version offset.

Referenced by XCcm_GetVersion(), and XCcm_SelfTest().

#define XCcm_WriteReg | ( |  | BaseAddress,
|  |  | RegOffset,
|  |  | Data
| ) |  | XCcm_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data))

This macro writes the given register.

Parameters

  BaseAddress | is the Xilinx base address of the CCM core.
  RegOffset | is the register offset of the register.
  Data | is the 32-bit value to write to the register.

Returns
  None.

Note
  C-style signature: void XCcm_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)

Referenced by XCcm_DisableDbgByPass(), XCcm_DisableDbgTestPattern(), XCcm_EnableDbgByPass(), XCcm_EnableDbgTestPattern(), XCcm_SetActiveSize(), XCcm_SetClamp(), XCcm_SetClip(), XCcm_SetCoefMatrix(), XCcm_SetRgbOffset(), and XCcm_Setup().

## Typedef Documentation

typedef void(* XCcm_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.

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

Callback type for 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.
  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.

## Enumeration Type Documentation

anonymous enum

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

Enumerator
XCCM_HANDLER_PROCSTART | A processing start event interrupt type.
XCCM_HANDLER_FRAMEDONE | A frame done event interrupt type.
XCCM_HANDLER_ERROR | An error condition interrupt type.

## Function Documentation

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.

Parameters

  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.

Returns
  - XST_SUCCESS if initialization was successful.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm::ErrCallBack, XCcm::FrameDoneCallBack, XCcm::IsReady, XCcm::ProcStartCallBack, and XCcm_Reset.

Referenced by XCcmSelfTestExample().

void XCcm_DisableDbgByPass | ( | XCcm * | InstancePtr | ) |

This function disables the Bypass mode of the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_BPE_MASK, XCcm_ReadReg, and XCcm_WriteReg.

void XCcm_DisableDbgTestPattern | ( | XCcm * | InstancePtr | ) |

This function disables debug test pattern mode in Control register of the CCM core, if Debug feature is enabled.

Parameters

  InstancePtr | is a pointer to the XCcm core instance to be worked on.

Returns
  None.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_TPE_MASK, XCcm_ReadReg, and XCcm_WriteReg.

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.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  None.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_BPE_MASK, XCcm_ReadReg, and XCcm_WriteReg.

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.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  None.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_TPE_MASK, XCcm_ReadReg, and XCcm_WriteReg.

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.

Parameters

  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).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_ACTIVE_SIZE_OFFSET, XCCM_ACTSIZE_NUM_LINE_MASK, XCCM_ACTSIZE_NUM_LINE_SHIFT, XCCM_ACTSIZE_NUM_PIXEL_MASK, and XCcm_ReadReg.

u32 XCcm_GetClamp | ( | XCcm * | InstancePtr | ) |

This function returns the clamp value from the Clamp register.

Parameters

  InstancePtr | is a pointer to the CCM instance.

Returns
  Clamp Value is returned.(Range is 0 to 255).

Note
  If Output value smaller than this clamp value it will be replaced by this value.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_CLAMP_MASK, XCCM_CLAMP_OFFSET, and XCcm_ReadReg.

u32 XCcm_GetClip | ( | XCcm * | InstancePtr | ) |

This function gets the clip value from Clip register of the CCM core.

Parameters

  InstancePtr | is a pointer to the CCM instance.

Returns
  Clip value is returned.(Range is 0 to 255).

Note
  If Output value greater than this Clip value it will be replaced by this Clip value.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_CLIP_MASK, XCCM_CLIP_OFFSET, and XCcm_ReadReg.

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.

Parameters

  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)).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Coefs::K11, XCcm_Coefs::K12, XCcm_Coefs::K13, XCcm_Coefs::K21, XCcm_Coefs::K22, XCcm_Coefs::K23, XCcm_Coefs::K31, XCcm_Coefs::K32, XCcm_Coefs::K33, XCCM_K11_OFFSET, XCCM_K12_OFFSET, XCCM_K13_OFFSET, XCCM_K21_OFFSET, XCCM_K22_OFFSET, XCCM_K23_OFFSET, XCCM_K31_OFFSET, XCCM_K32_OFFSET, XCCM_K33_OFFSET, and XCcm_ReadReg.

u32 XCcm_GetDbgFrameCount | ( | XCcm * | InstancePtr | ) |

This function gets number of frames processed since power-up or last time the core is reset.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  FrameCount is the number of frames processed since power up.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCcm_ReadReg, and XCCM_SYSDEBUG0_OFFSET.

u32 XCcm_GetDbgLineCount | ( | XCcm * | InstancePtr | ) |

This function gets the number of lines processed since power-up or last time the core is reset.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  LineCount is the number of lines processed since power up.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCcm_ReadReg, and XCCM_SYSDEBUG1_OFFSET.

u32 XCcm_GetDbgPixelCount | ( | XCcm * | InstancePtr | ) |

This function gets the number of pixels processed since power-up or last time the core is reset.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  PixelCount is the number of pixels processed since power up.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCcm_ReadReg, and XCCM_SYSDEBUG2_OFFSET.

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.

Parameters

  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]).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_BOFFSET_OFFSET, XCCM_GOFFSET_OFFSET, XCCM_OFFSET_SIGN_SHIFT, XCcm_ReadReg, and XCCM_ROFFSET_OFFSET.

u32 XCcm_GetVersion | ( | XCcm * | InstancePtr | ) |

This function gets the Version of the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance to be worked on.

Returns
  Returns the contents of the Version register.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_ReadReg, and XCCM_VERSION_OFFSET.

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. .

Parameters

  InstancePtr | is a pointer to the XCcm instance that just interrupted.

Returns
  None.

Note
  Interrupt interface should be enabled.

References XCcm::Config, XCcm::ErrCallBack, XCcm::ErrRef, XCcm::FrameDoneCallBack, XCcm::FrameDoneRef, XCcm_Config::HasIntcIf, XCcm::IsReady, XCcm::ProcStartCallBack, XCcm::ProcStartRef, XCcm_IntrClear, XCcm_IntrGetPending, XCCM_IXR_EOF_MASK, XCCM_IXR_PROCS_STARTED_MASK, and XCCM_IXR_SE_MASK.

int XCcm_IsDbgByPassEnabled | ( | XCcm * | InstancePtr | ) |

This function returns the current bypass mode settings from Control register of the CCM core.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  Core debug bypass mode.
  - TRUE = Bypass mode is enabled.
  - FALSE = Bypass mode is not enabled.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_BPE_MASK, and XCcm_ReadReg.

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.

Parameters

  InstancePtr | is a pointer to the XCcm instance.

Returns
  Test-pattern generator mode.
  - TRUE = Test-pattern mode is enabled.
  - FALSE = Test-pattern mode is not enabled.

Note
  Debug functionality should be enabled.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Config::HasDebug, XCCM_CONTROL_OFFSET, XCCM_CTL_TPE_MASK, and XCcm_ReadReg.

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.

Parameters

  DeviceId | is the unique device ID of the device for the lookup operation.

Returns
  CfgPtr is a reference to a config record in the configuration table (in xccm_g.c) corresponding to DeviceId, or NULL if no match is found.

Note
  None.

Referenced by XCcmSelfTestExample().

int XCcm_SelfTest | ( | XCcm * | InstancePtr | ) |

This function reads Version register of CCM core and compares with zero as part of self test.

Parameters

  InstancePtr | is a pointer to XCcm instance.

Returns
  - XST_SUCCESS if the test is successful.
  - XST_FAILURE if the test is failed.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_ReadReg, and XCCM_VERSION_OFFSET.

Referenced by XCcmSelfTestExample().

void XCcm_SetActiveSize | ( | XCcm * | InstancePtr,
|  | u16 | HSize,
|  | u16 | VSize
| ) |  |

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

Parameters

  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).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_ACT_SIZE_FIRST, XCCM_ACT_SIZE_LAST, XCCM_ACTIVE_SIZE_OFFSET, XCCM_ACTSIZE_NUM_LINE_SHIFT, and XCcm_WriteReg.

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

Parameters

  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.

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.

References XCcm::ErrCallBack, XCcm::ErrRef, XCcm::FrameDoneCallBack, XCcm::FrameDoneRef, XCcm::IsReady, XCcm::ProcStartCallBack, XCcm::ProcStartRef, XCCM_HANDLER_ERROR, XCCM_HANDLER_FRAMEDONE, and XCCM_HANDLER_PROCSTART.

void XCcm_SetClamp | ( | XCcm * | InstancePtr,
|  | u32 | Clamp
| ) |  |

This function sets the clamp value in the Clamp register.

Parameters

  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).

Returns
  None.

Note
  If Output value smaller than this Clamp value it will be replaced by this value.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_CLAMP_LAST, XCCM_CLAMP_MASK, XCCM_CLAMP_OFFSET, and XCcm_WriteReg.

void XCcm_SetClip | ( | XCcm * | InstancePtr,
|  | u32 | Clip
| ) |  |

This function sets the clip value in the Clip register of the CCM core.

Parameters

  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).

Returns
  None.

Note
  If Output value greater than this Clip value it will be replaced by this Clip value.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_CLIP_LAST, XCCM_CLIP_MASK, XCCM_CLIP_OFFSET, and XCcm_WriteReg.

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.

Parameters

  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)).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm_Coefs::K11, XCcm_Coefs::K12, XCcm_Coefs::K13, XCcm_Coefs::K21, XCcm_Coefs::K22, XCcm_Coefs::K23, XCcm_Coefs::K31, XCcm_Coefs::K32, XCcm_Coefs::K33, XCCM_COEF_FIRST, XCCM_COEF_LAST, XCCM_K11_OFFSET, XCCM_K12_OFFSET, XCCM_K13_OFFSET, XCCM_K21_OFFSET, XCCM_K22_OFFSET, XCCM_K23_OFFSET, XCCM_K31_OFFSET, XCCM_K32_OFFSET, XCCM_K33_OFFSET, and XCcm_WriteReg.

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.

Parameters

  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]).

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCCM_BOFFSET_OFFSET, XCCM_GOFFSET_OFFSET, XCCM_OFFSET_FIRST, XCCM_OFFSET_LAST, XCCM_ROFFSET_OFFSET, and XCcm_WriteReg.

void XCcm_Setup | ( | XCcm * | InstancePtr | ) |

This function sets the input/output frame size in Active Size register and enables the register update.

Parameters

  InstancePtr | is a pointer to the Xccm instance.

Returns
  None.

Note
  None.

References XCcm_Config::BaseAddress, XCcm::Config, XCcm::HSize, XCcm::VSize, XCCM_ACTIVE_SIZE_OFFSET, XCCM_ACTSIZE_NUM_LINE_MASK, XCCM_ACTSIZE_NUM_LINE_SHIFT, XCCM_ACTSIZE_NUM_PIXEL_MASK, XCcm_RegUpdateDisable, XCcm_RegUpdateEnable, and XCcm_WriteReg.