Table 4-3: gpio interrupt source bit settings – ADLINK PCI-8158 User Manual

Page 93

Advertising
background image

Operation Theory

83

GPIO Interrupt Source Bit Settings (1=Enable,0=Disable)

The steps for using interrupts:

1. Use _8158_int_control(CARD_ID, Enable=1/Disable=0);

2. Set interrupt sources for Event or GPIO interrupts.

3. _8158_set_motion_int_facor(AXIS0, 0x01); // Axis0 nor-

mally stop

4. _8158_set_gpio_int_factor(CARD0, 0x01); // DI0 falling

edge

5. _8158_wait_motion_interrupt(AXIS0, 0x01, 1000) // Wait

1000ms for normally stop interrupt

6. _8158_wait_gpio_interrupt(CARD0, 0x01, 1000) // Wait

1000ms for DI0 falling edge interrupt

7. I16 ErrNo=_8158_wait_error_interrupt(AXIS0, 2000); //

Wait 2000ms for error interrupts

Bit

Description

0

DI0 falling edge

1

DI1 falling edge

2

DI2 falling edge

3

DI3 falling edge

4

DI0 raising edge

5

DI1 raising edge

6

DI2 raising edge

7

DI3 raising edge

8

Pin23 input interrupt

9

Pin57 input interrupt

10

Pin23/57 interrupt mode selection (0=falling, 1=raising)

11-14

0

15

GPIO interrupt switch ( Always=1)

Table 4-3: GPIO Interrupt Source Bit Settings

Advertising