C# 클래스 CyrusBuilt.MonoPi.IO.GpioFile

Raspberry Pi GPIO using the file-based access method.
상속: GpioBase
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi 1 사용 예제들

공개 메소드들

메소드 설명
Cleanup ( ) : void

Unexports all pins in the registry.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.IO.GpioFile object.

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

GpioFile ( GpioPins pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access.

GpioFile ( GpioPins pin, PinMode mode ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access and the I/O direction.

GpioFile ( GpioPins pin, PinMode mode, PinState initialValue ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access, the I/O direction, and the initial value.

Provision ( ) : void

Provisions the pin (initialize to specified mode and make active).

Pulse ( ) : void

Pulse the pin output for 500ms.

Pulse ( Int32 millis ) : void

Pulse the pin output for the specified number of milliseconds.

Read ( ) : PinState

Read a value from the pin.

Read ( GpioPins pin ) : PinState

Read a value from the specified pin.

Write ( GpioPins pin, PinState value ) : void

Writes the specified value to the specified GPIO pin.

Write ( PinState value ) : void

Write the specified value to the pin.

비공개 메소드들

메소드 설명
ExportPin ( GpioPins pin, PinMode mode ) : void

Exports the GPIO setting the direction. This creates the /sys/class/gpio/gpioXX directory.

UnexportPin ( GpioPins pin ) : void

Unexport the GPIO. This removes the /sys/class/gpio/gpioXX directory.

internal_ExportPin ( Int32 pin, PinMode mode, String pinnum, String pinname ) : void

Exports the GPIO setting the direction. This creates the /sys/class/gpio/gpioXX directory.

internal_Read ( Int32 pin, String gpionum, String gpioname ) : PinState

Reads the value of the specified GPIO pin.

internal_UnexportPin ( Int32 pin, String gpioNum ) : void

Unexport the GPIO. This removes the /sys/class/gpio/gpioXX directory.

internal_Write ( Int32 pin, PinState value, String gpionum, String pinname ) : void

Writes the specified value to the specified GPIO pin.

메소드 상세

Cleanup() 공개 정적인 메소드

Unexports all pins in the registry.
public static Cleanup ( ) : void
리턴 void

Dispose() 공개 메소드

Releases all resource used by the CyrusBuilt.MonoPi.IO.GpioFile object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.IO.GpioFile. The Dispose method leaves the CyrusBuilt.MonoPi.IO.GpioFile in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.IO.GpioFile so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.IO.GpioFile was occupying.
public Dispose ( ) : void
리턴 void

GpioFile() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access.
public GpioFile ( GpioPins pin ) : System
pin GpioPins /// The pin on the board to access. ///
리턴 System

GpioFile() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access and the I/O direction.
public GpioFile ( GpioPins pin, PinMode mode ) : System
pin GpioPins /// The pin on the board to access. ///
mode PinMode /// The I/0 mode of the pin. ///
리턴 System

GpioFile() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioFile class with the Rev1 pin to access, the I/O direction, and the initial value.
public GpioFile ( GpioPins pin, PinMode mode, PinState initialValue ) : System
pin GpioPins /// The pin on the board to access. ///
mode PinMode /// The I/0 mode of the pin. ///
initialValue PinState /// The pin's initial value. ///
리턴 System

Provision() 공개 메소드

Provisions the pin (initialize to specified mode and make active).
public Provision ( ) : void
리턴 void

Pulse() 공개 메소드

Pulse the pin output for 500ms.
public Pulse ( ) : void
리턴 void

Pulse() 공개 메소드

Pulse the pin output for the specified number of milliseconds.
/// An attempt was made to pulse an input pin. ///
public Pulse ( Int32 millis ) : void
millis System.Int32 /// The number of milliseconds to wait between states. ///
리턴 void

Read() 공개 메소드

Read a value from the pin.
/// Cannot read the value from the pin. The path does not exist. ///
public Read ( ) : PinState
리턴 PinState

Read() 공개 정적인 메소드

Read a value from the specified pin.
/// The specified pin could not be read (device does path does not exist). ///
public static Read ( GpioPins pin ) : PinState
pin GpioPins /// The pin to read from. ///
리턴 PinState

Write() 공개 정적인 메소드

Writes the specified value to the specified GPIO pin.
public static Write ( GpioPins pin, PinState value ) : void
pin GpioPins /// The pin to write the value to. ///
value PinState /// The value to write to the pin. ///
리턴 void

Write() 공개 메소드

Write the specified value to the pin.
public Write ( PinState value ) : void
value PinState /// The value to write to the pin. ///
리턴 void