1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include <stdint.h>
10 #include <stddef.h>
11 #include "esp_err.h"
12 #include "freertos/FreeRTOS.h"
13 #include "freertos/queue.h"
14 #include "soc/sdmmc_periph.h"
15 
16 typedef struct {
17     uint32_t sdmmc_status;      ///< masked SDMMC interrupt status
18     uint32_t dma_status;        ///< masked DMA interrupt status
19 } sdmmc_event_t;
20 
21 void sdmmc_host_reset(void);
22 
23 esp_err_t sdmmc_host_start_command(int slot, sdmmc_hw_cmd_t cmd, uint32_t arg);
24 
25 esp_err_t sdmmc_host_wait_for_event(int tick_count, sdmmc_event_t* out_event);
26 
27 void sdmmc_host_dma_prepare(sdmmc_desc_t* desc, size_t block_size, size_t data_size);
28 
29 void sdmmc_host_dma_stop(void);
30 
31 void sdmmc_host_dma_resume(void);
32 
33 bool sdmmc_host_card_busy(void);
34 
35 esp_err_t sdmmc_host_transaction_handler_init(void);
36 
37 void sdmmc_host_transaction_handler_deinit(void);
38