![]() |
tmrctr
Xilinx SDK Drivers API Documentation
|
This file contains a design example using the timer counter driver (XTmCtr) and hardware device using interrupt mode.This example assumes that the interrupt controller is also present as a part of the system.
This file can be used as a standalone example or by the TestAppGen utility to include a test for Timer interrupts.
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 1.00b sn 05/09/06 Modified to be used by TestAppGen to include test for interrupts. 2.00a ktn 10/30/09 Updated to use HAL API's and minor changes as per coding guidelines. 2.00a ssb 01/11/01 Updated the example to be used with the SCUGIC in Zynq. 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 | TmrCtrIntrExample (INTC *IntcInstancePtr, XTmrCtr *TmrCtrInstancePtr, u16 DeviceId, u16 IntrId, u8 TmrCtrNumber) |
This function does a minimal test on the timer counter device and driver as a design example. More... | |
void | TimerCounterHandler (void *CallBackRef, u8 TmrCtrNumber) |
This function is the handler which performs processing for the timer counter. More... | |
void | TmrCtrDisableIntr (INTC *IntcInstancePtr, u16 IntrId) |
This function disables the interrupts for the Timer. More... | |
int | main (void) |
This function is the main function of the Tmrctr example using Interrupts. More... | |
int main | ( | void | ) |
This function is the main function of the Tmrctr example using Interrupts.
None. |
References TmrCtrIntrExample().
void TimerCounterHandler | ( | void * | CallBackRef, |
u8 | TmrCtrNumber | ||
) |
This function is the handler which performs processing for the timer counter.
It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when the timer counter expires if interrupts are enabled.
This handler provides an example of how to handle timer counter interrupts but is application specific.
CallBackRef | is a pointer to the callback function |
TmrCtrNumber | is the number of the timer to which this handler is associated with. |
References XTmrCtr_IsExpired().
void TmrCtrDisableIntr | ( | INTC * | IntcInstancePtr, |
u16 | IntrId | ||
) |
This function disables the interrupts for the Timer.
IntcInstancePtr | is a reference to the Interrupt Controller driver Instance. |
IntrId | is XPAR_<INTC_instance>_<Timer_instance>_VEC_ID value from xparameters.h. |
int TmrCtrIntrExample | ( | INTC * | IntcInstancePtr, |
XTmrCtr * | TmrCtrInstancePtr, | ||
u16 | DeviceId, | ||
u16 | IntrId, | ||
u8 | TmrCtrNumber | ||
) |
This function does a minimal test on the timer counter device and driver as a design example.
The purpose of this function is to illustrate how to use the XTmrCtr component. It initializes a timer counter and then sets it up in compare mode with auto reload such that a periodic interrupt is generated.
This function uses interrupt driven mode of the timer counter.
IntcInstancePtr | is a pointer to the Interrupt Controller driver Instance |
TmrCtrInstancePtr | is a pointer to the XTmrCtr driver Instance |
DeviceId | is the XPAR_<TmrCtr_instance>_DEVICE_ID value from xparameters.h |
IntrId | is XPAR_<INTC_instance>_<TmrCtr_instance>_INTERRUPT_INTR value from xparameters.h |
TmrCtrNumber | is the number of the timer to which this handler is associated with. |
Referenced by main().