Product Comparison: USB I2C | USB SPI | USB GPIO

USB-I/O Interface Adapter GPIO-24. Programmer's Reference Manual.


6.6. GPIO_EV_IN (0x82)

GPIO-24 adapter can send GPIO_EV_IN event to your application.

You can configure event generation conditions with GPIO_SET_IN_CFG command. For more detailed information see Section 6.1, “Digital Input Event”.

The GPIO_EV_IN event returns the following information:

Use data masks to define which pins the event has been sent for. Current values on inputs are valid only for the pins with the corresponding mask bit set to 1.

Byte 0 GPIO_EV_INResponse ID (0x82).
Byte 1CNTCounter value.
Byte 2A_VALPort A input pins values.
Byte 3B_VALPort B input pins values.
Byte 4C_VALPort C input pins values.
Byte 5A_MASK

Data mask for port A pins values.

Byte 6B_MASKData mask for port B pins values.
Byte 7C_MASK

Data mask for port C pins values.

Event is an 8-byte array of the following format:

Byte 0: GPIO_EV_IN (0x82)

Event ID (event type). This byte will contain 0x82.

Byte 1: CNT

Counter value. This counter is incremented by GPIO-24 adapter with each event.

Byte 2: A_VAL

Port A input pins values. Only values with the corresponding mask bit set to 1 are valid. The data mask is stored in Byte 5: A_MASK.

Byte 3: B_VAL

Port B input pins values. Only values with the corresponding mask bit set to 1 are valid. The data mask is stored in Byte 6: B_MASK.

Byte 4: C_VAL

Port C input pins values. Only values with the corresponding mask bit set to 1 are valid. The data mask is stored in Byte 7: C_MASK.

Byte 5: A_MASK

Data mask for port A pins values. If mask bit equals to 1, the corresponding bit of Byte 2: A_VAL contains valid value. If mask bit equals to 0. the corresponding bit of Byte 2: A_VAL should be ignored.

Byte 6: B_MASK

Data mask for port B pins values. If mask bit equals to 1, the corresponding bit of Byte 3: B_VAL contains valid value. If mask bit equals to 0. the corresponding bit of Byte 3: B_VAL should be ignored.

Byte 7: C_MASK

Data mask for port C pins values. If mask bit equals to 1, the corresponding bit of Byte 4: C_VAL contains valid value. If mask bit equals to 0. the corresponding bit of Byte 4: C_VAL should be ignored.

For convenience GPIO_IN_EV structure is declared in reports.h file.