Class: BeagleBoard::Base::Gpio

Inherits:
Object
  • Object
show all
Defined in:
lib/beagleboard/base/gpio.rb

Direct Known Subclasses

FreeBSD::Gpio, Linux::Gpio

Instance Method Summary collapse

Constructor Details

#initialize(bank, gpio) ⇒ Gpio

Returns a new instance of Gpio.



4
5
6
7
8
# File 'lib/beagleboard/base/gpio.rb', line 4

def initialize(bank, gpio)
  @bank = bank
  @gpio = gpio
  open
end

Instance Method Details

#closeObject



12
# File 'lib/beagleboard/base/gpio.rb', line 12

def close; end

#directionObject

Raises:

  • (StandardError)


14
15
16
# File 'lib/beagleboard/base/gpio.rb', line 14

def direction
  raise StandardError, 'Not supported'
end

#direction=(value) ⇒ Object

Raises:

  • (StandardError)


18
19
20
21
22
# File 'lib/beagleboard/base/gpio.rb', line 18

def direction=(value)
  raise StandardError, 'Invalid direction' unless %i[in out low high].include?(value)

  value.to_s
end

#openObject



10
# File 'lib/beagleboard/base/gpio.rb', line 10

def open; end

#valueObject

Raises:

  • (StandardError)


24
25
26
# File 'lib/beagleboard/base/gpio.rb', line 24

def value
  raise StandardError, 'Not supported'
end

#value=(_value) ⇒ Object

Raises:

  • (StandardError)


28
29
30
# File 'lib/beagleboard/base/gpio.rb', line 28

def value=(_value)
  raise StandardError, 'Not supported'
end