10.5. GPIO_EV_FR_CNT (0x85)

GPIO-24 adapter can send GPIO_EV_FR_CNT event to your application.

You can configure event generation conditions with GPIO_SET_FR_CNT_CFG command. For more detailed information see Section 10.1, “Frequency Counter Event”.

The GPIO_EV_FR_CNT event returns the following information:

Byte 0GPIO_EV_FR_CNTEvent ID (0x85).
Byte 1CNTCNT is incremented each time after the event arises.
Byte 2FREQUENCY[2]Current frequency in Hz (least significant byte)
Byte 3FREQUENCY[1]Current frequency in Hz (middle byte)
Byte 4FREQUENCY[0]Current frequency in Hz (most significant byte)
Byte 5FR_CNT_NUMBERID number of the frequency counter, from which frequency has been retrieved.
Byte 6..7ReservedReserved

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

Byte 0: GPIO_EV_FR_CNT (0x85)

Event ID (response type). Should be set to 0x85

Byte 1: CNT

CNT byte value is incremented each time when any event arises.

Byte 2..4: FREQUENCY

The current frequency in Hz.

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

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

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

Byte 5: 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.

Bytes 6..7: Reserved

These bytes are reserved for future usage.

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