MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ----------------------------------------------- 1.00a ecm 08/16/01 First release 1.00b jhl 02/21/02 Repartitioned the driver for smaller files 1.10b mta 03/21/07 Updated to new coding style 2.00a ktn 10/30/09 Updated to use HAL API's. _m is removed from all the macro definitions. 2.05a adk 15/05/13 Fixed the CR:693066 Added the IsStartedTmrCtr0/IsStartedTmrCtr1 members to the XTmrCtr instance structure. The IsStartedTmrCtrX will be assigned XIL_COMPONENT_IS_STARTED in the XTmrCtr_Start function. The IsStartedTmrCtrX will be cleared in the XTmrCtr_Stop function. There will be no Initialization done in the XTmrCtr_Initialize if both the timers have already started and the XST_DEVICE_IS_STARTED Status is returned. Removed the logic in the XTmrCtr_Initialize function which was checking the Register Value to know whether a timer has started or not.
#include "xstatus.h"
#include "xparameters.h"
#include "xtmrctr.h"
#include "xtmrctr_i.h"
Functions | |
int | XTmrCtr_Initialize (XTmrCtr *InstancePtr, u16 DeviceId) |
void | XTmrCtr_Start (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
void | XTmrCtr_Stop (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
u32 | XTmrCtr_GetValue (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
void | XTmrCtr_SetResetValue (XTmrCtr *InstancePtr, u8 TmrCtrNumber, u32 ResetValue) |
u32 | XTmrCtr_GetCaptureValue (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
void | XTmrCtr_Reset (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
int | XTmrCtr_IsExpired (XTmrCtr *InstancePtr, u8 TmrCtrNumber) |
|
Returns the timer counter value that was captured the last time the external capture input was asserted.
|
|
Get the current value of the specified timer counter. The timer counter may be either incrementing or decrementing based upon the current mode of operation.
|
|
Initializes a specific timer/counter instance/driver. Initialize fields of the XTmrCtr structure, then reset the timer/counter.If a timer is already running then it is not initialized.
|
|
Checks if the specified timer counter of the device has expired. In capture mode, expired is defined as a capture occurred. In compare mode, expired is defined as the timer counter rolled over/under for up/down counting. When interrupts are enabled, the expiration causes an interrupt. This function is typically used to poll a timer counter to determine when it has expired.
|
|
Resets the specified timer counter of the device. A reset causes the timer counter to set it's value to the reset value.
|
|
Set the reset value for the specified timer counter. This is the value that is loaded into the timer counter when it is reset. This value is also loaded when the timer counter is started.
|
|
Starts the specified timer counter of the device such that it starts running. The timer counter is reset before it is started and the reset value is loaded into the timer counter. If interrupt mode is specified in the options, it is necessary for the caller to connect the interrupt handler of the timer/counter to the interrupt source, typically an interrupt controller, and enable the interrupt within the interrupt controller.
|
|
Stops the timer counter by disabling it. It is the callers' responsibility to disconnect the interrupt handler of the timer_counter from the interrupt source, typically an interrupt controller, and disable the interrupt within the interrupt controller.
|