drv_sdio.h 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __DRV_SDIO_H__
  2. #define __DRV_SDIO_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <rtthread.h>
  7. struct sdhci_cmd_t
  8. {
  9. rt_uint32_t cmdidx;
  10. rt_uint32_t cmdarg;
  11. rt_uint32_t resptype;
  12. rt_uint32_t response[4];
  13. };
  14. struct sdhci_data_t
  15. {
  16. rt_uint8_t * buf;
  17. rt_uint32_t flag;
  18. rt_uint32_t blksz;
  19. rt_uint32_t blkcnt;
  20. };
  21. struct sdhci_t
  22. {
  23. char * name;
  24. rt_uint32_t voltages;
  25. rt_uint32_t width;
  26. rt_uint32_t clock;
  27. rt_err_t removeable;
  28. void * sdcard;
  29. rt_err_t (*detect)(struct sdhci_t * sdhci);
  30. rt_err_t (*setwidth)(struct sdhci_t * sdhci, rt_uint32_t width);
  31. rt_err_t (*setclock)(struct sdhci_t * sdhci, rt_uint32_t clock);
  32. rt_err_t (*transfer)(struct sdhci_t * sdhci, struct sdhci_cmd_t * cmd, struct sdhci_data_t * dat);
  33. void * priv;
  34. };
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif