forked from espressif/esp-idf
sdmmc: use periph_ctrl to enable peripheral when initializing the host
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "rom/gpio.h"
|
#include "rom/gpio.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "driver/sdmmc_host.h"
|
#include "driver/sdmmc_host.h"
|
||||||
|
#include "driver/periph_ctrl.h"
|
||||||
#include "sdmmc_private.h"
|
#include "sdmmc_private.h"
|
||||||
|
|
||||||
#define SDMMC_EVENT_QUEUE_LENGTH 32
|
#define SDMMC_EVENT_QUEUE_LENGTH 32
|
||||||
@@ -236,6 +237,8 @@ esp_err_t sdmmc_host_init()
|
|||||||
return ESP_ERR_INVALID_STATE;
|
return ESP_ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
periph_module_enable(PERIPH_SDMMC_MODULE);
|
||||||
|
|
||||||
// Enable clock to peripheral
|
// Enable clock to peripheral
|
||||||
sdmmc_host_input_clk_enable();
|
sdmmc_host_input_clk_enable();
|
||||||
|
|
||||||
@@ -367,6 +370,7 @@ esp_err_t sdmmc_host_deinit()
|
|||||||
s_event_queue = NULL;
|
s_event_queue = NULL;
|
||||||
sdmmc_host_input_clk_disable();
|
sdmmc_host_input_clk_disable();
|
||||||
sdmmc_host_transaction_handler_deinit();
|
sdmmc_host_transaction_handler_deinit();
|
||||||
|
periph_module_disable(PERIPH_SDMMC_MODULE);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user