1.1.3.4.19 DRV_METROLOGY_GetRMSSign Function

C

DRV_METROLOGY_RMS_SIGN DRV_METROLOGY_GetRMSSign(DRV_METROLOGY_RMS_TYPE type);

Summary

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

Description

For further information about RMS types, refer to DRV_METROLOGY_RMS_TYPE definition.

Parameters

ParamDescription
typeIndicate what type of measurement is obtained.

Returns

The RMS sign of the last RMS value. Positive sign is identified as RMS_SIGN_POSITIVE (0), negative sign as RMS_SIGN_NEGATIVE (1).

Example

bool APP_METROLOGY_GetRMS(DRV_METROLOGY_RMS_TYPE rmsId, uint32_t * rmsValue, DRV_METROLOGY_RMS_SIGN * sign)
{
    if (rmsId >= RMS_TYPE_NUM)
    {
        return false;
    }

    if (sign != NULL)
    {
        *sign = DRV_METROLOGY_GetRMSSign(rmsId);
    }

    *rmsValue = DRV_METROLOGY_GetRMSValue(rmsId);
    return true;
}

Remarks

None.