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
| Type | Kind | Summary |
|---|---|---|
| Power.WakeupPin | Enum | GPIO 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.
| Parameter | Type | Description |
|---|---|---|
wakeupPin | WakeupPin | The pin to monitor. See Power.WakeupPin. |
edge | PinEventTypes | PinEventTypes.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.
| Parameter | Type | Description |
|---|---|---|
dtWakeup | DateTime | Absolute time at which to wake. Use DateTime.MaxValue for no RTC alarm. |
wakeupPin | WakeupPin | Optional wake-up pin; defaults to WakeupPin.None (no pin wake). |
edge | PinEventTypes | Active 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.