Class: LinkDemo::GPIO

Inherits:
Object
  • Object
show all
Includes:
Origen::Model
Defined in:
lib/link_demo/gpio.rb

Instance Method Summary (collapse)

Constructor Details

- (GPIO) initialize(options = {})

Returns a new instance of GPIO



5
6
7
# File 'lib/link_demo/gpio.rb', line 5

def initialize(options = {})
  instantiate_registers(options)
end

Instance Method Details

- (Object) instantiate_registers(options = {})



9
10
11
12
13
14
15
16
# File 'lib/link_demo/gpio.rb', line 9

def instantiate_registers(options = {})
  # Data output register
  add_reg :pdor, 0
  # Data input register
  add_reg :pdir, 0x10
  # Data direction register
  add_reg :pddr, 0x14
end