Jump to main content

# 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

Param | Description
--- | ---
handle | A valid open-instance handle, returned from the driver's open routine.
enable | Set 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.

Rev: G