![]() |
iomodule
Vitis Drivers API Documentation
|
This file contains a design example using the IO Module driver (XIOModule) and hardware device using interrupt mode.This example tests the internal interrupts in the IO Module.
This file can be used as a standalone example or by the TestAppGen utility to include a test of IOModule interrupts.
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.16 ml 12/07/23 Make TimerExpired as a static variable.
Functions | |
XStatus | IOModuleIntrExample (XIOModule *IOModuleInstancePtr, u16 DeviceId) |
This function does a minimal test on the IO Module device and driver as a design example. More... | |
XStatus | IOModuleInterruptSetup (XIOModule *IOModuleInstancePtr, u16 DeviceId) |
This function is used by the TestAppGen generated application to setup the IO Module interrupts. More... | |
void | IOModuleHandler (void *CallBackRef, u8 Timer) |
This function is the handler which performs processing for the IO module. More... | |
void | IOModuleSetupIntrSystem (XIOModule *IOModuleInstancePtr) |
This function initializes and enables exception handling for interrupts in the processor. More... | |
void | IOModuleDisableIntr (XIOModule *IOModuleInstancePtr) |
This function disables the interrupts for the IO Module. More... | |
int | main (void) |
This is the main function for the IO Module example. More... | |
void IOModuleDisableIntr | ( | XIOModule * | IOModuleInstancePtr | ) |
This function disables the interrupts for the IO Module.
IOModuleInstancePtr | is a reference to the IO Module driver Instance. |
References XIOModule_Disable().
Referenced by IOModuleIntrExample().
void IOModuleHandler | ( | void * | CallBackRef, |
u8 | Timer | ||
) |
This function is the handler which performs processing for the IO module.
It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when an interrupt occurs if interrupts are enabled.
This handler provides an example of how to handle Programmable Interval Timer interrupts but is application specific.
CallBackRef | is a pointer to the callback function |
Timer | is the number of the interrupt this handler is associated with. |
References XIOModule_IsExpired(), and XIOModule_Timer_SetOptions().
Referenced by IOModuleIntrExample().
XStatus IOModuleInterruptSetup | ( | XIOModule * | IOModuleInstancePtr, |
u16 | DeviceId | ||
) |
This function is used by the TestAppGen generated application to setup the IO Module interrupts.
IOModuleInstancePtr | is the reference to the IO Module instance. |
DeviceId | is device ID of the IO Module Device , typically XPAR_<IOMODULE_instance>_DEVICE_ID value from xparameters.h |
References IOModuleSetupIntrSystem(), XIOModule_Initialize(), XIOModule_SelfTest(), and XIOModule_Start().
XStatus IOModuleIntrExample | ( | XIOModule * | IOModuleInstancePtr, |
u16 | DeviceId | ||
) |
This function does a minimal test on the IO Module device and driver as a design example.
The purpose of this function is to illustrate how to use the IO Module component. It initializes the Programmable Interval Timers and then sets it up in compare mode with auto reload such that a periodic interrupt is generated.
This function uses interrupt driven mode of the IO Module.
IOModuleInstancePtr | is a pointer to the IO Module driver Instance |
DeviceId | is the XPAR_<IOModule_instance>_DEVICE_ID value from xparameters.h |
References XIOModule::CfgPtr, IOModuleDisableIntr(), IOModuleHandler(), IOModuleSetupIntrSystem(), XIOModule_Config::PitPrescaler, XIOModule_Config::PitReadable, XIOModule_Config::PitSize, XIOModule_Config::PitUsed, XIOModule_Enable(), XIOModule_Initialize(), XIOModule_SelfTest(), XIOModule_SetHandler(), XIOModule_SetResetValue(), XIOModule_Timer_SetOptions(), XIOModule_Timer_Start(), and XIOModule_Timer_Stop().
Referenced by main().
void IOModuleSetupIntrSystem | ( | XIOModule * | IOModuleInstancePtr | ) |
This function initializes and enables exception handling for interrupts in the processor.
IOModuleInstancePtr | is the reference to the IO Module instance. |
References XIOModule_DeviceInterruptHandler().
Referenced by IOModuleInterruptSetup(), and IOModuleIntrExample().
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.
None. |
References IOModuleIntrExample().