ttcps
Vitis Drivers API Documentation
xttcps.h File Reference

Data Structures

struct  XTtcPs_Config
 This typedef contains configuration information for the device. More...
 
struct  XTtcPs
 The XTtcPs driver instance data. More...
 

Macros

#define XTtcPs_Start(InstancePtr)
 This function starts the counter/timer without resetting the counter value. More...
 
#define XTtcPs_Stop(InstancePtr)
 This function stops the counter/timer. More...
 
#define XTtcPs_IsStarted(InstancePtr)
 This function checks whether the timer counter has already started. More...
 
#define XTtcPs_GetCounterValue(InstancePtr)   (u16)InstReadReg((InstancePtr), XTTCPS_COUNT_VALUE_OFFSET)
 This function returns the current 16-bit counter value. More...
 
#define XTtcPs_SetInterval(InstancePtr, Value)   InstWriteReg((InstancePtr), XTTCPS_INTERVAL_VAL_OFFSET, (Value))
 This function sets the interval value to be used in interval mode. More...
 
#define XTtcPs_GetInterval(InstancePtr)   (u16)InstReadReg((InstancePtr), XTTCPS_INTERVAL_VAL_OFFSET)
 This function gets the interval value from the interval register. More...
 
#define XTtcPs_ResetCounterValue(InstancePtr)
 This macro resets the count register. More...
 
#define XTtcPs_EnableInterrupts(InstancePtr, InterruptMask)
 This function enables the interrupts. More...
 
#define XTtcPs_DisableInterrupts(InstancePtr, InterruptMask)
 This function disables the interrupts. More...
 
#define XTtcPs_GetInterruptStatus(InstancePtr)   InstReadReg((InstancePtr), XTTCPS_ISR_OFFSET)
 This function reads the interrupt status. More...
 
#define XTtcPs_ClearInterruptStatus(InstancePtr, InterruptMask)
 This function clears the interrupt status. More...
 
Configuration options

Options for the device.

Each of the options is bit field, so more than one options can be specified.

#define XTTCPS_OPTION_EXTERNAL_CLK   0x00000001U
 External clock source. More...
 
#define XTTCPS_OPTION_CLK_EDGE_NEG   0x00000002U
 Clock on trailing edge for external clock. More...
 
#define XTTCPS_OPTION_INTERVAL_MODE   0x00000004U
 Interval mode. More...
 
#define XTTCPS_OPTION_DECREMENT   0x00000008U
 Decrement the counter. More...
 
#define XTTCPS_OPTION_MATCH_MODE   0x00000010U
 Match mode. More...
 
#define XTTCPS_OPTION_WAVE_DISABLE   0x00000020U
 No waveform output. More...
 
#define XTTCPS_OPTION_WAVE_POLARITY   0x00000040U
 Waveform polarity. More...
 

Typedefs

typedef u16 XInterval
 This typedef contains interval count and Match register value. More...
 

Functions

XTtcPs_ConfigXTtcPs_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 
s32 XTtcPs_CfgInitialize (XTtcPs *InstancePtr, XTtcPs_Config *ConfigPtr, u32 EffectiveAddr)
 Initializes a specific XTtcPs instance such that the driver is ready to use. More...
 
u32 XTtcPs_Release (XTtcPs *InstancePtr)
 This routine releases resources of XTtcPs instance/driver. More...
 
void XTtcPs_SetMatchValue (XTtcPs *InstancePtr, u8 MatchIndex, XMatchRegValue Value)
 This function is used to set the match registers. More...
 
XMatchRegValue XTtcPs_GetMatchValue (XTtcPs *InstancePtr, u8 MatchIndex)
 This function is used to get the value of the match registers. More...
 
void XTtcPs_SetPrescaler (XTtcPs *InstancePtr, u8 PrescalerValue)
 This function sets the prescaler enable bit and if needed sets the prescaler bits in the control register. More...
 
u8 XTtcPs_GetPrescaler (XTtcPs *InstancePtr)
 This function gets the input clock prescaler. More...
 
void XTtcPs_CalcIntervalFromFreq (XTtcPs *InstancePtr, u32 Freq, XInterval *Interval, u8 *Prescaler)
 This function calculates the interval value as well as the prescaler value for a given frequency. More...
 
s32 XTtcPs_SetOptions (XTtcPs *InstancePtr, u32 Options)
 This function sets the options for the TTC device. More...
 
u32 XTtcPs_GetOptions (XTtcPs *InstancePtr)
 This function gets the settings for the options for the TTC device. More...
 
s32 XTtcPs_SelfTest (XTtcPs *InstancePtr)
 Runs a self-test on the driver/device. More...
 
u32 XTtcPs_InterruptHandler (XTtcPs *InstancePtr)
 Handles interrupts by resetting the counter value and clearing the status register. More...
 
void XTtcPs_SetStatusHandler (XTtcPs *InstancePtr, void *CallBackRef, XTtcPs_StatusHandler FuncPointer)
 Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software. More...