1.1.3.4.9 DRV_METROLOGY_HarmonicAnalysisCallbackRegister Function

C

DRV_METROLOGY_RESULT DRV_METROLOGY_HarmonicAnalysisCallbackRegister (
    DRV_METROLOGY_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_METROLOGY_Initialize routine is called, since the initialization routine sets a NULL pointer to indicate no callback.

Parameters

ParamDescription
callbackPointer to the function to be called

Returns

If successful, returns DRV_METROLOGY_SUCCESS. Otherwise, it returns DRV_METROLOGY_ERROR.

Example

    static void _APP_METROLOGY_HarmonicAnalysisCallback(uint8_t harmonicNum)
    {
        if (app_metrologyData.pHarmonicAnalysisCallback)
        {
            app_metrologyData.harmonicAnalysisPending = false;
            app_metrologyData.pHarmonicAnalysisCallback(harmonicNum);
        }
    }

    (...)

    // Set Callback for harmonic analysis process
    DRV_METROLOGY_HarmonicAnalysisCallbackRegister(_APP_METROLOGY_HarmonicAnalysisCallback);

Remarks

None.