/* Get the state of an input GPIO pin. Using this function on a gpio pin which is set to output mode will return an undefined value. */
int32_t hal_gpio_input_get(gpio_dev_t *gpio, uint32_t *value)
/* Get the state of an input GPIO pin. Using this function on a gpio pin which is set to output mode will return an undefined value. */
int32_t hal_gpio_input_get(gpio_dev_t *gpio, uint32_t *value)
{
    int32_t ret = -1;
    if(NULL != gpio && NULL != value) {
        hal_gpio_pin_set_dir(gpio->port, HAL_GPIO_DIR_IN, 0);
        *value = hal_gpio_pin_get_val(gpio->port);
        ret = 0;
    }
	return ret;
}