Software Drivers

xccm.c File Reference


Detailed Description

This file contains the implementation of the interface functions for CCM driver. Refer to the header file xccm.h for more detailed information.

 MODIFICATION HISTORY:

 Ver   Who     Date     Changes
 ----- ------- -------- ------------------------------------------------------
 2.00a jo      05/1/10  Updated for CCM V2.0
 3.00a ren     09/11/11 Updated for CCM v3.0
 4.00a jj      12/18/12 Converted from xio.h to xil_io.h,translating
                        basic types,MB cache functions, exceptions
                        and assertions to xil_io format.
 6.0   adk     03/06/14 Changed filename ccm.c to xccm.c.
                        Implemented the following functions:
                        XCcm_CfgInitialize, XCcm_Setup, XCcm_GetVersion,
                        XCcm_EnableDbgByPass, XCcm_IsDbgByPassEnabled,
                        XCcm_DisableDbgByPass, XCcm_EnableDbgTestPattern,
                        XCcm_IsDbgTestPatternEnabled,
                        XCcm_DisableDbgTestPattern, XCcm_GetDbgFrameCount,
                        XCcm_GetDbgLineCount, XCcm_GetDbgPixelCount,
                        XCcm_SetActiveSize, XCcm_GetActiveSize,
                        XCcm_SetCoefMatrix, XCcm_GetCoefMatrix,
                        XCcm_SetRgbOffset, XCcm_GetRgbOffset,
                        XCcm_SetClip, XCcm_GetClip,
                        XCcm_SetClamp and XCcm_GetClamp XCcm_FloatToFixedConv,
                        and XCcm_FixedToFloatConv.

 

#include "xccm.h"

Functions

int XCcm_CfgInitialize (XCcm *InstancePtr, XCcm_Config *CfgPtr, u32 EffectiveAddr)
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_GetVersion (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)


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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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