The GPIO_GET_IN_CFG command retrieves input mode settings
for specified I/O pin. The settings are configured with GPIO_SET_IN_CFG command.
| Byte 0 | GPIO_GET_IN_CFG | Command ID (0x06). |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | GPIO | GPIO pin number. |
| Byte 3..7 | Reserved | Reserved (must be set to 0). |
Command is an 8-byte array of the following format:
This byte contains command ID (command type). It should be set to 0x06.
This byte is used to associate a response received from GPIO-24 adapter with a specific command. Response will contain exactly the same value in its echo byte.
GPIO pin number:
0..7 corresponds to GPIO PORT A pins 0..7
8..15 corresponds to GPIO PORT B pins 0..7
16..23 corresponds to GPIO PORT C pins 0..7
These bytes are reserved for future usage and must be set to 0.
For convenience GPIO_GET_IN_CFG_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_IN_CFG response after command execution. The configuration settings are specified inside the response.
The GPIO_GET_IN_CFG response contains input mode
configuration settings for I/O pin specified in GPIO_GET_IN_CFG command.
| Byte 0 | GPIO_GET_IN_CFG | Response ID (0x06). |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | ST | Status of the command execution. |
| Byte 3 | GPIO | GPIO pin number. |
| Byte 4 | PHASE | Phase configuration |
| Byte 5 | DEBOUNCE | Debounce time in ms. |
| Byte 6 | REPEAT | Repeat interval in units of 100 ms. |
| Byte 7 | Reserved | Reserved |
Response is an 8-byte array of the following format:
Response ID (response type). This byte will contain 0x06.
Echo byte copied from the corresponding command. It is used to associate the response with the specific command.
Status of the command execution:
GPIO_ST_SUCCESS (0x00) – The I/O pin input mode configuration settings
were successfully retrieved.
GPIO_ST_INVALID_GPIO (0x02) – Invalid
I/O pin number has been
specified.
GPIO pin number:
0..7 corresponds to GPIO PORT A pins 0..7
8..15 corresponds to GPIO PORT B pins 0..7
16..23 corresponds to GPIO PORT C pins 0..7
Phase configuration, which determines the conditions when GPIO-24 adapter sends GPIO_EV_IN event.
The following values are available for this byte:
GPIO_IN_EV_NONE (0x00) – No events are sent for current pin. For more detailed information see Section 6.2.1, “GPIO_IN_EV_NONE (0x00) – No events are sent”.
GPIO_IN_EV_LEV_0 (0x01) – Events are sent when pin has logical "0" on its input. For more detailed information see Section 6.2.2, “GPIO_IN_EV_LEV_0 (0x01) – Sending events when pin has logical "0" on its input”.
GPIO_IN_EV_LEV_1 (0x02) – Events are sent when pin has logical "1" on its input. For more detailed information see Section 6.2.3, “GPIO_IN_EV_LEV_1 (0x01) – Sending events when pin has logical "1" on its input”.
GPIO_IN_EV_RISING (0x03) – Events are sent when input value changes from logical "0" to "1". For more detailed information see Section 6.2.4, “GPIO_IN_EV_RISING (0x03) – Sending events when input value changes from logical "0" to "1"”.
GPIO_IN_EV_FALLING (0x04) – Events are sent when input value changes from logical "1" to "0". For more detailed information see Section 6.2.5, “GPIO_IN_EV_FALLING (0x04) – Sending events when input value changes from logical "1" to "0"”.
GPIO_IN_EV_CHANGE (0x05) – Events are sent when input value of the pin changes. For more detailed information see Section 6.2.6, “GPIO_IN_EV_CHANGE (0x05) – Sending events when input value of the pin changes”.
To avoid sending numerous events caused by contact bounce, GPIO-24 adapter accepts signal change only after the new value is stable. Byte 5: DEBOUNCE contains the debounce time in ms. If Byte 5: DEBOUNCE = 0, the debounce check is not carried out.
Byte 6 defines the repeat interval in units of 100 ms for the event GPIO_EV_IN generation. Byte 6: REPEAT is used for pins with phase configuration set to GPIO_IN_EV_LEV_0 or GPIO_IN_EV_LEV_1. It is ignored for pins with other phase configurations. If Byte 6: REPEAT is non-zero , GPIO-24 adapter sends events each REPEAT*100 ms. For more detailed information see Section 6.1, “Digital Input Event”.
This byte is reserved for future usage.
For convenience GPIO_GET_IN_CFG_RSP structure is declared in reports.h file.