You are here

Digital Input Event

Each of 24 USB-I/O adapter GPIO pins can be configured with GPIO_SET_IN_CFG command to send GPIO_EV_IN event.

The configuration settings may be identical for several pins of one port. Use data mask to specify the pins which should be configured identically. You can specify data mask in Byte 3: MASK of GPIO_SET_IN_CFG command. It is well known that a byte consists of 8 bits (which can be 0 or 1). This characteristic is used to create a mask. The configuration settings are applied only for the pins with the corresponding mask bit set to 1.

Use Byte 4: PHASE of GPIO_SET_IN_CFG command to define the conditions of GPIO_EV_IN event generation. For more detailed information see Section 6.2, “Phase of Event Generation for Digital Input Pins”.

If the phase configuration is set to GPIO_IN_EV_LEV_0 or GPIO_IN_EV_LEV_1 the event can be sent periodically while the event condition exists. This repeat interval in units of 100 ms is specified in Byte 6: REPEAT of GPIO_SET_IN_CFG command.

Contact bounce may cause sending numerous events. To avoid it, debounce algorithm is implemented in USB-I/O interface adapter. The new value is only accepted if it is stable for a predefined period of time. The time period is defined with Byte 5: DEBOUNCE in ms. If Byte 5: DEBOUNCE = 0, the debounce check is not carried out.

The event may return current values on one input pin or on several pins at once. Use data masks to define which pins the event has been sent for. Data masks for port A, port B and port C pins are stored in Byte 5: A_MASK, Byte 6: B_MASK and Byte 7: C_MASK of GPIO_EV_IN event. Current values on the input pins of port A, port B and port C are stored in Byte 2: A_VAL, Byte 3: B_VAL and Byte 4: C_VAL of GPIO_EV_IN event. Note, that these values are valid only for the pins with the corresponding mask bit set to 1.