/* Enable output pins. 
Onlyc the ones where bits are set to "1" are touched, everything else remains in the old state. */
void gpio_enable(uint32_t gpioport, uint32_t gpios, enum gpio_mode mode)
/* Enable output pins. 
Onlyc the ones where bits are set to "1" are touched, everything else remains in the old state. */
void gpio_enable(uint32_t gpioport, uint32_t gpios, enum gpio_mode mode)
{
	if (mode < GPIO_MODE_IN) {
		GPIO_GPERC(gpioport) = gpios;
		uint8_t i = 0;
		for (; i < 3; ++i, mode >>= 1) {
			GPIO_PMR_FLIP(gpioport, i, mode & 1) = gpios;
		}
	} else if (mode == GPIO_MODE_OUT) {
		GPIO_GPERS(gpioport) = gpios;
		GPIO_ODERS(gpioport) = gpios;
	} else if (mode == GPIO_MODE_IN) {
		GPIO_GPERS(gpioport) = gpios;
		GPIO_ODERC(gpioport) = gpios;
	}
}