Software Drivers

xcfa.c File Reference


Detailed Description

This file contains the implementation of the interface functions for CFA core. Refer to the header file xcfa.h for more detailed information.

 MODIFICATION HISTORY:

 Ver   Who    Date     Changes
 ----- ------ -------- --------------------------------------------------
 1.00  drg/jz 01/13/10 First Release
 3.00a gz     10/22/10 Updated for CFA V3.0
 4.00a rc     09/11/11 Updated for CFA v4.0
 5.00a se     12/01/11 Updated for CFA v5.0
 7.0   adk    01/07/14 Changed the file name from
                       cfa.c to xcfa.c
                       Implemented the following functions:
                       XCfa_CfgInitialize, XCfa_Setup,
                       XCfa_GetVersion,
                       XCfa_EnableDbgByPass,
                       XCfa_IsDbgByPassEnabled,
                       XCfa_DisableDbgBypass,
                       XCfa_EnableDbgTestPattern,
                       XCfa_IsDbgTestPatternEnabled,
                       XCfa_DisableDbgTestPattern,
                       XCfa_GetDbgFrameCount
                       XCfa_GetDbgLineCount, XCfa_GetDbgPixelCount
                       XCfa_SetActiveSize, XCfa_GetActiveSize
                       XCfa_SetBayerPhase, XCfa_GetBayerPhase,
                       StubCallBack, StubErrCallBack.
 

#include "xcfa.h"

Functions

int XCfa_CfgInitialize (XCfa *InstancePtr, XCfa_Config *CfgPtr, u32 EffectiveAddr)
void XCfa_Setup (XCfa *InstancePtr)
void XCfa_EnableDbgByPass (XCfa *InstancePtr)
int XCfa_IsDbgByPassEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgBypass (XCfa *InstancePtr)
void XCfa_EnableDbgTestPattern (XCfa *InstancePtr)
int XCfa_IsDbgTestPatternEnabled (XCfa *InstancePtr)
void XCfa_DisableDbgTestPattern (XCfa *InstancePtr)
u32 XCfa_GetVersion (XCfa *InstancePtr)
u32 XCfa_GetDbgFrameCount (XCfa *InstancePtr)
u32 XCfa_GetDbgLineCount (XCfa *InstancePtr)
u32 XCfa_GetDbgPixelCount (XCfa *InstancePtr)
void XCfa_SetActiveSize (XCfa *InstancePtr, u16 HSize, u16 VSize)
void XCfa_GetActiveSize (XCfa *InstancePtr, u16 *HSize, u16 *VSize)
void XCfa_SetBayerPhase (XCfa *InstancePtr, enum XCfa_BayerPhaseCombination BayerPhase)
u32 XCfa_GetBayerPhase (XCfa *InstancePtr)


Function Documentation

int XCfa_CfgInitialize ( XCfa InstancePtr,
XCfa_Config CfgPtr,
u32  EffectiveAddr 
)

This function initializes the CFA core. This function must be called prior to using the CFA core. Initialization of the CFA includes setting up the instance data and ensuring the hardware is in a quiescent state.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
CfgPtr is a reference to a configuration structure containing information about the CFA core.
EffectiveAddr is the base address of the core. If address translation is being used then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
Returns:
  • XST_SUCCESS if initialization was successful.
Note:
None.

void XCfa_DisableDbgBypass ( XCfa InstancePtr  ) 

This function disables bypass mode of the CFA core.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCfa_DisableDbgTestPattern ( XCfa InstancePtr  ) 

This function disables the test pattern mode of the CFA core.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCfa_EnableDbgByPass ( XCfa InstancePtr  ) 

This sets the bypass bit of the control register to switch the core to bypass mode if debug is enabled in the CFA core.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCfa_EnableDbgTestPattern ( XCfa InstancePtr  ) 

This function sets the test-pattern mode of the CFA core if debug features is enabled.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCfa_GetActiveSize ( XCfa InstancePtr,
u16 *  HSize,
u16 *  VSize 
)

This function gets the number of Active Pixel per Scan line and number of Active Lines per Frame from the Active Frame Size register.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
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 XCfa_GetBayerPhase ( XCfa InstancePtr  ) 

This function gets the Bayer phase value combination from Bayer phase register.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
BayerPhase the Bayer Phase value 0 to 3. The Phase value combinations are
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
Note:
- It is a double buffered register.

u32 XCfa_GetDbgFrameCount ( XCfa 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 XCfa instance to be worked on.
Returns:
FrameCount is the number of frames processed since power up.
Note:
Debug functionality should be enabled.

u32 XCfa_GetDbgLineCount ( XCfa 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 XCfa instance to be worked on.
Returns:
LineCount is the number of lines processed since power up.
Note:
Debug functionality should be enabled.

u32 XCfa_GetDbgPixelCount ( XCfa 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 XCfa instance to be worked on.
Returns:
PixelCount is the number of pixels processed since power up.
Note:
Debug functionality should be enabled.

u32 XCfa_GetVersion ( XCfa InstancePtr  ) 

This function gets the Version of the CFA core.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
Returns the contents of the Version register.
Note:
None.

int XCfa_IsDbgByPassEnabled ( XCfa InstancePtr  ) 

This function gets the current status of the bypass setting of the CFA core.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
Returns:
Core debug bypass mode.
  • TRUE = Bypass mode is enabled.
  • FALSE = Bypass mode is not enabled.
Note:
Debug functionality should be enabled.

int XCfa_IsDbgTestPatternEnabled ( XCfa InstancePtr  ) 

This function gets the test-pattern mode if debug feature is enabled.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
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 XCfa_SetActiveSize ( XCfa 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 XCfa instance to be worked on.
HSize is number of Active Pixels per scan line to be set. Range of HSize is 32 to 7680.
VSize is number of Active Lines per frame to be set. Range of VSize is 32 to 7680.
Returns:
None.
Note:
None.

void XCfa_SetBayerPhase ( XCfa InstancePtr,
enum XCfa_BayerPhaseCombination  BayerPhase 
)

This function specify whether the starting position pixel(0,0) of the Bayer sampling grid is on a red-green or blue-green line and whether the first pixel is green or not.

Parameters:
InstancePtr is a pointer to the XCfa instance to be worked on.
BayerPhase to be set to identify starting position. Range of Phase is 0 to 3. The Phase value combinations are
  • Bayer Phase 0 is XCFA_RGRG_COMBINATION.
  • Bayer Phase 1 is XCFA_GRGR_COMBINATION.
  • Bayer Phase 2 is XCFA_GBGB_COMBINATION.
  • Bayer Phase 3 is XCFA_BGBG_COMBINATION.
  • It is a double buffered register.
Returns:
None.
Note:
None.

void XCfa_Setup ( XCfa 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 XCfa instance to be worked on.
Returns:
None.
Note:
None.

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