2.1.4.3 DRV_MCMETROLOGY_Open Function
C
Returns
DRV_MCMETROLOGY_RESULT DRV_MCMETROLOGY_Open (
DRV_MCMETROLOGY_START_MODE mode,
DRV_MCMETROLOGY_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_MCMETROLOGY_SUCCESS. Otherwise, it returns DRV_MCMETROLOGY_ERROR.
Example /* Detection of the WDOG0 Reset */
if (RSTC_ResetCauseGet() == RSTC_SR_RSTTYP(RSTC_SR_RSTTYP_WDT0_RST_Val))
{
app_metrologyData.startMode = DRV_MCMETROLOGY_START_SOFT;
}
else
{
app_metrologyData.startMode = DRV_MCMETROLOGY_START_HARD;
}
...
case APP_METROLOGY_STATE_INIT:
{
if (DRV_MCMETROLOGY_Open(app_metrologyData.startMode, NULL) == DRV_MCMETROLOGY_SUCCESS)
{
if (app_metrologyData.startMode == DRV_MCMETROLOGY_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_MCMETROLOGY_Initialize routine is called.
