Lines Matching refs:errorstate
467 uint32_t errorstate; in HAL_SD_InitCard() local
528 errorstate = SD_PowerON(hsd); in HAL_SD_InitCard()
529 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_InitCard()
532 hsd->ErrorCode |= errorstate; in HAL_SD_InitCard()
537 errorstate = SD_InitCard(hsd); in HAL_SD_InitCard()
538 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_InitCard()
541 hsd->ErrorCode |= errorstate; in HAL_SD_InitCard()
546 errorstate = SDMMC_CmdBlockLength(hsd->Instance, BLOCKSIZE); in HAL_SD_InitCard()
547 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_InitCard()
551 hsd->ErrorCode |= errorstate; in HAL_SD_InitCard()
681 uint32_t errorstate; in HAL_SD_ReadBlocks() local
731 errorstate = SDMMC_CmdReadMultiBlock(hsd->Instance, add); in HAL_SD_ReadBlocks()
738 errorstate = SDMMC_CmdReadSingleBlock(hsd->Instance, add); in HAL_SD_ReadBlocks()
740 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ReadBlocks()
744 hsd->ErrorCode |= errorstate; in HAL_SD_ReadBlocks()
790 errorstate = SDMMC_CmdStopTransfer(hsd->Instance); in HAL_SD_ReadBlocks()
791 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ReadBlocks()
795 hsd->ErrorCode |= errorstate; in HAL_SD_ReadBlocks()
866 uint32_t errorstate; in HAL_SD_WriteBlocks() local
916 errorstate = SDMMC_CmdWriteMultiBlock(hsd->Instance, add); in HAL_SD_WriteBlocks()
923 errorstate = SDMMC_CmdWriteSingleBlock(hsd->Instance, add); in HAL_SD_WriteBlocks()
925 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_WriteBlocks()
929 hsd->ErrorCode |= errorstate; in HAL_SD_WriteBlocks()
962 hsd->ErrorCode |= errorstate; in HAL_SD_WriteBlocks()
976 errorstate = SDMMC_CmdStopTransfer(hsd->Instance); in HAL_SD_WriteBlocks()
977 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_WriteBlocks()
981 hsd->ErrorCode |= errorstate; in HAL_SD_WriteBlocks()
1053 uint32_t errorstate; in HAL_SD_ReadBlocks_IT() local
1101 errorstate = SDMMC_CmdReadMultiBlock(hsd->Instance, add); in HAL_SD_ReadBlocks_IT()
1108 errorstate = SDMMC_CmdReadSingleBlock(hsd->Instance, add); in HAL_SD_ReadBlocks_IT()
1110 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ReadBlocks_IT()
1114 hsd->ErrorCode |= errorstate; in HAL_SD_ReadBlocks_IT()
1148 uint32_t errorstate; in HAL_SD_WriteBlocks_IT() local
1197 errorstate = SDMMC_CmdWriteMultiBlock(hsd->Instance, add); in HAL_SD_WriteBlocks_IT()
1204 errorstate = SDMMC_CmdWriteSingleBlock(hsd->Instance, add); in HAL_SD_WriteBlocks_IT()
1206 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_WriteBlocks_IT()
1210 hsd->ErrorCode |= errorstate; in HAL_SD_WriteBlocks_IT()
1245 uint32_t errorstate; in HAL_SD_ReadBlocks_DMA() local
1296 errorstate = SDMMC_CmdReadMultiBlock(hsd->Instance, add); in HAL_SD_ReadBlocks_DMA()
1303 errorstate = SDMMC_CmdReadSingleBlock(hsd->Instance, add); in HAL_SD_ReadBlocks_DMA()
1305 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ReadBlocks_DMA()
1309 hsd->ErrorCode |= errorstate; in HAL_SD_ReadBlocks_DMA()
1344 uint32_t errorstate; in HAL_SD_WriteBlocks_DMA() local
1397 errorstate = SDMMC_CmdWriteMultiBlock(hsd->Instance, add); in HAL_SD_WriteBlocks_DMA()
1404 errorstate = SDMMC_CmdWriteSingleBlock(hsd->Instance, add); in HAL_SD_WriteBlocks_DMA()
1406 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_WriteBlocks_DMA()
1410 hsd->ErrorCode |= errorstate; in HAL_SD_WriteBlocks_DMA()
1438 uint32_t errorstate; in HAL_SD_Erase() local
1490 errorstate = SDMMC_CmdSDEraseStartAdd(hsd->Instance, start_add); in HAL_SD_Erase()
1491 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_Erase()
1495 hsd->ErrorCode |= errorstate; in HAL_SD_Erase()
1501 errorstate = SDMMC_CmdSDEraseEndAdd(hsd->Instance, end_add); in HAL_SD_Erase()
1502 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_Erase()
1506 hsd->ErrorCode |= errorstate; in HAL_SD_Erase()
1513 errorstate = SDMMC_CmdErase(hsd->Instance, 0UL); in HAL_SD_Erase()
1514 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_Erase()
1518 hsd->ErrorCode |= errorstate; in HAL_SD_Erase()
1540 uint32_t errorstate; in HAL_SD_IRQHandler() local
1564 errorstate = SDMMC_CmdStopTransfer(hsd->Instance); in HAL_SD_IRQHandler()
1565 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_IRQHandler()
1567 hsd->ErrorCode |= errorstate; in HAL_SD_IRQHandler()
1607 errorstate = SDMMC_CmdStopTransfer(hsd->Instance); in HAL_SD_IRQHandler()
1608 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_IRQHandler()
1610 hsd->ErrorCode |= errorstate; in HAL_SD_IRQHandler()
2276 uint32_t errorstate; in HAL_SD_GetCardStatus() local
2284 errorstate = SD_SendSDStatus(hsd, sd_status); in HAL_SD_GetCardStatus()
2285 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_GetCardStatus()
2289 hsd->ErrorCode |= errorstate; in HAL_SD_GetCardStatus()
2322 errorstate = SDMMC_CmdBlockLength(hsd->Instance, BLOCKSIZE); in HAL_SD_GetCardStatus()
2323 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_GetCardStatus()
2327 hsd->ErrorCode = errorstate; in HAL_SD_GetCardStatus()
2371 uint32_t errorstate; in HAL_SD_ConfigWideBusOperation() local
2389 errorstate = SD_WideBus_Enable(hsd); in HAL_SD_ConfigWideBusOperation()
2391 hsd->ErrorCode |= errorstate; in HAL_SD_ConfigWideBusOperation()
2395 errorstate = SD_WideBus_Disable(hsd); in HAL_SD_ConfigWideBusOperation()
2397 hsd->ErrorCode |= errorstate; in HAL_SD_ConfigWideBusOperation()
2514 errorstate = SDMMC_CmdBlockLength(hsd->Instance, BLOCKSIZE); in HAL_SD_ConfigWideBusOperation()
2515 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ConfigWideBusOperation()
2519 hsd->ErrorCode |= errorstate; in HAL_SD_ConfigWideBusOperation()
2544 uint32_t errorstate; in HAL_SD_ConfigSpeedBusOperation() local
2820 errorstate = SDMMC_CmdBlockLength(hsd->Instance, BLOCKSIZE); in HAL_SD_ConfigSpeedBusOperation()
2821 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_ConfigSpeedBusOperation()
2825 hsd->ErrorCode |= errorstate; in HAL_SD_ConfigSpeedBusOperation()
2842 uint32_t errorstate; in HAL_SD_GetCardState() local
2845 errorstate = SD_SendStatus(hsd, &resp1); in HAL_SD_GetCardState()
2846 if (errorstate != HAL_SD_ERROR_NONE) in HAL_SD_GetCardState()
2848 hsd->ErrorCode |= errorstate; in HAL_SD_GetCardState()
3018 uint32_t errorstate; in SD_InitCard() local
3032 errorstate = SDMMC_CmdSendCID(hsd->Instance); in SD_InitCard()
3033 if (errorstate != HAL_SD_ERROR_NONE) in SD_InitCard()
3035 return errorstate; in SD_InitCard()
3053 errorstate = SDMMC_CmdSetRelAdd(hsd->Instance, &sd_rca); in SD_InitCard()
3054 if (errorstate != HAL_SD_ERROR_NONE) in SD_InitCard()
3056 return errorstate; in SD_InitCard()
3070 errorstate = SDMMC_CmdSendCSD(hsd->Instance, (uint32_t)(hsd->SdCard.RelCardAdd << 16U)); in SD_InitCard()
3071 if (errorstate != HAL_SD_ERROR_NONE) in SD_InitCard()
3073 return errorstate; in SD_InitCard()
3095 …errorstate = SDMMC_CmdSelDesel(hsd->Instance, (uint32_t)(((uint32_t)hsd->SdCard.RelCardAdd) << 16U… in SD_InitCard()
3096 if (errorstate != HAL_SD_ERROR_NONE) in SD_InitCard()
3098 return errorstate; in SD_InitCard()
3117 uint32_t errorstate; in SD_PowerON() local
3123 errorstate = SDMMC_CmdGoIdleState(hsd->Instance); in SD_PowerON()
3124 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3126 return errorstate; in SD_PowerON()
3130 errorstate = SDMMC_CmdOperCond(hsd->Instance); in SD_PowerON()
3131 if (errorstate == SDMMC_ERROR_TIMEOUT) /* No response to CMD8 */ in SD_PowerON()
3135 errorstate = SDMMC_CmdGoIdleState(hsd->Instance); in SD_PowerON()
3136 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3138 return errorstate; in SD_PowerON()
3150 errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0); in SD_PowerON()
3151 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3161 errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0); in SD_PowerON()
3162 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3164 return errorstate; in SD_PowerON()
3168 …errorstate = SDMMC_CmdAppOperCommand(hsd->Instance, SDMMC_VOLTAGE_WINDOW_SD | SDMMC_HIGH_CAPACITY | in SD_PowerON()
3170 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3206 errorstate = SDMMC_CmdVoltageSwitch(hsd->Instance); in SD_PowerON()
3207 if (errorstate != HAL_SD_ERROR_NONE) in SD_PowerON()
3209 return errorstate; in SD_PowerON()
3297 uint32_t errorstate; in SD_SendSDStatus() local
3309 errorstate = SDMMC_CmdBlockLength(hsd->Instance, 64U); in SD_SendSDStatus()
3310 if (errorstate != HAL_SD_ERROR_NONE) in SD_SendSDStatus()
3313 return errorstate; in SD_SendSDStatus()
3317 errorstate = SDMMC_CmdAppCommand(hsd->Instance, (uint32_t)(hsd->SdCard.RelCardAdd << 16U)); in SD_SendSDStatus()
3318 if (errorstate != HAL_SD_ERROR_NONE) in SD_SendSDStatus()
3321 return errorstate; in SD_SendSDStatus()
3334 errorstate = SDMMC_CmdStatusRegister(hsd->Instance); in SD_SendSDStatus()
3335 if (errorstate != HAL_SD_ERROR_NONE) in SD_SendSDStatus()
3338 return errorstate; in SD_SendSDStatus()
3402 uint32_t errorstate; in SD_SendStatus() local
3410 errorstate = SDMMC_CmdSendStatus(hsd->Instance, (uint32_t)(hsd->SdCard.RelCardAdd << 16U)); in SD_SendStatus()
3411 if (errorstate != HAL_SD_ERROR_NONE) in SD_SendStatus()
3413 return errorstate; in SD_SendStatus()
3430 uint32_t errorstate; in SD_WideBus_Enable() local
3438 errorstate = SD_FindSCR(hsd, scr); in SD_WideBus_Enable()
3439 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Enable()
3441 return errorstate; in SD_WideBus_Enable()
3448 errorstate = SDMMC_CmdAppCommand(hsd->Instance, (uint32_t)(hsd->SdCard.RelCardAdd << 16U)); in SD_WideBus_Enable()
3449 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Enable()
3451 return errorstate; in SD_WideBus_Enable()
3455 errorstate = SDMMC_CmdBusWidth(hsd->Instance, 2U); in SD_WideBus_Enable()
3456 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Enable()
3458 return errorstate; in SD_WideBus_Enable()
3477 uint32_t errorstate; in SD_WideBus_Disable() local
3485 errorstate = SD_FindSCR(hsd, scr); in SD_WideBus_Disable()
3486 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Disable()
3488 return errorstate; in SD_WideBus_Disable()
3495 errorstate = SDMMC_CmdAppCommand(hsd->Instance, (uint32_t)(hsd->SdCard.RelCardAdd << 16U)); in SD_WideBus_Disable()
3496 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Disable()
3498 return errorstate; in SD_WideBus_Disable()
3502 errorstate = SDMMC_CmdBusWidth(hsd->Instance, 0U); in SD_WideBus_Disable()
3503 if (errorstate != HAL_SD_ERROR_NONE) in SD_WideBus_Disable()
3505 return errorstate; in SD_WideBus_Disable()
3526 uint32_t errorstate; in SD_FindSCR() local
3533 errorstate = SDMMC_CmdBlockLength(hsd->Instance, 8U); in SD_FindSCR()
3534 if (errorstate != HAL_SD_ERROR_NONE) in SD_FindSCR()
3536 return errorstate; in SD_FindSCR()
3540 errorstate = SDMMC_CmdAppCommand(hsd->Instance, (uint32_t)((hsd->SdCard.RelCardAdd) << 16U)); in SD_FindSCR()
3541 if (errorstate != HAL_SD_ERROR_NONE) in SD_FindSCR()
3543 return errorstate; in SD_FindSCR()
3555 errorstate = SDMMC_CmdSendSCR(hsd->Instance); in SD_FindSCR()
3556 if (errorstate != HAL_SD_ERROR_NONE) in SD_FindSCR()
3558 return errorstate; in SD_FindSCR()
3694 uint32_t errorstate = HAL_SD_ERROR_NONE; in SD_SwitchSpeed() local
3711 errorstate = SDMMC_CmdBlockLength(hsd->Instance, 64U); in SD_SwitchSpeed()
3713 if (errorstate != HAL_SD_ERROR_NONE) in SD_SwitchSpeed()
3715 return errorstate; in SD_SwitchSpeed()
3729 errorstate = SDMMC_CmdSwitch(hsd->Instance, SwitchSpeedMode); in SD_SwitchSpeed()
3730 if (errorstate != HAL_SD_ERROR_NONE) in SD_SwitchSpeed()
3732 return errorstate; in SD_SwitchSpeed()
3759 return errorstate; in SD_SwitchSpeed()
3765 errorstate = SDMMC_ERROR_DATA_CRC_FAIL; in SD_SwitchSpeed()
3767 return errorstate; in SD_SwitchSpeed()
3773 errorstate = SDMMC_ERROR_RX_OVERRUN; in SD_SwitchSpeed()
3775 return errorstate; in SD_SwitchSpeed()
3788 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in SD_SwitchSpeed()
3793 return errorstate; in SD_SwitchSpeed()
3808 uint32_t errorstate = HAL_SD_ERROR_NONE; in SD_UltraHighSpeed() local
3825 errorstate = SDMMC_CmdBlockLength(hsd->Instance, 64U); in SD_UltraHighSpeed()
3827 if (errorstate != HAL_SD_ERROR_NONE) in SD_UltraHighSpeed()
3829 return errorstate; in SD_UltraHighSpeed()
3845 errorstate = SDMMC_CmdSwitch(hsd->Instance, UltraHighSpeedMode); in SD_UltraHighSpeed()
3846 if (errorstate != HAL_SD_ERROR_NONE) in SD_UltraHighSpeed()
3848 return errorstate; in SD_UltraHighSpeed()
3875 return errorstate; in SD_UltraHighSpeed()
3881 errorstate = SDMMC_ERROR_DATA_CRC_FAIL; in SD_UltraHighSpeed()
3883 return errorstate; in SD_UltraHighSpeed()
3889 errorstate = SDMMC_ERROR_RX_OVERRUN; in SD_UltraHighSpeed()
3891 return errorstate; in SD_UltraHighSpeed()
3904 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in SD_UltraHighSpeed()
3922 return errorstate; in SD_UltraHighSpeed()
3935 uint32_t errorstate = HAL_SD_ERROR_NONE; in SD_DDR_Mode() local
3952 errorstate = SDMMC_CmdBlockLength(hsd->Instance, 64U); in SD_DDR_Mode()
3954 if (errorstate != HAL_SD_ERROR_NONE) in SD_DDR_Mode()
3956 return errorstate; in SD_DDR_Mode()
3972 errorstate = SDMMC_CmdSwitch(hsd->Instance, SDMMC_DDR50_SWITCH_PATTERN); in SD_DDR_Mode()
3973 if (errorstate != HAL_SD_ERROR_NONE) in SD_DDR_Mode()
3975 return errorstate; in SD_DDR_Mode()
4002 return errorstate; in SD_DDR_Mode()
4008 errorstate = SDMMC_ERROR_DATA_CRC_FAIL; in SD_DDR_Mode()
4010 return errorstate; in SD_DDR_Mode()
4016 errorstate = SDMMC_ERROR_RX_OVERRUN; in SD_DDR_Mode()
4018 return errorstate; in SD_DDR_Mode()
4031 errorstate = SDMMC_ERROR_UNSUPPORTED_FEATURE; in SD_DDR_Mode()
4049 return errorstate; in SD_DDR_Mode()