You are here

GPIO_EV_ADC (0x83)

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

You can configure event generation conditions with GPIO_SET_ADC_CHANNEL_CFG command. For more detailed information see Section 7.4, “ADC Event”.

Byte 0 GPIO_EV_ADC Event ID (0x83).
Byte 1 CNT Event counter
Byte 2 CHANNEL ID number of the ADC channel which has generated the event
Byte 3 ADC_VAL_LSB Current voltage (least significant byte)
Byte 4 ADC_VAL_MSB Current voltage (most significant byte)
Byte 5 EVENT_CONDITION Condition of the event sending
Bytes 6..7 Reserved Reserved

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

Byte 0: GPIO_EV_ADC (0x83)

Event ID (event type). This byte will contain 0x83.

Byte 1: CNT

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

Byte 2: CHANNEL

The number of the ADC channel which has generated the event:

  • 0 – C.1 pin;

  • 1 – C.2 pin;

  • 2 – C.5 pin;

  • 3 – C.6 pin;

  • 4 – B.3 pin.

Byte 3..4: ADC_VAL_LSB/ADC_VAL_MSB

Current voltage.

Byte 3: ADC_VAL_LSB – least significant byte of the voltage.

Byte 4: ADC_VAL_MSB – most significant byte of the voltage.

Byte 5: EVENT_CONDITION

The condition of the event generation:

  • GPIO_ADC_EV_BELOW (0x1) – the input voltage descends below the low threshold value.

  • GPIO_ADC_EV_ABOVE (0x2) – the input voltage rises above high threshold value.

  • GPIO_ADC_EV_OUTSIDE (0x3) – the input voltage exceeds the limits specified by low and high threshold values.

  • GPIO_ADC_EV_INSIDE (0x4) – 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.

For more detailed information about the event generation see Section 7.4, “ADC Event”.

Bytes 6..7: Reserved

These bytes are reserved for future usage.

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