

const byte _MCP23017_I2C__MODULE_ADDRESS_0                             = 0x00;
const byte _MCP23017_I2C__MODULE_ADDRESS_1                             = 0x01;
const byte _MCP23017_I2C__MODULE_ADDRESS_2                             = 0x02;
const byte _MCP23017_I2C__MODULE_ADDRESS_3                             = 0x03;
const byte _MCP23017_I2C__MODULE_ADDRESS_4                             = 0x04;
const byte _MCP23017_I2C__MODULE_ADDRESS_5                             = 0x05;
const byte _MCP23017_I2C__MODULE_ADDRESS_6                             = 0x06;
const byte _MCP23017_I2C__MODULE_ADDRESS_7                             = 0x07;

// Port Direction
const byte _MCP23017_PORT_DIRECTION_OUTPUT                             = 0x00;
const byte _MCP23017_PORT_DIRECTION_INPUT                              = 0xFF;

// BANK 1 register configuration
const byte _MCP23017_IODIRA_BANK1                                      = 0x00;
const byte _MCP23017_IPOLA_BANK1                                       = 0x01;
const byte _MCP23017_GPINTENA_BANK1                                    = 0x02;
const byte _MCP23017_DEFVALA_BANK1                                     = 0x03;
const byte _MCP23017_INTCONA_BANK1                                     = 0x04;
const byte _MCP23017_IOCON_BANK1                                       = 0x05;
const byte _MCP23017_GPPUA_BANK1                                       = 0x06;
const byte _MCP23017_INTFA_BANK1                                       = 0x07;
const byte _MCP23017_INTCAPA_BANK1                                     = 0x08;
const byte _MCP23017_GPIOA_BANK1                                       = 0x09;
const byte _MCP23017_OLATA_BANK1                                       = 0x0A;
const byte _MCP23017_IODIRB_BANK1                                      = 0x10;
const byte _MCP23017_IPOLB_BANK1                                       = 0x11;
const byte _MCP23017_GPINTENB_BANK1                                    = 0x12;
const byte _MCP23017_DEFVALB_BANK1                                     = 0x13;
const byte _MCP23017_INTCONB_BANK1                                     = 0x14;
const byte _MCP23017_IOCONO_BANK1                                      = 0x15;
const byte _MCP23017_GPPUB_BANK1                                       = 0x16;
const byte _MCP23017_INTFB_BANK1                                       = 0x17;
const byte _MCP23017_INTCAPB_BANK1                                     = 0x18;
const byte _MCP23017_GPIOB_BANK1                                       = 0x19;
const byte _MCP23017_OLATB_BANK1                                       = 0x1A;

// BANK 0 register configuration
const byte _MCP23017_IODIRA_BANK0                                      = 0x00;
const byte _MCP23017_IODIRB_BANK0                                      = 0x01;
const byte _MCP23017_IPOLA_BANK0                                       = 0x02;
const byte _MCP23017_IPOLB_BANK0                                       = 0x03;
const byte _MCP23017_GPINTENA_BANK0                                    = 0x04;
const byte _MCP23017_GPINTENB_BANK0                                    = 0x05;
const byte _MCP23017_DEFVALA_BANK0                                     = 0x06;
const byte _MCP23017_DEFVALB_BANK0                                     = 0x07;
const byte _MCP23017_INTCONA_BANK0                                     = 0x08;
const byte _MCP23017_INTCONB_BANK0                                     = 0x09;
const byte _MCP23017_IOCON_BANK0                                       = 0x0A;
const byte _MCP23017_GPPUA_BANK0                                       = 0x0C;
const byte _MCP23017_GPPUB_BANK0                                       = 0x0D;
const byte _MCP23017_INTFA_BANK0                                       = 0x0E;
const byte _MCP23017_INTFB_BANK0                                       = 0x0F;
const byte _MCP23017_INTCAPA_BANK0                                     = 0x10;
const byte _MCP23017_INTCAPB_BANK0                                     = 0x11;
const byte _MCP23017_GPIOA_BANK0                                       = 0x12;
const byte _MCP23017_GPIOB_BANK0                                       = 0x13;
const byte _MCP23017_OLATA_BANK0                                       = 0x14;
const byte _MCP23017_OLATB_BANK0                                       = 0x15;

const byte _MCP23017_HD1_PA0                                           = 0x01;
const byte _MCP23017_HD1_PA1                                           = 0x02;
const byte _MCP23017_HD1_PA2                                           = 0x04;
const byte _MCP23017_HD1_PA3                                           = 0x08;
const byte _MCP23017_HD1_PA4                                           = 0x10;
const byte _MCP23017_HD1_PA5                                           = 0x20;
const byte _MCP23017_HD1_PA6                                           = 0x40;
const byte _MCP23017_HD1_PA7                                           = 0x80;

const byte _MCP23017_HD2_PB0                                           = 0x01;
const byte _MCP23017_HD2_PB1                                           = 0x02;
const byte _MCP23017_HD2_PB2                                           = 0x04;
const byte _MCP23017_HD2_PB3                                           = 0x08;
const byte _MCP23017_HD2_PB4                                           = 0x10;
const byte _MCP23017_HD2_PB5                                           = 0x20;
const byte _MCP23017_HD2_PB6                                           = 0x40;
const byte _MCP23017_HD2_PB7                                           = 0x80;

const byte _MCP23017_HD_START_POSITION                                 = 0x01;

const byte _MCP23017_INT_ERR                                           = 0xFF;