Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

void  FSDev_SD_Card_BSP_CmdWaitEnd (FS_QTY               unit_nbr,
                                    FS_DEV_SD_CARD_CMD  *p_cmd,
                                    CPU_INT32U          *p_resp,

FS_DEV_SD_CARD_ERR *p_err);

File

Called from

Code enabled by

fs_dev_sd_card_bsp.c

SD/MMC cardmode driver

N/A

Wait for command to end and get command response.

Arguments

unit_nbr

Unit number of SD/MMC card.

p_cmd

Pointer to command that is ending.

p_resp

Pointer to buffer that will receive command response, if any.

p_err

Pointer to variable that will receive the return error code from this function:

FS_DEV_SD_CARD_ERR_NONE

No error.

FS_DEV_SD_CARD_ERR_NO_CARD

No card present.

FS_DEV_SD_CARD_ERR_UNKNOWN

Unknown or other error.

FS_DEV_SD_CARD_ERR_WAIT_TIMEOUT

Timeout in waiting for command response.

FS_DEV_SD_CARD_ERR_RESP_TIMEOUT

Timeout in receiving command response.

FS_DEV_SD_CARD_ERR_RESP_CHKSUM

Error in response checksum.

FS_DEV_SD_CARD_ERR_RESP_CMD_IX

Response command index error.

FS_DEV_SD_CARD_ERR_RESP_END_BIT

Response end bit error.

FS_DEV_SD_CARD_ERR_RESP

Other response error.

FS_DEV_SD_CARD_ERR_DATA

Other data error.

Returned Value

None.

Notes/Warnings

  1. This function will be called even if no response is expected from the command.
  2. This function will not be called if FSDev_SD_Card_BSP_CmdStart() returned an error.
  3. The data stored in the response buffer should include only the response data, i.e., should not include the start bit, transmission bit, command index, CRC and end bit.
    • For a command with a normal (48-bit) response, a 4-byte response should be stored in p_resp.
    • For a command with a long (136-bit) response, a 16-byte response should be returned in p_resp:

      The first 4-byte word should hold bits 127..96 of the response.

      The second 4-byte word should hold bits 95..64 of the response.

      The third 4-byte word should hold bits 63..32 of the response.

      The four 4-byte word should hold bits 31.. 0 of the response.

Example

The implementation of FSDev_SD_Card_BSP_CmdWaitEnd() in is targeted for the same host controller as the other listings in this chapter; for more information, see FSDev_SD_Card_BSP_CmdStart().

  • No labels