ccm
Xilinx SDK Drivers API Documentation
ccm Documentation

This header file contains identifiers and register-level driver functions (or macros), range macros, structure typedefs that can be used to access the Xilinx Color Correction Matrix (CCM) core instance.The Color Correction Matrix core offers a 3x3 matrix multiplication for a variety of color correction applications. CCM core provides following features:

  • Fully programmable coefficient matrix.
  • Offset compensation.
  • Clipping and
  • Clamping of the output.

Initialization & Configuration

The device driver enables higher layer software (e.g., an application) to communicate to the CCM core.

XCcm_CfgInitialize() API is used to initialize the CCM core. The user needs to first call the XCcm_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XCcm_CfgInitialize() API.

Interrupts

The driver provides an interrupt handler XCcm_IntrHandler for handling the interrupt from the CCM core. The users of this driver have to register this handler with the interrupt system and provide the callback functions by using XCcm_SetCallBack API.

Virtual Memory

This driver supports Virtual Memory. The RTOS is responsible for calculating the correct device base address in Virtual Memory space.

Threads

This driver is not thread safe. Any needs for threads or thread mutual exclusion must be satisfied by the layer above this driver.

Asserts

Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.

Building the driver

The XCcm driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

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. 5.0 adk 19/12/13 Updated as per the New Tcl API's. 6.0 adk 03/06/14 Changed file name ccm.h to xccm.h. Moved register offsets and bit definitions to xccm_hw.h file. Defined the following handler types as enum values: XCCM_HANDLER_PROCSTART ,XCCM_HANDLER_FRAMEDONE and XCCM_HANDLER_ERROR.

                       Added the following range macros:
                       XCCM_VSIZE_FIRST, XCCM_VSIZE_LAST
                       XCCM_HSIZE_FIRST, XCCM_HSIZE_LAST
                       XCCM_COEF_FIRST,XCCM_COEF_LAST
                       XCCM_OFFSET_FIRST,XCCM_OFFSET_LAST
                       XCCM_CLAMP_FIRST,XCCM_CLAMP_LAST
                       XCCM_CLIP_FIRST,XCCM_CLIP_LAST.
                       Added the following structure type definitions:
                       XCcm_Config and XCcm.
                       Removed the following functional macros:
                       CCM_Enable, CCM_Disable, CCM_RegUpdateEnable
                       CCM_RegUpdateDisable, CCM_Reset, CCM_AutoSyncReset
                       CCM_ClearReset.
                       Added the following macros:
                       XCcm_Enable, XCcm_Disable,XCcm_RegUpdateEnable,
                       XCcm_SyncReset, XCcm_Reset, XCcm_IntrGetPending,
                       XCcm_IntrEnable, XCcm_IntrDisable,
                       XCcm_StatusGetPending, XCcm_IntrClear, XCcm_Start,
                       XCcm_Stop.
                       Modification history from xccm_hw.h
                       First release.
                       Added the register offsets and bit masks for the
                       registers.
                       Added backward compatibility macros.
                       Modifications in the file xccm.c are:
                       Changed filename ccm 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 XCcm_GetClamp XCcm_FloatToFixedConv,
                       and XCcm_FixedToFloatConv.
                       Modifications in the file xccm_selftest.c are:
                       Implemented XCcm_SelfTest function.
                       Modifications in the file xccm_sinit.c are:
                       Implemented XCcm_LookupConfig function.
                       Modifications in the file xccm_intr.c are:
                       Implemented the following functions:
                       XCcm_IntrHandler
                       XCcm_SetCallBack
6.1   ms     01/16/17  Updated the parameter naming from
                       XPAR_CCM_NUM_INSTANCES to XPAR_XCCM_NUM_INSTANCES
                       to avoid  compilation failure for
                       XPAR_CCM_NUM_INSTANCES as the tools are generating
                       XPAR_XCCM_NUM_INSTANCES in the generated xccm_g.c
                       for fixing MISRA-C files. This is a fix for
                       CR-966099 based on the update in the tools.
      ms     03/17/17  Added readme.txt file in examples folder for doxygen
                       generation.