Skip to main content

Power Class

Package: GHIElectronics.Endpoint.Native
Namespace: GHIElectronics.Endpoint.Native

Reboot, shutdown and wake-up control for the Endpoint board.

public static class Power

Nested Types​

TypeKindSummary
Power.WakeupPinEnumGPIO pins the power block can monitor to wake the system from standby.

Methods​

EnableWakeup(WakeupPin wakeupPin, PinEventTypes edge)​

public static void EnableWakeup(WakeupPin wakeupPin, PinEventTypes edge)

Arms a GPIO wake-up input so a transition on it brings the system out of standby.

ParameterTypeDescription
wakeupPinWakeupPinThe pin to monitor. See Power.WakeupPin.
edgePinEventTypesPinEventTypes.Rising wakes on a high level with pull-down enabled; PinEventTypes.Falling wakes on a low level with pull-up enabled. PinEventTypes.None is not supported and throws.

EnableWakeup(DateTime dtWakeup, WakeupPin wakeupPin, PinEventTypes edge)​

public static void EnableWakeup(DateTime dtWakeup, WakeupPin wakeupPin, PinEventTypes edge)

Arms an RTC alarm and, optionally, a GPIO wake-up input so either event brings the system out of standby. The RTC alarm is scheduled via rtcwake; pass DateTime.MaxValue to skip the RTC and arm only the pin.

ParameterTypeDescription
dtWakeupDateTimeAbsolute time at which to wake. Use DateTime.MaxValue for no RTC alarm.
wakeupPinWakeupPinOptional wake-up pin; defaults to WakeupPin.None (no pin wake).
edgePinEventTypesActive edge for the pin wake. Defaults to PinEventTypes.Rising. PinEventTypes.None is not supported and throws.

Reboot()​

public static void Reboot()

Reboots the board by invoking reboot. The call does not return once the system restarts.

Shutdown()​

public static void Shutdown()

Puts the board into standby by programming the power and clock registers directly. Blocks forever in a wait-for-interrupt loop; execution resumes only after a wake-up event resets the processor.