sdmmc: support tuning input delay on esp32s3

This commit is contained in:
Armando
2023-04-18 19:50:01 +08:00
committed by Armando (Dou Yiwen)
parent e7fcfa43e9
commit 01a3d79b6f
7 changed files with 102 additions and 2 deletions

View File

@@ -206,6 +206,19 @@ esp_err_t sdmmc_init_host_frequency(sdmmc_card_t* card)
}
}
if (card->host.input_delay_phase != SDMMC_DELAY_PHASE_0) {
if (card->host.set_input_delay) {
err = (*card->host.set_input_delay)(card->host.slot, card->host.input_delay_phase);
if (err != ESP_OK) {
ESP_LOGE(TAG, "host.set_input_delay failed (0x%x)", err);
return err;
}
} else {
ESP_LOGE(TAG, "input phase delay feature isn't supported");
return ESP_ERR_NOT_SUPPORTED;
}
}
err = (*card->host.get_real_freq)(card->host.slot, &(card->real_freq_khz));
if (err != ESP_OK) {
ESP_LOGE(TAG, "failed to get real working frequency (0x%x)", err);