| 
									
										
										
										
											2016-12-19 22:19:47 +08:00
										 |  |  | // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Licensed under the Apache License, Version 2.0 (the "License");
 | 
					
						
							|  |  |  | // you may not use this file except in compliance with the License.
 | 
					
						
							|  |  |  | // You may obtain a copy of the License at
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //     http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Unless required by applicable law or agreed to in writing, software
 | 
					
						
							|  |  |  | // distributed under the License is distributed on an "AS IS" BASIS,
 | 
					
						
							|  |  |  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					
						
							|  |  |  | // See the License for the specific language governing permissions and
 | 
					
						
							|  |  |  | // limitations under the License.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <stdint.h>
 | 
					
						
							|  |  |  | #include <stddef.h>
 | 
					
						
							|  |  |  | #include "esp_err.h"
 | 
					
						
							|  |  |  | #include "freertos/FreeRTOS.h"
 | 
					
						
							|  |  |  | #include "freertos/queue.h"
 | 
					
						
							| 
									
										
										
										
											2018-05-25 19:44:53 +08:00
										 |  |  | #include "soc/sdmmc_periph.h"
 | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08: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 16:33:30 +07:00
										 |  |  | void sdmmc_host_reset(void); | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08: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 16:33:30 +07:00
										 |  |  | void sdmmc_host_dma_stop(void); | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-16 16:33:30 +07:00
										 |  |  | void sdmmc_host_dma_resume(void); | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-16 16:33:30 +07:00
										 |  |  | bool sdmmc_host_card_busy(void); | 
					
						
							| 
									
										
										
										
											2018-08-22 18:16:32 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-16 16:33:30 +07:00
										 |  |  | esp_err_t sdmmc_host_transaction_handler_init(void); | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-16 16:33:30 +07:00
										 |  |  | void sdmmc_host_transaction_handler_deinit(void); | 
					
						
							| 
									
										
										
										
											2016-12-19 22:19:47 +08:00
										 |  |  | 
 |