You are here

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_IN Response ID (0x82).
Byte 1 CNT Counter value.
Byte 2 A_VAL Port A input pins values.
Byte 3 B_VAL Port B input pins values.
Byte 4 C_VAL Port C input pins values.
Byte 5 A_MASK

Data mask for port A pins values.

Byte 6 B_MASK Data mask for port B pins values.
Byte 7 C_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.