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

Function mmcsd_app_cmd

components/drivers/sdio/dev_sd.c:317–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static rt_err_t mmcsd_app_cmd(struct rt_mmcsd_host *host,
318 struct rt_mmcsd_card *card)
319{
320 rt_err_t err;
321 struct rt_mmcsd_cmd cmd = {0};
322
323 cmd.cmd_code = APP_CMD;
324
325 if (card)
326 {
327 cmd.arg = card->rca << 16;
328 cmd.flags = RESP_R1 | CMD_AC;
329 }
330 else
331 {
332 cmd.arg = 0;
333 cmd.flags = RESP_R1 | CMD_BCR;
334 }
335
336 err = mmcsd_send_cmd(host, &cmd, 0);
337 if (err)
338 return err;
339
340 /* Check that card supported application commands */
341 if (!controller_is_spi(host) && !(cmd.resp[0] & R1_APP_CMD))
342 return -RT_ERROR;
343
344 return RT_EOK;
345}
346
347
348rt_err_t mmcsd_send_app_cmd(struct rt_mmcsd_host *host,

Callers 3

mmcsd_send_app_cmdFunction · 0.85
mmcsd_get_scrFunction · 0.85
mmcsd_read_sd_statusFunction · 0.85

Calls 1

mmcsd_send_cmdFunction · 0.85

Tested by

no test coverage detected