Software Drivers

xdeint.h File Reference

#include "xdeint_hw.h"
#include "xstatus.h"
#include "xil_assert.h"

Classes

struct  XDeint_Config
struct  XDeint

Interrupt types for setting up callbacks

#define XDEINT_HANDLER

Defines

#define XDEINT_H
#define XDeint_Enable(InstancePtr)
#define XDeint_Disable(InstancePtr)
#define XDeint_Start(InstancePtr)
#define XDeint_Stop(InstancePtr)
#define XDeint_Reset(InstancePtr)
#define XDeint_InReset(InstancePtr)
#define XDeint_RegUpdateReq(InstancePtr)
#define XDeint_IntrEnable(InstancePtr, IntrType)
#define XDeint_IntrDisable(InstancePtr, IntrType)
#define XDeint_IntrGetPending(InstancePtr)
#define XDeint_IntrClear(InstancePtr, IntrType)
#define XDeint_SetRGB(InstancePtr)
#define XDeint_SetYUV(InstancePtr)
#define XDeint_SetAlgorithm(InstancePtr, Alg)
#define XDeint_GetColorSpace(InstancePtr)
#define XDeint_GetAlgorithm(InstancePtr)

Typedefs

typedef void(*) XDeint_CallBack (u32 status)

Functions

int XDeint_ConfigInitialize (XDeint *InstancePtr, XDeint_Config *CfgPtr, u32 EffectiveAddr)
XDeint_ConfigXDeint_LookupConfig (u16 DeviceId)
void XDeint_SetFramestore (XDeint *InstancePtr, u32 FieldAddr1, u32 FieldAddr2, u32 FieldAddr3, u32 FrameSize)
void XDeint_SetSize (XDeint *InstancePtr, u32 Width, u32 Height)
void XDeint_SetPulldown (XDeint *InstancePtr, u32 Enable_32, u32 Enable_22)
void XDeint_SetThresholds (XDeint *InstancePtr, u32 ThresholdT1, u32 ThresholdT2)
void XDeint_SetVideo (XDeint *InstancePtr, u32 Packing, u32 Color, u32 Order, u32 PSF)
void XDeint_IntrHandler (void *InstancePtr)
int XDeint_SetCallBack (XDeint *InstancePtr, void *CallBackFunc)
void XDeint_GetVideo (XDeint *InstancePtr, u32 *Packing, u32 *Color, u32 *Order, u32 *PSF)
void XDeint_GetPulldown (XDeint *InstancePtr, u32 *Enable_32, u32 *Enable_22)
void XDeint_GetSize (XDeint *InstancePtr, u32 *Width, u32 *Height)
void XDeint_GetThresholds (XDeint *InstancePtr, u32 *ThresholdT1, u32 *ThresholdT2)
void XDeint_GetFramestore (XDeint *InstancePtr, u32 *FieldAddr1, u32 *FieldAddr2, u32 *FieldAddr3, u32 *FrameSize)
u32 XDeint_GetVersion (XDeint *InstancePtr)
int XDeint_Selftest (XDeint *InstancePtr)


Define Documentation

#define XDeint_Disable ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET)) & (~(XDEINT_CTL_ENABLE)))
This macro disables the Deinterlacer algorithms.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_Disable(XDeint *InstancePtr)

#define XDeint_Enable ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET)) | (XDEINT_CTL_ENABLE))
This macro enables the Deinterlacer algorithms.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_Enable(XDeint *InstancePtr)

#define XDeint_GetAlgorithm ( InstancePtr   ) 

Value:

XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_MODE_OFFSET)) & (XDEINT_MODE_ALGORITHM_FULL)
This macro gets the Deinterlacer's processing algorithm.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
Returns algorithm for deinterlacing method.
  • 0x00000000 = Pure field interpolating technique is used.
  • 0x00000001 = Diagonal engine is used.
  • 0x00000002 = Motion adaptive engine is used.
  • 0x00000003 = Motion and Diagonal engines are used.
Note:
C-style signature: u32 XDeint_GetAlgorithm(XDeint *InstancePtr)

#define XDeint_GetColorSpace ( InstancePtr   ) 

Value:

XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_MODE_OFFSET)) & (XDEINT_MODE_COL)
This macro gets the Deinterlacer's color space.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
Returns the color space. 0x00000004 - RGB color space, 0x00000000 - YUV color space.
Note:
C-style signature: u32 XDeint_GetColorSpace(XDeint *InstancePtr)

#define XDEINT_H

Prevent circular inclusions by using protection macros

#define XDEINT_HANDLER

Internal Register update done

#define XDeint_InReset ( InstancePtr   ) 

Value:

(XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                                (XDEINT_RESET_OFFSET)) & (XDEINT_RESET_RESET_MASK))
This macro returns the current soft-reset state.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
1=In Reset, 0=Ready.
Note:
C-style signature: u32 XDeint_InReset(XDeint *InstancePtr)

#define XDeint_IntrClear ( InstancePtr,
IntrType   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                                (XDEINT_ISR_OFFSET), (IntrType) & \
                                        (XDeint_IntrGetPending(InstancePtr)))
This macro clears/acknowledges pending interrupts of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
IntrType is the pending interrupts to clear/acknowledge. Use OR'ing of XDEINT_IXR_*_MASK constants defined in xdeint_hw.h to create this parameter value.
Returns:
None.
Note:
C-style signature: void XDeint_IntrClear(XDeint *InstancePtr, u32 IntrType)

#define XDeint_IntrDisable ( InstancePtr,
IntrType   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_IER_OFFSET), ((~(IntrType)) & \
                        (XDEINT_IXR_ALLINTR_MASK)) & \
        XDeint_ReadReg((InstancePtr)->Config.BaseAddress, (XDEINT_IER_OFFSET)))
This macro disables the given individual interrupt(s) on the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
IntrType is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be disabled. Bit post ions of 0 will keep the previous setting.This mask is formed by OR'ing XDEINT_IXR_*_MASK constants defined in xdeint_hw.h to create this parameter value.
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 XDeint_IntrDisable(XDeint *InstancePtr, u32 IntrType)

#define XDeint_IntrEnable ( InstancePtr,
IntrType   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_IER_OFFSET), ((IntrType) & \
                                (XDEINT_IXR_ALLINTR_MASK)) | \
        XDeint_ReadReg((InstancePtr)->Config.BaseAddress, (XDEINT_IER_OFFSET)))
This macro enables the given individual interrupt(s) on the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
IntrType is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit post ions of 0 will keep the previous setting.This mask is formed by OR'ing XDEINT_IXR_*_MASK constants defined in xdeint_hw.h to create this parameter value.
Returns:
None.
Note:
The existing enabled interrupt(s) will remain enabled.
C-style signature: void XDeint_IntrEnable(XDeint *InstancePtr, u32 IntrType)

#define XDeint_IntrGetPending ( InstancePtr   ) 

Value:

XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_IER_OFFSET)) & \
                (XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_ISR_OFFSET)) & (XDEINT_IXR_ALLINTR_MASK))
This macro returns the pending interrupts of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
The pending interrupts of the Deinterlacer core. Use XDEINT_IXR_*_MASK constants defined in xdeint_hw.h to interpret this value.
Note:
C-style signature: u32 XDeint_IntrGetPending(XDeint *InstancePtr)

#define XDeint_RegUpdateReq ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET)) | (XDEINT_CTL_UPDATE_REQ))
This macro tells the Deinterlacer core to pick up all the register value changes made so far by the software at the next frame boundary.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_RegUpdateReq(XDeint *InstancePtr)

#define XDeint_Reset ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_RESET_OFFSET), (u32)(XDEINT_RESET_RESET_MASK))
This macro soft resets the Deinterlacer to its default mode. This register will clear once the reset is complete. Software should poll here until the reset has completed. NOTE : Attempting to alter CPU registers during a soft reset will result in no register changes due to the CPU interface being reset.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_Reset(XDeint *InstancePtr)

#define XDeint_SetAlgorithm ( InstancePtr,
Alg   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_MODE_OFFSET), \
                        (XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                                (XDEINT_MODE_OFFSET)) & \
                                        (~(XDEINT_MODE_ALGORITHM_FULL))) | \
                                                (Alg))
This macro sets the Deinterlacer's processing algorithm.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Alg is a algorithm setting from XDEINT_MODE_ALGORITHM_????
Returns:
None.
Note:
C-style signature: void XDeint_SetAlgorithm(XDeint *InstancePtr, u32 Alg)

#define XDeint_SetRGB ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_MODE_OFFSET), \
                        XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_MODE_OFFSET)) | (XDEINT_MODE_COLOUR_RGB))
This macro sets the Deinterlacer's color space to RGB.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_SetRGB(XDeint *InstancePtr)

#define XDeint_SetYUV ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_MODE_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_MODE_OFFSET)) & (~(XDEINT_MODE_COLOUR_RGB)))
This macro sets the Deinterlacer's color space to YUV.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_SetYUV(XDeint *InstancePtr)

#define XDeint_Start ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XDEINT_CONTROL_OFFSET)) | (XDEINT_CTL_ACCEPT_VIDEO))
This macro enables the Deinterlacer core to accept video.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_Start(XDeint *InstancePtr)

#define XDeint_Stop ( InstancePtr   ) 

Value:

XDeint_WriteReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET), \
                XDeint_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XDEINT_CONTROL_OFFSET)) & \
                                (~(XDEINT_CTL_ACCEPT_VIDEO)))
This macro halts the Deinterlacer core on the next frame boundary.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
C-style signature: void XDeint_Stop(XDeint *InstancePtr)


Typedef Documentation

typedef void(*) XDeint_CallBack(u32 status)

Callback type for all interrupts


Function Documentation

int XDeint_ConfigInitialize ( XDeint InstancePtr,
XDeint_Config CfgPtr,
u32  EffectiveAddr 
)

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

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
CfgPtr points to the configuration structure associated with the Deinterlacer 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 XDeint_GetFramestore ( XDeint InstancePtr,
u32 *  FieldAddr1,
u32 *  FieldAddr2,
u32 *  FieldAddr3,
u32 *  FrameSize 
)

This function gets input field buffer addresses of an Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
FieldAddr1 is the pointer to the 1st input field buffer.
FieldAddr2 is the pointer to the 2nd input field buffer.
FieldAddr3 is the pointer to the 3rd input field buffer.
FrameSize is the pointer to size in 32bit words of a single field buffer.
Returns:
None.
Note:
None.

void XDeint_GetPulldown ( XDeint InstancePtr,
u32 *  Enable_32,
u32 *  Enable_22 
)

This function gets the pull down controller of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Enable_32 is a pointer which holds status of Enable_32 mode.
  • FALSE = Disabled.
  • TRUE = Enabled.
Enable_22 is a pointer which holds status of Enable_22 mode.
  • FALSE = Disabled.
  • TRUE = Enabled.
Returns:
None.
Note:
None.

void XDeint_GetSize ( XDeint InstancePtr,
u32 *  Width,
u32 *  Height 
)

This function gets the input frame size of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Width is pointer to the width of the frame.
Height is pointer to the height of the frame.
Returns:
None.
Note:
None.

void XDeint_GetThresholds ( XDeint InstancePtr,
u32 *  ThresholdT1,
u32 *  ThresholdT2 
)

This function gets the threshold used by the motion adaptive kernel.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
ThresholdT1 is the pointer to lower threshold of the motion kernel.
ThresholdT2 is the pointer to upper threshold of the motion kernel.
Returns:
None.

u32 XDeint_GetVersion ( XDeint InstancePtr  ) 

This function returns the contents of Version register.

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

void XDeint_GetVideo ( XDeint InstancePtr,
u32 *  Packing,
u32 *  Color,
u32 *  Order,
u32 *  PSF 
)

This function gets the video format of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Packing is a pointer to 32 bit variable which holds Packaging format.
  • 0 4:2:0 Packging is used.
  • XDEINT_MODE_PACKING_0 4:2:2 Packging is used.
  • XDEINT_MODE_PACKING_1 4:4:4 Packging is used.
Color is a pointer to 32 bit varaible which holds color value.
  • 0 YUV color space is used.
  • XDEINT_MODE_COL RGB color space is used.
Order is a pointer to 32 bit varaible which holds Field order.
  • 0 the field order maps to PAL/HD/3G.
  • XDEINT_MODE_FIELD_ORDER the field order maps to NTSC/480i
PSF is a pointer to 32 bit variable which says whether Psf enabled or disabled.
  • XDEINT_MODE_PSF_ENABLE for psf enable.
Returns:
None.
Note:
None.

void XDeint_IntrHandler ( void *  InstancePtr  ) 

This function is the interrupt handler for the Deinterlacer core.

This handler reads the pending interrupt from the IER/ISR, determines the source of the interrupts, calls according callback, 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 XDeint_SetCallBack() during initialization phase.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
None.
Note:
The Error interrupt callback invoked in case an error interrupt or spurious interrupt happens should reset the Deinterlacer core that just interrupted.

XDeint_Config* XDeint_LookupConfig ( u16  DeviceId  ) 

This function returns a reference to an XDeint_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 xdeint_g.c file.

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

int XDeint_Selftest ( XDeint InstancePtr  ) 

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

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

int XDeint_SetCallBack ( XDeint InstancePtr,
void *  CallBackFunc 
)

This routine installs an asynchronous callback function.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
CallBackFunc is the address of the callback function.
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 XDeint_SetFramestore ( XDeint InstancePtr,
u32  FieldAddr1,
u32  FieldAddr2,
u32  FieldAddr3,
u32  FrameSize 
)

This function sets the input field buffer addresses of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
FieldAddr1 is the address of the 1st input field buffer.
FieldAddr2 is the address of the 2nd input field buffer.
FieldAddr3 is the address of the 3rd input field buffer.
FrameSize is the size in 32bit words of a single field buffer.
Returns:
None.
Note:
None.

void XDeint_SetPulldown ( XDeint InstancePtr,
u32  Enable_32,
u32  Enable_22 
)

This function sets the pull down controller of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Enable_32 allows detectors to automatically control Deinterlacer core.
  • 1 Pull down enable 3:2
Enable_22 allows detectors to automatically control Deinterlacer core.
  • 1 Pull down enable 2:2
Returns:
None.
Note:
None.

void XDeint_SetSize ( XDeint InstancePtr,
u32  Width,
u32  Height 
)

This function sets the input frame size of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Width is the width of the frame.
Height is the height of the frame.
Returns:
None.
Note:
None.

void XDeint_SetThresholds ( XDeint InstancePtr,
u32  ThresholdT1,
u32  ThresholdT2 
)

This function sets the threshold used by the motion adaptive kernel of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
ThresholdT1 is the lower threshold of the motion kernel.
ThresholdT2 is the upper threshold of the motion kernel.
Returns:
None.
Note:
None.

void XDeint_SetVideo ( XDeint InstancePtr,
u32  Packing,
u32  Color,
u32  Order,
u32  PSF 
)

This function sets the video format of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Packing selects the XSVI video packing mode.
  • 0 4:2:0 Packging is used.
  • XDEINT_MODE_PACKING_0 4:2:2 Packging is used.
  • XDEINT_MODE_PACKING_1 4:4:4 Packging is used.
Color selects what color space to use.
  • 0 YUV color space is used.
  • XDEINT_MODE_COL RGB color space is used.
Order selects which field ordering is being used.
  • 0 the field order maps to PAL/HD/3G.
  • XDEINT_MODE_FIELD_ORDER the field order maps to NTSC/480i
PSF enables psf (progressive segmented frame mode).
  • XDEINT_MODE_PSF_ENABLE for psf enable.
Returns:
None.
Note:
None.

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