code: func (m *MCP23017Driver) SetGPIOPolarity(pin uint8, val uint8, portStr string) (err error) {
  	selectedPort := m.getPort(portStr)
  	return m.write(selectedPort.IPOL, pin, val)
  }
docs: // SetGPIOPolarity will change a given pin's polarity based on the value:
  // val = 1 opposite logic state of the input pin.
  // val = 0 same logic state of the input pin.