Jump to main content

# 1.2.4.4.6 SRV_PVDDMON_CALLBACK Typedef

## C

    typedef void (*SRV_PVDDMON_CALLBACK)( SRV_PVDDMON_CMP_MODE cmpMode, uintptr_t context );

## Summary

Pointer to a PVDD Monitor Event handler function.

## Description

This data type defines the required function signature for the PVDD Monitor Event handling callback function. A client must register a pointer using the callback register function whose function signature match the types specified by this function pointer in order to receive a notification related the comparison event.

## Parameters

Param | Description
--- | ---
cmpMode | Comparison mode - SRV_PVDDMON_CMP_MODE.
context | Pointer to parameters to be passed to Handler function.

## Returns

None.

## Example

    static void APP_PLC_PVDDMonitorCb( SRV_PVDDMON_CMP_MODE cmpMode, uintptr_t context )
    {
        (void)context;

        if (cmpMode == SRV_PVDDMON_CMP_MODE_OUT)
        {
            /* PLC Transmission is not permitted */
            DRV_PLC_PHY_EnableTX(appPlc.drvPl360Handle, false);
            appPlc.pvddMonTxEnable = false;
            /* Restart PVDD Monitor to check when VDD is within the comparison window */
            SRV_PVDDMON_Restart(SRV_PVDDMON_CMP_MODE_IN);
        }
        else
        {
            /* PLC Transmission is permitted again */
            DRV_PLC_PHY_EnableTX(appPlc.drvPl360Handle, true);
            appPlc.pvddMonTxEnable = true;
            /* Restart PVDD Monitor to check when VDD is out of the comparison window */
            SRV_PVDDMON_Restart(SRV_PVDDMON_CMP_MODE_OUT);
        }
    }

Rev: G