/* Obtain a mask of pins that match all of the provided 
The caller must ensure that  */
static gpio_port_pins_t get_pins_with_flags(const struct device *port, gpio_port_pins_t mask, gpio_flags_t flags)
/* Obtain a mask of pins that match all of the provided 
The caller must ensure that  */
static gpio_port_pins_t get_pins_with_flags(const struct device *port, gpio_port_pins_t mask, gpio_flags_t flags)
{
	size_t i;
	gpio_port_pins_t matched = 0;
	struct gpio_emul_data *drv_data =
		(struct gpio_emul_data *)port->data;
	const struct gpio_emul_config *config =
		(const struct gpio_emul_config *)port->config;
	for (i = 0; i < config->num_pins; ++i) {
		if ((drv_data->flags[i] & mask) == flags) {
			matched |= BIT(i);
		}
	}
	return matched;
}