• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
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  * Description: Provides sdio slave driver api \n
16  *
17  * History: \n
18  * 2023-01-17, Create file. \n
19  */
20 
21 #ifndef SDIO_H
22 #define SDIO_H
23 
24 #include <stdint.h>
25 #include <stdbool.h>
26 #include "errcode.h"
27 #include "sdio_porting.h"
28 
29 #ifdef __cplusplus
30 #if __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33 #endif /* __cplusplus */
34 
35 /**
36  * @defgroup drivers_driver_sdios SDIOS
37  * @ingroup  drivers_driver
38  * @{
39  */
40 
41 /**
42  * @if Eng
43  * @brief  SDIO message structure.
44  * @else
45  * @brief  SDIO消息结构体。
46  * @endif
47  */
48 typedef struct sdio_msg {
49     uint32_t pending_msg;                       /*!< @if Eng Pending message.
50                                                      @else   挂起中的消息 @endif */
51     uint32_t sending_msg;                       /*!< @if Eng Sending message.
52                                                      @else   发送中的消息 @endif */
53 } sdio_msg_t;
54 
55 /**
56  * @if Eng
57  * @brief  SDIO works status.
58  * @else
59  * @brief  SDIO工作状态
60  * @endif
61  */
62 typedef enum {
63     SDIO_CHANNEL_ERR    = 0x0,          /*!< @if Eng SDIO err.
64                                          @else SDIO错误 @endif */
65     SDIO_CHANNEL_RESET,                 /*!< @if Eng Reset SDIO.
66                                          @else 重置SDIO @endif */
67     SDIO_CHANNEL_INIT,                  /*!< @if Eng Initialize the SDIO.
68                                          @else 初始化SDIO @endif */
69     SDIO_CHANNEL_SLEEP,                 /*!< @if Eng Sleep the SDIO.
70                                          @else SDIO睡眠状态 @endif */
71     SDIO_CHANNEL_WAKE,                  /*!< @if Eng Wake the SDIO.
72                                          @else 唤醒SDIO @endif */
73     SDIO_CHANNEL_WORK,                  /*!< @if Eng SDIO work.
74                                          @else SDIO工作状态 @endif */
75     SDIO_CHANNEL_BUTT                   /*!< @if Eng SDIO status number.
76                                          @else SDIO状态枚举数 @endif */
77 } sdio_channel_t;
78 
79 /**
80  * @if Eng
81  * @brief  SDIO status informatio.
82  * @else
83  * @brief  SDIO状态信息。
84  * @endif
85  */
86 typedef struct sdio_status_info {
87     uint8_t     allow_sleep;                    /*!< @if Eng Allow sleep.
88                                                      @else   允许睡眠 @endif */
89     uint8_t     tx_status;                      /*!< @if Eng Tx status.
90                                                      @else   tx状态 @endif */
91     uint8_t     sleep_status;                   /*!< @if Eng Sleep status.
92                                                      @else   睡眠状态 @endif */
93     sdio_channel_t  work_status;         /*!< @if Eng Work status.
94                                                      @else   工作状态 @endif */
95 } sdio_status_info_t;
96 
97 #if defined(CONFIG_SDIO_EXTEND_INFO)
98 /**
99  * @if Eng
100  * @brief  SDIO extend function structure.
101  * @else
102  * @brief  SDIO扩展功能结构体。
103  * @endif
104  */
105 typedef struct sdio_extendfunc {
106     uint32_t                   int_stat;
107     uint32_t                   msg_stat;
108     uint32_t                   xfer_count;
109     uint32_t                   credit_info;
110     uint8_t                    comm_reg[SDIO_EXTENDREG_COUNT];
111     int32_t                    valid_commreg_cnt;
112     int8_t                     commreg_isvalid;
113     int8_t                     credit_isvalid;
114 } sdio_extendfunc_t;
115 #endif
116 
117 /**
118  * @if Eng
119  * @brief  SDIO status structure.
120  * @else
121  * @brief  SDIO状态结构体。
122  * @endif
123  */
124 typedef struct sdio_status {
125     uint16_t          rd_arg_invalid_cnt;
126     uint16_t          wr_arg_invlaid_cnt;
127     uint16_t          unsupport_int_cnt;
128     uint16_t          mem_int_cnt;
129     uint16_t          fn1_wr_over;
130     uint16_t          fn1_rd_over;
131     uint16_t          fn1_rd_error;
132     uint16_t          fn1_rd_start;
133     uint16_t          fn1_wr_start;
134     uint16_t          fn1_rst;
135     uint16_t          fn1_msg_rdy;
136     uint16_t          fn1_ack_to_arm_int_cnt;
137     uint16_t          fn1_adma_end_int;
138     uint16_t          fn1_suspend;
139     uint16_t          fn1_resume;
140     uint16_t          fn1_adma_int;
141     uint16_t          fn1_adma_err;
142     uint16_t          fn1_en_int;
143     uint16_t          fn1_msg_isr;
144     uint16_t          soft_reset_cnt;
145 } sdio_status_t;
146 
147 /**
148  * @if Eng
149  * @brief  SDIO transfer channel structure.
150  * @else
151  * @brief  SDIO传输通道结构体。
152  * @endif
153  */
154 typedef struct sdio_chan_info {
155     uint32_t                 send_data_len;
156     uint16_t                 last_msg;
157     uint16_t                 panic_forced_timeout;
158     uint16_t                 chan_msg_cnt[D2H_MSG_COUNT];
159 } sdio_chan_info_t;
160 
161 /**
162  * @if Eng
163  * @brief  SDIO information structure.
164  * @else
165  * @brief  SDIO信息结构体。
166  * @endif
167  */
168 typedef struct sdio_info {
169     uint8_t                 volt_switch_flag;
170 
171     uint8_t                 host_to_device_msg_flag;
172 
173     uint16_t                reinit_times;
174     uint16_t                gpio_int_times;
175     uint16_t                pad;
176     sdio_status_t           sdio_status;
177     sdio_chan_info_t        chan_info;
178     sdio_msg_t         sdio_msg_status;
179 } sdio_info_t;
180 
181 /**
182  * @if Eng
183  * @brief  SDIO interrupt callback structure.
184  * @else
185  * @brief  SDIO中断回调函数结构体
186  * @endif
187  */
188 typedef struct sdio_callback_func {
189     uint32_t (*read_start_callback)(uint32_t len, uint8_t *dma_tbl);    /*!< @if Eng HOST reading.
190                                                                              @else DEVICE感知到HOST发起了读操作 @endif */
191     uint32_t (*read_over_callback)(void);                               /*!< @if Eng HOST reading over.
192                                                                              @else DEVICE感知到HOST读操作结束 @endif */
193     void (*read_err_callback)(void);                                    /*!< @if Eng HOST read error.
194                                                                              @else DEVICE感知到HOST读数据错误 @endif */
195     uint32_t (*write_start_callback)(uint32_t len, uint8_t *dma_tbl);   /*!< @if Eng HOST writting.
196                                                                              @else DEVICE感知到HOST发起了写操作 @endif */
197     uint32_t (*write_over_callback)(void);                              /*!< @if Eng HOST write over.
198                                                                              @else DEVICE感知到HOST写操作结束 @endif */
199     void (*process_msg_callback)(uint32_t);                             /*!< @if Eng HOST getting message.
200                                                                              @else DEVICE接收到HOST发来的消息 @endif */
201     void (*soft_rst_callback)(void);                                    /*!< @if Eng HOST getting reset interruption.
202                                                                              @else DEVICE接收到HOST发来的软复位 @endif */
203 } sdio_callback_func_t;
204 
205 /**
206  * @if Eng
207  * @brief  use this callback to notify host msg event occurs.
208  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
209  * @else
210  * @brief  通知host消息或数据事件存在的回调。
211  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
212  * @endif
213  */
214 typedef void (*notify_host_event_t)(sdio_bus_t bus);
215 
216 /**
217  * @if Eng
218  * @brief  Initialize the SDIO.
219  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
220  * @retval ERRCODE_SUCC Success.
221  * @retval Other        Failure. For details, see @ref errcode_t.
222  * @else
223  * @brief  初始化SDIO。
224  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
225  * @retval ERRCODE_SUCC 成功。
226  * @retval Other        失败,参考 @ref errcode_t 。
227  * @endif
228  */
229 errcode_t uapi_sdio_slave_init(sdio_bus_t bus);
230 
231 /**
232  * @if Eng
233  * @brief  Deinitialize the SDIO.
234  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
235  * @else
236  * @brief  去初始化SDIO。
237  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
238  * @endif
239  */
240 void uapi_sdio_slave_deinit(sdio_bus_t bus);
241 
242 /**
243  * @if Eng
244  * @brief  Reinitiate the SDIO.
245  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
246  * @retval ERRCODE_SUCC Success.
247  * @retval Other        Failure. For details, see @ref errcode_t.
248  * @else
249  * @brief  重新初始化SDIO。
250  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
251  * @retval ERRCODE_SUCC 成功。
252  * @retval Other        失败,参考 @ref errcode_t 。
253  * @endif
254  */
255 errcode_t uapi_sdio_slave_reinit(sdio_bus_t bus);
256 
257 /**
258  * @if Eng
259  * @brief  SDIO IP chip reset function.
260  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
261  * @else
262  * @brief  IP芯片复位函数。
263  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
264  * @endif
265  */
266 void uapi_sdio_slave_soft_reset(sdio_bus_t bus);
267 
268  /**
269  * @if Eng
270  * @brief  SDIO register interrupt callback function.
271  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
272  * @param  [out]  fun SDIO interrupt callback structure. see @ref sdio_callback_func_t
273  * @retval ERRCODE_SUCC   Success.
274  * @retval Other        Failure. For details, see @ref errcode_t.
275  * @else
276  * @brief  SDIO 注册中断回调函数。
277  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
278  * @param  [out]  fun SDIO 中断回调函数结构体,参考 @ref sdio_callback_func_t
279  * @retval ERRCODE_SUCC 成功。
280  * @retval Other        失败,参考 @ref errcode_t 。
281  * @endif
282  */
283 errcode_t uapi_sdio_slave_register_callback(sdio_bus_t bus, const sdio_callback_func_t *fun);
284 
285  /**
286  * @if Eng
287  * @brief  Configuring the end flag of the EDMA descriptor.
288  * @param  [out]  adma_tab adma table first address.
289  * @param  [in]  adma_index adma Transmission channel number.
290  * @retval ERRCODE_SUCC   Success.
291  * @retval Other        Failure. For details, see @ref errcode_t.
292  * @else
293  * @brief  配置内部EDMA 描述符 结束标志。
294  * @param  [out]  adma_tab adma table首地址。
295  * @param  [in]  adma_index 传输通道号。
296  * @retval ERRCODE_SUCC 成功。
297  * @retval Other        失败,参考 @ref errcode_t 。
298  * @endif
299  */
300 errcode_t uapi_sdio_slave_complete_send(uint8_t *adma_tab, uint32_t adma_index);
301 
302  /**
303  * @if Eng
304  * @brief  set sdio pad adma table function.
305  * @param  [out]  adma_tab adma table first address.
306  * @param  [in]  adma_index adma Transmission channel number.
307  * @param  [in]  padlen Length of data to be sent after data alignment.
308  * @retval ERRCODE_SUCC   Success.
309  * @retval Other        Failure. For details, see @ref errcode_t.
310  * @else
311  * @brief  配置数据对齐后的ADMA表。
312  * @param  [out]  adma_tab adma table首地址。
313  * @param  [in]  adma_index 传输通道号。
314  * @param  [in]  padlen 据对齐后要发送的数据长度。
315  * @retval ERRCODE_SUCC 成功。
316  * @retval Other        失败,参考 @ref errcode_t 。
317  * @endif
318  */
319 errcode_t uapi_sdio_slave_set_pad_admatab(uint8_t *adma_tab, uint32_t adma_index, uint32_t padlen);
320 
321 #if defined(CONFIG_SDIO_EXTEND_INFO)
322  /**
323  * @if Eng
324  * @brief  write extend information function.
325  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
326  * @param  [out]  extfunc Extended information structure pointer. see @ref sdio_extendfunc_t
327  * @retval ERRCODE_SUCC   Success.
328  * @retval Other        Failure. For details, see @ref errcode_t.
329  * @else
330  * @brief  写扩展信息接口。
331  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
332  * @param  [out]  extfunc 扩展信息结构体指针,参考 @ref sdio_extendfunc_t
333  * @retval ERRCODE_SUCC 成功。
334  * @retval Other        失败,参考 @ref errcode_t 。
335  * @endif
336  */
337 errcode_t uapi_sdio_slave_write_extend_info(sdio_bus_t bus, sdio_extendfunc_t* extfunc);
338 
339  /**
340  * @if Eng
341  * @brief  get sdio extend configuration.
342  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
343  * @retval pointer to extend info buffer. For details, see @ref sdio_extendfunc_t.
344  * @else
345  * @brief  获取扩展区配置信息。
346  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
347  * @retval 扩展区配置信息指针,参考 @ref sdio_extendfunc_t 。
348  * @endif
349  */
350 sdio_extendfunc_t* uapi_sdio_slave_get_extend_info(sdio_bus_t bus);
351 #endif
352 
353  /**
354  * @if Eng
355  * @brief  start to send data.
356  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
357  * @param  [in]  data_len Length of sent data.
358  * @retval ERRCODE_SUCC   Success.
359  * @retval Other        Failure. For details, see @ref errcode_t.
360  * @else
361  * @brief  启动数据发送接口。
362  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
363  * @param  [in]  data_len 发送数据长度。
364  * @retval ERRCODE_SUCC 成功。
365  * @retval Other        失败,参考 @ref errcode_t 。
366  * @endif
367  */
368 errcode_t uapi_sdio_slave_prepare_send_data(sdio_bus_t bus, uint32_t data_len);
369 
370  /**
371  * @if Eng
372  * @brief  set adma table.
373  * @param  [out]  adma_tab adma table first address.
374  * @param  [in]  adma_index adma Transmission channel number.
375  * @param  [out]  data_addr adma transmission destination address.
376  * @param  [in]  data_len adma Transmission data length.
377  * @retval ERRCODE_SUCC   Success.
378  * @retval Other        Failure. For details, see @ref errcode_t.
379  * @else
380  * @brief  设置adma传输通道。
381  * @param  [out]  adma_tab adma table首地址。
382  * @param  [in]  adma_index 传输通道号。
383  * @param  [out]  data_addr 传输目的地址。
384  * @param  [in]  data_len 传输数据长度。
385  * @retval ERRCODE_SUCC 成功。
386  * @retval Other        失败,参考 @ref errcode_t 。
387  * @endif
388  */
389 errcode_t uapi_sdio_slave_set_admatab(uint8_t *adma_tab, uint32_t adma_index, const uint32_t *data_addr,
390                                       uint32_t data_len);
391 
392  /**
393  * @if Eng
394  * @brief  schedule sdio pending message.
395  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
396  * @retval ERRCODE_SUCC   Success.
397  * @retval Other   If sdio not in work status or there is msg sending, return failure. For details, see @ref errcode_t.
398  * @else
399  * @brief  调度sdio消息。
400  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
401  * @retval ERRCODE_SUCC 如果没有挂起的消息,或者将挂起的消息发送成功,返回成功。
402  * @retval Other        如果sdio不在工作状态,或者sdio正在发送消息,返回失败,参考 @ref errcode_t 。
403  * @endif
404  */
405 errcode_t uapi_sdio_slave_sched_msg(sdio_bus_t bus);
406 
407  /**
408  * @if Eng
409  * @brief  sync send message.
410  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
411  * @param  [in]  msg The message, range [0-31].
412  * @retval ERRCODE_SUCC   Success.
413  * @retval Other        Failure. For details, see @ref errcode_t.
414  * @else
415  * @brief  将消息加入消息队列并发送。
416  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
417  * @param  [in]  msg 给定消息,范围[0-31]。
418  * @retval ERRCODE_SUCC 成功。
419  * @retval Other        失败,参考 @ref errcode_t 。
420  * @endif
421  */
422 errcode_t uapi_sdio_slave_sync_msg(sdio_bus_t bus, uint32_t msg);
423 
424  /**
425  * @if Eng
426  * @brief  send given message ack.
427  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
428  * @param  [in]  msg the current sending msg will be overwrite by this msg.
429  * @retval ERRCODE_SUCC   Success.
430  * @retval Other        Failure. For details, see @ref errcode_t.
431  * @else
432  * @brief  发送指定消息。
433  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
434  * @param  [in]  msg 当前正在发送的消息将该消息覆盖。
435  * @retval ERRCODE_SUCC 成功。
436  * @retval Other        失败,参考 @ref errcode_t 。
437  * @endif
438  */
439 errcode_t uapi_sdio_slave_send_msg_ack(sdio_bus_t bus, uint32_t msg);
440 
441  /**
442  * @if Eng
443  * @brief  Clear given msg and add new msg to pending msg and send.
444  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
445  * @param  [in]  send_msg Message in range [0~31] which will be sent.
446  * @param  [in]  clear_msg Message in range [0~31] which will be cleard.
447  * @retval ERRCODE_SUCC   Success.
448  * @retval Other        Failure. For details, see @ref errcode_t.
449  * @else
450  * @brief  清除消息队列中挂起的指定消息,将新消息加入消息队列并发送。
451  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
452  * @param  [in]  send_msg 指定发送的消息号,范围[0-31]。
453  * @param  [in]  clear_msg 指定清除的消息号,范围[0-31]。
454  * @retval ERRCODE_SUCC 成功。
455  * @retval Other        失败,参考 @ref errcode_t 。
456  * @endif
457  */
458 errcode_t uapi_sdio_slave_process_msg(sdio_bus_t bus, uint32_t send_msg, uint32_t clear_msg);
459 
460  /**
461  * @if Eng
462  * @brief  sdio is pending given message.
463  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
464  * @param  [in]  msg The message, range [0-31].
465  * @retval true   The message at pending status.
466  * @retval false  The message at other status.
467  * @else
468  * @brief  判断sdio是否挂起指定的消息。
469  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
470  * @param  [in]  msg 给定消息,范围[0-31]。
471  * @retval true  指定消息处于挂起状态。
472  * @retval false 指定消息不处于挂起状态。
473  * @endif
474  */
475 bool uapi_sdio_slave_is_pending_msg(sdio_bus_t bus, uint32_t msg);
476 
477  /**
478  * @if Eng
479  * @brief  Check whether the sdio is sending a specified message.
480  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
481  * @param  [in]  msg The message, range [0-31].
482  * @retval true   The message at sending status.
483  * @retval false  The message at other status.
484  * @else
485  * @brief  判断sdio是否正在发送指定的消息。
486  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
487  * @param  [in]  msg 给定消息,范围[0-31]。
488  * @retval true  指定消息处于发送状态。
489  * @retval false 指定消息不处于发送状态。
490  * @endif
491  */
492 bool uapi_sdio_slave_is_sending_msg(sdio_bus_t bus, uint32_t msg);
493 
494  /**
495  * @if Eng
496  * @brief  register callback to notify host msg or data event occurs.
497  * @param  [in]  event_callback callback function when sending msg or data. see @ref notify_host_event_t
498  * @else
499  * @brief  注册通知Host发送了消息或数据的回调函数。
500  * @param  [in]  event_callback 消息或数据发送时调用的回调函数,参考 @ref notify_host_event_t
501  * @endif
502  */
503 void uapi_sdio_slave_register_notify_message_callback(notify_host_event_t event_callback);
504 
505  /**
506  * @if Eng
507  * @brief  SDIO read retry when read err event occurs.
508  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
509  * @param  [in]  read_bytes Length of read data.
510  * @else
511  * @brief  SDIO 读错误事件存在时尝试重新读取。
512  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
513  * @param  [in]  read_bytes 读取的数据长度。
514  * @endif
515  */
516 void uapi_sdio_slave_read_retry_when_read_err(sdio_bus_t bus, uint32_t read_bytes);
517 
518  /**
519  * @if Eng
520  * @brief  Init sdio with no wait .
521  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
522  * @else
523  * @brief  非阻塞初始化。
524  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
525  * @endif
526  */
527 void uapi_sdio_slave_init_no_wait(sdio_bus_t bus);
528 
529  /**
530  * @if Eng
531  * @brief  Get whether host clock ready.
532  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
533  * @retval true  Ready.
534  * @retval false Not ready.
535  * @else
536  * @brief  判断HOST时钟是否就绪。
537  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
538  * @retval true  准备就绪。
539  * @retval false 没有准备就绪。
540  * @endif
541  */
542 bool uapi_sdio_slave_host_clk_ready(sdio_bus_t bus);
543 
544  /**
545  * @if Eng
546  * @brief  get current sdio status.
547  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
548  * @param  [out]  satus_info Storage status information BUFFER pointer. see @ref sdio_status_info_t
549  * @retval ERRCODE_SUCC   Success.
550  * @retval Other        Failure. For details, see @ref errcode_t.
551  * @else
552  * @brief  获取当前SDIO通道状态信息。
553  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
554  * @param  [out]  satus_info 存储状态信息BUFFER指针,参考 @ref sdio_status_info_t
555  * @retval ERRCODE_SUCC 成功。
556  * @retval Other        失败,参考 @ref errcode_t 。
557  * @endif
558  */
559 errcode_t uapi_sdio_slave_get_status(sdio_bus_t bus, sdio_status_info_t* satus_info);
560 
561  /**
562  * @if Eng
563  * @brief  set current sdio status.
564  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
565  * @param  [out]  satus_info Pointing to the storage status information buffer. see @ref sdio_status_info_t
566  * @retval ERRCODE_SUCC   Success.
567  * @retval Other        Failure. For details, see @ref errcode_t.
568  * @else
569  * @brief  设置当前SDIO通道状态信息。
570  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
571  * @param  [out]  satus_info 指向存储状态信息buffer,参考 @ref sdio_status_info_t
572  * @retval ERRCODE_SUCC 成功。
573  * @retval Other        失败,参考 @ref errcode_t 。
574  * @endif
575  */
576 errcode_t uapi_sdio_slave_set_status(sdio_bus_t bus, const sdio_status_info_t* satus_info);
577 
578  /**
579  * @if Eng
580  * @brief  SDIO memory init function.
581  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
582  * @else
583  * @brief  SDIO 内存初始化函数。
584  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
585  * @endif
586  */
587 void uapi_sdio_slave_memory_init(sdio_bus_t bus);
588 
589  /**
590  * @if Eng
591  * @brief  Get SDIO info function.
592  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
593  * @else
594  * @brief  获取SDIO状态信息。
595  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
596  * @endif
597  */
598 sdio_info_t* uapi_sdio_slave_get_info(sdio_bus_t bus);
599 
600 #if defined(CONFIG_SDIO_EXTEND_INFO)
601  /**
602  * @if Eng
603  * @brief  write extend information value function.
604  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
605  * @param  [in]  offset The address offset.
606  * @param  [in]  val The value of setting.
607  * @else
608  * @brief  写扩展信息接口。
609  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
610  * @param  [in]  offset 地址偏移量。
611  * @param  [in]  val 设置的值。
612  * @endif
613  */
614 void uapi_sdio_slave_set_extend_val_info(sdio_bus_t bus, uint32_t offset, uint32_t val);
615 
616  /**
617  * @if Eng
618  * @brief  get extend information value function.
619  * @param  [in]  bus SDIO bus. see @ref sdio_bus_t
620  * @param  [in]  offset The address offset.
621  * @retval get value of extend info address.
622  * @else
623  * @brief  获取扩展信息接口。
624  * @param  [in]  bus SDIO通道, 参考 @ref sdio_bus_t
625  * @param  [in]  offset 地址偏移量。
626  * @retval 获取扩展信息地址的值。
627  * @endif
628  */
629 uint32_t uapi_sdio_slave_get_extend_val_info(sdio_bus_t bus, uint32_t offset);
630 #endif
631 
632 /**
633  * @}
634  */
635 
636 #ifdef __cplusplus
637 #if __cplusplus
638 }
639 #endif /* __cplusplus */
640 #endif /* __cplusplus */
641 
642 #endif