/* Clear an interrupt status for an input GPIO pin. Using this function on a gpio pin which has generated a interrupt. */
int32_t hal_gpio_clear_irq(gpio_dev_t *gpio)
/* Clear an interrupt status for an input GPIO pin. Using this function on a gpio pin which has generated a interrupt. */
int32_t hal_gpio_clear_irq(gpio_dev_t *gpio)
{
    const struct HAL_GPIO_IRQ_CFG_T gpiocfg = {
        .irq_enable = false,
        .irq_debounce = false,
        .irq_polarity = HAL_GPIO_IRQ_POLARITY_LOW_FALLING,
        .irq_handler = NULL,
        .irq_type = HAL_GPIO_IRQ_TYPE_EDGE_SENSITIVE,
    };
    hal_gpio_setup_irq(gpio->port, &gpiocfg);
	return 0;
}