drv_sdio.h 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2018, Synwit Technology Co.,Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-07-10 lik first version
  9. */
  10. #ifndef __DRV_SDIO_H__
  11. #define __DRV_SDIO_H__
  12. #include "board.h"
  13. #define SDIO_BUFF_SIZE 4096
  14. #define SDIO_ALIGN_LEN 4
  15. #ifndef SDIO_MAX_FREQ
  16. #define SDIO_MAX_FREQ (30000000)
  17. #endif
  18. struct sdio_pkg
  19. {
  20. struct rt_mmcsd_cmd *cmd;
  21. void *buff;
  22. rt_uint32_t flag;
  23. };
  24. typedef rt_err_t (*sdio_txconfig)(struct sdio_pkg *pkg, rt_uint32_t *buff, int size);
  25. typedef rt_err_t (*sdio_rxconfig)(struct sdio_pkg *pkg, rt_uint32_t *buff, int size);
  26. typedef rt_uint32_t (*sdio_clk_get)(SDIO_TypeDef *hw_sdio);
  27. struct swm_sdio_des
  28. {
  29. SDIO_TypeDef *hw_sdio;
  30. sdio_txconfig txconfig;
  31. sdio_rxconfig rxconfig;
  32. sdio_clk_get clk_get;
  33. };
  34. #endif /* __DRV_SDIO_H__ */