def METHOD_NAME(gpios):
    ports = {p: (8, 0) for p in set([p["port"] for p in gpios])}
    for gpio in gpios:
        pin = int(gpio["pin"])
        pmin, pmax = ports[gpio["port"]]
        ports[gpio["port"]] = (min(pin, pmin), max(pin, pmax))
    ports = [{"name": k.upper(), "start": v[0], "width": v[1] - v[0] + 1} for k,v in ports.items()]
    ports.sort(key=lambda p: p["name"])
    return ports