C# Класс CyrusBuilt.MonoPi.IO.GpioFile

Raspberry Pi GPIO using the file-based access method.
Наследование: GpioBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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