| Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 |
|---|---|---|---|---|---|---|---|
| GPIO_ SET_OUT _VAL (0x03) | ECHO | PORT | MASK | VAL | 0 | 0 | 0 |
The GPIO_SET_OUT_VAL command sets output values for all pins of particular I/O port. Port number is specified in Byte 2. Only pins with corresponding mask bit set to 1 will be affected.
IO pins have to be switched to output mode using the GPIO_SET_CFG command. GPIO_SET_OUT_VAL command can be used prior to GPIO_SET_CFG to preset output values before switching the pin to output mode. If IO pin is already in output mode, the output value is applied immediately.
Command is an 8-byte array of the following format:
For convenience GPIO_SET_OUT_VAL_CMD structure is declared in reports.h file:
typedef struct _GPIO_SET_OUT_VAL_CMD
{
unsigned char id; // = GPIO_SET_OUT_VAL_CMD;
unsigned char echo;
unsigned char port;
unsigned char mask;
unsigned char val;
unsigned char reserved[3]; // must be 0
} __PACKED_ATTR GPIO_SET_OUT_VAL_CMD, *PGPIO_SET_OUT_VAL_CMD;
GPIO-24 adapter sends GPIO_SET_OUT_VAL response after command execution.