LCD using MCP23017 i2C

In the .h file:

#define LCD_DATA   0b00100000   // 1xxxxxxx = data; 0xxxxxxx = instruction  (pin 26)  0x20

If the sense is reversed then you would need to 'or' in LCD_DATA in the places it doesn't currently do it, and not 'or' it in, in the other places.

Maybe the simplest fix:

#define LCD_DATA          0b00000000   // 0xxxxxxx = data; 1xxxxxxx = instruction  (pin 26)  0x00
#define LCD_INSTRUCTION   0b00100000   // 0xxxxxxx = data; 1xxxxxxx = instruction  (pin 26)  0x20

Then add to the command function:

void I2C_graphical_LCD_display::cmd (const byte data)
{
  startSend ();
    doSend (GPIOA);                      // control port
    doSend (LCD_RESET | LCD_ENABLE | LCD_INSTRUCTION | _chipSelect);   // set enable high
    doSend (data);                       // (command written to GPIOB)
    doSend (LCD_RESET | LCD_INSTRUCTION | _chipSelect);    // (GPIOA again) pull enable low to toggle data 
  endSend ();
} // end of I2C_graphical_LCD_display::cmd