/* Sets the state of a gpio pin that is configured as an output. 
Sets the current output level of a gpio pin to a given logic level. */
void gpio_pin_set_output_level(const uint8_t gpio_pin, const bool level)
/* Sets the state of a gpio pin that is configured as an output. 
Sets the current output level of a gpio pin to a given logic level. */
void gpio_pin_set_output_level(const uint8_t gpio_pin, const bool level)
{
	if (gpio_pin < 16) {
		if(level) {
			GPIO0->DATAOUT.reg |= (1 << gpio_pin);
		} else {
			GPIO0->DATAOUT.reg &= ~(1 << gpio_pin);
		}
	} else if (gpio_pin < 32) {
		if(level) {
			GPIO1->DATAOUT.reg |= (1 << (gpio_pin % 16));
		} else {
			GPIO1->DATAOUT.reg &= ~(1 << (gpio_pin % 16));
		}
	} else {
		if(level) {
			GPIO2->DATAOUT.reg |= (1 << (gpio_pin % 16));
		} else {
			GPIO2->DATAOUT.reg &= ~(1 << (gpio_pin % 16));
		}
	}
}