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

Overview

This file contains a self test example using the Interrupt Controller driver (XScuGic) and hardware device.

Please reference other device driver examples to see more examples of how the Intc and interrupts can be used by a software application.

The TestApp Gen utility uses this file to perform the self test and setup of Intc for interrupts.

MODIFICATION HISTORY:
Ver   Who  Date Changes


1.00a sdm 05/29/11 Created for Test App Integration 3.6 ms 01/23/17 Modified 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. 5.7 bdk 12/08/25 Updated comments to support SDT flow for Doxygen documentation.

#include "xparameters.h"
#include "xstatus.h"
#include "xscugic.h"
#include "xil_exception.h"

Macros

#define XSCUGIC_DIST_BASEADDR   XPAR_XSCUGIC_0_BASEADDR
 Base address of the GIC distributor. More...
 

Functions

int ScuGicSelfTestExample (u32 BaseAddr)
 Runs a self-test on the driver/device. More...
 
int ScuGicInterruptSetup (XScuGic *IntcInstancePtr, u32 BaseAddr)
 Sets up the interrupt system for the TestAppGen application. More...
 
int main (void)
 This is the main function for the Interrupt Controller example. More...
 

Macro Definition Documentation

#define XSCUGIC_DIST_BASEADDR   XPAR_XSCUGIC_0_BASEADDR

Base address of the GIC distributor.

Referenced by main().

Function Documentation

int main ( void  )

This is the main function for the Interrupt Controller example.

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

Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE.

References ScuGicSelfTestExample(), and XSCUGIC_DIST_BASEADDR.

int ScuGicInterruptSetup ( XScuGic *  IntcInstancePtr,
u32  BaseAddr 
)

Sets up the interrupt system for the TestAppGen application.

Parameters
[in]IntcInstancePtris the reference to the Interrupt Controller instance.
[in]BaseAddris the base address of the device
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XScuGic_Config::CpuBaseAddress, XScuGic_CfgInitialize(), XScuGic_InterruptHandler(), and XScuGic_LookupConfig().

int ScuGicSelfTestExample ( u32  BaseAddr)

Runs a self-test on the driver/device.

This is a destructive test. This function is an example of how to use the interrupt controller driver component (XScuGic) and the hardware device. This function is designed to work without any hardware devices to cause interrupts. It may not return if the interrupt controller is not properly connected to the processor in either software or hardware. This function relies on the fact that the interrupt controller hardware has come out of the reset state such that it will allow interrupts to be simulated by the software.

Parameters
[in]BaseAddris the base address of the device
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XScuGic_Config::CpuBaseAddress, XScuGic_CfgInitialize(), and XScuGic_LookupConfig().

Referenced by main().