class PiDriver::Device::MCP23017::Register::RegisterHelper
Constants
- DEFVAL
- GPINTEN
- GPIO
- GPPU
- INTCAP
- INTCON
- INTF
- IOCON
- IODIR
- IPOL
- OLAT
- VALID_REGISTERS
Public Class Methods
address(options)
click to toggle source
# File lib/pi_driver/device/mcp23017/register/register_helper.rb, line 32 def self.address(options) bank = options[:bank] port = options[:port] register = options[:register] port_index = Port::VALID_PORTS.index(port) register_index = VALID_REGISTERS.index(register) if bank == Utils::State::LOW port_index + register_index * 0x02 else port_index * 0x10 + register_index end end