Software Drivers

xenhance.h File Reference

#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_ConfigXEnhance_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 Documentation

#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)))
This function macro disables the Image Enhancement core instance.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_Disable(XEnhance *InstancePtr)

#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))
This function macro enables the Image Enhancement core instance.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_Enable(XEnhance *InstancePtr)

#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)))
This function macro clears/acknowledges pending interrupts of a Enhance core.

Parameters:
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.
Returns:
None.
Note:
C-style signature: void XEnhance_IntrClear(XEnhance *InstancePtr, u32 IntrType)

#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))))
This function macro disables the given individual interrupt(s) on the Enhance core by updating Irq_Enable register.

Parameters:
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.
Returns:
None.
Note:
Any other interrupt not covered by parameter IntrType, if enabled before this macro is called, will remain enabled. C-style signature: void XEnhance_IntrDisable(XEnhance *InstancePtr, u32 IntrType)

#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))))
This function macro enables the given individual interrupt(s) on the Enhance core.

Parameters:
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.
Returns:
None.
Note:
The existing enabled interrupt(s) will remain enabled. C-style signature: void XEnhance_IntrEnable(XEnhance *InstancePtr, u32 IntrType)

#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))
This function macro returns the pending interrupts of a Enhance core.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK constants defined in xenhance_hw.h to interpret this value.
Note:
C-style signature: u32 XEnhance_IntrGetPending(XEnhance *InstancePtr)

#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))))
This function macro prevents the Image Enhancement core instance from committing recent changes made so far by the software. When disabled, changes to other configuration registers are stored, but do not effect the behavior of the core.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_RegUpdateDisable(XEnhance *InstancePtr)

#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))
This function macro commits all the register value changes made so far by the software to the Image Enhancement core instance.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_RegUpdateEnable(XEnhance *InstancePtr)

#define XEnhance_Reset ( InstancePtr   ) 

Value:

XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XENH_CONTROL_OFFSET), (XENH_CTL_RESET_MASK))
This function macro resets a Image Enhancement core instance. This reset effects the core immediately, and may cause image tearing.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_Reset(XEnhance *InstancePtr)

#define XEnhance_Start   XEnhance_Enable

This function macro starts the Image Enhancement core instance.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_Start(XEnhance *InstancePtr)

#define XEnhance_StatusGetPending ( InstancePtr   ) 

Value:

XEnhance_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XENH_STATUS_OFFSET)) & (XENH_IXR_ALLINTR_MASK)
This function macro returns the pending status of a Enhance core.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
The pending interrupts of the Enhance core. Use XENH_IXR_*_MASK constants defined in xenhance_hw.h to interpret this value.
Note:
C-style signature: u32 XEnhance_StatusGePending(XEnhance *InstancePtr).

#define XEnhance_Stop   XEnhance_Disable

This function macro stops the Image Enhancement core instance.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void XEnhance_Stop(XEnhance *InstancePtr)

#define XEnhance_SyncReset ( InstancePtr   ) 

Value:

XEnhance_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XENH_CONTROL_OFFSET), (XENH_CTL_AUTORESET_MASK))
This function macro resets a Image Enhancement core instance, but differs from XEnhance_Reset() in that it automatically synchronizes to the SOF input of the core to prevent tearing.

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.

Parameters:
InstancePtr is a pointer to the Enhance core instance to be worked on.
Returns:
None.
Note:
C-style signature: void Enhance_SyncReset(XEnhance *InstancePtr)


Typedef Documentation

typedef void(*) XEnhance_CallBack(void *CallBackRef)

Callback type for all interrupts except error interrupt.

Parameters:
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.

Parameters:
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


Enumeration Type Documentation

anonymous enum

These constants specify different types of handlers and used to differentiate interrupt requests from core.

Enumerator:
XENH_HANDLER_PROCSTART  A processing start event interrupt type
XENH_HANDLER_FRAMEDONE  A frame done event interrupt type
XENH_HANDLER_ERROR  An error condition event interrupt type


Function Documentation

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.

Parameters:
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.
Returns:
  • XST_SUCCESS if initialization was successful.
Note:
None.

void XEnhance_DisableDbgBypass ( XEnhance InstancePtr  ) 

This function disables Bypass mode of the Enhance core.

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

void XEnhance_DisableDbgTestPattern ( XEnhance InstancePtr  ) 

This function disables the test Pattern mode of the Enhance core.

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

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.

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

void XEnhance_EnableDbgTestPattern ( XEnhance InstancePtr  ) 

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

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

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.

Parameters:
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).
Returns:
None.
Note:
None.

u32 XEnhance_GetDbgFrameCount ( XEnhance InstancePtr  ) 

This function gets number of frames processed since power-up or last time the core is reset.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Returns:
FrameCount is the number of frames processed since power-up.
Note:
Debug functionality should be enabled.

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

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

u32 XEnhance_GetEdgeStrength ( XEnhance InstancePtr  ) 

This function gets the Edge Strength value for the Enhance core.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Returns:
The amount of edge enhancement that can be controlled.
Note:
None.

u32 XEnhance_GetHaloSuppress ( XEnhance InstancePtr  ) 

This function gets the Halo Suppress value for the Enhance core.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Returns:
The amount of halo suppression that can be controlled.
Note:
None.

u32 XEnhance_GetNoiseThreshold ( XEnhance InstancePtr  ) 

This function gets the Noise Threshold value for the Enhance core.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Returns:
The amount of noise reduction that can be controlled.
Note:
None.

u32 XEnhance_GetVersion ( XEnhance InstancePtr  ) 

This function returns the contents of Version register.

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

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.

Parameters:
InstancePtr is a pointer to the XEnhance instance that just interrupted.
Returns:
None.
Note:
Interrupt interface should be enabled.

int XEnhance_IsDbgByPassEnabled ( XEnhance InstancePtr  ) 

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

Parameters:
InstancePtr is a pointer to XEnhance 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 XEnhance_IsDbgTestPatternEnabled ( XEnhance InstancePtr  ) 

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

Parameters:
InstancePtr is a pointer to XEnhance 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.

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.

Parameters:
DeviceId is the unique device ID of the device for the lookup operation.
Returns:
XEnhance_LookupConfig returns a reference to a config record in the configuration table (in xenhance_g.c) corresponding to DeviceId, or NULL if no match is found.
Note:
None.

int XEnhance_SelfTest ( XEnhance InstancePtr  ) 

This function reads complete Version register of Enhance core and compares with zero values as part of self test.

Parameters:
InstancePtr is a pointer to the XEnhance instance to be worked on.
Returns:
  • XST_SUCCESS if the test was successful.
  • XST_FAILURE if the test failed.
Note:
None.

void XEnhance_SetActiveSize ( XEnhance InstancePtr,
u16  HSize,
u16  VSize 
)

This function sets active H/V sizes in the Active size register.

Parameters:
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.
Returns:
None.
Note:
None.

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
 

Parameters:
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.
Returns:
  • XST_SUCCESS when handler is installed.
  • XST_INVALID_PARAM when HandlerType is invalid.
Note:
Invoking this function for a handler that already has been installed replaces it with the new handler.

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.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Strength is the value to set the Edge Strength of the core.
Returns:
None.
Note:
The larger the strength, the stronger the edge enhancement.

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.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Suppress is the value to set the Suppression value.
Returns:
None.
Note:
None.

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.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Threshold is the value to set the Noise Threshold.
Returns:
None.
Note:
None.

void XEnhance_Setup ( XEnhance InstancePtr  ) 

This function sets the input/output frame size in Active Size register and enables the register update.

Parameters:
InstancePtr is a pointer to XEnhance instance to be worked on.
Returns:
None.
Note:
None.

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