2.1.4.9 DRV_MCMETROLOGY_HarmonicAnalysisCallbackRegister Function

C
DRV_MCMETROLOGY_RESULT DRV_MCMETROLOGY_HarmonicAnalysisCallbackRegister (
    DRV_MCMETROLOGY_HARMONIC_ANALYSIS_CALLBACK callback
);
Summary

Registers a function with the metrology driver to be called back when the harmonic analysis has completed.

Description

This function allows a client to register a handling function with the driver to call back when a harmonic analysis has completed. This function must be always called after DRV_MCMETROLOGY_Initialize routine is called, since the initialization routine sets a NULL pointer to indicate no callback.

Precondition

DRV_MCMETROLOGY_Initialize must have been called before.

Parameters
ParamDescription
callbackPointer to the function to be called
Returns

If successful, returns DRV_MCMETROLOGY_SUCCESS. Otherwise, it returns DRV_MCMETROLOGY_ERROR.

Example
    staticvoid_APP_METROLOGY_HarmonicAnalysisCallback(uint32_t harmonicBitmap)
    {
        if (app_metrologyData.pHarmonicAnalysisCallback)
        {
            app_metrologyData.harmonicAnalysisPending = false;
            app_metrologyData.pHarmonicAnalysisCallback(harmonicBitmap);
        }
    }

    (...)

    // Set Callback for harmonic analysis process
    DRV_MCMETROLOGY_HarmonicAnalysisCallbackRegister(_APP_METROLOGY_HarmonicAnalysisCallback);
Remarks

None.