1.1.4.22 DRV_METROLOGY_GetMeasureSign Function

C
DRV_METROLOGY_MEASURE_SIGN DRV_METROLOGY_GetMeasureSign(DRV_METROLOGY_MEASURE_TYPE type);
Summary

Gets the sign of the last value of the selected measurement type.

Description

Gets the sign of the last value of the selected measurement type. Values are updated at the end of each integration period. For additional information about Measurement types, refer to the DRV_METROLOGY_MEASURE_TYPE definition.

Parameters
ParamDescription
typeIndicate what type of measurement is obtained.
Returns

The sign of the last value for the selected type. Positive sign is identified as MEASURE_SIGN_POSITIVE (0), negative sign as MEASURE_SIGN_NEGATIVE (1).

Example
bool APP_METROLOGY_GetMeasure(DRV_METROLOGY_MEASURE_TYPE measureId, uint32_t * value, DRV_METROLOGY_MEASURE_SIGN * sign)
{
    if (measureId >= MEASURE_TYPE_NUM)
    {
        return false;
    }

    if (sign != NULL)
    {
        *sign = DRV_METROLOGY_GetMeasureSign(measureId);
    }

    *value = DRV_METROLOGY_GetMeasureValue(measureId);
    return true;
}
Remarks

None.