scugic: xscugic_tapp_example.c File Reference

| scugic Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
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.

Note

None

    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.

## Functions
int | ScuGicSelfTestExample (u16 DeviceId)
| This function runs a self-test on the driver/device. More...
int | ScuGicInterruptSetup (XScuGic *IntcInstancePtr, u16 DeviceId)
| This function is used by the TestAppGen generated application to setup the interrupt controller. More...
int | main (void)
| This is the main function for the Interrupt Controller example. More...

## 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.

Parameters

  None. |

Returns
  XST_SUCCESS to indicate success, otherwise XST_FAILURE.

Note
  None.

References ScuGicSelfTestExample().

int ScuGicInterruptSetup | ( | XScuGic * | IntcInstancePtr,
|  | u16 | DeviceId
| ) |  |

This function is used by the TestAppGen generated application to setup the interrupt controller.

Parameters

  IntcInstancePtr | is the reference to the Interrupt Controller instance.
  DeviceId | is device ID of the Interrupt Controller Device, typically XPAR_<INTC_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS to indicate success, otherwise XST_FAILURE.

Note
  None.

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

int ScuGicSelfTestExample | ( | u16 | DeviceId | ) |

This function 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

  DeviceId | is device ID of the Interrupt Controller Device, typically XPAR_<INTC_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS to indicate success, otherwise XST_FAILURE.

Note
  None.

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

Referenced by main().