#include "xil_assert.h"
#include "xstatus.h"
#include "xenhance_hw.h"
Classes | |
struct | XEnhance_Config |
struct | XEnhance |
Active size range macros | |
#define | XENH_VSIZE_FIRST 32 |
#define | XENH_VSIZE_LAST 7680 |
#define | XENH_HSIZE_FIRST 32 |
#define | XENH_HSIZE_LAST 7680 |
Noise threshold range macros | |
#define | XENH_NOISETHRES_MIN 0 |
#define | XENH_NOISETHRES_MAX 255 |
Strength range macros | |
#define | XENH_ENHSTRENGTH_MIN 0 |
#define | XENH_ENHSTRENGTH_MAX 32768 |
Halo Suppress range macros | |
#define | XENH_HALOSUPPRESS_MIN 0 |
#define | XENH_HALOSUPPRESS_MAX 32768 |
Handler Types | |
enum | { XENH_HANDLER_PROCSTART = 1, XENH_HANDLER_FRAMEDONE, XENH_HANDLER_ERROR } |
Defines | |
#define | XENHANCE_H_ |
#define | XEnhance_Enable(InstancePtr) |
#define | XEnhance_Disable(InstancePtr) |
#define | XEnhance_Start XEnhance_Enable |
#define | XEnhance_Stop XEnhance_Disable |
#define | XEnhance_RegUpdateEnable(InstancePtr) |
#define | XEnhance_RegUpdateDisable(InstancePtr) |
#define | XEnhance_SyncReset(InstancePtr) |
#define | XEnhance_Reset(InstancePtr) |
#define | XEnhance_StatusGetPending(InstancePtr) |
#define | XEnhance_IntrClear(InstancePtr, IntrType) |
#define | XEnhance_IntrEnable(InstancePtr, IntrType) |
#define | XEnhance_IntrDisable(InstancePtr, IntrType) |
#define | XEnhance_IntrGetPending(InstancePtr) |
Typedefs | |
typedef void(*) | XEnhance_CallBack (void *CallBackRef) |
typedef void(*) | XEnhance_ErrorCallBack (void *CallBackRef, u32 ErrorMask) |
Functions | |
int | XEnhance_CfgInitialize (XEnhance *InstancePtr, XEnhance_Config *CfgPtr, u32 EffectiveAddr) |
void | XEnhance_Setup (XEnhance *InstancePtr) |
void | XEnhance_EnableDbgByPass (XEnhance *InstancePtr) |
int | XEnhance_IsDbgByPassEnabled (XEnhance *InstancePtr) |
void | XEnhance_DisableDbgBypass (XEnhance *InstancePtr) |
void | XEnhance_EnableDbgTestPattern (XEnhance *InstancePtr) |
int | XEnhance_IsDbgTestPatternEnabled (XEnhance *InstancePtr) |
void | XEnhance_DisableDbgTestPattern (XEnhance *InstancePtr) |
u32 | XEnhance_GetVersion (XEnhance *InstancePtr) |
u32 | XEnhance_GetDbgFrameCount (XEnhance *InstancePtr) |
u32 | XEnhance_GetDbgLineCount (XEnhance *InstancePtr) |
u32 | XEnhance_GetDbgPixelCount (XEnhance *InstancePtr) |
void | XEnhance_SetActiveSize (XEnhance *InstancePtr, u16 HSize, u16 VSize) |
void | XEnhance_GetActiveSize (XEnhance *InstancePtr, u16 *HSize, u16 *VSize) |
void | XEnhance_SetNoiseThreshold (XEnhance *InstancePtr, u32 Threshold) |
u32 | XEnhance_GetNoiseThreshold (XEnhance *InstancePtr) |
void | XEnhance_SetEdgeStrength (XEnhance *InstancePtr, u32 Strength) |
u32 | XEnhance_GetEdgeStrength (XEnhance *InstancePtr) |
void | XEnhance_SetHaloSuppress (XEnhance *InstancePtr, u32 Suppress) |
u32 | XEnhance_GetHaloSuppress (XEnhance *InstancePtr) |
XEnhance_Config * | XEnhance_LookupConfig (u16 DeviceId) |
int | XEnhance_SelfTest (XEnhance *InstancePtr) |
void | XEnhance_IntrHandler (void *InstancePtr) |
int | XEnhance_SetCallBack (XEnhance *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef) |
#define XENH_ENHSTRENGTH_MAX 32768 |
Strength ending value
#define XENH_ENHSTRENGTH_MIN 0 |
Strength starting value
#define XENH_HALOSUPPRESS_MAX 32768 |
Halo Suppress ending value
#define XENH_HALOSUPPRESS_MIN 0 |
Halo Suppress starting value
#define XENH_HSIZE_FIRST 32 |
Horizontal Size starting value
#define XENH_HSIZE_LAST 7680 |
Horizontal Size ending value
#define XENH_NOISETHRES_MAX 255 |
Noise threshold ending value
#define XENH_NOISETHRES_MIN 0 |
Noise threshold starting value
#define XENH_VSIZE_FIRST 32 |
Vertical Size starting value
#define XENH_VSIZE_LAST 7680 |
Vertical Size ending value
#define XEnhance_Disable | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), \ XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET)) & (~(XENH_CTL_SW_EN_MASK)))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_Enable | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), \ XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET)) | (XENH_CTL_SW_EN_MASK))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XENHANCE_H_ |
Prevent circular inclusions by using protection macros
#define XEnhance_IntrClear | ( | InstancePtr, | |||
IntrType | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_STATUS_OFFSET), ((IntrType) & (XENH_IXR_ALLINTR_MASK)))
InstancePtr | is a pointer to the Enhance core instance to be worked on. | |
IntrType | is the pending interrupts to clear/acknowledge. Use OR'ing of XENH_IXR_*_MASK constants defined in xEnhance_hw.h to create this parameter value. |
#define XEnhance_IntrDisable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_IRQ_EN_OFFSET), \ (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_IRQ_EN_OFFSET)) & ((~(IntrType)) & \ (XENH_IXR_ALLINTR_MASK))))
InstancePtr | is a pointer to the Enhance core 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 XENH_IXR_*_MASK bits defined in xenhance_hw.h. |
#define XEnhance_IntrEnable | ( | InstancePtr, | |||
IntrType | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_IRQ_EN_OFFSET), \ ((IntrType) & (XENH_IXR_ALLINTR_MASK)) | \ (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_IRQ_EN_OFFSET))))
InstancePtr | is a pointer to the Enhance core 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 XENH_IXR_*_MASK bits defined in xenhance_hw.h. |
#define XEnhance_IntrGetPending | ( | InstancePtr | ) |
Value:
XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_IRQ_EN_OFFSET)) & \ (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_STATUS_OFFSET))) & ((u32)(XENH_IXR_ALLINTR_MASK))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_RegUpdateDisable | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), \ ((XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET))) & \ (~(XENH_CTL_RUE_MASK))))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_RegUpdateEnable | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), \ (XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET))) | (XENH_CTL_RUE_MASK))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_Reset | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), (XENH_CTL_RESET_MASK))
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_Start XEnhance_Enable |
This function macro starts the Image Enhancement core instance.
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_StatusGetPending | ( | InstancePtr | ) |
Value:
XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \ (XENH_STATUS_OFFSET)) & (XENH_IXR_ALLINTR_MASK)
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_Stop XEnhance_Disable |
This function macro stops the Image Enhancement core instance.
InstancePtr | is a pointer to the Enhance core instance to be worked on. |
#define XEnhance_SyncReset | ( | InstancePtr | ) |
Value:
XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \ (XENH_CONTROL_OFFSET), (XENH_CTL_AUTORESET_MASK))
On the next SOF following a call to XEnhance_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 Enhance core instance to be worked on. |
typedef void(*) XEnhance_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(*) XEnhance_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 XENH_IXR_*_MASK values defined in xenhance_hw.h |
anonymous enum |
int XEnhance_CfgInitialize | ( | XEnhance * | InstancePtr, | |
XEnhance_Config * | CfgPtr, | |||
u32 | EffectiveAddr | |||
) |
This function initializes a Enhance core. This function must be called prior to using a Enhance core. Initialization of a Enhance includes setting up the instance data, and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to XEnhance instance to be worked on. | |
CfgPtr | is a reference to a configuration structure containing information about the Enhance 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 XEnhance_DisableDbgBypass | ( | XEnhance * | InstancePtr | ) |
This function disables Bypass mode of the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
void XEnhance_DisableDbgTestPattern | ( | XEnhance * | InstancePtr | ) |
This function disables the test Pattern mode of the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
void XEnhance_EnableDbgByPass | ( | XEnhance * | InstancePtr | ) |
This sets the bypass bit of the control register to switch the core to bypass mode if debug is enabled in the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
void XEnhance_EnableDbgTestPattern | ( | XEnhance * | InstancePtr | ) |
This function sets the test-pattern mode of the Enhance core if debug features is enabled.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
void XEnhance_GetActiveSize | ( | XEnhance * | 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 XEnhance 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 XEnhance_GetDbgFrameCount | ( | XEnhance * | InstancePtr | ) |
This function gets number of frames processed since power-up or last time the core is reset.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetDbgLineCount | ( | XEnhance * | InstancePtr | ) |
This function gets the number of lines processed since power-up or last time the core is reset.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetDbgPixelCount | ( | XEnhance * | InstancePtr | ) |
This function gets the number of pixels processed since power-up or last time the core is reset.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetEdgeStrength | ( | XEnhance * | InstancePtr | ) |
This function gets the Edge Strength value for the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetHaloSuppress | ( | XEnhance * | InstancePtr | ) |
This function gets the Halo Suppress value for the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetNoiseThreshold | ( | XEnhance * | InstancePtr | ) |
This function gets the Noise Threshold value for the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
u32 XEnhance_GetVersion | ( | XEnhance * | InstancePtr | ) |
This function returns the contents of Version register.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
void XEnhance_IntrHandler | ( | void * | InstancePtr | ) |
This function is the interrupt handler for the Enhance driver.
This handler reads the pending interrupt from the IER/ISR, determines the source of the interrupts, calls according callbacks, 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 XEnhance_SetCallBack() during initialization phase.
InstancePtr | is a pointer to the XEnhance instance that just interrupted. |
int XEnhance_IsDbgByPassEnabled | ( | XEnhance * | InstancePtr | ) |
This function gets the current status of the bypass setting of the Enhance core.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
int XEnhance_IsDbgTestPatternEnabled | ( | XEnhance * | InstancePtr | ) |
This function gets the test-pattern mode if debug feature is enabled.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
XEnhance_Config* XEnhance_LookupConfig | ( | u16 | DeviceId | ) |
This function returns a reference to an XEnhance_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 xenhance_g.c. file.
DeviceId | is the unique device ID of the device for the lookup operation. |
int XEnhance_SelfTest | ( | XEnhance * | InstancePtr | ) |
This function reads complete Version register of Enhance core and compares with zero values as part of self test.
InstancePtr | is a pointer to the XEnhance instance to be worked on. |
void XEnhance_SetActiveSize | ( | XEnhance * | InstancePtr, | |
u16 | HSize, | |||
u16 | VSize | |||
) |
This function sets active H/V sizes in the Active size register.
InstancePtr | is a pointer to XEnhance 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. |
int XEnhance_SetCallBack | ( | XEnhance * | InstancePtr, | |
u32 | HandlerType, | |||
void * | CallBackFunc, | |||
void * | CallBackRef | |||
) |
This routine installs an asynchronous callback function for the given HandlerType:
HandlerType Callback Function Type ----------------------- -------------------------------- XENH_HANDLER_PROCSTART ProcStartCallBack XENH_HANDLER_FRAMEDONE FrameDoneCallBack XENH_HANDLER_ERROR ErrCallBack
InstancePtr | is a pointer to the XEnhance 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. |
void XEnhance_SetEdgeStrength | ( | XEnhance * | InstancePtr, | |
u32 | Strength | |||
) |
This function sets the Edge Strength value for the Enhance core. i.e. The amount of edge enhancement can be controlled through the programmable Enhance Strength parameter.
InstancePtr | is a pointer to XEnhance instance to be worked on. | |
Strength | is the value to set the Edge Strength of the core. |
void XEnhance_SetHaloSuppress | ( | XEnhance * | InstancePtr, | |
u32 | Suppress | |||
) |
This function sets the Halo Suppress value for the Enhance core. i.e. The amount of halo suppression can be controlled through the programmable Halo Suppress parameter.
InstancePtr | is a pointer to XEnhance instance to be worked on. | |
Suppress | is the value to set the Suppression value. |
void XEnhance_SetNoiseThreshold | ( | XEnhance * | InstancePtr, | |
u32 | Threshold | |||
) |
This function sets the Noise Threshold value for the Enhance core The amount of noise reduction can be controlled through Noise Threshold parameter.
InstancePtr | is a pointer to XEnhance instance to be worked on. | |
Threshold | is the value to set the Noise Threshold. |
void XEnhance_Setup | ( | XEnhance * | InstancePtr | ) |
This function sets the input/output frame size in Active Size register and enables the register update.
InstancePtr | is a pointer to XEnhance instance to be worked on. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.