2021-05-23 20:09:38 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2016-12-19 09:19:47 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/queue.h"
|
2018-05-25 07:44:53 -04:00
|
|
|
#include "soc/sdmmc_periph.h"
|
2016-12-19 09:19:47 -05: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 05:33:30 -04:00
|
|
|
void sdmmc_host_reset(void);
|
2016-12-19 09:19:47 -05: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 05:33:30 -04:00
|
|
|
void sdmmc_host_dma_stop(void);
|
2016-12-19 09:19:47 -05:00
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
void sdmmc_host_dma_resume(void);
|
2016-12-19 09:19:47 -05:00
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
bool sdmmc_host_card_busy(void);
|
2018-08-22 06:16:32 -04:00
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
esp_err_t sdmmc_host_transaction_handler_init(void);
|
2016-12-19 09:19:47 -05:00
|
|
|
|
2019-07-16 05:33:30 -04:00
|
|
|
void sdmmc_host_transaction_handler_deinit(void);
|