3.3.4.18 EMAFE_SetComparisonModeChannelA Function

C

void EMAFE_SetComparisonModeChannelA ( EMAFE_COMPARISON_DATA *data );

Summary

Set the comparison mode between channel A and two thresholds.

Description

This feature compares one channel with two thresholds. A comparison event is triggered as a result of the combination of two events.

The first event is triggered when the channel data is lower than the first threshold, whereas the second event is triggered if the channel data is greater than the second threshold. The combination can be defined as an “or” or “and” between the two events.

Therefore, the comparison can detect if the channel data is out of range, in range or higher or lower than a threshold.

Precondition

None.

Parameters

ParamDescription
dataPointer to the configuration values of the channel comparison mode.

Returns

None.

Example


EMAFE_COMPARISON_DATA chnComparison;

chnComparison.channel = EMAFE_COMP_CHN_2_ID;
chnComparison.condition = EMAFE_CONDITION_OR;
chnComparison.threshold1 = threshold1Value;
chnComparison.threshold2 = threshold2Value;
EMAFE_SetComparisonModeChannelA(&chnComparison);

Remarks

Figure 3-25. Out-of-Range Detection of Signed Data (EMAFE_CONDITION_OR)
Figure 3-26. In-Range Detection of Signed Data (EMAFE_CONDITION_AND)