/* Toggles the state of a gpio pin that is configured as an output. 
Toggles the current output level of a gpio pin. */
void gpio_pin_toggle_output_level(const uint8_t gpio_pin)
/* Toggles the state of a gpio pin that is configured as an output. 
Toggles the current output level of a gpio pin. */
void gpio_pin_toggle_output_level(const uint8_t gpio_pin)
{
	if (gpio_pin < 16) {
		GPIO0->DATAOUT.reg ^= (1 << gpio_pin);
	} else if (gpio_pin < 32) {
		GPIO1->DATAOUT.reg ^= (1 << (gpio_pin % 16));
	} else {
		GPIO2->DATAOUT.reg ^= (1 << (gpio_pin % 16));
	}
}