Interface IPowerController
Interface for controlling power-related functionality of the device.
Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface IPowerController
Methods
Reset()
Resets the device.
View Source
Declaration
void Reset()
Sleep(TimeSpan)
Puts the device into low-power (sleep) mode for the specified amount of time.
View Source
Declaration
void Sleep(TimeSpan duration)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | duration | The amount of time to sleep. |
Sleep(DateTime)
Puts the device into low-power (sleep) mode until the specified time.
View Source
Declaration
void Sleep(DateTime wakeTime)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | wakeTime | The UTC time to wake. |
Sleep(IPin, InterruptMode, ResistorMode)
Puts the device into low-power (sleep) mode until an interrupt occurs
View Source
Declaration
void Sleep(IPin interruptPin, InterruptMode interruptMode, ResistorMode resistorMode = ResistorMode.Disabled)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Hardware.IPin | interruptPin | The IPin to monitor for the wake interrupt. |
Meadow.Hardware.InterruptMode | interruptMode | The interrupt mode used for wake |
Meadow.Hardware.ResistorMode | resistorMode | The resistor mode used for wake |
RegisterForSleep(ISleepAwarePeripheral)
Registers a peripheral to be aware of sleep mode.
View Source
Declaration
void RegisterForSleep(ISleepAwarePeripheral peripheral)
Parameters
Type | Name | Description |
---|---|---|
Meadow.ISleepAwarePeripheral | peripheral | The peripheral to register. |
Events
BeforeReset
Event called before a software reset.
View Source
Declaration
event PowerTransitionHandler BeforeReset
Event Type
BeforeSleep
Event called before entering sleep mode.
View Source
Declaration
event PowerTransitionHandler BeforeSleep
Event Type
AfterWake
Event called after waking from sleep mode.
View Source
Declaration
event EventHandler<WakeSource> AfterWake
Event Type
System.EventHandler<Meadow.Hardware.WakeSource>