/* Set one or zero to the selected GPIO pin.  */
int32_t csi_gpio_pin_write(gpio_pin_handle_t handle, bool value)
/* Set one or zero to the selected GPIO pin.  */
int32_t csi_gpio_pin_write(gpio_pin_handle_t handle, bool value)
{
    GPIO_NULL_PARAM_CHK(handle);
    dw_gpio_pin_priv_t *gpio_pin_priv = handle;
    dw_gpio_priv_t *port_handle = &gpio_handle[gpio_pin_priv->portidx];
    uint8_t offset = gpio_pin_priv->idx;
    uint32_t port_value = value << offset;
    port_handle->value = port_value;
    gpio_write(port_handle, (1 << offset));
    return 0;
}