drv_sdio.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <rtthread.h>
  16. struct sdhci_cmd_t
  17. {
  18. rt_uint32_t cmdidx;
  19. rt_uint32_t cmdarg;
  20. rt_uint32_t resptype;
  21. rt_uint32_t response[4];
  22. };
  23. struct sdhci_data_t
  24. {
  25. rt_uint8_t * buf;
  26. rt_uint32_t flag;
  27. rt_uint32_t blksz;
  28. rt_uint32_t blkcnt;
  29. };
  30. struct sdhci_t
  31. {
  32. char * name;
  33. rt_uint32_t voltages;
  34. rt_uint32_t width;
  35. rt_uint32_t clock;
  36. rt_err_t removeable;
  37. void * sdcard;
  38. rt_err_t (*detect)(struct sdhci_t * sdhci);
  39. rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width);
  40. rt_err_t (*setclock)(struct sdhci_t * sdhci, rt_uint32_t clock);
  41. rt_err_t (*transfer)(struct sdhci_t * sdhci, struct sdhci_cmd_t * cmd, struct sdhci_data_t * dat);
  42. void * priv;
  43. };
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif