Show / Hide Table of Contents

    Class Sleep

    Encapsulates ESP32 sleep functions.

    Inheritance
    Object
    Sleep
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: nanoFramework.Hardware.Esp32
    Assembly: nanoFramework.Hardware.Esp32.dll
    Syntax
    public class Sleep

    Methods

    | Improve this Doc View Source

    EnableWakeupByMultiPins(Sleep.WakeupGpioPin, Sleep.WakeupMode)

    Enable wakeup using multiple pins.

    Declaration
    public static EspNativeError EnableWakeupByMultiPins(Sleep.WakeupGpioPin pins, Sleep.WakeupMode mode)
    Parameters
    Type Name Description
    Sleep.WakeupGpioPin pins

    Combination of pins that are enabled for wakeup.

    Sleep.WakeupMode mode

    Logical mode used for wakeup to occur.

    Returns
    Type Description
    EspNativeError

    Returns ESP32 native error enumeration.

    Remarks

    Only pins that are RTC connected.

    | Improve this Doc View Source

    EnableWakeupByPin(Sleep.WakeupGpioPin, Int32)

    Enable wakeup using a gpio pin.

    Declaration
    public static EspNativeError EnableWakeupByPin(Sleep.WakeupGpioPin pin, int level)
    Parameters
    Type Name Description
    Sleep.WakeupGpioPin pin

    GPIO number used as wakeup source. Only pins that have RTC functionality can be used. 0,2,4,12->15,25->27,32->39

    Int32 level

    Analog threshold at or above which pin causes wake up, or zero if pin is not active for wakeup.

    Returns
    Type Description
    EspNativeError

    Returns ESP32 native error enumeration.

    | Improve this Doc View Source

    EnableWakeupByTimer(TimeSpan)

    Enable Wakeup by Timer.

    Declaration
    public static EspNativeError EnableWakeupByTimer(TimeSpan time)
    Parameters
    Type Name Description
    TimeSpan time

    Period after which wakeup occurs.

    Returns
    Type Description
    EspNativeError

    returns ESP32 native error enumeration.

    | Improve this Doc View Source

    EnableWakeupByTouchPad()

    Enable wakeup by Touchpad.

    Declaration
    public static EspNativeError EnableWakeupByTouchPad()
    Returns
    Type Description
    EspNativeError

    Returns ESP32 native error enumeration.

    | Improve this Doc View Source

    GetWakeupCause()

    Get the cause for waking up.

    Declaration
    public static Sleep.WakeupCause GetWakeupCause()
    Returns
    Type Description
    Sleep.WakeupCause

    Returns the wakeup cause.

    | Improve this Doc View Source

    GetWakeupGpioPin()

    Returns a combination of pins that caused the wakeup.

    Declaration
    public static Sleep.WakeupGpioPin GetWakeupGpioPin()
    Returns
    Type Description
    Sleep.WakeupGpioPin

    Returns a combination of the pins that caused the wakeup.

    | Improve this Doc View Source

    GetWakeupTouchpad()

    Get the Touchpad which caused the wakeup.

    Declaration
    public static Sleep.TouchPad GetWakeupTouchpad()
    Returns
    Type Description
    Sleep.TouchPad

    Returns TouchPad number which caused the wakeup, else None.

    | Improve this Doc View Source

    StartDeepSleep()

    Enter deep sleep using configured wakeup sources.

    Declaration
    public static void StartDeepSleep()
    Remarks

    After a call to this method the device enters deep sleep, a wakeup source will wake the device and the execution will start as if it was a reset. After this occurs the cause can be queried using GetWakeupCause(). Keep in mind that the execution WILL NOT continue after the call to this method. This call never returns. If no wakeup sources are configured then the device enters an indefinite sleep.

    See Also
    EnableWakeupByMultiPins(Sleep.WakeupGpioPin, Sleep.WakeupMode)
    EnableWakeupByPin(Sleep.WakeupGpioPin, Int32)
    EnableWakeupByTimer(TimeSpan)
    EnableWakeupByTouchPad()
    | Improve this Doc View Source

    StartLightSleep()

    Enter light sleep with the configured wakeup options.

    Declaration
    public static EspNativeError StartLightSleep()
    Returns
    Type Description
    EspNativeError

    Returns ESP32 native error enumeration, ESP_ERR_INVALID_STATE if Wifi or BT is not stopped.

    Extension Methods

    LogDispatcher.GetCurrentClassLogger(Object)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX