1.1.3.4.8 DRV_METROLOGY_CalibrationCallbackRegister Function
C
DRV_METROLOGY_RESULT DRV_METROLOGY_CalibrationCallbackRegister ( DRV_METROLOGY_CALIBRATION_CALLBACK callback );
Summary
Registers a function with the metrology driver to be called back when the calibration process has completed.
Description
This function allows a client to register a handling function with the driver to call back when a calibration process 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.
Precondition
DRV_METROLOGY_Initialize must have been called before.
Parameters
Param | Description |
---|---|
callback | Pointer to the function to be called |
Returns
If successful, returns DRV_METROLOGY_SUCCESS. Otherwise, it returns DRV_METROLOGY_ERROR.
Example
static void _APP_METROLOGY_CalibrationCallback(bool result)
{
if (app_metrologyData.pCalibrationCallback)
{
app_metrologyData.pCalibrationCallback(result);
}
/* Signal Metrology to exit calibration status */
OSAL_SEM_Post(&appMetrologyCalibrationSemID);
}
(...)
/* Set Callback for calibration process */
DRV_METROLOGY_CalibrationCallbackRegister(_APP_METROLOGY_CalibrationCallback);
Remarks
None.