18#if VSF_HAL_USE_SDIO == ENABLED
23#define vsf_real_sdio_t VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_t)
24#define vsf_real_sdio_capability VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_capability)
26#ifndef VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY
27# define VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY DISABLED
30#ifdef VSF_SDIO_CFG_IMP_REMAP_PREFIX
31# undef VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY
32# define VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY ENABLED
35#if VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
36# ifndef VSF_SDIO_CFG_CAPCBILITY_MAX_FREQ_HZ
37# define VSF_SDIO_CFG_CAPCBILITY_MAX_FREQ_HZ (50 * 1000 * 1000)
39# ifndef VSF_SDIO_CFG_CAPCBILITY_BUS_WIDTH
40# define VSF_SDIO_CFG_CAPCBILITY_BUS_WIDTH SDIO_CAP_BUS_WIDTH_8
47#if VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
52 .bus_width = VSF_SDIO_CFG_CAPCBILITY_BUS_WIDTH,
59#undef VSF_SDIO_CFG_REIMPLEMENT_API_CAPABILITY
60#undef VSF_SDIO_CFG_CAPCBILITY_MAX_FREQ_HZ
61#undef VSF_SDIO_CFG_CAPCBILITY_BUS_WIDTH
63#undef vsf_real_sdio_capability
67#ifdef VSF_SDIO_CFG_IMP_REMAP_PREFIX
69# define vsf_imp_sdio_t VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_t)
70# define vsf_imp_sdio_init VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_init)
71# define vsf_imp_sdio_enable VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_enable)
72# define vsf_imp_sdio_disable VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_disable)
73# define vsf_imp_sdio_irq_enable VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_irq_enable)
74# define vsf_imp_sdio_irq_disable VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_irq_disable)
75# define vsf_imp_sdio_status VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_status)
76# define vsf_imp_sdio_capability VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_capability)
77# define vsf_imp_sdio_set_clock VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_set_clock)
78# define vsf_imp_sdio_set_bus_width VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_set_bus_width)
79# define vsf_imp_sdio_host_request VSF_MCONNECT(VSF_SDIO_CFG_IMP_PREFIX, _sdio_host_request)
81# define vsf_remap_sdio_t VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_t)
82# define vsf_remap_sdio_init VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_init)
83# define vsf_remap_sdio_enable VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_enable)
84# define vsf_remap_sdio_disable VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_disable)
85# define vsf_remap_sdio_irq_enable VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_irq_enable)
86# define vsf_remap_sdio_irq_disable VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_irq_disable)
87# define vsf_remap_sdio_status VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_status)
88# define vsf_remap_sdio_capability VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_capability)
89# define vsf_remap_sdio_set_clock VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_set_clock)
90# define vsf_remap_sdio_set_bus_width VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_set_bus_width)
91# define vsf_remap_sdio_host_request VSF_MCONNECT(VSF_SDIO_CFG_IMP_REMAP_PREFIX, _sdio_host_request)
93# define VSF_SDIO_CFG_IMP_REMAP_FUNCTIONS \
94 vsf_err_t vsf_imp_sdio_init(vsf_imp_sdio_t *sdio_ptr, vsf_sdio_cfg_t *cfg_ptr) \
96 VSF_HAL_ASSERT((sdio_ptr != NULL) && (cfg_ptr != NULL)); \
97 return vsf_remap_sdio_init(sdio_ptr, cfg_ptr); \
99 void vsf_imp_sdio_fini(vsf_imp_sdio_t *sdio_ptr) \
101 VSF_HAL_ASSERT(sdio_ptr != NULL); \
102 vsf_remap_sdio_fini(sdio_ptr); \
104 void vsf_imp_sdio_irq_enable(vsf_imp_sdio_t *sdio_ptr, vsf_sdio_irq_mask_t irq_mask) \
106 VSF_HAL_ASSERT(sdio_ptr != NULL); \
107 vsf_remap_sdio_irq_enable(sdio_ptr, irq_mask); \
109 void vsf_imp_sdio_irq_disable(vsf_imp_sdio_t *sdio_ptr, vsf_sdio_irq_mask_t irq_mask) \
111 VSF_HAL_ASSERT(sdio_ptr != NULL); \
112 vsf_remap_sdio_irq_disable(sdio_ptr, irq_mask); \
114 vsf_sdio_status_t vsf_imp_sdio_status(vsf_imp_sdio_t *sdio_ptr) \
116 VSF_HAL_ASSERT(sdio_ptr != NULL); \
117 return vsf_remap_sdio_status(sdio_ptr); \
119 vsf_sdio_capability_t vsf_imp_sdio_capability(vsf_imp_sdio_t *sdio_ptr) \
121 VSF_HAL_ASSERT(sdio_ptr != NULL); \
122 return vsf_remap_sdio_capability(sdio_ptr); \
124 vsf_err_t vsf_imp_sdio_set_clock(vsf_imp_sdio_t *sdio_ptr, uint32_t clock_hz) \
126 VSF_HAL_ASSERT(sdio_ptr != NULL); \
127 return vsf_remap_sdio_set_clock(sdio_ptr, clock_hz); \
129 vsf_err_t vsf_imp_sdio_set_bus_width(vsf_imp_sdio_t *sdio_ptr, uint8_t bus_width) \
131 VSF_HAL_ASSERT(sdio_ptr != NULL); \
132 return vsf_remap_sdio_set_bus_width(sdio_ptr, bus_width); \
134 vsf_err_t vsf_imp_sdio_host_request(vsf_imp_sdio_t *sdio_ptr, vsf_sdio_trans_t *trans) \
136 VSF_HAL_ASSERT(sdio_ptr != NULL); \
137 return vsf_remap_sdio_host_request(sdio_ptr, trans); \
146#define VSF_HAL_TEMPLATE_IMP_NAME _sdio
147#define VSF_HAL_TEMPLATE_IMP_UPCASE_NAME _SDIO
149#ifndef VSF_SDIO_CFG_IMP_PREFIX
150# error "Please define VSF_SDIO_CFG_IMP_PREFIX in sdio driver"
153#ifndef VSF_SDIO_CFG_IMP_UPCASE_PREFIX
154# error "Please define VSF_SDIO_CFG_IMP_UPCASE_PREFIX in sdio driver"
157#ifndef VSF_SDIO_CFG_IMP_COUNT_MASK_PREFIX
158# define VSF_SDIO_CFG_IMP_COUNT_MASK_PREFIX VSF_SDIO_CFG_IMP_UPCASE_PREFIX
161#ifdef VSF_SDIO_CFG_IMP_REMAP_FUNCTIONS
162# define VSF_HAL_CFG_IMP_REMAP_FUNCTIONS VSF_SDIO_CFG_IMP_REMAP_FUNCTIONS
167#undef VSF_SDIO_CFG_IMP_PREFIX
168#undef VSF_SDIO_CFG_IMP_COUNT_MASK_PREFIX
169#undef VSF_SDIO_CFG_IMP_UPCASE_PREFIX
170#undef VSF_SDIO_CFG_IMP_LV0
171#undef VSF_SDIO_CFG_IMP_REMAP_FUNCTIONS
172#undef VSF_SDIO_CFG_IMP_HAS_OP
173#undef VSF_SDIO_CFG_IMP_EXTERN_OP
176#undef vsf_imp_sdio_init
177#undef vsf_imp_sdio_enable
178#undef vsf_imp_sdio_disable
179#undef vsf_imp_sdio_irq_enable
180#undef vsf_imp_sdio_irq_disable
181#undef vsf_imp_sdio_status
182#undef vsf_imp_sdio_capability
183#undef vsf_imp_sdio_set_clock
184#undef vsf_imp_sdio_set_bus_width
185#undef vsf_imp_sdio_host_request
187#undef vsf_remap_sdio_t
188#undef vsf_remap_sdio_init
189#undef vsf_remap_sdio_enable
190#undef vsf_remap_sdio_disable
191#undef vsf_remap_sdio_irq_enable
192#undef vsf_remap_sdio_irq_disable
193#undef vsf_remap_sdio_status
194#undef vsf_remap_sdio_capability
195#undef vsf_remap_sdio_set_clock
196#undef vsf_remap_sdio_set_bus_width
197#undef vsf_remap_sdio_host_request
Definition vsf_template_sdio.h:639
uint32_t max_freq_hz
Definition vsf_template_sdio.h:648