/* Change Logs: Date Author Notes  zylx first version.  */
rt_err_t rt_qspi_configure(struct rt_qspi_device *device, struct rt_qspi_configuration *cfg)
/* Change Logs: Date Author Notes  zylx first version.  */
rt_err_t rt_qspi_configure(struct rt_qspi_device *device, struct rt_qspi_configuration *cfg)
{
    RT_ASSERT(device != RT_NULL);
    RT_ASSERT(cfg != RT_NULL);
    struct rt_qspi_device *qspi_device = (struct rt_qspi_device *)device;
    rt_err_t result = RT_EOK;
    qspi_device->config.parent.mode = cfg->parent.mode;
    qspi_device->config.parent.max_hz = cfg->parent.max_hz;
    qspi_device->config.parent.data_width = cfg->parent.data_width;
    qspi_device->config.parent.reserved = cfg->parent.reserved;
    qspi_device->config.medium_size = cfg->medium_size;
    qspi_device->config.ddr_mode = cfg->ddr_mode;
    qspi_device->config.qspi_dl_width = cfg->qspi_dl_width;
    result = rt_spi_configure(&device->parent, &cfg->parent);
    return result;
}