+class MCP2221(_MCP2221):
+ def __init__(self, address):
+ self._hid = hid.device()
+ self._hid.open_path(address)
+ print("Connected to "+str(address))
+ self._gp_config = [0x07] * 4 # "don't care" initial value
+ for pin in range(4):
+ self.gp_set_mode(pin, self.GP_GPIO) # set to GPIO mode
+ self.gpio_set_direction(pin, 1) # set to INPUT