/* Send READ_OCR command to get OCR register content.  */
static status_t SDSPI_ReadOcr(sdspi_card_t *card)
/* Send READ_OCR command to get OCR register content.  */
static status_t SDSPI_ReadOcr(sdspi_card_t *card)
{
    assert(card);
    assert(card->host);
    uint32_t i;
    sdspi_host_t *host;
    sdspi_command_t command = {0};
    host = card->host;
    command.index = kSDMMC_ReadOcr;
    command.responseType = kSDSPI_ResponseTypeR3;
    if (kStatus_Success != SDSPI_SendCommand(host, &command, FSL_SDSPI_TIMEOUT))
    {
        return kStatus_SDSPI_SendCommandFailed;
    }
    if (command.response[0U])
    {
        return kStatus_SDSPI_ResponseError;
    }
    card->ocr = 0U;
    for (i = 4U; i > 0U; i--)
    {
        card->ocr |= (uint32_t)command.response[i] << ((4U - i) * 8U);
    }
    return kStatus_Success;
}