drv_sdio.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. * 2024-11-06 QT-one first version
  9. */
  10. #ifndef __DRV_SDIO_H__
  11. #define __DRV_SDIO_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include <string.h>
  15. #include "drv_common.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifndef SDIO_BASE_ADDRESS
  20. #define SDIO_BASE_ADDRESS HT_SDIO
  21. #endif
  22. #ifndef SDIO_CLOCK_FREQ
  23. #define SDIO_CLOCK_FREQ (48U * 1000 * 1000)
  24. #endif
  25. #ifndef SDIO_BUFF_SIZE
  26. #define SDIO_BUFF_SIZE (4096)
  27. #endif
  28. #ifndef SDIO_ALIGN_LEN
  29. #define SDIO_ALIGN_LEN (32)
  30. #endif
  31. #ifndef SDIO_MAX_FREQ
  32. #define SDIO_MAX_FREQ (24 * 1000 * 1000)
  33. #endif
  34. #define HW_SDIO_CMD_FLAG \
  35. (SDIO_INT_CMD_SEND | SDIO_FLAG_CMD_TIMEOUT | SDIO_FLAG_CMD_CRCERR | SDIO_FLAG_CMD_IDXERR)
  36. #define HW_SDIO_DATA_FLAG \
  37. (SDIO_FLAG_BUF_OVERFLOW | SDIO_FLAG_BUF_UNDERFLOW | SDIO_FLAG_DATA_CRCERR | SDIO_FLAG_DATA_TIMEOUT | SDIO_FLAG_TRANS_END)
  38. #define HW_SDIO_DATATIMEOUT (0x000FFFFF)
  39. void ht32_mmcsd_change(void);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif /* __DRV_SDIO_H__ */