Class: PiDriver::Device::MCP23017::Iocon

Inherits:
Register
  • Object
show all
Defined in:
lib/pi_driver/device/mcp23017/register/iocon.rb

Instance Attribute Summary

Attributes inherited from Register

#address, #byte

Instance Method Summary collapse

Methods inherited from Register

#mirror_bits_from_byte, #mirror_byte_from_bits, #update_address

Constructor Details

#initialize(options) ⇒ Iocon

Returns a new instance of Iocon.



5
6
7
8
9
10
11
# File 'lib/pi_driver/device/mcp23017/register/iocon.rb', line 5

def initialize(options)
  @observer = options.delete :observer
  options[:register] = :iocon
  # IOCON is a single register with two addresses, go with PORT A
  options[:port] = :a
  super(options)
end

Instance Method Details

#bit7=(value) ⇒ Object Also known as: bank=



13
14
15
16
# File 'lib/pi_driver/device/mcp23017/register/iocon.rb', line 13

def bit7=(value)
  super
  @observer.update_registers
end