• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 // Copyright (C) 2022 Beken Corporation
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef _SDCARD_H_
17 #define _SDCARD_H_
18 
19 #if CONFIG_SDCARD_HOST
20 #include "sdcard_pub.h"
21 
22 typedef void (*SD_DETECT_FUN)(void);
23 typedef void (*sdcard_ps_callback_t)(void);
24 
25 typedef struct _sdcard_ {
26 	UINT32  total_block;
27 	UINT16  block_size;
28 	UINT16  card_rca;
29 	UINT16	Addr_shift_bit;
30 	UINT8  	init_flag;
31 	UINT8 	clk_cfg;
32 } SDCARD_S, *SDCARD_PTR;
33 
34 /* API */
35 extern void sdcard_get_card_info(SDCARD_S *card_info);
36 extern UINT32 sdcard_open(UINT32 op_falag);
37 extern UINT32 sdcard_close(void);
38 extern UINT32 sdcard_read(char *user_buf, UINT32 count, UINT32 op_flag);
39 extern UINT32 sdcard_write(char *user_buf, UINT32 count, UINT32 op_flag);
40 extern UINT32 sdcard_ctrl(UINT32 cmd, void *parm);
41 extern void sdcard_register_ps_suspend_callback(sdcard_ps_callback_t ps_suspend_cb);
42 extern void sdcard_register_ps_resume_callback(sdcard_ps_callback_t ps_resume_cb);
43 
44 #endif // CONFIG_SDCARD_HOST
45 #endif
46 // eof
47 
48