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

Raspberry Pi GPIO using the direct memory access method. This requires the bcm2835 GPIO library provided by Mike McCauley ([email protected]) at http://www.open.com.au/mikem/bcm2835/index.html. To create the shared object, download the source code from the link above. The standard Makefile compiles a statically linked library. To build a shared object, do: tar -zxf bcm2835-1.3.tar.gz cd bcm2835-1.3/src make libbcm2835.a cc -shared bcm2835.o -o libbcm2835.so Place the shared object in the same directory as the executable and other assemblies.
상속: GpioBase
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi 1 사용 예제들

공개 메소드들

메소드 설명
Destroy ( ) : void

Destroy this GPIO factory.

Dispose ( ) : void

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

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

GpioMem ( GpioPins pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize.

Access to the specified GPIO setup as an output port with an initial value of false (0).

GpioMem ( GpioPins pin, PinMode mode ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize and the I/O direction.

Access to the specified GPIO setup with the specified direction with an initial value of LOW (0).

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

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize, the I/O direction, and the initial value to write to the pin.

Access to the specified GPIO setup with the specified direction with the specified initial value.

Initialize ( ) : System.Boolean

Initialize the memory access to the GPIO.

Provision ( ) : void

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

Pulse ( ) : void

Pulses the pin 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 the specified Revision 1.0 pin.

Write ( GpioPins pin, PinState value ) : void

Write the specified pin and value.

Write ( PinState value ) : void

Write the specified value to the pin.

비공개 메소드들

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

Exports the pin setting the direction.

UnexportPin ( GpioPins pin ) : void

Unexport the GPIO.

internal_ExportPin ( Int32 pin, PinMode mode ) : void

Export the GPIO setting the direction.

internal_Read ( Int32 pin, String pinname ) : PinState

Read the value of the specified pin.

internal_UnexportPin ( Int32 pin, String gpionum ) : void

Unexports an exported pin.

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

Write the value to the specified pin.

메소드 상세

Destroy() 공개 정적인 메소드

Destroy this GPIO factory.
public static Destroy ( ) : void
리턴 void

Dispose() 공개 메소드

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

GpioMem() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize.
Access to the specified GPIO setup as an output port with an initial value of false (0).
public GpioMem ( GpioPins pin ) : System
pin GpioPins /// The pin on the board to access. ///
리턴 System

GpioMem() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize and the I/O direction.
Access to the specified GPIO setup with the specified direction with an initial value of LOW (0).
public GpioMem ( GpioPins pin, PinMode mode ) : System
pin GpioPins /// The pin on the board to access. ///
mode PinMode /// The I/0 mode of the pin. ///
리턴 System

GpioMem() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.IO.GpioMem class with the pin to initialize, the I/O direction, and the initial value to write to the pin.
Access to the specified GPIO setup with the specified direction with the specified initial value.
public GpioMem ( 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

Initialize() 공개 정적인 메소드

Initialize the memory access to the GPIO.
public static Initialize ( ) : System.Boolean
리턴 System.Boolean

Provision() 공개 메소드

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

Pulse() 공개 메소드

Pulses the pin 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.
public Read ( ) : PinState
리턴 PinState

Read() 공개 정적인 메소드

Read the specified Revision 1.0 pin.
public static Read ( GpioPins pin ) : PinState
pin GpioPins /// The pin to read. ///
리턴 PinState

Write() 공개 정적인 메소드

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

Write() 공개 메소드

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