The GPIO_GET_VAL command retrieves current values on the
I/O pins.
This command retrieves:
for digital input pins;
for digital output pins;
for pulse width modulation (PWM) pins;
for pins sending a single pulse.
For convenience GPIO_GET_VAL_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_VAL response after command
execution. The current values on the I/O pins are specified
inside the response.
| Byte 0 | GPIO_GET_VAL | Command ID (0x09). |
| 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:
This byte contains command ID (command type). It should be set to 0x09.
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.
These bytes are reserved for future usage and must be set to 0.
For convenience GPIO_GET_VAL_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_VAL response after command
execution. The current values on I/O pins are specified inside
the response.
| Byte 0 | GPIO_GET_VAL | Response ID (0x09). |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | ST | Status of the command execution. |
| Byte 3 | PORT A | I/O port A pins values. |
| Byte 4 | PORT B | I/O port B pins values. |
| Byte 5 | PORT C |
|
| Byte 6..7 | Reserved | Reserved |
Response is an 8-byte array of the following format:
Response ID (response type). This byte will contain 0x09.
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 pins values were successfully
retrieved.
I/O port A pins values.
I/O port B pins values.
I/O port C pins values.
These bytes are reserved for future usage.
For convenience GPIO_GET_VAL_RSP structure is declared in reports.h file.