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

Function mmcsd_get_card_addr

components/drivers/sdio/dev_sd.c:512–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512rt_err_t mmcsd_get_card_addr(struct rt_mmcsd_host *host, rt_uint32_t *rca)
513{
514 rt_err_t err;
515 struct rt_mmcsd_cmd cmd;
516
517 rt_memset(&cmd, 0, sizeof(struct rt_mmcsd_cmd));
518
519 cmd.cmd_code = SD_SEND_RELATIVE_ADDR;
520 cmd.arg = 0;
521 cmd.flags = RESP_R6 | CMD_BCR;
522
523 err = mmcsd_send_cmd(host, &cmd, 3);
524 if (err)
525 return err;
526
527 *rca = cmd.resp[0] >> 16;
528
529 return RT_EOK;
530}
531
532#define be32_to_cpu(x) ((rt_uint32_t)( \
533 (((rt_uint32_t)(x) & (rt_uint32_t)0x000000ffUL) << 24) | \

Callers 2

sdio_init_cardFunction · 0.85
mmcsd_sd_init_cardFunction · 0.85

Calls 2

rt_memsetFunction · 0.85
mmcsd_send_cmdFunction · 0.85

Tested by

no test coverage detected