Product Comparison: USB I2C | USB SPI | USB GPIO

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


6.5. GPIO_GET_IN_CFG (0x06)

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.

GPIO_GET_IN_CFG Command

Go to Response

Byte 0 GPIO_GET_IN_CFGCommand ID (0x06).
Byte 1ECHOEcho to associate a command with the response.
Byte 2GPIOGPIO pin number.
Byte 3..7ReservedReserved (must be set to 0).

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

Byte 0: GPIO_GET_IN_CFG (0x06)

This byte contains command ID (command type). It should be set to 0x06.

Byte 1: ECHO

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.

Byte 2: GPIO

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

Bytes 3..7: Reserved

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.

GPIO_GET_IN_CFG Response

Go to Command

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_CFGResponse ID (0x06).
Byte 1ECHOEcho to associate a command with the response.
Byte 2STStatus of the command execution.
Byte 3GPIOGPIO pin number.
Byte 4PHASEPhase configuration
Byte 5DEBOUNCEDebounce time in ms.
Byte 6REPEATRepeat interval in units of 100 ms.
Byte 7ReservedReserved

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

Byte 0: GPIO_GET_IN_CFG (0x06)

Response ID (response type). This byte will contain 0x06.

Byte 1: ECHO

Echo byte copied from the corresponding command. It is used to associate the response with the specific command.

Byte 2: ST

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.

Byte 3: GPIO

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

Byte 4: PHASE

Phase configuration, which determines the conditions when GPIO-24 adapter sends GPIO_EV_IN event.

The following values are available for this byte:

Byte 5: DEBOUNCE

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: REPEAT

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”.

Byte 7: Reserved

This byte is reserved for future usage.

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