MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / cistpl_funce_func

Function cistpl_funce_func

components/drivers/sdio/dev_sdio.c:496–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496static rt_int32_t cistpl_funce_func(struct rt_sdio_function *func,
497 const rt_uint8_t *buf,
498 rt_uint32_t size)
499{
500 rt_uint32_t version;
501 rt_uint32_t min_size;
502
503 version = func->card->cccr.sdio_version;
504 min_size = (version == SDIO_SDIO_REV_1_00) ? 28 : 42;
505
506 if (size < min_size || buf[0] != 1)
507 return -RT_ERROR;
508
509 /* TPLFE_MAX_BLK_SIZE */
510 func->max_blk_size = buf[12] | (buf[13] << 8);
511
512 /* TPLFE_ENABLE_TIMEOUT_VAL, present in ver 1.1 and above */
513 if (version > SDIO_SDIO_REV_1_00)
514 func->enable_timeout_val = (buf[28] | (buf[29] << 8)) * 10;
515 else
516 func->enable_timeout_val = 1000; /* 1000ms */
517
518 return 0;
519}
520
521static rt_int32_t sdio_read_cis(struct rt_sdio_function *func)
522{

Callers 1

sdio_read_cisFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected