1 /* 2 * Copyright (c) 2006-2024, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2011-07-25 weety first version 9 * 2024-05-26 HPMicro Add UHS-I support 10 */ 11 12 #ifndef __DEV_SD_H__ 13 #define __DEV_SD_H__ 14 15 #include <rtthread.h> 16 #include <drivers/mmcsd_host.h> 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 23 /* 24 * SWITCH_FUNC timing 25 */ 26 #define SD_SWITCH_FUNC_TIMING_DEFAULT 0 27 #define SD_SWITCH_FUNC_TIMING_HS 1 28 #define SD_SWITCH_FUNC_TIMING_SDR50 2 29 #define SD_SWITCH_FUNC_TIMING_SDR104 3 30 #define SD_SWITCH_FUNC_TIMING_DDR50 4 31 32 33 rt_err_t mmcsd_send_if_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr); 34 rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr, rt_uint32_t *rocr); 35 36 rt_err_t mmcsd_get_card_addr(struct rt_mmcsd_host *host, rt_uint32_t *rca); 37 rt_int32_t mmcsd_get_scr(struct rt_mmcsd_card *card, rt_uint32_t *scr); 38 39 rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr); 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif 46