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

Overview

This file contains a design example using the Cortex A9 Scu Private Timer and the driver (XScuTimer) using interrupts.

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.6 ml 12/07/23 Make TimerExpired as a static variable. 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 "xinterrupt_wrap.h"
#include "xil_exception.h"
#include "xil_printf.h"

Macros

#define TIMER_LOAD_VALUE   0xFFFF
 Timer load value for interrupt example. More...
 

Functions

int ScuTimerIntrExample (XScuTimer *TimerInstancePtr, UINTPTR BaseAddress)
 This function tests the functioning of the Cortex A9 Scu Private Timer driver and hardware using interrupts. More...
 
int main (void)
 Main function to call the Cortex A9 Scu Private Timer interrupt example. More...
 

Variables

XScuTimer TimerInstance
 Cortex A9 Scu Private Timer Instance. More...
 

Macro Definition Documentation

#define TIMER_LOAD_VALUE   0xFFFF

Timer load value for interrupt example.

Referenced by ScuTimerIntrExample().

Function Documentation

int main ( void  )

Main function to call the Cortex A9 Scu Private Timer interrupt example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.

References ScuTimerIntrExample().

int ScuTimerIntrExample ( XScuTimer *  TimerInstancePtr,
UINTPTR  BaseAddress 
)

This function tests the functioning of the Cortex A9 Scu Private Timer driver and hardware using interrupts.

Parameters
[in]TimerInstancePtris a pointer to the instance of XScuTimer driver.
[in]BaseAddressis the base address of the XScuTimer 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, XScuTimer::Config, TIMER_LOAD_VALUE, XScuTimer_CfgInitialize(), XScuTimer_EnableAutoReload, XScuTimer_EnableInterrupt, XScuTimer_LoadTimer, XScuTimer_LookupConfig(), XScuTimer_SelfTest(), XScuTimer_Start(), and XScuTimer_Stop().

Referenced by main().

Variable Documentation

XScuTimer TimerInstance

Cortex A9 Scu Private Timer Instance.