/* Extract the pin's port base address from the given pin identifier.  */
static GPIO_TypeDef* _port(gpio_t pin)
/* Extract the pin's port base address from the given pin identifier.  */
static GPIO_TypeDef* _port(gpio_t pin)
{
    return (GPIO_TypeDef *)(pin & ~(0x0f));
}