/* Configure drive strength and input sensing for given GPIO port.  */
void gpio_set_options(uint32_t gpioport, uint32_t drive, uint32_t sense, uint32_t gpios)
/* Configure drive strength and input sensing for given GPIO port.  */
void gpio_set_options(uint32_t gpioport, uint32_t drive, uint32_t sense, uint32_t gpios)
{
	(void) gpioport;
	uint8_t i = 0;
	while (gpios) {
		if (gpios & 1) {
			GPIO_PIN_CNF(i) = (GPIO_PIN_CNF(i) &
					~((GPIO_CNF_DRIVE_MASK << GPIO_CNF_DRIVE_SHIFT)
						| (GPIO_CNF_SENSE_MASK << GPIO_CNF_SENSE_SHIFT)
					 )
				) | (drive << GPIO_CNF_DRIVE_SHIFT)
				| (sense << GPIO_CNF_SENSE_SHIFT);
		}
		++i;
		gpios >>= 1;
	}
}