Class: UChip::MCP2221::Pin

Inherits:
Struct
  • Object
show all
Defined in:
lib/uchip/mcp2221.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#chipObject

Returns the value of attribute chip

Returns:

  • (Object)

    the current value of chip



266
267
268
# File 'lib/uchip/mcp2221.rb', line 266

def chip
  @chip
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



266
267
268
# File 'lib/uchip/mcp2221.rb', line 266

def number
  @number
end

Instance Method Details

#output!Object



267
268
269
# File 'lib/uchip/mcp2221.rb', line 267

def output!
  chip.configure_gpio number, :output
end

#valueObject



271
272
273
# File 'lib/uchip/mcp2221.rb', line 271

def value
  chip.gpio_value number
end

#value=(v) ⇒ Object



275
276
277
# File 'lib/uchip/mcp2221.rb', line 275

def value= v
  chip.set_gpio_value number, v
end