/* Write an output value to corresponding Port. Parameters: port: use to choose a I/O port among Port A, B, or C. output: value that will be written to the corresponding Port. return: SUCCESS  */
static int32_t gpio_write(void *port, uint32_t mask)
/* Write an output value to corresponding Port. Parameters: port: use to choose a I/O port among Port A, B, or C. output: value that will be written to the corresponding Port. return: SUCCESS  */
static int32_t gpio_write(void *port, uint32_t mask)
{
    dw_gpio_priv_t *gpio_priv = port;
    uint32_t value = gpio_reg->SWPORT_DR;
    value &= ~(mask);
    value |= gpio_priv->value;
    gpio_reg->SWPORT_DR = value;
    return 0;
}