From d39f0310de5073f9e53ea5fd7652f0a8939bfcf9 Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 17 Jan 2023 19:17:49 +0800 Subject: [PATCH] sdio: split sdio ll version init, and hs_enable --- components/hal/esp32/include/hal/sdio_slave_ll.h | 11 ++++++++++- components/hal/esp32c6/include/hal/sdio_slave_ll.h | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/components/hal/esp32/include/hal/sdio_slave_ll.h b/components/hal/esp32/include/hal/sdio_slave_ll.h index 14d69f4a39..5c4015f2e7 100644 --- a/components/hal/esp32/include/hal/sdio_slave_ll.h +++ b/components/hal/esp32/include/hal/sdio_slave_ll.h @@ -128,6 +128,14 @@ static inline void sdio_slave_ll_set_timing(host_dev_t *host, sdio_slave_timing_ } } +/** + * Set the CCCR, SDIO and Physical Layer version + */ +static inline void sdio_slave_ll_init_version(hinf_dev_t *hinf) +{ + hinf->cfg_data1.sdio_ver = 0x232; +} + /** * Set the HS supported bit to be read by the host. * @@ -137,8 +145,9 @@ static inline void sdio_slave_ll_set_timing(host_dev_t *host, sdio_slave_timing_ static inline void sdio_slave_ll_enable_hs(hinf_dev_t *hinf, bool hs) { if (hs) { - hinf->cfg_data1.sdio_ver = 0x232; hinf->cfg_data1.highspeed_enable = 1; + } else { + hinf->cfg_data1.highspeed_enable = 0; } } diff --git a/components/hal/esp32c6/include/hal/sdio_slave_ll.h b/components/hal/esp32c6/include/hal/sdio_slave_ll.h index 39abafeff4..29031b9475 100644 --- a/components/hal/esp32c6/include/hal/sdio_slave_ll.h +++ b/components/hal/esp32c6/include/hal/sdio_slave_ll.h @@ -128,6 +128,14 @@ static inline void sdio_slave_ll_set_timing(host_dev_t *host, sdio_slave_timing_ } } +/** + * Set the CCCR, SDIO and Physical Layer version + */ +static inline void sdio_slave_ll_init_version(hinf_dev_t *hinf) +{ + hinf->cfg_data1.sdio_ver = 0x232; +} + /** * Set the HS supported bit to be read by the host. * @@ -137,8 +145,9 @@ static inline void sdio_slave_ll_set_timing(host_dev_t *host, sdio_slave_timing_ static inline void sdio_slave_ll_enable_hs(hinf_dev_t *hinf, bool hs) { if (hs) { - hinf->cfg_data1.sdio_ver = 0x232; hinf->cfg_data1.highspeed_enable = 1; + } else { + hinf->cfg_data1.highspeed_enable = 0; } }