You are here

GPIO_GET_ADC_VAL (0x11)

The GPIO_GET_ADC_VAL command retrieves current voltage from two channels at once.

GPIO_GET_ADC_VAL Command

Go to Response

Byte 0 GPIO_GET_ADC_VAL Response ID (0x11).
Byte 1 ECHO Echo to associate command with the response.
Byte 2 CHANNEL1 ID number of the ADC channel
Byte 3 CHANNEL2 ID number of the ADC channel
Bytes 4..7 Reserved Reserved (must be 0).

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

Byte 0: GPIO_GET_ADC_VAL (0x11)

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

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..3: CHANNEL1/CHANNEL2

The GPIO-24 adapter can retrieve current voltage from two channels at once. These bytes define the ID number of the ADC channel to retrieve voltage from:

  • 0 – C.1 pin;

  • 1 – C.2 pin;

  • 2 – C.5 pin;

  • 3 – C.6 pin;

  • 4 – B.3 pin.

Bytes 4..7: Reserved

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

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

GPIO-24 adapter sends GPIO_GET_ADC_VAL response after command execution. Current voltage is specified inside the response.

GPIO_GET_ADC_VAL Response

Go to Command

Byte 0 GPIO_GET_ADC_VAL Response ID (0x11).
Byte 1 ECHO Echo to associate a command with the response.
Byte 2 ST Command execution status
Byte 3 CHANNEL1_LSB Current voltage on the ADC channel (least significant byte)
Byte 4 CHANNEL1_MSB Current voltage on the ADC channel (most significant byte)
Byte 5 CHANNEL2_LSB Current voltage on the ADC channel (least significant byte)
Byte 6 CHANNEL2_MSB Current voltage on the ADC channel (most significant byte)
Byte 7 Reserved Reserved

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

Byte 0: GPIO_GET_ADC_VAL (0x11)

This byte contains response ID (response type). This byte will contain 0x26.

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

 

Byte 3: CHANNEL1_LSB/CHANNEL1_MSB

Current voltage on the ADC channel

Byte 3: CHANNEL1_LSB – least significant byte of current voltage.

Byte 4: CHANNEL1_MSB – most significant byte of current voltage.

Byte 5: CHANNEL2_LSB

Current voltage on the ADC channel

Byte 5: CHANNEL2_LSB – least significant byte of current voltage.

Byte 6: CHANNEL2_MSB – most significant byte of current voltage.

Byte 7: Reserved

This byte is reserved for future usage.

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