/* Set an output GPIO pin to the state specified (1, 0). Returns 0 on success, -EINVAL otherwise.  */
int lpc178x_gpout_set(const struct lpc178x_gpio_dsc *dsc, int state)
/* Set an output GPIO pin to the state specified (1, 0). Returns 0 on success, -EINVAL otherwise.  */
int lpc178x_gpout_set(const struct lpc178x_gpio_dsc *dsc, int state)
{
	int rv;
	rv = lpc178x_validate_gpio(dsc);
	if (rv == 0) {
		if (state)
			 LPC178X_GPIO(dsc->port)->fioset = (1 << dsc->pin);
		else
			 LPC178X_GPIO(dsc->port)->fioclr = (1 << dsc->pin);
	}
	return rv;
}