scutimer
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Macros Groups Pages
xscutimer_polled_example.c File Reference

Overview

This file contains a design example using the Scu Private Timer driver (XScuTimer) and hardware timer device.

This test assumes Auto Reload mode is not enabled.

MODIFICATION HISTORY:

  Ver   Who  Date     Changes


1.00a nm 03/10/10 First release 2.5 dp 07/11/23 Add Support for system device tree flow 2.5 dp 09/08/23 Update example to stop timer at the end of the test 2.8 bdk 12/08/25 Updated comments to support SDT flow for Doxygen documentation. 2.9 ml 10/01/26 Fix doxygen 1.15.0 and compliance checker warnings *

#include "xparameters.h"
#include "xscutimer.h"
#include "xil_printf.h"

Macros

#define TIMER_LOAD_VALUE   0xFF
 Timer load value for polled mode example. More...
 

Functions

int ScuTimerPolledExample (XScuTimer *TimerInstancePtr, UINTPTR BaseAddress)
 This function does a minimal test on the SCU Private timer device and driver. More...
 
int main (void)
 Main function to call the Scu Private Timer polled mode example. More...
 

Variables

XScuTimer Timer
 Cortex A9 SCU Private Timer Instance. More...
 

Macro Definition Documentation

#define TIMER_LOAD_VALUE   0xFF

Timer load value for polled mode example.

Referenced by ScuTimerPolledExample().

Function Documentation

int main ( void  )

Main function to call the Scu Private Timer polled mode example.

Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful.

References ScuTimerPolledExample().

int ScuTimerPolledExample ( XScuTimer *  TimerInstancePtr,
UINTPTR  BaseAddress 
)

This function does a minimal test on the SCU Private timer device and driver.

The purpose of this function is to illustrate how to use the XScuTimer driver.

Parameters
[in]TimerInstancePtris a pointer to the XScuTimer instance
[in]BaseAddressis the base address of the device
Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XScuTimer_Config::BaseAddr, Timer, TIMER_LOAD_VALUE, XScuTimer_CfgInitialize(), XScuTimer_GetCounterValue, XScuTimer_LoadTimer, XScuTimer_LookupConfig(), XScuTimer_Start(), and XScuTimer_Stop().

Referenced by main().

Variable Documentation

XScuTimer Timer

Cortex A9 SCU Private Timer Instance.

Referenced by ScuTimerPolledExample().