iomodule
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xiomodule_selftest_example.c File Reference

Overview

This file contains a self test example using the IO Module driver (XIOModule) and hardware device.

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

The TestApp Gen utility uses this file to perform the self test and setup of the IO Module.

Note

None

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.00a sa 07/15/11 First release 2.4 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. 2.15 sa 01/05/23 Removed inclusion of mb_interface.h, as it is not required. 2.19 ml 04/18/25 Added support for system device-tree flow.

#include "xparameters.h"
#include "xstatus.h"
#include "xiomodule.h"
#include "xil_printf.h"

Macros

#define IOMODULE_DEVICE_ID   XPAR_IOMODULE_0_BASEADDR
 Device base address for SDT build. More...
 

Functions

XStatus IOModuleSelfTestExample (u32 DeviceId)
 This function runs a self-test on the driver/device. More...
 
int main (void)
 This is the main function for the IO Module example. More...
 

Macro Definition Documentation

#define IOMODULE_DEVICE_ID   XPAR_IOMODULE_0_BASEADDR

Device base address for SDT build.

Referenced by main().

Function Documentation

XStatus IOModuleSelfTestExample ( u32  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 IO Module driver component (XIOModule) and the hardware device. This function is designed to work without external hardware devices to cause interrupts. It may not return if the IO Module is not properly connected to the processor in either software or hardware.

Parameters
[in]DeviceIdis device ID of the IO Module Device, typically XPAR_<IOMODULE_instance>_DEVICE_ID value from xparameters.h
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE

References XIOModule_Initialize(), and XIOModule_SelfTest().

Referenced by main().

int main ( void  )

This is the main function for the IO Module 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 IOMODULE_DEVICE_ID, and IOModuleSelfTestExample().