VXI VT1433B User Manual

Page 105

Advertising
background image

VT1433B Interrupt Handling

To make the VT1433B module do the interrupt, both a mask and a VME
Interrupt line must be specified, by calling e1432_set_interrupt_mask and
e1432_set_interrupt_priority respectively. Once the mask and line have been set
and an interrupt occurs, the cause of the interrupt can be obtained by reading the
E1432_IRQ_STATUS_REG register (using e1432_read_register). The bit
positions of the interrupt mask and status registers match so the defines can be
used to set and check IRQ bits.

Once it has done this interrupt, the module will not do any more VME interrupts
until re-enabled with e1432_reenable_interrupt. Normally, the last thing a host
computer’s interrupt handler should do is call e1432_reenable_interrupt.

Events that would have caused an interrupt, but which are blocked because
e1432_reenable_interrupt has not yet been called, will be saved. After
e1432_reenable_interrupt is called, these saved events will cause an interrupt, so
that there is no way for the host to “miss” an interrupt. However, the module will
only do one VME interrupt for all of the saved events, so that the host computer
will not get flooded with too many interrupts.

For things like “E1432_IRQ_BLOCK_READY”, which are not events but are
actually states, the module will do an interrupt after e1432_reenable_interrupt only
if the state is still present. This allows the host computer’s interrupt handler to
potentially read multiple scans from a VT1433B module and not get flooded with
block ready interrupts after the fact.

Host Interrupt Setup

The VT1432A Host Interface library normally uses the SICL I/O library to
communicate with the VT1432A hardware. To receive VME interrupts, a variety
of SICL setup calls must be made. The “examples” directory of the VT1433B
distribution contains an example of setting up SICL to receive interrupts from a
VT1433B module.

This is a summary of how to set up SICL to receive a VT1433B interrupt:

q

Query SICL for which VME interrupt lines are available, using ivxibusstatus and
ivxirminfo.

q

Tell the VT1433B module to use the VME interrupt line found in step one, using
e1432_set_interrupt_priority.

q

Set up an interrupt handler routine, using ionintr and isetintr. The interrupt handler
routine will get called when the interrupt occurs.

q

Set up interrupt mask in the VT1433B module, using e1432_set_interrupt_mask.

VT1433B User's Guide

The Host Interface Library

4-27

Advertising