mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(spi_flash): Fix suspend issue on esp32s31, and add trs timing on other target
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -230,6 +230,23 @@ static inline void spimem_flash_ll_set_sus_delay(spi_mem_dev_t *dev, uint32_t dl
|
||||
dev->sus_status.flash_per_dly_128 = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get trs unit values in SPI_CLK cycles
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
* @return uint32_t trs unit values
|
||||
*/
|
||||
static inline uint32_t spimem_flash_ll_get_trs_unit_in_cycles(spi_mem_dev_t *dev)
|
||||
{
|
||||
uint32_t trs_unit = 0;
|
||||
if (dev->sus_status.flash_per_dly_128 == 1) {
|
||||
trs_unit = 128;
|
||||
} else {
|
||||
trs_unit = 4;
|
||||
}
|
||||
return trs_unit;
|
||||
}
|
||||
|
||||
#if (HAL_CONFIG(CHIP_SUPPORT_MIN_REV) >= 300)
|
||||
/**
|
||||
* Configure the delay after Resume
|
||||
@@ -240,7 +257,6 @@ static inline void spimem_flash_ll_set_sus_delay(spi_mem_dev_t *dev, uint32_t dl
|
||||
static inline void spimem_flash_ll_set_rs_delay(spi_mem_dev_t *dev, uint32_t dly_val)
|
||||
{
|
||||
dev->ctrl1.cs_hold_dly_per = dly_val;
|
||||
dev->sus_status.flash_per_dly_128 = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user