/* Send SEND_CSD command to get CSD register content from Card.  */
static status_t SD_SendCsd(sd_card_t *card)
/* Send SEND_CSD command to get CSD register content from Card.  */
static status_t SD_SendCsd(sd_card_t *card)
{
    assert(card);
    SDMMCHOST_TRANSFER content = {0};
    SDMMCHOST_COMMAND command = {0};
    status_t error = kStatus_Success;
    command.index = kSDMMC_SendCsd;
    command.argument = (card->relativeAddress << 16U);
    command.responseType = kCARD_ResponseTypeR2;
    content.command = &command;
    content.data = NULL;
    error = card->host.transfer(card->host.base, &content);
    if (kStatus_Success == error)
    {
        memcpy(card->rawCsd, command.response, sizeof(card->rawCsd));
        SD_DecodeCsd(card, command.response);
    }
    else
    {
        error = kStatus_SDMMC_TransferFailed;
        SDMMC_LOG("\r\nError: send CMD9(get csd) failed with host error %d, response %x", error, command.response[0U]);
    }
    return error;
}