/* Extract the port number from the given pin identifier. 
Isolating bits 10 to 13 of the port base addresses leads to unique port numbers.  */
static int _port_num(gpio_t pin)
/* Extract the port number from the given pin identifier. 
Isolating bits 10 to 13 of the port base addresses leads to unique port numbers.  */
static int _port_num(gpio_t pin)
{
    return (((pin >> 10) & 0x0f) - 2);
}