drv_sdctrl.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * 2021-03-18 Carl the first version
  9. */
  10. #ifndef __DRV_SDCTRL_H__
  11. #define __DRV_SDCTRL_H__
  12. #include <rtthread.h>
  13. #ifdef __cplusplus
  14. extern "C"
  15. {
  16. #endif
  17. #define SDCTR_CMD_IS_COMPLETE_FLG 0x1UL /* Command is complete */
  18. #define SDCTR_WRITE_IS_COMPLETE_FLG 0x2UL
  19. #define SDCTR_READ_IS_COMPLETE_FLG 0x4UL
  20. #define SDCTR_CMD_IS_ERROR_FLG 0x8UL
  21. #define SDCTR_CMD_CRC_IS_ERROR_FLG 0x10UL /* Command CRC error */
  22. #define SDCTR_DMA_IS_ERROR_FLG 0x20UL /* */
  23. #define SDCTR_CARD_REMOVE_FLG 0x40UL /* Card remove */
  24. #define SDCTR_CMD_TIMEOUT_FLG 0x70UL /* command timeout */
  25. #define SDCTR_CMD_RECEIVE_IS_ERROR_FLG 0x80UL /* CMD receive is error */
  26. #ifndef SDCTR_BUFF_SIZE
  27. #define SDCTR_BUFF_SIZE (512 * 128)
  28. #endif
  29. #ifndef SDCTR_ALIGN_LEN
  30. #define SDCTR_ALIGN_LEN (32)
  31. #endif
  32. void ft2004_mmcsd_change(void);
  33. rt_bool_t ft2004_card_status(void);
  34. rt_err_t ft2004_card_remove_check(rt_int32_t timeout, rt_uint32_t *status);
  35. void ft2004_sdctrl_reset(void);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif // !