18#ifndef __VSF_TEMPLATE_SDIO_H__
19#define __VSF_TEMPLATE_SDIO_H__
33#ifndef VSF_SDIO_CFG_MULTI_CLASS
34# define VSF_SDIO_CFG_MULTI_CLASS ENABLED
37#if defined(VSF_HW_SDIO_COUNT) && !defined(VSF_HW_SDIO_MASK)
38# define VSF_HW_SDIO_MASK VSF_HAL_COUNT_TO_MASK(VSF_HW_SDIO_COUNT)
41#if defined(VSF_HW_SDIO_MASK) && !defined(VSF_HW_SDIO_COUNT)
42# define VSF_HW_SDIO_COUNT VSF_HAL_MASK_TO_COUNT(VSF_HW_SDIO_MASK)
46#ifndef VSF_SDIO_CFG_PREFIX
47# if VSF_SDIO_CFG_MULTI_CLASS == ENABLED
48# define VSF_SDIO_CFG_PREFIX vsf
49# elif defined(VSF_HW_SDIO_COUNT) && (VSF_HW_SDIO_COUNT != 0)
50# define VSF_SDIO_CFG_PREFIX vsf_hw
52# define VSF_SDIO_CFG_PREFIX vsf
56#ifndef VSF_SDIO_CFG_FUNCTION_RENAME
57# define VSF_SDIO_CFG_FUNCTION_RENAME ENABLED
60#ifndef VSF_SDIO_CFG_REIMPLEMENT_TYPE_MODE
61# define VSF_SDIO_CFG_REIMPLEMENT_TYPE_MODE DISABLED
64#ifndef VSF_SDIO_CFG_REIMPLEMENT_TYPE_IRQ_MASK
65# define VSF_SDIO_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED
68#ifndef VSF_SDIO_CFG_REIMPLEMENT_TYPE_STATUS
69# define VSF_SDIO_CFG_REIMPLEMENT_TYPE_STATUS DISABLED
75#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
76# define VSF_SDIO_CFG_REIMPLEMENT_TYPE_CFG DISABLED
82#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
83# define VSF_SDIO_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED
86#ifndef VSF_SDIO_CFG_INHERT_HAL_CAPABILITY
87# define VSF_SDIO_CFG_INHERT_HAL_CAPABILITY ENABLED
93#define SD_SEND_RELATIVE_ADDR 3
94#define SD_SEND_RELATIVE_ADDR_OP (SDIO_RESP_R6)
95#define SD_SEND_IF_COND 8
96#define SD_SEND_IF_COND_OP (SDIO_RESP_R7)
97#define SD_SWITCH_VOLTAGE 11
98#define SD_SWITCH_VOLTAGE_OP (SDIO_RESP_R1 | SDIO_CMDOP_CLKHOLD)
102#define SD_SWITCH_OP (SDIO_RESP_R1)
105#define SD_ERASE_WR_BLK_START 32
106#define SD_ERASE_WR_BLK_START_OP (SDIO_RESP_R1)
107#define SD_ERASE_WR_BLK_END 33
108#define SD_ERASE_WR_BLK_END_OP (SDIO_RESP_R1)
111#define SD_APP_SET_BUS_WIDTH 6
112#define SD_APP_SET_BUS_WIDTH_OP (SDIO_RESP_R1)
113# define SD_BUS_WIDTH_1 0
114# define SD_BUS_WIDTH_4 2
115# define SD_BUS_WIDTH_8 3
116#define SD_APP_SD_STATUS 13
117#define SD_APP_SD_STATUS_OP (SDIO_RESP_R1)
118#define SD_APP_SEND_NUM_WR_BLKS 22
119#define SD_APP_SEND_NUM_WR_BLKS_OP (SDIO_RESP_R1)
120#define SD_APP_OP_COND 41
121#define SD_APP_OP_COND_OP (SDIO_RESP_R3)
122#define SD_APP_SEND_SCR 51
123#define SD_APP_SEND_SCR_OP (SDIO_RESP_R1)
126#define SD_READ_EXTR_SINGLE 48
127#define SD_READ_EXTR_SINGLE_OP (SDIO_RESP_R1)
128#define SD_WRITE_EXTR_SINGLE 49
129#define SD_WRITE_EXTR_SINGLE_OP (SDIO_RESP_R1)
132#define SD_OCR_VDD_165_195 0x00000080
133#define SD_OCR_VDD_20_21 0x00000100
134#define SD_OCR_VDD_21_22 0x00000200
135#define SD_OCR_VDD_22_23 0x00000400
136#define SD_OCR_VDD_23_24 0x00000800
137#define SD_OCR_VDD_24_25 0x00001000
138#define SD_OCR_VDD_25_26 0x00002000
139#define SD_OCR_VDD_26_27 0x00004000
140#define SD_OCR_VDD_27_28 0x00008000
141#define SD_OCR_VDD_28_29 0x00010000
142#define SD_OCR_VDD_29_30 0x00020000
143#define SD_OCR_VDD_30_31 0x00040000
144#define SD_OCR_VDD_31_32 0x00080000
145#define SD_OCR_VDD_32_33 0x00100000
146#define SD_OCR_VDD_33_34 0x00200000
147#define SD_OCR_VDD_34_35 0x00400000
148#define SD_OCR_VDD_35_36 0x00800000
149#define SD_OCR_VDD_HIGH 0x00FF8000
150#define SD_OCR_VDD_LOW 0x00007F80
151#define SD_OCR_VDD (SD_OCR_VDD_HIGH | SD_OCR_VDD_LOW)
152#define SD_OCR_S18R (1 << 24)
153#define SD_ROCR_S18A SD_OCR_S18R
154#define SD_OCR_XPC (1 << 28)
155#define SD_OCR_CCS (1 << 30)
159#define MMC_GO_IDLE_STATE 0
160#define MMC_GO_IDLE_STATE_OP (SDIO_RESP_NONE)
161#define MMC_SEND_OP_COND 1
162#define MMC_SEND_OP_COND_OP (SDIO_RESP_R3)
163#define MMC_ALL_SEND_CID 2
164#define MMC_ALL_SEND_CID_OP (SDIO_RESP_R2)
165#define MMC_SET_RELATIVE_ADDR 3
166#define MMC_SET_RELATIVE_ADDR_OP (SDIO_RESP_R1)
168#define MMC_SET_DSR_OP (SDIO_RESP_NONE)
169#define MMC_SLEEP_AWAKE 5
170#define MMC_SLEEP_AWAKE_OP (SDIO_RESP_R1B)
172#define MMC_SWITCH_OP (SDIO_RESP_R1B)
173#define MMC_SELECT_CARD 7
174#define MMC_SELECT_CARD_OP (SDIO_RESP_R1)
175#define MMC_SEND_EXT_CSD 8
176#define MMC_SEND_EXT_CSD_OP (SDIO_RESP_R1)
177#define MMC_SEND_CSD 9
178#define MMC_SEND_CSD_OP (SDIO_RESP_R2)
179#define MMC_SEND_CID 10
180#define MMC_SEND_CID_OP (SDIO_RESP_R2)
181#define MMC_READ_DAT_UNTIL_STOP 11
182#define MMC_READ_DAT_UNTIL_STOP_OP (SDIO_RESP_R1)
183#define MMC_STOP_TRANSMISSION 12
184#define MMC_STOP_TRANSMISSION_OP (SDIO_RESP_R1B | SDIO_CMDOP_TRANS_STOP)
185#define MMC_SEND_STATUS 13
186#define MMC_SEND_STATUS_OP (SDIO_RESP_R1)
187#define MMC_BUS_TEST_R 14
188#define MMC_BUS_TEST_R_OP (SDIO_RESP_R1)
189#define MMC_GO_INACTIVE_STATE 15
190#define MMC_BUS_TEST_W 19
191#define MMC_BUS_TEST_W_OP (SDIO_RESP_R1)
192#define MMC_SPI_READ_OCR 58
193#define MMC_SPI_READ_OCR_OP (SDIO_RESP_SPI_R3)
194#define MMC_SPI_CRC_ON_OFF 59
195#define MMC_SPI_CRC_ON_OFF_OP (SDIO_RESP_SPI_R1)
198#define MMC_SET_BLOCKLEN 16
199#define MMC_SET_BLOCKLEN_OP (SDIO_RESP_R1)
200#define MMC_READ_SINGLE_BLOCK 17
201#define MMC_READ_SINGLE_BLOCK_OP (SDIO_RESP_R1 | SDIO_CMDOP_SINGLE_BLOCK | SDIO_CMDOP_READ)
202#define MMC_READ_MULTIPLE_BLOCK 18
203#define MMC_READ_MULTIPLE_BLOCK_OP (SDIO_RESP_R1 | SDIO_CMDOP_MULTI_BLOCK | SDIO_CMDOP_READ)
204#define MMC_SEND_TUNING_BLOCK 19
205#define MMC_SEND_TUNING_BLOCK_OP (SDIO_RESP_R1)
206#define MMC_SEND_TUNING_BLOCK_HS200 21
207#define MMC_SEND_TUNING_BLOCK_HS200_OP (SDIO_RESP_R1)
210#define MMC_WRITE_DAT_UNTIL_STOP 20
211#define MMC_WRITE_DAT_UNTIL_STOP_OP (SDIO_RESP_R1)
214#define MMC_SET_BLOCK_COUNT 23
215#define MMC_SET_BLOCK_COUNT_OP (SDIO_RESP_R1)
216#define MMC_WRITE_BLOCK 24
217#define MMC_WRITE_BLOCK_OP (SDIO_RESP_R1 | SDIO_CMDOP_SINGLE_BLOCK | SDIO_CMDOP_WRITE)
218#define MMC_WRITE_MULTIPLE_BLOCK 25
219#define MMC_WRITE_MULTIPLE_BLOCK_OP (SDIO_RESP_R1 | SDIO_CMDOP_MULTI_BLOCK | SDIO_CMDOP_WRITE)
220#define MMC_PROGRAM_CID 26
221#define MMC_PROGRAM_CID_OP (SDIO_RESP_R1)
222#define MMC_PROGRAM_CSD 27
223#define MMC_PROGRAM_CSD_OP (SDIO_RESP_R1)
226#define MMC_SET_WRITE_PROT 28
227#define MMC_SET_WRITE_PROT_OP (SDIO_RESP_R1B)
228#define MMC_CLR_WRITE_PROT 29
229#define MMC_CLR_WRITE_PROT_OP (SDIO_RESP_R1B)
230#define MMC_SEND_WRITE_PROT 30
231#define MMC_SEND_WRITE_PROT_OP (SDIO_RESP_R1)
234#define MMC_ERASE_GROUP_START 35
235#define MMC_ERASE_GROUP_START_OP (SDIO_RESP_R1)
236#define MMC_ERASE_GROUP_END 36
237#define MMC_ERASE_GROUP_END_OP (SDIO_RESP_R1)
239#define MMC_ERASE_OP (SDIO_RESP_R1B)
242#define MMC_FAST_IO 39
243#define MMC_FAST_IO_OP (SDIO_RESP_R4)
244#define MMC_GO_IRQ_STATE 40
245#define MMC_GO_IRQ_STATE_OP (SDIO_RESP_R5)
248#define MMC_LOCK_UNLOCK 42
249#define MMC_LOCK_UNLOCK_OP (SDIO_RESP_R1B)
252#define MMC_APP_CMD 55
253#define MMC_APP_CMD_OP (SDIO_RESP_R1)
254#define MMC_GEN_CMD 56
255#define MMC_GEN_CMD_OP (SDIO_RESP_R1)
258#define MMC_QUE_TASK_PARAMS 44
259#define MMC_QUE_TASK_PARAMS_OP (SDIO_RESP_R1)
260#define MMC_QUE_TASK_ADDR 45
261#define MMC_QUE_TASK_ADDR_OP (SDIO_RESP_R1)
262#define MMC_EXECUTE_READ_TASK 46
263#define MMC_EXECUTE_READ_TASK_OP (SDIO_RESP_R1)
264#define MMC_EXECUTE_WRITE_TASK 47
265#define MMC_EXECUTE_WRITE_TASK_OP (SDIO_RESP_R1)
266#define MMC_CMDQ_TASK_MGMT 48
267#define MMC_CMDQ_TASK_MGMT_OP (SDIO_RESP_R1B)
270#define SD_VERSION_SD (1U << 31)
271#define MMC_VERSION_MMC (1U << 30)
273#define MAKE_SDMMC_VERSION(a, b, c) \
274 ((((uint32_t)(a)) << 16) | ((uint32_t)(b) << 8) | (uint32_t)(c))
275#define MAKE_SD_VERSION(a, b, c) \
276 (SD_VERSION_SD | MAKE_SDMMC_VERSION(a, b, c))
277#define MAKE_MMC_VERSION(a, b, c) \
278 (MMC_VERSION_MMC | MAKE_SDMMC_VERSION(a, b, c))
280#define EXTRACT_SDMMC_MAJOR_VERSION(x) \
281 (((uint32_t)(x) >> 16) & 0xff)
282#define EXTRACT_SDMMC_MINOR_VERSION(x) \
283 (((uint32_t)(x) >> 8) & 0xff)
284#define EXTRACT_SDMMC_CHANGE_VERSION(x) \
285 ((uint32_t)(x) & 0xff)
287#define SD_VERSION_3 MAKE_SD_VERSION(3, 0, 0)
288#define SD_VERSION_2 MAKE_SD_VERSION(2, 0, 0)
289#define SD_VERSION_1_0 MAKE_SD_VERSION(1, 0, 0)
290#define SD_VERSION_1_10 MAKE_SD_VERSION(1, 10, 0)
292#define MMC_VERSION_UNKNOWN MAKE_MMC_VERSION(0, 0, 0)
293#define MMC_VERSION_1_2 MAKE_MMC_VERSION(1, 2, 0)
294#define MMC_VERSION_1_4 MAKE_MMC_VERSION(1, 4, 0)
295#define MMC_VERSION_2_2 MAKE_MMC_VERSION(2, 2, 0)
296#define MMC_VERSION_3 MAKE_MMC_VERSION(3, 0, 0)
297#define MMC_VERSION_4 MAKE_MMC_VERSION(4, 0, 0)
298#define MMC_VERSION_4_1 MAKE_MMC_VERSION(4, 1, 0)
299#define MMC_VERSION_4_2 MAKE_MMC_VERSION(4, 2, 0)
300#define MMC_VERSION_4_3 MAKE_MMC_VERSION(4, 3, 0)
301#define MMC_VERSION_4_4 MAKE_MMC_VERSION(4, 4, 0)
302#define MMC_VERSION_4_41 MAKE_MMC_VERSION(4, 4, 1)
303#define MMC_VERSION_4_5 MAKE_MMC_VERSION(4, 5, 0)
304#define MMC_VERSION_5_0 MAKE_MMC_VERSION(5, 0, 0)
305#define MMC_VERSION_5_1 MAKE_MMC_VERSION(5, 1, 0)
307#define IS_SD(x) ((x) & SD_VERSION_SD)
308#define IS_MMC(x) ((x) & MMC_VERSION_MMC)
311#define R1_OUT_OF_RANGE (1 << 31)
312#define R1_ADDRESS_ERROR (1 << 30)
313#define R1_BLOCK_LEN_ERROR (1 << 29)
314#define R1_ERASE_SEQ_ERROR (1 << 28)
315#define R1_ERASE_PARAM (1 << 27)
316#define R1_WP_VIOLATION (1 << 26)
317#define R1_CARD_IS_LOCKED (1 << 25)
318#define R1_LOCK_UNLOCK_FAILED (1 << 24)
319#define R1_COM_CRC_ERROR (1 << 23)
320#define R1_ILLEGAL_COMMAND (1 << 22)
321#define R1_CARD_ECC_FAILED (1 << 21)
322#define R1_CC_ERROR (1 << 20)
323#define R1_ERROR (1 << 19)
324#define R1_UNDERRUN (1 << 18)
325#define R1_OVERRUN (1 << 17)
326#define R1_CID_CSD_OVERWRITE (1 << 16)
327#define R1_WP_ERASE_SKIP (1 << 15)
328#define R1_CARD_ECC_DISABLED (1 << 14)
329#define R1_ERASE_RESET (1 << 13)
330#define R1_STATUS(x) (x & 0xFFF9A000)
331#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9)
332#define R1_READY_FOR_DATA (1 << 8)
333#define R1_SWITCH_ERROR (1 << 7)
334#define R1_EXCEPTION_EVENT (1 << 6)
335#define R1_APP_CMD (1 << 5)
337#define R1_STATE_IDLE 0
338#define R1_STATE_READY 1
339#define R1_STATE_IDENT 2
340#define R1_STATE_STBY 3
341#define R1_STATE_TRAN 4
342#define R1_STATE_DATA 5
343#define R1_STATE_RCV 6
344#define R1_STATE_PRG 7
345#define R1_STATE_DIS 8
346#define R1_STATE_MASK 0x0FUL
348#define R1_CUR_STATE(__S) ((__S) << 9)
352#define VSF_SDIO_APIS(__prefix) \
353 __VSF_HAL_TEMPLATE_API(__prefix, vsf_err_t, sdio, init, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, vsf_sdio_cfg_t *cfg_ptr) \
354 __VSF_HAL_TEMPLATE_API(__prefix, void, sdio, fini, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr) \
355 __VSF_HAL_TEMPLATE_API(__prefix, void, sdio, irq_enable, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, vsf_sdio_irq_mask_t irq_mask) \
356 __VSF_HAL_TEMPLATE_API(__prefix, void, sdio, irq_disable, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, vsf_sdio_irq_mask_t irq_mask) \
357 __VSF_HAL_TEMPLATE_API(__prefix, vsf_sdio_status_t, sdio, status, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr) \
358 __VSF_HAL_TEMPLATE_API(__prefix, vsf_sdio_capability_t, sdio, capability, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr) \
359 __VSF_HAL_TEMPLATE_API(__prefix, vsf_err_t, sdio, set_clock, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, uint32_t clock_hz, bool is_ddr) \
360 __VSF_HAL_TEMPLATE_API(__prefix, vsf_err_t, sdio, set_bus_width, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, uint8_t bus_width) \
361 __VSF_HAL_TEMPLATE_API(__prefix, vsf_err_t, sdio, host_request, VSF_MCONNECT(__prefix, _sdio_t) *sdio_ptr, vsf_sdio_req_t *req)
541#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_MODE == DISABLED
558#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_REQOP == DISABLED
577#define SDIO_RESP_R1B (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT_CRC | SDIO_CMDOP_RESP_BUSY)
578#define SDIO_RESP_R2 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_LONG_CRC)
579#define SDIO_RESP_R3 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT)
580#define SDIO_RESP_R4 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT)
581#define SDIO_RESP_R5 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT_CRC)
582#define SDIO_RESP_R6 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT_CRC)
583#define SDIO_RESP_R7 (__SDIO_CMDOP_RESP | __SDIO_CMDOP_RESP_SHORT_CRC)
603#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_IRQ_MASK == DISABLED
615#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_REQSTS == DISABLED
629#if VSF_SDIO_CFG_REIMPLEMENT_TYPE_STATUS == DISABLED
640#if VSF_SDIO_CFG_INHERT_HAL_CAPABILITY == ENABLED
644 SDIO_CAP_BUS_WIDTH_1 = (0x1ul << 0),
645 SDIO_CAP_BUS_WIDTH_4 = (0x1ul << 1),
646 SDIO_CAP_BUS_WIDTH_8 = (0x1ul << 2),
655#if VSF_STIO_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
730#undef __VSF_HAL_TEMPLATE_API
731#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP
736#if VSF_SDIO_CFG_MULTI_CLASS == ENABLED
903#if VSF_SDIO_CFG_FUNCTION_RENAME == ENABLED
904# define __vsf_sdio_t VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_t)
905# define vsf_sdio_init(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_init) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
906# define vsf_sdio_enable(__SDIO) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_enable) ((__vsf_sdio_t *)(__SDIO))
907# define vsf_sdio_disable(__SDIO) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_disable) ((__vsf_sdio_t *)(__SDIO))
908# define vsf_sdio_irq_enable(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_irq_enable) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
909# define vsf_sdio_irq_disable(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_irq_disable) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
910# define vsf_sdio_status(__SDIO) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_status) ((__vsf_sdio_t *)(__SDIO))
911# define vsf_sdio_capability(__SDIO) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_capability) ((__vsf_sdio_t *)(__SDIO))
912# define vsf_sdio_set_clock(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_set_clock) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
913# define vsf_sdio_set_bus_width(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_set_bus_width) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
914# define vsf_sdio_host_request(__SDIO, ...) VSF_MCONNECT(VSF_SDIO_CFG_PREFIX, _sdio_host_request) ((__vsf_sdio_t *)(__SDIO), ##__VA_ARGS__)
vsf_err_t
Definition __type.h:42
vsf_sdio_reqop_t
Definition sdio.h:38
vsf_sdio_irq_mask_t
Definition sdio.h:78
vsf_sdio_reqsts_t
Definition sdio.h:85
vsf_arch_prio_t
Definition cortex_a_generic.h:88
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned long long uint64_t
Definition stdint.h:11
Definition vsf_template_hal_driver.h:203
Definition vsf_template_hal_driver.h:196
Definition vsf_template_sdio.h:639
bus_width
Definition vsf_template_sdio.h:647
bool support_ddr
Definition vsf_template_sdio.h:652
uint16_t data_size_alignment
Definition vsf_template_sdio.h:651
uint32_t max_freq_hz
Definition vsf_template_sdio.h:648
uint16_t data_ptr_alignment
Definition vsf_template_sdio.h:650
inherit(vsf_peripheral_capability_t) enum
Definition vsf_template_sdio.h:641
sdio configuration
Definition vsf_template_sdio.h:721
vsf_sdio_isr_t isr
Definition vsf_template_sdio.h:724
vsf_sdio_mode_t mode
Definition vsf_template_sdio.h:722
Definition vsf_template_sdio.h:528
uint64_t MDT
Definition vsf_template_sdio.h:532
uint64_t PRV
Definition vsf_template_sdio.h:535
uint64_t PNM
Definition vsf_template_sdio.h:536
uint64_t MID
Definition vsf_template_sdio.h:538
uint64_t PSN
Definition vsf_template_sdio.h:534
uint64_t OID
Definition vsf_template_sdio.h:537
uint64_t CRC
Definition vsf_template_sdio.h:531
sdio interrupt configuration
Definition vsf_template_sdio.h:705
vsf_sdio_isr_handler_t * handler_fn
Definition vsf_template_sdio.h:706
vsf_arch_prio_t prio
Definition vsf_template_sdio.h:710
void * target_ptr
Definition vsf_template_sdio.h:708
Definition vsf_template_sdio.h:729
Definition vsf_template_sdio.h:592
uint8_t cmd
Definition vsf_template_sdio.h:593
vsf_sdio_reqop_t op
Definition vsf_template_sdio.h:595
uint32_t arg
Definition vsf_template_sdio.h:594
uint8_t block_size_bits
Definition vsf_template_sdio.h:598
uint8_t * buffer
Definition vsf_template_sdio.h:599
uint32_t count
Definition vsf_template_sdio.h:600
Definition vsf_template_sdio.h:630
vsf_sdio_irq_mask_t irq_status
Definition vsf_template_sdio.h:634
Definition vsf_template_sdio.h:737
const vsf_sdio_op_t * op
Definition vsf_template_sdio.h:738
Definition vsf_template_sdio.h:365
uint32_t WRITE_BL_LEN
Definition vsf_template_sdio.h:385
struct vsf_sdio_csd_t::@573 mmc
uint32_t TAAC
Definition vsf_template_sdio.h:413
uint32_t CONTENT_PROT_APP
Definition vsf_template_sdio.h:484
uint32_t READ_BL_PARTIAL
Definition vsf_template_sdio.h:408
uint32_t WP_GRP_SIZE
Definition vsf_template_sdio.h:392
uint32_t ERASE_GRP_SIZE
Definition vsf_template_sdio.h:499
uint32_t READ_BLK_MISALIGN
Definition vsf_template_sdio.h:406
uint32_t ECC
Definition vsf_template_sdio.h:475
uint32_t ERASE_GRP_MULT
Definition vsf_template_sdio.h:498
uint32_t SECTOR_SIZE
Definition vsf_template_sdio.h:393
uint32_t R2W_FACTOR
Definition vsf_template_sdio.h:386
uint32_t ALWAY1
Definition vsf_template_sdio.h:369
uint32_t WP_GRP_ENABLE
Definition vsf_template_sdio.h:391
uint32_t NSAC
Definition vsf_template_sdio.h:412
uint32_t ERASE_BLK_EN
Definition vsf_template_sdio.h:394
uint32_t FILE_FORMAT
Definition vsf_template_sdio.h:375
uint32_t READ_BL_LEN
Definition vsf_template_sdio.h:409
uint32_t COPY
Definition vsf_template_sdio.h:378
uint32_t CCC
Definition vsf_template_sdio.h:410
uint32_t VDD_R_CURR_MAX
Definition vsf_template_sdio.h:400
uint32_t WRITE_BL_PARTIAL
Definition vsf_template_sdio.h:384
uint32_t CSD_STRUCTURE
Definition vsf_template_sdio.h:418
struct vsf_sdio_csd_t::@572 sd_v2
uint32_t FILE_FORMAT_GRP
Definition vsf_template_sdio.h:379
uint32_t VDD_W_CURR_MIN
Definition vsf_template_sdio.h:399
uint32_t DSR_IMP
Definition vsf_template_sdio.h:405
uint32_t VDD_R_CURR_MIN
Definition vsf_template_sdio.h:401
uint32_t SPEC_VERS
Definition vsf_template_sdio.h:522
uint32_t CRC
Definition vsf_template_sdio.h:370
uint32_t TRANS_SPEED
Definition vsf_template_sdio.h:411
uint32_t DEFAULT_ECC
Definition vsf_template_sdio.h:492
uint32_t C_SIZE
Definition vsf_template_sdio.h:402
uint32_t C_SIZE_MULT
Definition vsf_template_sdio.h:397
uint32_t TMP_WRITE_PROTECT
Definition vsf_template_sdio.h:376
uint32_t PERM_WRITE_PROTECT
Definition vsf_template_sdio.h:377
uint32_t WRITE_BLK_MISALIGN
Definition vsf_template_sdio.h:407
uint32_t VDD_W_CURR_MAX
Definition vsf_template_sdio.h:398
struct vsf_sdio_csd_t::@571 sd_v1
struct vk_romfs_header_t VSF_CAL_PACKED
vsf_sdio_reqop_t
flags of sdio request operations
Definition vsf_template_sdio.h:559
@ SDIO_CMDOP_READ
Definition vsf_template_sdio.h:566
@ SDIO_CMDOP_RESP_BUSY
Definition vsf_template_sdio.h:568
@ SDIO_CMDOP_SINGLE_BLOCK
Definition vsf_template_sdio.h:562
@ __SDIO_CMDOP_RESP
Definition vsf_template_sdio.h:570
@ SDIO_CMDOP_BYTE
Definition vsf_template_sdio.h:560
@ SDIO_CMDOP_STREAM
Definition vsf_template_sdio.h:561
@ SDIO_CMDOP_TRANS_STOP
Definition vsf_template_sdio.h:588
@ __SDIO_CMDOP_RESP_LONG_CRC
Definition vsf_template_sdio.h:573
@ SDIO_CMDOP_WRITE
Definition vsf_template_sdio.h:565
@ __SDIO_CMDOP_RESP_SHORT
Definition vsf_template_sdio.h:571
@ SDIO_CMDOP_CLKHOLD
Definition vsf_template_sdio.h:586
@ SDIO_CMDOP_MULTI_BLOCK
Definition vsf_template_sdio.h:563
@ __SDIO_CMDOP_RESP_SHORT_CRC
Definition vsf_template_sdio.h:572
#define VSF_SDIO_APIS(__prefix)
Definition vsf_template_sdio.h:352
#define vsf_sdio_init(__SDIO,...)
Definition vsf_template_sdio.h:905
void vsf_sdio_isr_handler_t(void *target_ptr, vsf_sdio_t *sdio_ptr, vsf_sdio_irq_mask_t irq_mask, vsf_sdio_reqsts_t status, uint32_t resp[4])
sdio interrupt callback function prototype.
Definition vsf_template_sdio.h:692
#define vsf_sdio_set_bus_width(__SDIO,...)
Definition vsf_template_sdio.h:913
vsf_sdio_irq_mask_t
Definition vsf_template_sdio.h:604
@ SDIO_IRQ_MASK_HOST_DATA_DONE
Definition vsf_template_sdio.h:607
@ SDIO_IRQ_MASK_HOST_RESP_DONE
Definition vsf_template_sdio.h:606
@ SDIO_IRQ_MASK_HOST_ALL
Definition vsf_template_sdio.h:609
@ SDIO_IRQ_MASK_HOST_DATA_ABORT
Definition vsf_template_sdio.h:608
#define vsf_sdio_capability(__SDIO)
Definition vsf_template_sdio.h:911
vsf_sdio_mode_t
Definition vsf_template_sdio.h:542
@ SDIO_MODE_MASK
Definition vsf_template_sdio.h:545
@ SDIO_MODE_SLAVE
Definition vsf_template_sdio.h:544
@ SDIO_MODE_HOST
Definition vsf_template_sdio.h:543
#define SDIO_RESP_NONE
Definition vsf_template_sdio.h:575
#define vsf_sdio_irq_enable(__SDIO,...)
Definition vsf_template_sdio.h:908
void vsf_sdio_fini(vsf_sdio_t *sdio_ptr)
finalize a sdio instance.
Definition sdio_common.c:45
#define vsf_sdio_irq_disable(__SDIO,...)
Definition vsf_template_sdio.h:909
vsf_err_t vsf_sdio_single_voltage(vsf_sdio_t *sdio_ptr, uint8_t bus_width)
set the bus width of sdio instance.
#define vsf_sdio_host_request(__SDIO,...)
Definition vsf_template_sdio.h:914
#define vsf_sdio_set_clock(__SDIO,...)
Definition vsf_template_sdio.h:912
#define SDIO_RESP_R1
Definition vsf_template_sdio.h:576
vsf_sdio_reqsts_t
Definition vsf_template_sdio.h:616
@ SDIO_REQSTS_ERR_MASK
Definition vsf_template_sdio.h:623
@ SDIO_REQSTS_BUSY
Definition vsf_template_sdio.h:622
@ SDIO_REQSTS_DATA_BUSY
Definition vsf_template_sdio.h:621
@ SDIO_REQSTS_DONE
Definition vsf_template_sdio.h:617
@ SDIO_REQSTS_ERR_RESP_CRC
Definition vsf_template_sdio.h:619
@ SDIO_REQSTS_ERR_RESP_NONE
Definition vsf_template_sdio.h:618
@ SDIO_REQSTS_ERR_DATA_CRC
Definition vsf_template_sdio.h:620
#define vsf_sdio_status(__SDIO)
Definition vsf_template_sdio.h:910
uint8_t status
Definition vsf_tgui.h:139