iomodule
Xilinx SDK Drivers API Documentation
xiomodule_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.

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.

Functions

XStatus SetUpInterruptSystem (XIOModule *XIOModuleInstancePtr)
 This function connects the interrupt handler of the IO Module to the processor. More...
 
void DeviceDriverHandler (void *CallbackRef)
 This function is designed to look like an interrupt handler in a device driver. More...
 
int main (void)
 This is the main function for the IO Module example . More...
 
XStatus IOModuleExample (u16 DeviceId)
 This function is an example of how to use the IO Module driver component (XIOModule) and the hardware device. More...
 

Function Documentation

◆ DeviceDriverHandler()

void DeviceDriverHandler ( void *  CallbackRef)

This function is designed to look like an interrupt handler in a device driver.

This is typically a 2nd level handler that is called from the IO Module interrupt handler. This handler would typically perform device specific processing such as reading and writing the registers of the device to clear the interrupt condition and pass any data to an application using the device driver. Many drivers already provide this handler and the user is not required to create it.

Parameters
CallbackRefis passed back to the device driver's interrupt handler by the XIOModule driver. It was given to the XIOModule driver in the XIOModule_Connect() function call. It is typically a pointer to the device driver instance variable if using the Xilinx Level 1 device drivers. In this example, we do not care about the callback reference, so we passed it a 0 when connecting the handler to the XIOModule driver and we make no use of it here.
Returns
None.
Note
None.

◆ IOModuleExample()

XStatus IOModuleExample ( u16  DeviceId)

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
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
Note
None.

References XIOModule_Initialize().

Referenced by main().

◆ main()

int main ( void  )

This is the main function for the IO Module example .

Parameters
None.
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE.
Note
None.

References IOModuleExample().

◆ SetUpInterruptSystem()

XStatus SetUpInterruptSystem ( XIOModule XIOModuleInstancePtr)

This function connects the interrupt handler of the IO Module to the processor.

This function is separate to allow it to be customized for each application. Each processor or RTOS may require unique processing to connect the interrupt handler.

Parameters
None.
Returns
None.
Note
None.

References XIOModule_Connect().