The GPIO_EV_CMP event can be generated for either of the comparators. The event can be sent:
when the comparison results change;
periodically with the predefined repeat interval.
For more detailed information see Section 8.3, “Comparator module event”.
| Byte 0 | GPIO_EV_CMP | Event ID (0x84). |
| Byte 1 | CNT | CNT byte value is incremented each time after the event arises. |
| Byte 2 | CMP0_OUT | Result of comparison for CMP0 comparator. |
| Byte 3 | CMP1_OUT | Result of comparison for CMP1 comparator. |
| Byte 4 | EVENT_COND0 | Condition of sending the event for CMP0 comparator. |
| Byte 5 | EVENT_COND1 | Condition of sending the event for CMP1 comparator. |
| Byte 6..7 | Reserved | Reserved |
Event is an 8-byte array of the following format:
Event ID (event type). This byte will contain 0x84.
CNT byte value is incremented each time after the GPIO_EV_CMP event arises.
The result of comparison for CMP0 comparator. This byte contains valid data only if Byte 4: EVENT_COND0 is not GPIO_CMP_EV_NONE (0x00).
The comparator output can be inverted with Bit 5: CMP0_INV in Byte 2: CMP_CFG of GPIO_SET_CMP_CFG command.
If CMP0_INV = 0:
0, if VIN+ < VIN-;
1, if VIN+ > VIN-.
0, if VIN+ > VIN-;
1, if VIN+ < VIN-.
The result of comparison for CMP1 comparator. This byte contains valid data only if Byte 5: EVENT_COND1 is not GPIO_CMP_EV_NONE (0x00).
The comparator output can be inverted with Bit 4: CMP1_INV in Byte 2: CMP_CFG of GPIO_SET_CMP_CFG command.
If CMP1_INV = 0:
0, if VIN+ > VIN-;
1, if VIN+ < VIN-.
0, if VIN+ < VIN-;
1, if VIN+ > VIN-.
This byte contains the current event for CMP0 comparator. The following events are possible:
The CMP0 comparator has not taken part in generation of the event. Data, stored in Byte 2: CMP0_OUT, is not valid.
The event is sent because CMP0 comparator output value has changed.
The event is sent periodically with the predefined repeat interval.
This byte contains current event for CMP1 comparator. The following events are possible:
The CMP1 comparator has not taken part in generation of the event. Data, stored in Byte 3: CMP1_OUT, is not valid.
The event is sent because CMP1 comparator output value has changed.
The event is sent periodically with the predefined repeat interval.
These bytes are reserved for future usage.
For convenience GPIO_EV_CMP structure is declared in reports.h file.