#include "xstatus.h"
#include "xscutimer_hw.h"
Classes | |
struct | XScuTimer_Config |
struct | XScuTimer |
Defines | |
#define | XSCUTIMER_H |
#define | XScuTimer_IsExpired(InstancePtr) |
#define | XScuTimer_RestartTimer(InstancePtr) |
#define | XScuTimer_LoadTimer(InstancePtr, Value) |
#define | XScuTimer_GetCounterValue(InstancePtr) |
#define | XScuTimer_EnableAutoReload(InstancePtr) |
#define | XScuTimer_DisableAutoReload(InstancePtr) |
#define | XScuTimer_EnableInterrupt(InstancePtr) |
#define | XScuTimer_DisableInterrupt(InstancePtr) |
#define | XScuTimer_GetInterruptStatus(InstancePtr) |
#define | XScuTimer_ClearInterruptStatus(InstancePtr) |
Functions | |
XScuTimer_Config * | XScuTimer_LookupConfig (u16 DeviceId) |
int | XScuTimer_SelfTest (XScuTimer *InstancePtr) |
int | XScuTimer_CfgInitialize (XScuTimer *InstancePtr, XScuTimer_Config *ConfigPtr, u32 EffectiveAddress) |
void | XScuTimer_Start (XScuTimer *InstancePtr) |
void | XScuTimer_Stop (XScuTimer *InstancePtr) |
void | XScuTimer_SetPrescaler (XScuTimer *InstancePtr, u8 PrescalerValue) |
u8 | XScuTimer_GetPrescaler (XScuTimer *InstancePtr) |
#define XScuTimer_ClearInterruptStatus | ( | InstancePtr | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_ISR_OFFSET, XSCUTIMER_ISR_EVENT_FLAG_MASK)
This function clears the interrupt status.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_DisableAutoReload | ( | InstancePtr | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET, \ (XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET) & \ ~(XSCUTIMER_CONTROL_AUTO_RELOAD_MASK)))
Disable auto-reload mode.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_DisableInterrupt | ( | InstancePtr | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET, \ (XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET) & \ ~(XSCUTIMER_CONTROL_IRQ_ENABLE_MASK)))
Disable the Timer interrupt.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_EnableAutoReload | ( | InstancePtr | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET, \ (XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET) | \ XSCUTIMER_CONTROL_AUTO_RELOAD_MASK))
Enable auto-reload mode.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_EnableInterrupt | ( | InstancePtr | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET, \ (XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_CONTROL_OFFSET) | \ XSCUTIMER_CONTROL_IRQ_ENABLE_MASK))
Enable the Timer interrupt.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_GetCounterValue | ( | InstancePtr | ) |
XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_COUNTER_OFFSET)
Returns the current timer counter register value. It can be called at any time.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_GetInterruptStatus | ( | InstancePtr | ) |
XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_ISR_OFFSET)
This function reads the interrupt status.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XSCUTIMER_H |
#define XScuTimer_IsExpired | ( | InstancePtr | ) |
((XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_ISR_OFFSET) & \ XSCUTIMER_ISR_EVENT_FLAG_MASK) == \ XSCUTIMER_ISR_EVENT_FLAG_MASK)
Check if the timer has expired.
InstancePtr | is a pointer to the XScuTimer instance. |
#define XScuTimer_LoadTimer | ( | InstancePtr, | |||
Value | ) |
XScuTimer_WriteReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_LOAD_OFFSET, Value)
Write to the timer load register. This will also update the timer counter register with the new value. This macro can be used to change the time-out value.
InstancePtr | is a pointer to the XScuTimer instance. | |
Value | is the count to be loaded in to the load register. |
#define XScuTimer_RestartTimer | ( | InstancePtr | ) |
XScuTimer_LoadTimer(InstancePtr, \ XScuTimer_ReadReg((InstancePtr)->Config.BaseAddr, \ XSCUTIMER_LOAD_OFFSET))
Re-start the timer. This macro will read the timer load register and writes the same value to load register to update the counter register.
InstancePtr | is a pointer to the XScuTimer instance. |
int XScuTimer_CfgInitialize | ( | XScuTimer * | InstancePtr, | |
XScuTimer_Config * | ConfigPtr, | |||
u32 | EffectiveAddress | |||
) |
Initialize a specific timer instance/driver. This function must be called before other functions of the driver are called.
InstancePtr | is a pointer to the XScuTimer instance. | |
ConfigPtr | points to the XScuTimer configuration structure. | |
EffectiveAddress | is the base address for the device. It could be a virtual address if address translation is supported in the system, otherwise it is the physical address. |
u8 XScuTimer_GetPrescaler | ( | XScuTimer * | InstancePtr | ) |
This function returns the current prescaler value.
InstancePtr | is a pointer to the XScuTimer instance. |
XScuTimer_Config* XScuTimer_LookupConfig | ( | u16 | DeviceId | ) |
Lookup the device configuration based on the unique device ID. The table contains the configuration info for each device in the system.
DeviceId | is the unique device ID of the device being looked up. |
int XScuTimer_SelfTest | ( | XScuTimer * | InstancePtr | ) |
Run a self-test on the timer. This test clears the timer enable bit in the control register, writes to the timer load register and verifies the value read back matches the value written and restores the control register and the timer load register.
InstancePtr | is a pointer to the XScuTimer instance. |
void XScuTimer_SetPrescaler | ( | XScuTimer * | InstancePtr, | |
u8 | PrescalerValue | |||
) |
This function sets the prescaler bits in the timer control register.
InstancePtr | is a pointer to the XScuTimer instance. | |
PrescalerValue | is a 8 bit value that sets the prescaler to use. |
void XScuTimer_Start | ( | XScuTimer * | InstancePtr | ) |
Start the timer.
InstancePtr | is a pointer to the XScuTimer instance. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.