struct Pi::GPIOPin

Defined in:

pi-gpio.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(number : Int32) #

[View source]

Instance Method Detail

def as_input #

Configures this GPIO pin for input. This is a shortcut for self.mode = Mode::Input.


[View source]
def as_output #

Configures this GPIO pin for output. This is a shortcut for self.mode = Mode::Output.


[View source]
def high! #

Sets this GPIO pin to 'High' voltage. This is a shortcut for self.state = State::High.


[View source]
def high?(*args, **options) #

Checks whether this GPIO pin is on 'High' voltage. This is a shortcut for self.state.high?.


[View source]
def high?(*args, **options, &) #

Checks whether this GPIO pin is on 'High' voltage. This is a shortcut for self.state.high?.


[View source]
def low! #

Sets this GPIO pin to 'Low' voltage. This is a shortcut for self.state = State::Low.


[View source]
def low?(*args, **options) #

Checks whether this GPIO pin is on 'Low' voltage. This is a shortcut for self.state.low?.


[View source]
def low?(*args, **options, &) #

Checks whether this GPIO pin is on 'Low' voltage. This is a shortcut for self.state.low?.


[View source]
def mode : Pi::GPIOPin::Mode #

The operation mode of this GPIO pin. Initially set as Undefined, this property must be set to any of the other available Modes prior to access.


[View source]
def mode=(m : Mode) #

[View source]
def mode=(mode : Pi::GPIOPin::Mode) #

The operation mode of this GPIO pin. Initially set as Undefined, this property must be set to any of the other available Modes prior to access.


[View source]
def state #

The current voltage at this GPIO pin: Either High (3.3V) or Low (0V).


[View source]
def state=(value) #

:ditto


[View source]