iomodule
Vitis Drivers API Documentation
xiomodule_low_level_example.c File Reference

Overview

This file contains a design example using the low level-0 driver, interface of the IO Module driver.

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 Updated example to use generic API Xil_ExceptionEnable instead of Microblaze specific API microblaze_enable_interrupts. It is needed to support RISC-V.

Functions

XStatus IOModuleLowLevelExample (u32 IOModuleBaseAddress)
 This function is an example of how to use the IO Module driver component (XIOModule) and the hardware device. More...
 
void SetupInterruptSystem ()
 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 Low Level example. More...
 

Function Documentation

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.

Referenced by IOModuleLowLevelExample().

XStatus IOModuleLowLevelExample ( u32  IOModuleBaseAddress)

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
IOModuleBaseAddressis Base Address of the the IO Module Device
Returns
XST_SUCCESS to indicate success, otherwise XST_FAILURE
Note
None.

References DeviceDriverHandler(), SetupInterruptSystem(), XIOModule_EnableIntr, and XIOModule_RegisterHandler().

Referenced by main().

int main ( void  )

This is the main function for the IO Module Low Level example.

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

References IOModuleLowLevelExample().

void SetupInterruptSystem ( )

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.

Referenced by IOModuleLowLevelExample().