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