/* Initialize USART Interface. 1. Initializes the resources needed for the USART interface 2.registers event callback function.  */
usart_handle_t csi_usart_initialize(pin_t tx, pin_t rx, usart_event_cb_t cb_event, void *cb_arg)
/* Initialize USART Interface. 1. Initializes the resources needed for the USART interface 2.registers event callback function.  */
usart_handle_t csi_usart_initialize(pin_t tx, pin_t rx, usart_event_cb_t cb_event, void *cb_arg)
{
    uint32_t base = 0u;
    uint32_t irq = 0u;
    int32_t idx = target_usart_init(tx, rx, &base, &irq);
    if (idx < 0 || idx >= CONFIG_USART_NUM) {
        return NULL;
    }
    dw_usart_priv_t *usart_priv = &usart_instance[idx];
    usart_priv->base = base;
    usart_priv->irq = irq;
    usart_priv->cb_event = cb_event;
    usart_priv->cb_arg = cb_arg;
    dw_usart_reg_t *addr = (dw_usart_reg_t *)(usart_priv->base);
    addr->FCR = DW_FCR_FIFOE;
    drv_nvic_enable_irq(usart_priv->irq);
    return usart_priv;
}