1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2020/12/31 Bernard Add license info 9 */ 10 #ifndef __DRV_SDIO_H__ 11 #define __DRV_SDIO_H__ 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 #include <rtthread.h> 18 19 struct sdhci_cmd_t 20 { 21 rt_uint32_t cmdidx; 22 rt_uint32_t cmdarg; 23 rt_uint32_t resptype; 24 rt_uint32_t response[4]; 25 }; 26 27 struct sdhci_data_t 28 { 29 rt_uint8_t * buf; 30 rt_uint32_t flag; 31 rt_uint32_t blksz; 32 rt_uint32_t blkcnt; 33 }; 34 35 struct sdhci_t 36 { 37 char * name; 38 rt_uint32_t voltages; 39 rt_uint32_t width; 40 rt_uint32_t clock; 41 rt_err_t removeable; 42 void * sdcard; 43 44 rt_err_t (*detect)(struct sdhci_t * sdhci); 45 rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width); 46 rt_err_t (*setclock)(struct sdhci_t * sdhci, rt_uint32_t clock); 47 rt_err_t (*transfer)(struct sdhci_t * sdhci, struct sdhci_cmd_t * cmd, struct sdhci_data_t * dat); 48 void * priv; 49 }; 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif 56