blob: dc13829fe6e7f8342085ff665048a0b9ff8bb0ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
* Copyright (C) 2022-2024, Xiaohua Semiconductor Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-02-14 CDT first version
*/
#ifndef __DRV_SDIO_H__
#define __DRV_SDIO_H__
/*******************************************************************************
* Include files
******************************************************************************/
#include <rtthread.h>
#include "rtdevice.h"
#include "drv_dma.h"
#include "drv_irq.h"
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
* Global type definitions ('typedef')
******************************************************************************/
/* sdio package */
struct sdio_pkg
{
struct rt_mmcsd_cmd *cmd;
void *buf;
rt_uint32_t flag;
};
typedef rt_err_t (*sdio_txconfig)(CM_DMA_TypeDef *dma_instance, rt_uint8_t channel, struct sdio_pkg *pkg);
typedef rt_err_t (*sdio_rxconfig)(CM_DMA_TypeDef *dma_instance, rt_uint8_t channel, struct sdio_pkg *pkg);
typedef rt_uint32_t (*sdio_clk_get)(CM_SDIOC_TypeDef *sdio_instance);
/* hc32 sdio des */
struct hc32_sdio_des
{
sdio_clk_get clk_get;
sdio_txconfig txconfig;
sdio_rxconfig rxconfig;
};
/* hc32 sdio configure */
struct hc32_sdio_config
{
const char *name;
CM_SDIOC_TypeDef *instance;
rt_uint32_t clock;
struct hc32_irq_config irq_config;
struct dma_config dma_rx;
struct dma_config dma_tx;
};
/*******************************************************************************
* Global pre-processor symbols/macros ('#define')
******************************************************************************/
/*******************************************************************************
* Global variable definitions ('extern')
******************************************************************************/
/*******************************************************************************
* Global function prototypes (definition in C source)
******************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* __DRV_SDIO_H__ */
|