Merge branch 'bugfix/spi_flash_cs_setup_xiaomi_v4.0' into customer/maintain_v4.0_xiaomi_tsf_issue

See merge request espressif/esp-idf!13893
This commit is contained in:
Michael (XIAO Xufeng) 2021-06-15 12:34:22 +08:00
commit b24a5e78f2
2 changed files with 7 additions and 0 deletions

View File

@ -340,3 +340,9 @@ static inline void spi_flash_ll_set_dummy(spi_dev_t *dev, uint32_t dummy_n)
dev->user.usr_dummy = dummy_n ? 1 : 0;
dev->user1.usr_dummy_cyclelen = dummy_n - 1;
}
static inline void spi_flash_ll_set_cs_setup(spi_dev_t *dev, uint32_t cs_setup_time)
{
dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0);
dev->ctrl2.setup_time = cs_setup_time - 1;
}

View File

@ -38,6 +38,7 @@ esp_err_t spi_flash_hal_device_config(spi_flash_host_driver_t *host)
spi_flash_ll_reset(dev);
spi_flash_ll_set_cs_pin(dev, drv_data->cs_num);
spi_flash_ll_set_clock(dev, &drv_data->clock_conf);
spi_flash_ll_set_cs_setup(dev, 1);
/*
* workaround for the ROM: the ROM, as well as the OpenOCD, don't know the