1.1.1.4.14 DRV_PLC_PHY_Sleep Function

C

void DRV_PLC_PHY_Sleep (
    const DRV_HANDLE handle, 
    bool enable 
);

Summary

Allows to manage the PLC Sleep mode.

Description

This function allows to manage the PLC Sleep mode. Before going to sleep, it disables PLC interrupts, and will leave them disabled upon return to normal operation. In sleep mode, the PLC transceiver consumes as little power as possible. If there is any PLC transmission in progress, it will be silently discarded before sleep mode is entered. To exit from sleep mode it is not needed to load the PLC binary again.

Precondition

DRV_PLC_PHY_Open must have been called to obtain a valid opened device handle.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine
enableSet true to enter in sleep mode. Set false to exit from sleep mode.

Returns

None.

Example

 DRV_HANDLE handle;     // Returned from DRV_PLC_PHY_Initialize

while (true)
{
    if (sleep_condition)
    {
        DRV_PLC_PHY_Sleep (handle, true);
    }
}

Remarks

This function will never block or access any resources that may cause it to block.

This function is only available if Sleep Mode is enabled in MCC.