#include "xcfa_hw.h"
#include "xil_assert.h"
#include "xstatus.h"
Classes | |
struct | XCfa_Config |
struct | XCfa |
Active size range macros | |
#define | XCFA_VSIZE_FIRST 32 |
#define | XCFA_VSIZE_LAST 7680 |
#define | XCFA_HSIZE_FIRST 32 |
#define | XCFA_HSIZE_LAST 7680 |
Handler Types | |
enum | { XCFA_HANDLER_PROCSTART = 1, XCFA_HANDLER_FRAMEDONE, XCFA_HANDLER_ERROR } |
Bayer phase | |
enum | XCfa_BayerPhaseCombination { XCFA_RGRG_COMBINATION, XCFA_GRGR_COMBINATION, XCFA_GBGB_COMBINATION, XCFA_BGBG_COMBINATION } |
Defines | |
#define | XCFA_H_ |
#define | XCfa_Enable(InstancePtr) |
#define | XCfa_Disable(InstancePtr) |
#define | XCfa_Start XCfa_Enable |
#define | XCfa_Stop XCfa_Disable |
#define | XCfa_RegUpdateEnable(InstancePtr) |
#define | XCfa_RegUpdateDisable(InstancePtr) |
#define | XCfa_SyncReset(InstancePtr) |
#define | XCfa_Reset(InstancePtr) |
#define | XCfa_StatusGetPending(InstancePtr) |
#define | XCfa_IntrClear(InstancePtr, IntrType) |
#define | XCfa_IntrEnable(InstancePtr, IntrType) |
#define | XCfa_IntrDisable(InstancePtr, IntrType) |
#define | XCfa_IntrGetPending(InstancePtr) |
Typedefs | |
typedef void(*) | XCfa_CallBack (void *CallBackRef) |
typedef void(*) | XCfa_ErrorCallBack (void *CallBackRef, u32 ErrorMask) |
Functions | |
XCfa_Config * | XCfa_LookupConfig (u16 DeviceId) |
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) |
int | XCfa_SelfTest (XCfa *InstancePtr) |
void | XCfa_IntrHandler (void *InstancePtr) |
int | XCfa_SetCallBack (XCfa *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef) |
#define XCfa_Disable | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET))) & (~(XCFA_CTL_SW_EN_MASK))))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_Enable | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_SW_EN_MASK)))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCFA_H_ |
Prevent circular inclusions by using protection macros
#define XCFA_HSIZE_FIRST 32 |
Horizontal Size starting value
#define XCFA_HSIZE_LAST 7680 |
Horizontal Size ending value
#define XCfa_IntrClear | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_STATUS_OFFSET), ((IntrType) & \ ((u32)(XCFA_IXR_ALLINTR_MASK))))
InstancePtr | is a pointer to the XCfa instance to be worked on. | |
IntrType | is the pending interrupts to clear/acknowledge. Use OR'ing of XCFA_IXR_*_MASK constants defined in xcfa_hw.h to create this parameter value. |
#define XCfa_IntrDisable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_IRQ_EN_OFFSET), \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_IRQ_EN_OFFSET))) & ((~(IntrType)) & \ (XCFA_IXR_ALLINTR_MASK))))
InstancePtr | is a pointer to the XCfa instance to be worked on. | |
IntrType | is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCFA_IXR_*_MASK bits defined in xcfa_hw.h. |
#define XCfa_IntrEnable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_IRQ_EN_OFFSET), \ (((IntrType) & (XCFA_IXR_ALLINTR_MASK)) | \ (XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_IRQ_EN_OFFSET)))))
InstancePtr | is a pointer to the XCfa instance to be worked on. | |
IntrType | is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XCFA_IXR_*_MASK bits defined in xcfa_hw.h. |
#define XCfa_IntrGetPending | ( | InstancePtr | ) |
Value:
XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_IRQ_EN_OFFSET)) & \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_STATUS_OFFSET))) & ((u32)(XCFA_IXR_ALLINTR_MASK)))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_RegUpdateDisable | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET)))) & (~(XCFA_CTL_RUE_MASK)))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_RegUpdateEnable | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), \ ((XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET))) | (XCFA_CTL_RUE_MASK)))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_Reset | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), (XCFA_CTL_RESET_MASK))
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_Start XCfa_Enable |
This function macro enables/starts the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_StatusGetPending | ( | InstancePtr | ) |
Value:
XCfa_ReadReg((InstancePtr)->Config.BaseAddress, \ (XCFA_STATUS_OFFSET)) & (XCFA_IXR_ALLINTR_MASK)
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_Stop XCfa_Disable |
This function macro disables/stops the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
#define XCfa_SyncReset | ( | InstancePtr | ) |
Value:
XCfa_WriteReg((InstancePtr)->Config.BaseAddress, \ (XCFA_CONTROL_OFFSET), (XCFA_CTL_AUTORESET_MASK))
On the next rising-edge of SOF following a call to XCfa_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 XCfa instance to be worked on. |
#define XCFA_VSIZE_FIRST 32 |
Vertical Size starting value
#define XCFA_VSIZE_LAST 7680 |
Vertical Size ending value
typedef void(*) XCfa_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(*) XCfa_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 XCFA_IXR_*_MASK values defined in xcfa_hw.h. |
anonymous enum |
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.
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. |
void XCfa_DisableDbgBypass | ( | XCfa * | InstancePtr | ) |
This function disables bypass mode of the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
void XCfa_DisableDbgTestPattern | ( | XCfa * | InstancePtr | ) |
This function disables the test pattern mode of the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
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.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
void XCfa_EnableDbgTestPattern | ( | XCfa * | InstancePtr | ) |
This function sets the test-pattern mode of the CFA core if debug features is enabled.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
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.
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). |
u32 XCfa_GetBayerPhase | ( | XCfa * | InstancePtr | ) |
This function gets the Bayer phase value combination from Bayer phase register.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
u32 XCfa_GetDbgFrameCount | ( | XCfa * | InstancePtr | ) |
This function gets number of frames processed since power-up or last time the core is reset.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
u32 XCfa_GetDbgLineCount | ( | XCfa * | 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 XCfa instance to be worked on. |
u32 XCfa_GetDbgPixelCount | ( | XCfa * | 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 XCfa instance to be worked on. |
u32 XCfa_GetVersion | ( | XCfa * | InstancePtr | ) |
This function gets the Version of the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
void XCfa_IntrHandler | ( | void * | InstancePtr | ) |
This function is the interrupt handler for the CFA core.
This handler reads the pending interrupt from the 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 core is also responsible for providing callbacks to handle interrupts and installing the callbacks using XCfa_SetCallBack() during initialization phase.
InstancePtr | is a pointer to the XCfa instance that just interrupted. |
int XCfa_IsDbgByPassEnabled | ( | XCfa * | InstancePtr | ) |
This function gets the current status of the bypass setting of the CFA core.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
int XCfa_IsDbgTestPatternEnabled | ( | XCfa * | InstancePtr | ) |
This function gets the test-pattern mode if debug feature is enabled.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
XCfa_Config* XCfa_LookupConfig | ( | u16 | DeviceId | ) |
This function returns a reference to an XCfa_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 xcfa_g.c file.
DeviceId | is the unique device ID of the core for the lookup operation. |
int XCfa_SelfTest | ( | XCfa * | InstancePtr | ) |
This function reads complete Version register of CFA core and compares with zero values as part of self test.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
void XCfa_SetActiveSize | ( | XCfa * | InstancePtr, | |
u16 | HSize, | |||
u16 | VSize | |||
) |
This function sets the active H/V sizes in the Active Size register.
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. |
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.
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
|
int XCfa_SetCallBack | ( | XCfa * | InstancePtr, | |
u32 | HandlerType, | |||
void * | CallBackFunc, | |||
void * | CallBackRef | |||
) |
void XCfa_Setup | ( | XCfa * | InstancePtr | ) |
This function sets the input/output frame size in Active Size register and enables the register update.
InstancePtr | is a pointer to the XCfa instance to be worked on. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.