The GPIO_GET_ADC_CHANNEL_CFG command retrieves the configuration settings for specified ADC channel (analog input).
| Byte 0 | GPIO_GET_ADC_CHANNEL_CFG | Command ID (0x26) |
| Byte 1 | ECHO | Echo to associate a command with the response. |
| Byte 2 | CHANNEL | ID number of the ADC channel |
| Bytes 3..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 0x26.
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.
ID number of the ADC channel to retrieve the configuration settings for :
0 – C.1 pin;
1 – C.2 pin;
2 – C.5 pin;
3 – C.6 pin;
4 – B.3 pin.
These bytes are reserved for future usage and must be set to 0.
For convenience GPIO_GET_ADC_CHANNEL_CFG_CMD structure is declared in reports.h file.
GPIO-24 adapter sends GPIO_GET_ADC_CHANNEL_CFG response after command execution. ADC channel configuration settings are specified inside the response.
| Byte 0 | GPIO_GET_ADC_CHANNEL_CFG | Response ID (0x26). | |
| Byte 1 | ECHO | Echo to associate a command with the response. | |
| Byte 2 | Bits 7..4 | ST | Status of the command execution. |
| Bits 3..0 | EVENT_CONDITION | Condition of the event generation | |
| Byte 3 | REPEAT | Repeat interval value in units of 10 ms | |
| Byte 4 | LOW_LSB | Low threshold value (least significant byte) | |
| Byte 5 | LOW_MSB | Low threshold value (most significant byte) | |
| Byte 6 | HI_LSB | High threshold value (least significant byte) | |
| Byte 7 | HI_MSB | High threshold value (most significant byte) | |
Response is an 8-byte array of the following format:
This byte contains response ID (response type). This byte will contain 0x26.
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.
| Bits 7..4 | Bits 3..0 |
|---|---|
| ST | EVENT_CONDITION |
Status of the command execution:
GPIO_ST_SUCCESS (0x00) – ADC channel configuration was succesfully retrieved.
The condition when USB-I/O adapter
sends GPIO_EV_ADC event:
GPIO_ADC_EV_NONE (0x0) – No events are sent for current ADC channel.
GPIO_ADC_EV_BELOW (0x1) – The event is sent when the input voltage descends below the low threshold value. High threshold value is ignored.
GPIO_ADC_EV_ABOVE (0x2) – The event is sent when the input voltage rises above high threshold value. Low threshold value is ignored.
GPIO_ADC_EV_OUTSIDE (0x3) – The event is sent when the input voltage exceeds the limits specified by low and high threshold values.
GPIO_ADC_EV_INSIDE (0x4) – The event is sent when the input voltage is within the limits specified by low and high threshold values.
GPIO_ACD_EV_ALWAYS (0x5) – The events are sent periodically with predefined interval. The non-zero repeat interval is specified in Byte 3: REPEAT.
This byte contains the repeat interval for GPIO_EV_ADC event generation. If this byte is non-zero, GPIO-24 adapter sends events each REPEAT * 10 ms. For more detailed information about the event generation see Section 7.4, “ADC Event”.
These bytes contain low and high threshold values.
Byte 4: LOW_LSB – least significant byte of low threshold value.
Byte 5: LOW_MSB – most significant byte of low threshold value.
Byte 6: HI_LSB – least significant byte of high threshold value.
Byte 7: HI_MSB – most significant byte of high threshold value.
For convenience GPIO_GET_ADC_CHANNEL_CFG_RSP structure is declared in reports.h file.