Lines Matching refs:errorstate

424   uint32_t errorstate;  in HAL_MMC_InitCard()  local
480 errorstate = MMC_PowerON(hmmc); in HAL_MMC_InitCard()
481 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_InitCard()
484 hmmc->ErrorCode |= errorstate; in HAL_MMC_InitCard()
489 errorstate = MMC_InitCard(hmmc); in HAL_MMC_InitCard()
490 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_InitCard()
493 hmmc->ErrorCode |= errorstate; in HAL_MMC_InitCard()
498 errorstate = SDMMC_CmdBlockLength(hmmc->Instance, MMC_BLOCKSIZE); in HAL_MMC_InitCard()
499 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_InitCard()
503 hmmc->ErrorCode |= errorstate; in HAL_MMC_InitCard()
617 uint32_t errorstate; in HAL_MMC_ReadBlocks() local
686 errorstate = SDMMC_CmdReadMultiBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks()
693 errorstate = SDMMC_CmdReadSingleBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks()
695 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ReadBlocks()
699 hmmc->ErrorCode |= errorstate; in HAL_MMC_ReadBlocks()
742 errorstate = SDMMC_CmdStopTransfer(hmmc->Instance); in HAL_MMC_ReadBlocks()
743 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ReadBlocks()
747 hmmc->ErrorCode |= errorstate; in HAL_MMC_ReadBlocks()
813 uint32_t errorstate; in HAL_MMC_WriteBlocks() local
881 errorstate = SDMMC_CmdWriteMultiBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks()
888 errorstate = SDMMC_CmdWriteSingleBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks()
890 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_WriteBlocks()
894 hmmc->ErrorCode |= errorstate; in HAL_MMC_WriteBlocks()
926 hmmc->ErrorCode |= errorstate; in HAL_MMC_WriteBlocks()
937 errorstate = SDMMC_CmdStopTransfer(hmmc->Instance); in HAL_MMC_WriteBlocks()
938 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_WriteBlocks()
942 hmmc->ErrorCode |= errorstate; in HAL_MMC_WriteBlocks()
1009 uint32_t errorstate; in HAL_MMC_ReadBlocks_IT() local
1075 errorstate = SDMMC_CmdReadMultiBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks_IT()
1082 errorstate = SDMMC_CmdReadSingleBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks_IT()
1085 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ReadBlocks_IT()
1089 hmmc->ErrorCode |= errorstate; in HAL_MMC_ReadBlocks_IT()
1122 uint32_t errorstate; in HAL_MMC_WriteBlocks_IT() local
1189 errorstate = SDMMC_CmdWriteMultiBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks_IT()
1196 errorstate = SDMMC_CmdWriteSingleBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks_IT()
1198 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_WriteBlocks_IT()
1202 hmmc->ErrorCode |= errorstate; in HAL_MMC_WriteBlocks_IT()
1236 uint32_t errorstate; in HAL_MMC_ReadBlocks_DMA() local
1305 errorstate = SDMMC_CmdReadMultiBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks_DMA()
1312 errorstate = SDMMC_CmdReadSingleBlock(hmmc->Instance, add); in HAL_MMC_ReadBlocks_DMA()
1314 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ReadBlocks_DMA()
1318 hmmc->ErrorCode = errorstate; in HAL_MMC_ReadBlocks_DMA()
1351 uint32_t errorstate; in HAL_MMC_WriteBlocks_DMA() local
1421 errorstate = SDMMC_CmdWriteMultiBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks_DMA()
1428 errorstate = SDMMC_CmdWriteSingleBlock(hmmc->Instance, add); in HAL_MMC_WriteBlocks_DMA()
1430 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_WriteBlocks_DMA()
1434 hmmc->ErrorCode |= errorstate; in HAL_MMC_WriteBlocks_DMA()
1461 uint32_t errorstate; in HAL_MMC_Erase() local
1521 errorstate = SDMMC_CmdEraseStartAdd(hmmc->Instance, start_add); in HAL_MMC_Erase()
1522 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_Erase()
1526 hmmc->ErrorCode |= errorstate; in HAL_MMC_Erase()
1532 errorstate = SDMMC_CmdEraseEndAdd(hmmc->Instance, end_add); in HAL_MMC_Erase()
1533 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_Erase()
1537 hmmc->ErrorCode |= errorstate; in HAL_MMC_Erase()
1543 errorstate = SDMMC_CmdErase(hmmc->Instance, 0UL); in HAL_MMC_Erase()
1544 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_Erase()
1548 hmmc->ErrorCode |= errorstate; in HAL_MMC_Erase()
1570 uint32_t errorstate; in HAL_MMC_IRQHandler() local
1599 errorstate = SDMMC_CmdStopTransfer(hmmc->Instance); in HAL_MMC_IRQHandler()
1600 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_IRQHandler()
1602 hmmc->ErrorCode |= errorstate; in HAL_MMC_IRQHandler()
1637 errorstate = SDMMC_CmdStopTransfer(hmmc->Instance); in HAL_MMC_IRQHandler()
1638 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_IRQHandler()
1640 hmmc->ErrorCode |= errorstate; in HAL_MMC_IRQHandler()
2248 uint32_t errorstate; in HAL_MMC_GetCardExtCSD() local
2282 errorstate = SDMMC_CmdSendEXTCSD(hmmc->Instance, 0); in HAL_MMC_GetCardExtCSD()
2283 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_GetCardExtCSD()
2287 hmmc->ErrorCode |= errorstate; in HAL_MMC_GetCardExtCSD()
2371 uint32_t errorstate; in HAL_MMC_ConfigWideBusOperation() local
2385 errorstate = MMC_PwrClassUpdate(hmmc, WideMode, SDMMC_SPEED_MODE_DDR); in HAL_MMC_ConfigWideBusOperation()
2389 errorstate = MMC_PwrClassUpdate(hmmc, WideMode, SDMMC_SPEED_MODE_HIGH); in HAL_MMC_ConfigWideBusOperation()
2394 errorstate = MMC_PwrClassUpdate(hmmc, WideMode, SDMMC_SPEED_MODE_DEFAULT); in HAL_MMC_ConfigWideBusOperation()
2397 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigWideBusOperation()
2401 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70200U); in HAL_MMC_ConfigWideBusOperation()
2405 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70100U); in HAL_MMC_ConfigWideBusOperation()
2409 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70000U); in HAL_MMC_ConfigWideBusOperation()
2414 errorstate = HAL_MMC_ERROR_PARAM; in HAL_MMC_ConfigWideBusOperation()
2418 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigWideBusOperation()
2424errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in HAL_MMC_ConfigWideBusOperation()
2425 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigWideBusOperation()
2436 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_ConfigWideBusOperation()
2441 errorstate = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; in HAL_MMC_ConfigWideBusOperation()
2453 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_ConfigWideBusOperation()
2465 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigWideBusOperation()
2469 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigWideBusOperation()
2493 uint32_t errorstate; in HAL_MMC_ConfigSpeedBusOperation() local
2511 errorstate = MMC_HighSpeed(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2512 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2514 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2521 errorstate = MMC_DDR_Mode(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2522 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2524 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2532 errorstate = MMC_HighSpeed(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2533 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2535 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2549 errorstate = MMC_HighSpeed(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2550 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2552 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2559 errorstate = MMC_DDR_Mode(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2560 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2562 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2580 errorstate = MMC_HighSpeed(hmmc, ENABLE); in HAL_MMC_ConfigSpeedBusOperation()
2581 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2583 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2599 errorstate = MMC_DDR_Mode(hmmc, DISABLE); in HAL_MMC_ConfigSpeedBusOperation()
2600 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2602 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2608 errorstate = MMC_HighSpeed(hmmc, DISABLE); in HAL_MMC_ConfigSpeedBusOperation()
2609 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSpeedBusOperation()
2611 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSpeedBusOperation()
2647 uint32_t errorstate; in HAL_MMC_GetCardState() local
2650 errorstate = MMC_SendStatus(hmmc, &resp1); in HAL_MMC_GetCardState()
2651 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_GetCardState()
2653 hmmc->ErrorCode |= errorstate; in HAL_MMC_GetCardState()
2821 uint32_t errorstate; in HAL_MMC_EraseSequence() local
2883 errorstate = SDMMC_CmdEraseStartAdd(hmmc->Instance, start_add); in HAL_MMC_EraseSequence()
2884 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_EraseSequence()
2887 errorstate = SDMMC_CmdEraseEndAdd(hmmc->Instance, end_add); in HAL_MMC_EraseSequence()
2888 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_EraseSequence()
2891 errorstate = SDMMC_CmdErase(hmmc->Instance, EraseType); in HAL_MMC_EraseSequence()
2892 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_EraseSequence()
2897 … while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_EraseSequence()
2901 errorstate = HAL_MMC_ERROR_TIMEOUT; in HAL_MMC_EraseSequence()
2916 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_EraseSequence()
2920 hmmc->ErrorCode |= errorstate; in HAL_MMC_EraseSequence()
2922 if (errorstate != HAL_MMC_ERROR_TIMEOUT) in HAL_MMC_EraseSequence()
2951 uint32_t errorstate; in HAL_MMC_Sanitize() local
2963 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03A50100U); in HAL_MMC_Sanitize()
2964 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_Sanitize()
2967 … while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_Sanitize()
2971 errorstate = HAL_MMC_ERROR_TIMEOUT; in HAL_MMC_Sanitize()
2978 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_Sanitize()
2984errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in HAL_MMC_Sanitize()
2985 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_Sanitize()
2996 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_Sanitize()
3001 errorstate = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; in HAL_MMC_Sanitize()
3006 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_Sanitize()
3019 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_Sanitize()
3023 hmmc->ErrorCode |= errorstate; in HAL_MMC_Sanitize()
3025 if (errorstate != HAL_MMC_ERROR_TIMEOUT) in HAL_MMC_Sanitize()
3063 uint32_t errorstate; in HAL_MMC_ConfigSecRemovalType() local
3084 errorstate = SDMMC_CmdSwitch(hmmc->Instance, (0x03100000U | (srt << 8U))); in HAL_MMC_ConfigSecRemovalType()
3085 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSecRemovalType()
3091errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in HAL_MMC_ConfigSecRemovalType()
3092 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSecRemovalType()
3103 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_ConfigSecRemovalType()
3108 errorstate = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; in HAL_MMC_ConfigSecRemovalType()
3113 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_ConfigSecRemovalType()
3123 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in HAL_MMC_ConfigSecRemovalType()
3131 errorstate = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; in HAL_MMC_ConfigSecRemovalType()
3135 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_ConfigSecRemovalType()
3139 hmmc->ErrorCode |= errorstate; in HAL_MMC_ConfigSecRemovalType()
3195 uint32_t errorstate, in HAL_MMC_SleepDevice() local
3209 errorstate = SDMMC_CmdSwitch(hmmc->Instance, (0x03220100U)); in HAL_MMC_SleepDevice()
3210 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3216errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in HAL_MMC_SleepDevice()
3217 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3230 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_SleepDevice()
3232 else if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3237 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in HAL_MMC_SleepDevice()
3242 errorstate = SDMMC_CmdSwitch(hmmc->Instance, (0x03220400U)); in HAL_MMC_SleepDevice()
3243 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3258 … while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_SleepDevice()
3262 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_SleepDevice()
3269 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3275 errorstate = SDMMC_CmdSendStatus(hmmc->Instance, in HAL_MMC_SleepDevice()
3277 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3290 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_SleepDevice()
3292 else if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3297 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in HAL_MMC_SleepDevice()
3319 errorstate = SDMMC_CmdSleepMmc(hmmc->Instance, in HAL_MMC_SleepDevice()
3321 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3324 … while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_SleepDevice()
3328 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_SleepDevice()
3338 errorstate = SDMMC_ERROR_REQUEST_NOT_APPLICABLE; in HAL_MMC_SleepDevice()
3360 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_SleepDevice()
3364 hmmc->ErrorCode |= errorstate; in HAL_MMC_SleepDevice()
3366 if (errorstate != HAL_MMC_ERROR_TIMEOUT) in HAL_MMC_SleepDevice()
3393 uint32_t errorstate; in HAL_MMC_AwakeDevice() local
3419 errorstate = SDMMC_CmdSleepMmc(hmmc->Instance, (hmmc->MmcCard.RelCardAdd << 16U)); in HAL_MMC_AwakeDevice()
3420 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3423 … while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE)) in HAL_MMC_AwakeDevice()
3427 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_AwakeDevice()
3434 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3439 errorstate = SDMMC_CmdSelDesel(hmmc->Instance, (hmmc->MmcCard.RelCardAdd << 16U)); in HAL_MMC_AwakeDevice()
3440 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3445 errorstate = SDMMC_CmdSwitch(hmmc->Instance, (0x03220100U)); in HAL_MMC_AwakeDevice()
3446 if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3452 errorstate = SDMMC_CmdSendStatus(hmmc->Instance, in HAL_MMC_AwakeDevice()
3454 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3467 errorstate = SDMMC_ERROR_TIMEOUT; in HAL_MMC_AwakeDevice()
3469 else if (errorstate == HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3474 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in HAL_MMC_AwakeDevice()
3485 errorstate = SDMMC_ERROR_REQUEST_NOT_APPLICABLE; in HAL_MMC_AwakeDevice()
3491 errorstate = SDMMC_ERROR_REQUEST_NOT_APPLICABLE; in HAL_MMC_AwakeDevice()
3500 if (errorstate != HAL_MMC_ERROR_NONE) in HAL_MMC_AwakeDevice()
3504 hmmc->ErrorCode |= errorstate; in HAL_MMC_AwakeDevice()
3506 if (errorstate != HAL_MMC_ERROR_TIMEOUT) in HAL_MMC_AwakeDevice()
3546 uint32_t errorstate; in MMC_InitCard() local
3558 errorstate = SDMMC_CmdSendCID(hmmc->Instance); in MMC_InitCard()
3559 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3561 return errorstate; in MMC_InitCard()
3574 errorstate = SDMMC_CmdSetRelAddMmc(hmmc->Instance, mmc_rca); in MMC_InitCard()
3575 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3577 return errorstate; in MMC_InitCard()
3584 errorstate = SDMMC_CmdSendCSD(hmmc->Instance, (uint32_t)(hmmc->MmcCard.RelCardAdd << 16U)); in MMC_InitCard()
3585 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3587 return errorstate; in MMC_InitCard()
3602errorstate = SDMMC_CmdSelDesel(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) << … in MMC_InitCard()
3603 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3605 return errorstate; in MMC_InitCard()
3615errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_InitCard()
3616 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3618 hmmc->ErrorCode |= errorstate; in MMC_InitCard()
3628errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_InitCard()
3629 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_InitCard()
3631 hmmc->ErrorCode |= errorstate; in MMC_InitCard()
3655 uint32_t errorstate; in MMC_PowerON() local
3658 errorstate = SDMMC_CmdGoIdleState(hmmc->Instance); in MMC_PowerON()
3659 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_PowerON()
3661 return errorstate; in MMC_PowerON()
3672 errorstate = SDMMC_CmdOpCondition(hmmc->Instance, MMC_VOLTAGE_RANGE); in MMC_PowerON()
3673 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_PowerON()
3718 uint32_t errorstate; in MMC_SendStatus() local
3726 errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(hmmc->MmcCard.RelCardAdd << 16U)); in MMC_SendStatus()
3727 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_SendStatus()
3729 return errorstate; in MMC_SendStatus()
3750 uint32_t errorstate; in MMC_ReadExtCSD() local
3771 errorstate = SDMMC_CmdSendEXTCSD(hmmc->Instance, 0); in MMC_ReadExtCSD()
3772 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_ReadExtCSD()
3776 hmmc->ErrorCode |= errorstate; in MMC_ReadExtCSD()
3842errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_ReadExtCSD()
3843 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_ReadExtCSD()
3845 hmmc->ErrorCode |= errorstate; in MMC_ReadExtCSD()
3934 uint32_t errorstate = HAL_MMC_ERROR_NONE; in MMC_HighSpeed() local
3942errorstate = MMC_PwrClassUpdate(hmmc, (hmmc->Instance->CLKCR & SDMMC_CLKCR_WIDBUS), SDMMC_SPEED_MO… in MMC_HighSpeed()
3943 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_HighSpeed()
3946 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B90000U); in MMC_HighSpeed()
3952errorstate = MMC_PwrClassUpdate(hmmc, (hmmc->Instance->CLKCR & SDMMC_CLKCR_WIDBUS), SDMMC_SPEED_MO… in MMC_HighSpeed()
3953 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_HighSpeed()
3956 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B90100U); in MMC_HighSpeed()
3960 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_HighSpeed()
3966errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_HighSpeed()
3967 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_HighSpeed()
3978 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in MMC_HighSpeed()
3983 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in MMC_HighSpeed()
4020 errorstate = SDMMC_ERROR_INVALID_PARAMETER; in MMC_HighSpeed()
4041 errorstate = SDMMC_ERROR_TIMEOUT; in MMC_HighSpeed()
4049 return errorstate; in MMC_HighSpeed()
4060 uint32_t errorstate = HAL_MMC_ERROR_NONE; in MMC_DDR_Mode() local
4068 errorstate = MMC_PwrClassUpdate(hmmc, SDMMC_BUS_WIDE_4B, SDMMC_SPEED_MODE_HIGH); in MMC_DDR_Mode()
4069 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4072 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70100U); in MMC_DDR_Mode()
4077 errorstate = MMC_PwrClassUpdate(hmmc, SDMMC_BUS_WIDE_8B, SDMMC_SPEED_MODE_HIGH); in MMC_DDR_Mode()
4078 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4081 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70200U); in MMC_DDR_Mode()
4090 errorstate = MMC_PwrClassUpdate(hmmc, SDMMC_BUS_WIDE_4B, SDMMC_SPEED_MODE_DDR); in MMC_DDR_Mode()
4091 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4094 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70500U); in MMC_DDR_Mode()
4099 errorstate = MMC_PwrClassUpdate(hmmc, SDMMC_BUS_WIDE_8B, SDMMC_SPEED_MODE_DDR); in MMC_DDR_Mode()
4100 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4103 errorstate = SDMMC_CmdSwitch(hmmc->Instance, 0x03B70600U); in MMC_DDR_Mode()
4108 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4114errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_DDR_Mode()
4115 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_DDR_Mode()
4126 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in MMC_DDR_Mode()
4131 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in MMC_DDR_Mode()
4148 errorstate = SDMMC_ERROR_TIMEOUT; in MMC_DDR_Mode()
4156 return errorstate; in MMC_DDR_Mode()
4170 uint32_t errorstate = HAL_MMC_ERROR_NONE; in MMC_PwrClassUpdate() local
4181 errorstate = SDMMC_ERROR_GENERAL_UNKNOWN_ERR; in MMC_PwrClassUpdate()
4208 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_PwrClassUpdate()
4219errorstate = SDMMC_CmdSwitch(hmmc->Instance, (0x03BB0000U | ((supported_pwr_class & 0x0FU) << 8U))… in MMC_PwrClassUpdate()
4221 if (errorstate == HAL_MMC_ERROR_NONE) in MMC_PwrClassUpdate()
4227errorstate = SDMMC_CmdSendStatus(hmmc->Instance, (uint32_t)(((uint32_t)hmmc->MmcCard.RelCardAdd) <… in MMC_PwrClassUpdate()
4228 if (errorstate != HAL_MMC_ERROR_NONE) in MMC_PwrClassUpdate()
4239 if ((count != 0U) && (errorstate == HAL_MMC_ERROR_NONE)) in MMC_PwrClassUpdate()
4244 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in MMC_PwrClassUpdate()
4249 errorstate = SDMMC_ERROR_TIMEOUT; in MMC_PwrClassUpdate()
4260 return errorstate; in MMC_PwrClassUpdate()