MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- -------------------------------------------------------- 1.00a sa 07/15/11 First release 1.01a sa 04/10/12 Updated with fast interrupt 2.1 bss 05/02/14 Modified XIOModule_IsExpired to check for all 1's instead of 0 in CounterReg.(CR#794167)
#include "xiomodule.h"
#include "xiomodule_l.h"
#include "xiomodule_i.h"
#include "xiomodule_io.h"
#include "xil_types.h"
#include "xil_assert.h"
Functions | |
int | XIOModule_Initialize (XIOModule *InstancePtr, u16 DeviceId) |
int | XIOModule_Start (XIOModule *InstancePtr) |
void | XIOModule_Stop (XIOModule *InstancePtr) |
int | XIOModule_Connect (XIOModule *InstancePtr, u8 Id, XInterruptHandler Handler, void *CallBackRef) |
void | XIOModule_Disconnect (XIOModule *InstancePtr, u8 Id) |
void | XIOModule_Enable (XIOModule *InstancePtr, u8 Id) |
void | XIOModule_Disable (XIOModule *InstancePtr, u8 Id) |
void | XIOModule_Acknowledge (XIOModule *InstancePtr, u8 Id) |
XIOModule_Config * | XIOModule_LookupConfig (u16 DeviceId) |
int | XIOModule_ConnectFastHandler (XIOModule *InstancePtr, u8 Id, XFastInterruptHandler Handler) |
void | XIOModule_SetNormalIntrMode (XIOModule *InstancePtr, u8 Id) |
u32 | XIOModule_DiscreteRead (XIOModule *InstancePtr, unsigned Channel) |
void | XIOModule_DiscreteWrite (XIOModule *InstancePtr, unsigned Channel, u32 Data) |
int | XIOModule_Timer_Initialize (XIOModule *InstancePtr, u16 DeviceId) |
void | XIOModule_Timer_Start (XIOModule *InstancePtr, u8 TimerNumber) |
void | XIOModule_Timer_Stop (XIOModule *InstancePtr, u8 TimerNumber) |
u32 | XIOModule_GetValue (XIOModule *InstancePtr, u8 TimerNumber) |
void | XIOModule_SetResetValue (XIOModule *InstancePtr, u8 TimerNumber, u32 ResetValue) |
u32 | XIOModule_GetCaptureValue (XIOModule *InstancePtr, u8 TimerNumber) |
void | XIOModule_Reset (XIOModule *InstancePtr, u8 TimerNumber) |
int | XIOModule_IsExpired (XIOModule *InstancePtr, u8 TimerNumber) |
u32 | XIOModule_IoReadWord (XIOModule *InstancePtr, u32 ByteOffset) |
u16 | XIOModule_IoReadHalfword (XIOModule *InstancePtr, u32 ByteOffset) |
u8 | XIOModule_IoReadByte (XIOModule *InstancePtr, u32 ByteOffset) |
void | XIOModule_IoWriteWord (XIOModule *InstancePtr, u32 ByteOffset, u32 Data) |
void | XIOModule_IoWriteHalfword (XIOModule *InstancePtr, u32 ByteOffset, u16 Data) |
void | XIOModule_IoWriteByte (XIOModule *InstancePtr, u32 ByteOffset, u8 Data) |
|
Acknowledges the interrupt source provided as the argument Id. When the interrupt is acknowledged, it causes the interrupt controller to clear its interrupt condition.
|
|
Makes the connection between the Id of the interrupt source and the associated handler that is to run when the interrupt is recognized. The argument provided in this call as the Callbackref is used as the argument for the handler when it is called.
|
|
Makes the connection between the Id of the interrupt source and the associated handler that is to run when the interrupt is recognized.
|
|
Disables the interrupt source provided as the argument Id such that the interrupt controller will not cause interrupts for the specified Id. The interrupt controller will continue to hold an interrupt condition for the Id, but will not cause an interrupt.
|
|
Updates the interrupt table with the Null Handler and NULL arguments at the location pointed at by the Id. This effectively disconnects that interrupt source from any handler. The interrupt is disabled also.
|
|
Read state of discretes for the specified GPI channnel.
|
|
Write to discretes register for the specified GPO channel.
|
|
Enables the interrupt source provided as the argument Id. Any pending interrupt condition for the specified Id will occur after this function is called.
|
|
Returns the timer counter value that was captured the last time the external capture input was asserted.
|
|
Get the current value of the specified timer counter. The timer counter may be either incrementing or decrementing based upon the current mode of operation.
|
|
Initialize a specific interrupt controller instance/driver. The initialization entails:
|
|
Read byte from the IO Bus memory mapped IO
|
|
Read 16-bit halfword from the IO Bus memory mapped IO
|
|
Read 32-bit word from the IO Bus memory mapped IO
|
|
Write 8-bit word to the IO Bus memory mapped IO
|
|
Write 16-bit word to the IO Bus memory mapped IO
|
|
Write 32-bit word to the IO Bus memory mapped IO
|
|
Checks if the specified timer counter of the device has expired. In capture mode, expired is defined as a capture occurred. In compare mode, expired is defined as the timer counter rolled over/under for up/down counting. When interrupts are enabled, the expiration causes an interrupt. This function is typically used to poll a timer counter to determine when it has expired.
|
|
Looks up the device configuration based on the unique device ID. A table contains the configuration info for each device in the system.
|
|
Resets the specified timer counter of the device. A reset causes the timer counter to set it's value to the reset value.
|
|
Sets the normal interrupt mode for the specified interrupt in the Interrupt Mode Register, by resetting the vector to (BaseVector & 0xFFFFFF80) | 0x10 and selecting normal mode.
|
|
Set the reset value for the specified timer counter. This is the value that is loaded into the timer counter when it is reset. This value is also loaded when the timer counter is started.
|
|
Starts the IO Module. Interrupts may be generated by the IO Module after this function is called. It is necessary for the caller to connect the interrupt handler of this component to the proper interrupt source.
|
|
Stops the interrupt controller by disabling the output from the controller so that no interrupts will be caused by the interrupt controller.
|
|
Initializes a specific timer instance/driver. Initialize fields of the XIOModule structure, then reset the timer
|
|
Starts the specified timer counter of the device such that it starts running. The timer counter is reset before it is started and the reset value is loaded into the timer counter. If interrupt mode is specified in the options, it is necessary for the caller to connect the interrupt handler of the timer to the interrupt source, typically an interrupt controller, and enable the interrupt within the interrupt controller.
|
|
Stops the timer by disabling it. It is the callers' responsibility to disconnect the interrupt handler of the timer from the interrupt source, typically an interrupt controller, and disable the interrupt within the interrupt controller.
|