2024-02-11 03:34 AM
Hi
I see sleep/awake cmd is implemeneted in HAL fpr STM32H7only.
Now I ported it myself to Stm32f446 myself successfully. However instead of while loop below, i inserted a HAL_Delay(1);
H7 has a SDMMC but Stm32f446 has a SDIO.
In the H/ HAL bit SDMMC_FLAG_BUSYD0END flag is checked to check when device is ready.
SDMMC_FLAG_BUSYD0END is bit 20 in SDMMC status register (SDMMC_STAR)
This bit how ever does not exist in SDIO status register (SDIO_STA).
How can I implement this on Stm32f446 ?
Its is about this while loop which i need to rewrite:
Thx
/* Wait that the device is ready by checking the D0 line */
while ((!__HAL_MMC_GET_FLAG(hmmc, SDMMC_FLAG_BUSYD0END)) && (errorstate == HAL_MMC_ERROR_NONE))
{
if ((HAL_GetTick() - tickstart) >= timeout)
{
errorstate = SDMMC_ERROR_TIMEOUT;
}
}
/* Clear the flag corresponding to end D0 bus line */
__HAL_MMC_CLEAR_FLAG(hmmc, SDMMC_FLAG_BUSYD0END);