![]() |
tmrctr
Vitis Drivers API Documentation
|
This file contains a design example using the Timer Counter (XTmrCtr) low level driver and hardware device in a polled mode.
None
MODIFICATION HISTORY:
Ver Who Date Changes
1.00b jhl 02/13/02 First release 1.00b sv 04/26/05 Minor changes to comply to Doxygen and coding guidelines 2.00a ktn 10/30/09 Updated the example as the macros in the driver are renamed by removing _m in the definition. Minor changes as per coding guidelines are done. 4.2 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028.
Functions | |
int | TmrCtrLowLevelExample (UINTPTR TmrCtrBaseAddress, u8 TmrCtrNumber) |
This function does a minimal test on the timer counter device and the low level driver as a design example. More... | |
int | main (void) |
This function is the main function of the Tmrctr low level example. More... | |
int main | ( | void | ) |
This function is the main function of the Tmrctr low level example.
None. |
References TmrCtrLowLevelExample().
int TmrCtrLowLevelExample | ( | UINTPTR | TmrCtrBaseAddress, |
u8 | TmrCtrNumber | ||
) |
This function does a minimal test on the timer counter device and the low level driver as a design example.
The purpose of this function is to illustrate how to use the XTmrCtr low level driver.
TmrCtrBaseAddress | is the base address of the device. |
TmrCtrNumber | is the timer counter of the device to operate on. Each device may contain multiple timer counters. The timer number is a zero based number with a range of 0 - (XTC_DEVICE_TIMER_COUNT - 1). |
This function contains a loop which waits for the value of a timer counter to change. If the hardware is not working correctly, this function may not return.
References XTC_CSR_LOAD_MASK, XTmrCtr_Disable, XTmrCtr_Enable, XTmrCtr_GetControlStatusReg, XTmrCtr_GetTimerCounterReg, XTmrCtr_LoadTimerCounterReg, XTmrCtr_SetControlStatusReg, and XTmrCtr_SetLoadReg.
Referenced by main().