/* Send SET_RCA command to set the relative address of the card.  */
static status_t MMC_SetRelativeAddress(mmc_card_t *card)
/* Send SET_RCA command to set the relative address of the card.  */
static status_t MMC_SetRelativeAddress(mmc_card_t *card)
{
    assert(card);
    assert(card->host.transfer);
    sdhc_command_t command = {0};
    sdhc_transfer_t content = {0};
    command.index = kMMC_SetRelativeAddress;
    command.argument = (MMC_DEFAULT_RELATIVE_ADDRESS << 16U);
    command.responseType = kSDHC_ResponseTypeR1;
    content.command = &command;
    content.data = NULL;
    if ((kStatus_Success == card->host.transfer(card->host.base, &content)) ||
        (!((command.response[0U]) & kSDMMC_R1ErrorAllFlag)))
    {
        card->relativeAddress = MMC_DEFAULT_RELATIVE_ADDRESS;
        return kStatus_Success;
    }
    return kStatus_SDMMC_TransferFailed;
}