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

Function mmc_switch

components/drivers/sdio/dev_mmc.c:250–267  ·  view source on GitHub ↗

* mmc_switch - modify EXT_CSD register * @card: the MMC card associated with the data transfer * @set: cmd set values * @index: EXT_CSD register index * @value: value to program into EXT_CSD register * * Modifies the EXT_CSD register for selected card. */

Source from the content-addressed store, hash-verified

248 * Modifies the EXT_CSD register for selected card.
249 */
250static int mmc_switch(struct rt_mmcsd_card *card, rt_uint8_t set,
251 rt_uint8_t index, rt_uint8_t value)
252{
253 int err;
254 struct rt_mmcsd_host *host = card->host;
255 struct rt_mmcsd_cmd cmd = {0};
256
257 cmd.cmd_code = SWITCH;
258 cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
259 (index << 16) | (value << 8) | set;
260 cmd.flags = RESP_R1B | CMD_AC;
261
262 err = mmcsd_send_cmd(host, &cmd, 3);
263 if (err)
264 return err;
265
266 return 0;
267}
268
269static int mmc_compare_ext_csds(struct rt_mmcsd_card *card,
270 rt_uint8_t *ext_csd, rt_uint32_t bus_width)

Callers 4

mmc_select_bus_widthFunction · 0.70
mmc_select_hs200Function · 0.70
mmc_switch_to_hs400Function · 0.70
mmcsd_mmc_init_cardFunction · 0.70

Calls 1

mmcsd_send_cmdFunction · 0.85

Tested by

no test coverage detected