tmrctr
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups Pages
xtmrctr_selftest_example.c File Reference

Overview

This file contains a example for using the Timer Counter hardware and driver.

Note

None

MODIFICATION HISTORY:
Ver   Who  Date  Changes


1.00a sv 04/25/05 Initial release for TestApp integration. 2.00a ktn 11/26/09 Minor changes as per coding guidelines. 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. 4.15 bdk 12/08/25 Updated comments to support SDT flow for Doxygen documentation.

#include "xtmrctr.h"
#include "xil_printf.h"
#include "xparameters.h"

Functions

int TmrCtrSelfTestExample (UINTPTR BaseAddr)
 This function does a minimal test on the TmrCtr device and driver as a design example. More...
 
int main (void)
 Main function to call the example. More...
 

Function Documentation

int main ( void  )

Main function to call the example.

This function is not included if the example is generated from the TestAppGen test tool.

Parameters
None
Returns
XST_SUCCESS to indicate success, else XST_FAILURE to indicate a Failure.
Note
None

References TmrCtrSelfTestExample().

int TmrCtrSelfTestExample ( UINTPTR  BaseAddr)

This function does a minimal test on the TmrCtr device and driver as a design example.

The purpose of this function is to illustrate how to use the XTmrCtr component.

Parameters
BaseAddris the base address of the device
TmrCtrNumberis 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).
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XTmrCtr_Initialize(), and XTmrCtr_SelfTest().

Referenced by main().