You are here

GPIO_GET_ADC_MODULE_CFG (0x25)

The GPIO_GET_ADC_MODULE_CFG command retrieves the ADC module configuration.

GPIO_GET_ADC_MODULE_CFG Command

Go to Response

Byte 0 GPIO_GET_ADC_MODULE_CFG Response ID (0x25).
Byte 1 ECHO Echo to associate a command with the response.
Bytes 2..7 Reserved Reserved

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

Byte 0: GPIO_GET_ADC_MODULE_CFG (0x25)

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

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.

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

GPIO-24 adapter sends GPIO_GET_ADC_MODULE_CFG response after command execution. ADC module configuration settings are specified inside the response.

GPIO_GET_ADC_MODULE_CFG Response

Go to Command

Byte 0 GPIO_GET_ADC_MODULE_CFG Response ID (0x25)
Byte 1 ECHO Echo to associate a command with the response
Byte 2 ST Status of the command execution
Byte 3 ON ADC module state (on/off)
Byte 4 Bits 7..2 Reserved Reserved
Bit 1 VREF_LOW Low reference voltage configuration
Bit 0 VREF_HI High reference voltage configuration.
Bytes 5..7 Reserved Reserved

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

Byte 0: GPIO_GET_ADC_MODULE_CFG (0x25)

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

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

Status of the command execution:

  • GPIO_ST_SUCCESS (0x00) – ADC module configuration has been succesfully retrieved.

Byte 3: ON

The ADC module state (on/off):

  • 1 – the ADC module is turned on. The C.1, C.2, C.5, C.6 and B.3 pins are analog inputs (ADC channels);

  • 0 – the ADC module is turned off. The ADC mode is switched off on the C.1, C.2, C.5, C.6 and B.3 pins.

Byte 4: VREF

This byte contains the value of reference voltage. You can use either USB-I/O adapter supply voltage (VDD and VSS) or the external reference voltage connected to C.6 (VRefHi) and C.5 (VRefLow) pins.

Bits 7..2 Bit 1 Bit 0
Reserved VREF_LOW VREF_HI
Bits 7..2: Reserved

These bits are reserved for future usage

Bit 1: VREF_LOW

The low reference voltage:

  • 1 – the external voltage reference on C.5 pin is used as low reference voltage;

  • 0 – the USB-I/O adapter negative supply voltage (VSS) is used as low reference voltage.

Bit 0: VREF_HI

The high reference voltage:

  • 1 – the external voltage reference on C.6 pin is used as high reference voltage;

  • 0 – the USB-I/O adapter positive supply voltage (VDD) is used as high reference voltage.

Bytes 5..7: Reserved

These bytes are reserved for future usage.

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