/* Extract the port number of the given pin.  */
static uint8_t _port_num(gpio_t pin)
/* Extract the port number of the given pin.  */
static uint8_t _port_num(gpio_t pin)
{
    return (pin >> 4) & 0x0f;
}