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:
current values on the input pins of port A, port B and port C (Byte 2: A_VAL, Byte 3: B_VAL and Byte 4: C_VAL);
data masks for port A, port B and port C pins values (Byte 5: A_MASK, Byte 6: B_MASK, Byte 7: C_MASK).
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:
Event ID (event type). This byte will contain 0x82.
Counter value. This counter is incremented by GPIO-24 adapter with each event.
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.
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.
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.
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.
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.
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.