2021-05-24 00:09:38 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2016-12-19 14:19:47 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/queue.h"
|
2018-05-25 11:44:53 +00:00
|
|
|
#include "soc/sdmmc_periph.h"
|
2016-12-19 14:19:47 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t sdmmc_status; ///< masked SDMMC interrupt status
|
|
|
|
uint32_t dma_status; ///< masked DMA interrupt status
|
|
|
|
} sdmmc_event_t;
|
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
void sdmmc_host_reset(void);
|
2016-12-19 14:19:47 +00:00
|
|
|
|
|
|
|
esp_err_t sdmmc_host_start_command(int slot, sdmmc_hw_cmd_t cmd, uint32_t arg);
|
|
|
|
|
|
|
|
esp_err_t sdmmc_host_wait_for_event(int tick_count, sdmmc_event_t* out_event);
|
|
|
|
|
|
|
|
void sdmmc_host_dma_prepare(sdmmc_desc_t* desc, size_t block_size, size_t data_size);
|
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
void sdmmc_host_dma_stop(void);
|
2016-12-19 14:19:47 +00:00
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
void sdmmc_host_dma_resume(void);
|
2016-12-19 14:19:47 +00:00
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
bool sdmmc_host_card_busy(void);
|
2018-08-22 10:16:32 +00:00
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
esp_err_t sdmmc_host_transaction_handler_init(void);
|
2016-12-19 14:19:47 +00:00
|
|
|
|
2019-07-16 09:33:30 +00:00
|
|
|
void sdmmc_host_transaction_handler_deinit(void);
|