func (m *MCP23017Driver) Start() (errs []error) {
	if err := m.connection.I2cStart(m.mcp23017Address); err != nil {
		return []error{err}
	}
	ioconReg := m.getPort("A").IOCON  
	ioconVal := m.conf.GetUint8Value()
	if err := m.connection.I2cWrite(m.mcp23017Address, []uint8{ioconReg, ioconVal}); err != nil {
		return []error{err}
	}
	return
}
Start writes the device configuration.
package i2c
import (
	"fmt"
	"log"
	"strings"
	"time"
	"github.com/hybridgroup/gobot"
)
var (
	debug = false  
	_ gobot.Driver = (*MCP23017Driver)(nil)
)
type port struct {
	IODIR   uint8  
	IPOL    uint8  
	GPINTEN uint8  
	DEFVAL  uint8  
	INTCON  uint8  
	IOCON   uint8  
	GPPU    uint8  
	INTF    uint8  
	INTCAP  uint8  
	GPIO    uint8  
	OLAT    uint8  
}
type bank struct {
	PortA port
	PortB port
}
func getBank(bnk uint8) bank {
	if bnk == 0 {
		return bank{PortA: port{0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14}, PortB: port{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x11, 0x13, 0x15}}
	}
	return bank{PortA: port{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A}, PortB: port{0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A}}
}
type MCP23017Config struct {
	Bank   uint8
	Mirror uint8
	Seqop  uint8
	Disslw uint8
	Haen   uint8
	Odr    uint8
	Intpol uint8
}
func (mc *MCP23017Config) GetUint8Value() uint8 {
	return mc.Bank<<7 | mc.Mirror<<6 | mc.Seqop<<5 | mc.Disslw<<4 | mc.Haen<<3 | mc.Odr<<2 | mc.Intpol<<1
}
type MCP23017Driver struct {
	name            string
	connection      I2c
	conf            MCP23017Config
	mcp23017Address int
	interval        time.Duration
	gobot.Commander
	gobot.Eventer
}
func NewMCP23017Driver(a I2c, name string, conf MCP23017Config, deviceAddress int, v ...time.Duration) *MCP23017Driver {
	m := &MCP23017Driver{
		name:            name,
		connection:      a,
		conf:            conf,
		mcp23017Address: deviceAddress,
		Commander:       gobot.NewCommander(),
		Eventer:         gobot.NewEventer(),
	}
	m.AddCommand("WriteGPIO", func(params map[string]interface{}) interface{} {
		pin := params["pin"].(uint8)
		val := params["val"].(uint8)
		port := params["port"].(string)
		err := m.WriteGPIO(pin, val, port)
		return map[string]interface{}{"err": err}
	})
	m.AddCommand("ReadGPIO", func(params map[string]interface{}) interface{} {
		pin := params["pin"].(uint8)
		port := params["port"].(string)
		val, err := m.ReadGPIO(pin, port)
		return map[string]interface{}{"val": val, "err": err}
	})
	return m
}
func (m *MCP23017Driver) Name() string { return m.name }
func (m *MCP23017Driver) Connection() gobot.Connection { return m.connection.(gobot.Connection) }
func (m *MCP23017Driver) Halt() (err []error) { return }