Software Drivers

xvtc.h File Reference

#include "xvtc_hw.h"
#include "xil_assert.h"
#include "xstatus.h"

Classes

struct  XVtc_Config
struct  XVtc_Polarity
struct  XVtc_SourceSelect
struct  XVtc_Signal
struct  XVtc_HoriOffsets
struct  XVtc_Timing
struct  XVtc

Interrupt Types for setting up Callbacks

#define XVTC_HANDLER_FRAMESYNC   1
#define XVTC_HANDLER_LOCK   2
#define XVTC_HANDLER_DETECTOR   3
#define XVTC_HANDLER_GENERATOR   4
#define XVTC_HANDLER_ERROR   5

Options for enabling VTC modules

#define XVTC_EN_GENERATOR   1
#define XVTC_EN_DETECTOR   2

Address gap between two register next to each other

#define XVTC_REG_ADDRGAP   4
#define XVTC_VMODE_720P   1
#define XVTC_VMODE_1080P   2
#define XVTC_VMODE_480P   3
#define XVTC_VMODE_576P   4
#define XVTC_VMODE_VGA   5
#define XVTC_VMODE_SVGA   6
#define XVTC_VMODE_XGA   7
#define XVTC_VMODE_SXGA   8
#define XVTC_VMODE_WXGAPLUS   9
#define XVTC_VMODE_WSXGAPLUS   10
#define XVTC_VMODE_1080I   100
#define XVTC_VMODE_NTSC   101
#define XVTC_VMODE_PAL   102

Defines

#define XVTC_H_
#define XVtc_Reset(InstancePtr)
#define XVtc_SyncReset(InstancePtr)
#define XVtc_EnableSync(InstancePtr)
#define XVtc_RegUpdate(InstancePtr)
#define XVtc_RegUpdateEnable(InstancePtr)
#define XVtc_RegUpdateDisable(InstancePtr)
#define XVtc_DisableSync(InstancePtr)
#define XVtc_GetDetectionStatus(InstancePtr)   XVtc_ReadReg((InstancePtr)->Config.BaseAddress, (XVTC_DTSTAT_OFFSET))
#define XVtc_IntrEnable(InstancePtr, IntrType)
#define XVtc_IntrDisable(InstancePtr, IntrType)
#define XVtc_StatusGetPending(InstancePtr)
#define XVtc_IntrGetPending(InstancePtr)
#define XVtc_IntrClear(InstancePtr, IntrType)
#define XVtc_Sync_Reset   XVtc_SyncReset

Typedefs

typedef void(*) XVtc_CallBack (void *CallBackRef, u32 Mask)
typedef void(*) XVtc_ErrorCallBack (void *CallBackRef, u32 ErrorMask)

Functions

int XVtc_CfgInitialize (XVtc *InstancePtr, XVtc_Config *CfgPtr, u32 EffectiveAddr)
void XVtc_EnableGenerator (XVtc *InstancePtr)
void XVtc_EnableDetector (XVtc *InstancePtr)
void XVtc_Enable (XVtc *InstancePtr)
void XVtc_DisableGenerator (XVtc *InstancePtr)
void XVtc_DisableDetector (XVtc *InstancePtr)
void XVtc_Disable (XVtc *InstancePtr)
void XVtc_ConvVideoMode2Timing (XVtc *InstancePtr, u16 Mode, XVtc_Timing *TimingPtr)
void XVtc_ConvTiming2Signal (XVtc *InstancePtr, XVtc_Timing *TimingPtr, XVtc_Signal *SignalCfgPtr, XVtc_HoriOffsets *HOffPtr, XVtc_Polarity *PolarityPtr)
void XVtc_ConvSignal2Timing (XVtc *InstancePtr, XVtc_Signal *SignalCfgPtr, XVtc_HoriOffsets *HOffPtr, XVtc_Polarity *PolarityPtr, XVtc_Timing *TimingPtr)
u16 XVtc_ConvTiming2VideoMode (XVtc *InstancePtr, XVtc_Timing *TimingPtr)
void XVtc_SetGeneratorTiming (XVtc *InstancePtr, XVtc_Timing *TimingPtr)
void XVtc_SetGeneratorVideoMode (XVtc *InstancePtr, u16 Mode)
void XVtc_GetGeneratorTiming (XVtc *InstancePtr, XVtc_Timing *TimingPtr)
u16 XVtc_GetGeneratorVideoMode (XVtc *InstancePtr)
void XVtc_GetDetectorTiming (XVtc *InstancePtr, XVtc_Timing *TimingPtr)
u16 XVtc_GetDetectorVideoMode (XVtc *InstancePtr)
void XVtc_SetPolarity (XVtc *InstancePtr, XVtc_Polarity *PolarityPtr)
void XVtc_GetPolarity (XVtc *InstancePtr, XVtc_Polarity *PolarityPtr)
void XVtc_GetDetectorPolarity (XVtc *InstancePtr, XVtc_Polarity *PolarityPtr)
void XVtc_SetSource (XVtc *InstancePtr, XVtc_SourceSelect *SourcePtr)
void XVtc_GetSource (XVtc *InstancePtr, XVtc_SourceSelect *SourcePtr)
void XVtc_SetSkipLine (XVtc *InstancePtr, int GeneratorChromaSkip)
void XVtc_GetSkipLine (XVtc *InstancePtr, int *GeneratorChromaSkipPtr)
void XVtc_SetSkipPixel (XVtc *InstancePtr, int GeneratorChromaSkip)
void XVtc_GetSkipPixel (XVtc *InstancePtr, int *GeneratorChromaSkipPtr)
void XVtc_SetGenerator (XVtc *InstancePtr, XVtc_Signal *SignalCfgPtr)
void XVtc_GetGenerator (XVtc *InstancePtr, XVtc_Signal *SignalCfgPtr)
void XVtc_GetDetector (XVtc *InstancePtr, XVtc_Signal *SignalCfgPtr)
void XVtc_SetDelay (XVtc *InstancePtr, int VertDelay, int HoriDelay)
void XVtc_GetDelay (XVtc *InstancePtr, int *VertDelayPtr, int *HoriDelayPtr)
void XVtc_SetFSync (XVtc *InstancePtr, u16 FrameSyncIndex, u16 VertStart, u16 HoriStart)
void XVtc_GetFSync (XVtc *InstancePtr, u16 FrameSyncIndex, u16 *VertStartPtr, u16 *HoriStartPtr)
void XVtc_SetGeneratorHoriOffset (XVtc *InstancePtr, XVtc_HoriOffsets *HoriOffset)
void XVtc_GetGeneratorHoriOffset (XVtc *InstancePtr, XVtc_HoriOffsets *HoriOffset)
void XVtc_GetDetectorHoriOffset (XVtc *InstancePtr, XVtc_HoriOffsets *HoriOffset)
u32 XVtc_GetVersion (XVtc *InstancePtr)
XVtc_ConfigXVtc_LookupConfig (u16 DeviceId)
void XVtc_IntrHandler (void *InstancePtr)
int XVtc_SetCallBack (XVtc *InstancePtr, u32 IntrType, void *CallBackFunc, void *CallBackRef)


Define Documentation

#define XVtc_DisableSync ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                (XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XVTC_CTL_OFFSET)) & ~(XVTC_CTL_SE_MASK)))
This function macro disables synchronization of the Generator with the Detector on the given VTC core.

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

#define XVTC_EN_DETECTOR   2

To enable detector

#define XVTC_EN_GENERATOR   1

To enable generator

#define XVtc_EnableSync ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XVTC_CTL_OFFSET)) | (XVTC_CTL_SE_MASK))
This function macro enables synchronization of the Generator with the Detector on the given VTC core.

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

#define XVtc_GetDetectionStatus ( InstancePtr   )     XVtc_ReadReg((InstancePtr)->Config.BaseAddress, (XVTC_DTSTAT_OFFSET))

This function macro gets the status of the Detector in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC core instance to be worked on.
Returns:
The Detector status. Use XVTC_DS_* in xvtc_hw.h to interpret the returned value.
Note:
C-style signature: u32 XVtc_GetDetectionStatus(XVtc *InstancePtr)

#define XVTC_H_

Prevent circular inclusions by using protection macros

#define XVTC_HANDLER_DETECTOR   3

A detector event interrupt type

#define XVTC_HANDLER_ERROR   5

An error condition interrupt type

#define XVTC_HANDLER_FRAMESYNC   1

A frame sync event interrupt type

#define XVTC_HANDLER_GENERATOR   4

A generator event interrupt type

#define XVTC_HANDLER_LOCK   2

A signal lock event interrupt type

#define XVtc_IntrClear ( InstancePtr,
IntrType   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_ISR_OFFSET), \
                ((IntrType) & (XVTC_IXR_ALLINTR_MASK)))
This function macro clears/acknowledges pending interrupts of the VTC core in the Status register. Bit positions of 1 will be cleared.

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

#define XVtc_IntrDisable ( InstancePtr,
IntrType   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_IER_OFFSET), \
                XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                (XVTC_IER_OFFSET)) & ((~(IntrType)) & (XVTC_IXR_ALLINTR_MASK)))
This function macro disables individual interrupts of the VTC core by updating the IRQ_ENABLE register.

Parameters:
InstancePtr is a pointer to the VTC 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 XVTC_IXR_*_MASK bits defined in xvtc_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 XVtc_IntrDisable(XVtc *InstancePtr, u32 IntrType)

#define XVtc_IntrEnable ( InstancePtr,
IntrType   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_IER_OFFSET), \
                (((IntrType) & (XVTC_IXR_ALLINTR_MASK)) | \
                        (XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                                (XVTC_IER_OFFSET)))))
This function macro enables individual interrupts of the VTC core by updating the IRQ_ENABLE register.

Parameters:
InstancePtr is a pointer to the VTC 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 XVTC_IXR_*_MASK bits defined in xvtc_hw.h.
Returns:
None.
Note:
The existing enabled interrupt(s) will remain enabled. C-style signature: void XVtc_IntrEnable(XVtc *InstancePtr, u32 IntrType)

#define XVtc_IntrGetPending ( InstancePtr   ) 

Value:

(XVtc_ReadReg((InstancePtr)->Config.BaseAddress, XVTC_IER_OFFSET) & \
         XVtc_ReadReg((InstancePtr)->Config.BaseAddress, XVTC_ISR_OFFSET) & \
         XVTC_IXR_ALLINTR_MASK)
This function macro returns the pending interrupts of the VTC core for the interrupts that have been enabled.

Parameters:
InstancePtr is a pointer to the VTC core instance to be worked on.
Returns:
The pending interrupts of the VTC core. Use XVTC_IXR_*_MASK constants defined in xvtc_hw.h to interpret this value. The returned value is a logical AND of the contents of the STATUS Register and the IRQ_ENABLE Register.
Note:
C-style signature: u32 XVtc_IntrGetPending(XVtc *InstancePtr)

#define XVTC_REG_ADDRGAP   4

Register address gap

#define XVtc_RegUpdate ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XVTC_CTL_OFFSET)) | (XVTC_CTL_RU_MASK))
This function macro enables updating timing registers at the end of each Generator frame. (DEPRECATED - replaced with XVtc_RegUpdateEnable).

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

#define XVtc_RegUpdateDisable ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XVTC_CTL_OFFSET)) & (~(XVTC_CTL_RU_MASK)))
This function macro disables updating timing registers at the end of each Generator frame.

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

#define XVtc_RegUpdateEnable ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                XVtc_ReadReg((InstancePtr)->Config.BaseAddress, \
                        (XVTC_CTL_OFFSET)) | (XVTC_CTL_RU_MASK))
This function macro enables updating timing registers at the end of each Generator frame.

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

#define XVtc_Reset ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                        (XVTC_CTL_RESET_MASK))
This function macro resets the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
Returns:
None.
Note:
C-style signature: void XVtc_Reset(XVtc *InstancePtr)

#define XVtc_StatusGetPending ( InstancePtr   ) 

Value:

XVtc_ReadReg((InstancePtr)->Config.BaseAddress, (XVTC_ISR_OFFSET)) & \
                (XVTC_IXR_ALLINTR_MASK)
This function macro returns the pending interrupt status of the VTC core read from the Status register.

Parameters:
InstancePtr is a pointer to the VTC core instance to be worked on.
Returns:
The status of pending interrupts of the VTC core. Use XVTC_IXR_*_MASK constants defined in xvtc_hw.h to interpret this value.
Note:
C-style signature: u32 XVtc_StatusGePending(XVtc *InstancePtr)

#define XVtc_Sync_Reset   XVtc_SyncReset

This function macro resets the VTC core after the next input frame is complete.

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

#define XVtc_SyncReset ( InstancePtr   ) 

Value:

XVtc_WriteReg((InstancePtr)->Config.BaseAddress, (XVTC_CTL_OFFSET), \
                (XVTC_CTL_SRST_MASK))
This function macro resets the VTC core after the next input frame is complete.

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

#define XVTC_VMODE_1080I   100

Video mode 1080I

#define XVTC_VMODE_1080P   2

Video mode 1080P

#define XVTC_VMODE_480P   3

Video mode 480P

#define XVTC_VMODE_576P   4

Video mode 576P

#define XVTC_VMODE_720P   1

Video mode 720P

#define XVTC_VMODE_NTSC   101

Video mode NTSC

#define XVTC_VMODE_PAL   102

Video mode PAL

#define XVTC_VMODE_SVGA   6

Video mode SVGA

#define XVTC_VMODE_SXGA   8

Video mode SXGA

#define XVTC_VMODE_VGA   5

Video mode VGA

#define XVTC_VMODE_WSXGAPLUS   10

Video mode WSXGAPlus

#define XVTC_VMODE_WXGAPLUS   9

Video mode WXGAPlus

#define XVTC_VMODE_XGA   7

Video mode XGA


Typedef Documentation

typedef void(*) XVtc_CallBack(void *CallBackRef, u32 Mask)

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.
Mask is a bit mask indicating the cause of the event. For current core version, this parameter is "OR" of 0 or more XVTC_IXR_*_MASK constants defined in xvtc_hw.h.
Returns:
None.
Note:
None.

typedef void(*) XVtc_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. For current core version, this parameter always have value 0 and could be ignored.
Returns:
None.
Note:
None.


Function Documentation

int XVtc_CfgInitialize ( XVtc InstancePtr,
XVtc_Config CfgPtr,
u32  EffectiveAddr 
)

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

Parameters:
InstancePtr is a pointer to the VTC core instance to be worked on.
CfgPtr points to the configuration structure associated with the VTC core.
EffectiveAddr is the base address of the device. 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 XVtc_CfgInitialize was successful.
Note:
None.

void XVtc_ConvSignal2Timing ( XVtc InstancePtr,
XVtc_Signal SignalCfgPtr,
XVtc_HoriOffsets HOffPtr,
XVtc_Polarity PolarityPtr,
XVtc_Timing TimingPtr 
)

This function converts the VTC signal structure, horizontal offsets structure and the polarity structure into the Video Timing structure.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
SignalCfgPtr is a pointer to a VTC signal configuration to be read
HOffPtr is a pointer to a VTC horizontal offsets structure to be read
PolarityPtr is a pointer to a VTC polarity structure to be read.
TimingPtr is a pointer to a Video Timing structure to be set.
Returns:
None.
Note:
None.

void XVtc_ConvTiming2Signal ( XVtc InstancePtr,
XVtc_Timing TimingPtr,
XVtc_Signal SignalCfgPtr,
XVtc_HoriOffsets HOffPtr,
XVtc_Polarity PolarityPtr 
)

This function converts the video timing structure into the VTC signal configuration structure, horizontal offsets structure and the polarity structure.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
TimingPtr is a pointer to a Video Timing structure to be read.
SignalCfgPtr is a pointer to a VTC signal configuration to be set.
HOffPtr is a pointer to a VTC horizontal offsets structure to be set.
PolarityPtr is a pointer to a VTC polarity structure to be set.
Returns:
None.
Note:
None.

u16 XVtc_ConvTiming2VideoMode ( XVtc InstancePtr,
XVtc_Timing TimingPtr 
)

This function converts the video timing structure into predefined video mode values returned as a short integer.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
TimingPtr is a pointer to a Video Timing structure to be read.
Returns:
VideoMode is the video mode of the VTC core.
Note:
None.

void XVtc_ConvVideoMode2Timing ( XVtc InstancePtr,
u16  Mode,
XVtc_Timing TimingPtr 
)

This function converts the video mode integer into the video timing information stored within the XVtc_Timing pointer.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
Mode is a u16 int defined as macro to one of the predefined Video Modes.
TimingPtr is a pointer to a VTC Video Timing Structure.
Returns:
None.
Note:
None.

void XVtc_Disable ( XVtc InstancePtr  ) 

This function disables the Detector and Generator at same time of the VTC core.

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

void XVtc_DisableDetector ( XVtc InstancePtr  ) 

This function disables the VTC Detector core.

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

void XVtc_DisableGenerator ( XVtc InstancePtr  ) 

This function disables the VTC Generator core.

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

void XVtc_Enable ( XVtc InstancePtr  ) 

This function enables the Detector and Generator at same time of the VTC core.

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

void XVtc_EnableDetector ( XVtc InstancePtr  ) 

This function enables the VTC Detector core

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

void XVtc_EnableGenerator ( XVtc InstancePtr  ) 

This function enables the VTC Generator core.

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

void XVtc_GetDelay ( XVtc InstancePtr,
int *  VertDelayPtr,
int *  HoriDelayPtr 
)

This function gets the Generator delay setting used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
VertDelayPtr will point to a value indicating the number of total lines per frame to delay the generator output after this function returns.
HoriDelayPtr will point to a value indicating the number of total clock cycles per line to delay the generator output after this function returns.
Returns:
None.
Note:
None.

void XVtc_GetDetector ( XVtc InstancePtr,
XVtc_Signal SignalCfgPtr 
)

This function gets the VTC signal setting used by the Detector module in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
SignalCfgPtr is a pointer to a VTC signal configuration which will be populated with the setting used by the Detector module in the VTC core once this function returns.
Returns:
None.
Note:
None.

void XVtc_GetDetectorHoriOffset ( XVtc InstancePtr,
XVtc_HoriOffsets HoriOffsets 
)

This function gets the VBlank/VSync Horizontal Offsets detected by the Detector in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
HoriOffsets points to a VBlank/VSync Horizontal Offset configuration structure that will be populated with the setting detected on the Detector in the given VTC device after this function returns.
Returns:
None.
Note:
None.

void XVtc_GetDetectorPolarity ( XVtc InstancePtr,
XVtc_Polarity PolarityPtr 
)

This function gets the input polarity setting used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
PolarityPtr points to a Polarity configuration structure that will be populated with the setting used on the VTC core after this function returns.
Returns:
None.
Note:
None.

void XVtc_GetDetectorTiming ( XVtc InstancePtr,
XVtc_Timing TimingPtr 
)

This function gets the video timing structure settings currently reported by the detector in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
TimingPtr is a pointer to a Video Timing structure to be set.
Returns:
None.
Note:
None.

u16 XVtc_GetDetectorVideoMode ( XVtc InstancePtr  ) 

This function gets the video mode currently reported by the detector in the VTC core. If the video mode is unknown or not recognized, then 0 will be returned.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
Returns:
VideoMode is the video mode of the VTC core.
Note:
None.

void XVtc_GetFSync ( XVtc InstancePtr,
u16  FrameSyncIndex,
u16 *  VertStartPtr,
u16 *  HoriStartPtr 
)

This function gets the SYNC setting of a frame sync used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
FrameSyncIndex indicates the index number of the frame sync. The valid range is from 0 to 15.
VertStartPtr will point to the value that indicates the vertical line count during which the frame sync is active once this function returns.
HoriStartPtr will point to the value that indicates the horizontal cycle count during which the frame sync is active once this function returns.
Returns:
None.

void XVtc_GetGenerator ( XVtc InstancePtr,
XVtc_Signal SignalCfgPtr 
)

This function gets the VTC signal setting used by the Generator module in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
SignalCfgPtr is a pointer to a VTC signal configuration which will be populated with the setting used by the Generator module in the VTC core once this function returns.
Returns:
None.
Note:
None.

void XVtc_GetGeneratorHoriOffset ( XVtc InstancePtr,
XVtc_HoriOffsets HoriOffsets 
)

This function gets the VBlank/VSync Horizontal Offsets currently used by the Generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
HoriOffsets points to a VBlank/VSync Horizontal Offset configuration structure that will be populated with the setting currently used on the Generator in the given VTC device after this function returns.
Returns:
None.
Note:
None.

void XVtc_GetGeneratorTiming ( XVtc InstancePtr,
XVtc_Timing TimingPtr 
)

This function gets the video timing structure settings currently used by generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
TimingPtr is a pointer to a Video Timing Structure to be set.
Returns:
None.
Note:
None.

u16 XVtc_GetGeneratorVideoMode ( XVtc InstancePtr  ) 

This function gets the video mode currently used by the generator in the VTC core. If the video mode is unknown or not recognized, then 0 will be returned.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
Returns:
VideoMode is the video mode of the VTC core.
Note:
Note.

void XVtc_GetPolarity ( XVtc InstancePtr,
XVtc_Polarity PolarityPtr 
)

This function gets the output polarity setting used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
PolarityPtr points to a Polarity configuration structure that will be populated with the setting used on the VTC core after this function returns.
Returns:
None.
Note:
None.

void XVtc_GetSkipLine ( XVtc InstancePtr,
int *  GeneratorChromaSkipPtr 
)

This function gets the line skip setting used by the Generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
GeneratorChromaSkipPtr will point to the value indicating whether one line is skipped between active chroma for the Generator module after this function returns. Value 1 means that 1 line is skipped and zero means that no lines are skipped.
Returns:
None.
Note:
None.

void XVtc_GetSkipPixel ( XVtc InstancePtr,
int *  GeneratorChromaSkipPtr 
)

This function gets the pixel skip setting used by the Generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
GeneratorChromaSkipPtr will point to the value indicating whether one pixel is skipped between active chroma for the Generator module after this function returns. Value 1 means that 1 pixel is skipped and zero means that no pixels are skipped.
Returns:
None.
Note:
None.

void XVtc_GetSource ( XVtc InstancePtr,
XVtc_SourceSelect SourcePtr 
)

This function gets the source select setting used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
SourcePtr points to a source select configuration structure that will be populated with the setting used on the VTC core after this function returns.
Returns:
None.
Note:
None.

u32 XVtc_GetVersion ( XVtc InstancePtr  ) 

This function facilitates software identification of exact version of the VTC hardware (h/w).

Parameters:
InstancePtr is a pointer to the XVtc instance.
Returns:
Version, contents of a Version register.
Note:
None.

void XVtc_IntrHandler ( void *  InstancePtr  ) 

This function is the interrupt handler for the VTC core.

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 XVtc_SetCallBack() during initialization phase.

Parameters:
InstancePtr is a pointer to the XVtc instance that just interrupted.
Returns:
None.
Note:
None.

XVtc_Config* XVtc_LookupConfig ( u16  DeviceId  ) 

This function returns a reference to an XVtc_Config structure based on the core id, DeviceId. The return value will refer to an entry in the device configuration table defined in the xvtc_g.c file.

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

int XVtc_SetCallBack ( XVtc InstancePtr,
u32  HandlerType,
void *  CallBackFunc,
void *  CallBackRef 
)

This routine installs an asynchronous callback function for the given HandlerType:

 HandlerType              Callback Function Type
 -----------------------  --------------------------------------------------
 XVTC_HANDLER_FRAMESYNC   XVtc_FrameSyncCallBack
 XVTC_HANDLER_LOCK        XVtc_LockCallBack
 XVTC_HANDLER_DETECTOR    XVtc_DetectorCallBack
 XVTC_HANDLER_GENERATOR   XVtc_GeneratorCallBack
 XVTC_HANDLER_ERROR       XVtc_ErrCallBack

 HandlerType              Invoked by this driver when:
 -----------------------  --------------------------------------------------
 XVTC_HANDLER_FRAMESYNC   A frame sync event happens
 XVTC_HANDLER_LOCK        A signal lock event happens
 XVTC_HANDLER_DETECTOR    A detector related event happens
 XVTC_HANDLER_GENERATOR   A generator related event happens
 XVTC_HANDLER_ERROR       An error condition happens
 

Parameters:
InstancePtr is a pointer to the XVtc 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 XVtc_SetDelay ( XVtc InstancePtr,
int  VertDelay,
int  HoriDelay 
)

This function sets up the Generator delay setting of the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
VertDelay indicates the number of total lines per frame to delay the generator output. The valid range is from 0 to 4095.
HoriDelay indicates the number of total clock cycles per line to delay the generator output. The valid range is from 0 to 4095.
Returns:
None.
Note:
None.

void XVtc_SetFSync ( XVtc InstancePtr,
u16  FrameSyncIndex,
u16  VertStart,
u16  HoriStart 
)

This function sets up the SYNC setting of a frame sync used by the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
FrameSyncIndex indicates the index number of the frame sync. The valid range is from 0 to 15.
VertStart indicates the vertical line count during which the frame sync is active. The valid range is from 0 to 4095.
HoriStart indicates the horizontal cycle count during which the frame sync is active. The valid range is from 0 to 4095.
Returns:
None.
Note:
None.

void XVtc_SetGenerator ( XVtc InstancePtr,
XVtc_Signal SignalCfgPtr 
)

This function sets up VTC signal to be used by the Generator module in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
SignalCfgPtr is a pointer to the VTC signal configuration to be used by the Generator module in the VTC core.
Returns:
None.
Note:
None.

void XVtc_SetGeneratorHoriOffset ( XVtc InstancePtr,
XVtc_HoriOffsets HoriOffsets 
)

This function sets the VBlank/VSync Horizontal Offsets for the Generator in a VTC device.

Parameters:
InstancePtr is a pointer to the VTC device instance to be worked on.
HoriOffsets points to a VBlank/VSync Horizontal Offset configuration with the setting to use on the VTC device.
Returns:
NONE.

void XVtc_SetGeneratorTiming ( XVtc InstancePtr,
XVtc_Timing TimingPtr 
)

This function sets up the generator (Polarity, H/V values and horizontal offsets) by reading the configuration from a video timing structure.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
TimingPtr is a pointer to a Video Timing Structure to be read.
Returns:
None.
Note:
None.

void XVtc_SetGeneratorVideoMode ( XVtc InstancePtr,
u16  Mode 
)

This function sets up the generator (Polarity, H/V values and horizontal offsets) by reading the configuration from a video mode short integer.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
Mode is a short integer predefined video mode.
Returns:
None.
Note:
None.

void XVtc_SetPolarity ( XVtc InstancePtr,
XVtc_Polarity PolarityPtr 
)

This function sets up the output polarity of the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
PolarityPtr points to a Polarity configuration structure with the setting to use on the VTC core.
Returns:
None.
Note:
None.

void XVtc_SetSkipLine ( XVtc InstancePtr,
int  GeneratorChromaSkip 
)

This function sets up the line skip setting of the Generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
GeneratorChromaSkip indicates whether to skip 1 line between active chroma for the Generator module. Use Non-0 value for this parameter to skip 1 line, and 0 to not skip lines.
Returns:
None.
Note:
None.

void XVtc_SetSkipPixel ( XVtc InstancePtr,
int  GeneratorChromaSkip 
)

This function sets up the pixel skip setting of the Generator in the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on.
GeneratorChromaSkip indicates whether to skip 1 pixel between active chroma for the Generator module. Use Non-0 value for this parameter to skip 1 pixel, and 0 to not skip pixels
Returns:
None.
Note:
None.

void XVtc_SetSource ( XVtc InstancePtr,
XVtc_SourceSelect SourcePtr 
)

This function sets up the source selecting of the VTC core.

Parameters:
InstancePtr is a pointer to the VTC instance to be worked on
SourcePtr points to a Source Selecting configuration structure with the setting to use on the VTC device.
Returns:
None.
Note:
None.

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