/* SDIF sync clock command function. 
This function will try to recovery the host while sending clock command failed. */
static status_t SDIF_SyncClockCommand(SDIF_Type *base)
/* SDIF sync clock command function. 
This function will try to recovery the host while sending clock command failed. */
static status_t SDIF_SyncClockCommand(SDIF_Type *base)
{
    uint32_t syncTimeout      = 10000U;
    uint32_t sendCommandRetry = 3U;
    do
    {
        if (SDIF_SetCommandRegister(
                base, (uint32_t)kSDIF_CmdUpdateClockRegisterOnly | (uint32_t)kSDIF_WaitPreTransferComplete, 0UL,
                syncTimeout) == kStatus_Success)
        {
            break;
        }
        (void)SDIF_Reset(base, kSDIF_ResetController, syncTimeout);
        sendCommandRetry--;
    } while (sendCommandRetry != 0U);
    if (sendCommandRetry == 0U)
    {
        return kStatus_Fail;
    }
    return kStatus_Success;
}