You are here

GPIO_GET_OUT_VAL (0x04)

All GPIO-24 adapter pins have an output data latch. The GPIO_GET_OUT_VAL command retrieves the values on these data latches. If a pin is not configured as digital output, the value on the pin may differ from the value in its output data latch. Use GPIO_GET_VAL command to retrieve the values on the I/O pins.

GPIO_GET_OUT_VAL Command

Go to Response

Byte 0 GPIO_GET_OUT_VAL Command ID (0x04).
Byte 1 ECHO Echo to associate a command with the response.
Byte 2..7 Reserved Reserved (must be 0).

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

Byte 0: GPIO_GET_OUT_VAL (0x04)

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

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.

Bytes 2..7: Reserved

These bytes are reserved for future usage and must be set to 0.

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

GPIO-24 adapter sends GPIO_GET_OUT_VAL response after command execution. The values on output data latches are specified inside the response.

GPIO_GET_OUT_VAL Response

Go to Command

The GPIO_GET_OUT_VAL response returns the values on data latches. If pin is not configured in output mode, the value on the pin may differ from the value on its output data latch. Use GPIO_GET_VAL command to retrieve the values currently present on the I/O pins.

Byte 0 GPIO_GET_OUT_VAL Response ID (0x04).
Byte 1 ECHO Echo to associate a response with a specific command.
Byte 2 ST Status of the command execution.
Byte 3 PORT A Output values on data latches of the GPIO port A pins.
Byte 4 PORT B Output values on data latches of the GPIO port B pins.
Byte 5 PORT C Output values on data latches of the GPIO port C pins.
Byte 6..7 Reserved Reserved

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

Byte 0: GPIO_GET_OUT_VAL (0x04)

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

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 pins output values were successfully retrieved.

Byte 3: PORT A

Output values of the GPIO port A pins.

Byte 4: PORT B

Output values of the GPIO port B pins.

Byte 5: PORT C

Output values of the GPIO port C pins.

Bytes 6..7: Reserved

These bytes are reserved for future usage.

[Warning] Warning

The I/O pin does not output the value specified in this response if it is not configured for output with the GPIO_SET_CFG command.

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