1.1.4.3 DRV_METROLOGY_Open Function
C
Returns
DRV_METROLOGY_RESULT DRV_METROLOGY_Open (
DRV_METROLOGY_START_MODE mode,
DRV_METROLOGY_CONTROL * pConfiguration
);SummaryOpens the metrology driver according to the mode parameter.
DescriptionThis routine enables the IPC peripheral and, only if a HARD start mode has been selected, handles the reset and clock lines for enabling the metrology library application. On the other hand, SOFT mode does not any effects on metrology library application running in the second processor.
Parameters| Param | Description |
|---|---|
| mode | Metrology Driver Start mode. |
| pConfiguration | Pointer to CONTROL configuration to be loaded. In case of NULL, the MCC default configuration will be loaded. |
If successful, returns DRV_METROLOGY_SUCCESS. Otherwise, it returns DRV_METROLOGY_ERROR.
Example /* Detection of the WDOG0 Reset */
if (RSTC_ResetCauseGet() == RSTC_SR_RSTTYP(RSTC_SR_RSTTYP_WDT0_RST_Val))
{
app_metrologyData.startMode = DRV_METROLOGY_START_SOFT;
}
else
{
app_metrologyData.startMode = DRV_METROLOGY_START_HARD;
}
...
case APP_METROLOGY_STATE_INIT:
{
if (DRV_METROLOGY_Open(app_metrologyData.startMode, NULL) == DRV_METROLOGY_SUCCESS)
{
if (app_metrologyData.startMode == DRV_METROLOGY_START_HARD)
{
app_metrologyData.state = APP_METROLOGY_STATE_START;
}
else
{
app_metrologyData.state = APP_METROLOGY_STATE_RUNNING;
}
}
else
{
app_metrologyData.state = APP_METROLOGY_STATE_ERROR;
}
break;
}RemarksThis routine must be called after DRV_METROLOGY_Initialize routine is called.
