2.1.4.7 DRV_MCMETROLOGY_IntegrationCallbackRegister Function
DRV_MCMETROLOGY_RESULT DRV_MCMETROLOGY_IntegrationCallbackRegister (
DRV_MCMETROLOGY_CALLBACK callback
);SummaryAllows a client to set a metrology integration event handling function for the driver to call back when a integration period has completed.
DescriptionThis function allows a client to register an integration period event handling function with the driver to call back when a integration period 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.
PreconditionDRV_MCMETROLOGY_Initialize must have been called before.
Parameters| Param | Description |
|---|---|
| callback | Pointer to the callback function |
If successful, returns DRV_MCMETROLOGY_SUCCESS. Otherwise, it returns DRV_MCMETROLOGY_ERROR.
Example staticvoid_APP_METROLOGY_NewIntegrationCallback(void)
{
if (app_metrologyData.state == APP_METROLOGY_STATE_RUNNING)
{
/* Signal Metrology thread to update measurements for an integration period */
OSAL_SEM_PostISR(&appMetrologySemID);
}
}
(...)
/* Set Callback for each metrology integration process */
DRV_MCMETROLOGY_IntegrationCallbackRegister(_APP_METROLOGY_NewIntegrationCallback);RemarksNone.
