Power Management
There are multiple ways to put a system in different power modes to save on power consumption.
Endpoint currently only support complete shutdown.
Both Real Time Clock and one of the wakeup pins can be used to wakeup the system from shutdown.
note
Power shutdown and wake-up is currently exposed only through the .NET
GHIElectronics.Endpoint.Native.Power API. A Python / C++ equivalent is
planned; for now, use .NET from any of the three language workflows (or
drive it from a short C# helper).
- .NET
- Python
- C/C++
using GHIElectronics.Endpoint.Native;
using GHIElectronics.Endpoint.Devices.Rtc;
var rtc = new RtcController();
var dt = DateTime.Now;
rtc.Now = dt;
Console.WriteLine("rtc = " + rtc.Now);
Console.WriteLine("system = " + DateTime.Now);
Power.EnableWakeup(DateTime.Now.AddSeconds(30), WakeupPin.PA0);
Console.WriteLine("Wakeup = " + DateTime.Now.AddSeconds(30).ToString());
Power.Shutdown();
# Power.Shutdown / Power.EnableWakeup are not yet exposed in the Python
# GHIElectronics.Endpoint.Core package. Use the .NET API, or invoke a
# short C# helper from Python until the Python binding ships.
// Power::Shutdown / Power::EnableWakeup are not yet exposed in the C++
// endpoint headers. Use the .NET API, or invoke a short C# helper from
// C++ until the C++ binding ships.
tip
Shutdown is brings the system down completely. Any unsaved files will be lost.