/* Enables the interrupt of a pin with the specified settings.  */
uint32_t gpio_enable_pin_interrupt(uint32_t pin, uint32_t mode)
/* Enables the interrupt of a pin with the specified settings.  */
uint32_t gpio_enable_pin_interrupt(uint32_t pin, uint32_t mode)
{
	volatile avr32_gpio_port_t *gpio_port = &AVR32_GPIO.port[pin >> 5];
	gpio_port->gfers = 1 << (pin & 0x1F);
	if (GPIO_INVALID_ARGUMENT == gpio_configure_edge_detector(pin, mode)) {
		return(GPIO_INVALID_ARGUMENT);
	}
	gpio_port->iers = 1 << (pin & 0x1F);
	return GPIO_SUCCESS;
}