C# Class CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent

A power control component implemented using a single native GPIO configured as an output.
Inheritance: PowerBase
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent was occupying.

GpioPowerComponent ( IRaspiGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent class with the GPIO pin that will be used to control the component.

GpioPowerComponent ( IRaspiGpio pin, PinState onState, PinState offState ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent class with the GPIO pin that will be used to control the component and the pin states that will be used to consider the device on or off.

Private Methods

Method Description
Output_StateChanged ( Object sender, PinStateChangeEventArgs e ) : void

Handles the pin state change event by firing the corresponding power state change event.

Method Details

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent was occupying.
public Dispose ( ) : void
return void

GpioPowerComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent class with the GPIO pin that will be used to control the component.
public GpioPowerComponent ( IRaspiGpio pin ) : System
pin IRaspiGpio /// The GPIO pin that will be used to control the component. ///
return System

GpioPowerComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Power.GpioPowerComponent class with the GPIO pin that will be used to control the component and the pin states that will be used to consider the device on or off.
public GpioPowerComponent ( IRaspiGpio pin, PinState onState, PinState offState ) : System
pin IRaspiGpio /// The GPIO pin that will be used to control the component. ///
onState PinState /// The pin state to consider the device "on". ///
offState PinState /// The pin state to consider the device "off". ///
return System