You are here

GPIO_GET_FR_CNT_VAL (0x18)

The GPIO_GET_FR_CNT_VAL command retrieves current frequency measured by specified frequency counter.

GPIO_GET_FR_CNT_VAL Command

Go to Response

Byte 0 GPIO_GET_FR_CNT_VAL Command ID (0x18).
Byte 1 ECHO Echo to associate a command with the response.
Byte 2 FR_CNT_NUMBER ID number of the frequency counter to retrieve frequency from.
Byte 3..7 Reserved Reserved (must be 0).

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

Byte 0: GPIO_GET_FR_CNT_VAL (0x18)

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

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

The ID number of the frequency counter to retrieve frequency from:

  • 0 – frequency counter on A.3 pin;

  • 1 – frequency counter on A.4 pin.

Bytes 3..7: Reserved

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

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

GPIO-24 adapter sends GPIO_GET_FR_CNT_VAL response after command execution. The current frequency is specified inside the response.

GPIO_GET_FR_CNT_VAL Response

Go to Command

Byte 0 GPIO_GET_FR_CNT_VAL Response ID (0x18).
Byte 1 ECHO Echo to associate a command with the response.
Byte 2 ST Status of the command execution.
Byte 3 FR_CNT_NUMBER ID number of the frequency counter, from which frequency has been retrieved.
Byte 4 FREQUENCY[2] Frequency in Hz (least significant byte).
Byte 5 FREQUENCY[1] Frequency in Hz (middle byte).
Byte 6 FREQUENCY[0] Frequency in Hz (most significant byte).
Byte 7 Reserved Reserved

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

Byte 0: GPIO_GET_FR_CNT_VAL (0x18)

Response ID (response type). This byte will contain 0x18.

Byte 1: ECHO

Echo byte copied from the corresponding command. It is used to associate the response with the specific command.

Byte 2: ST

Status of the command execution:

  • GPIO_ST_SUCCESS (0x00) – Frequency has been succesfully retrieved;

  • GPIO_ST_INVALID_FR_CNT_NUMBER (0x0A) – Invalid ID number of the frequency counter has been specified (only 0 and 1 are valid).

Byte 3: FR_CNT_NUMBER

The ID number of the frequency counter, from which current frequency has been retrieved:

  • 0 – frequency counter on A.3 pin;

  • 1 – frequency counter on A.4 pin.

Byte 4..6: FREQUENCY

The current frequency in Hz.

Byte 4: FREQUENCY[2] – least significant byte (low byte) of frequency.

Byte 5: FREQUENCY[1] – middle byte of frequency.

Byte 6: FREQUENCY[0] – most significant byte (high byte) of frequency.

Byte 7: Reserved

This byte is reserved for future usage.

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