STM32H735xx HAL User Manual
Functions
Peripheral Control functions
SD Exported Functions

management functions More...

Functions

HAL_StatusTypeDef HAL_SD_GetCardCID (SD_HandleTypeDef *hsd, HAL_SD_CardCIDTypeDef *pCID)
 Returns information the information of the card which are stored on the CID register.
HAL_StatusTypeDef HAL_SD_GetCardCSD (SD_HandleTypeDef *hsd, HAL_SD_CardCSDTypeDef *pCSD)
 Returns information the information of the card which are stored on the CSD register.
HAL_StatusTypeDef HAL_SD_GetCardStatus (SD_HandleTypeDef *hsd, HAL_SD_CardStatusTypeDef *pStatus)
 Gets the SD status info.
HAL_StatusTypeDef HAL_SD_GetCardInfo (SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypeDef *pCardInfo)
 Gets the SD card info.
HAL_StatusTypeDef HAL_SD_ConfigWideBusOperation (SD_HandleTypeDef *hsd, uint32_t WideMode)
 Enables wide bus operation for the requested card if supported by card.
HAL_StatusTypeDef HAL_SD_ConfigSpeedBusOperation (SD_HandleTypeDef *hsd, uint32_t SpeedMode)
 Configure the speed bus mode.
HAL_SD_CardStateTypeDef HAL_SD_GetCardState (SD_HandleTypeDef *hsd)
 Gets the current sd card data state.
HAL_StatusTypeDef HAL_SD_Abort (SD_HandleTypeDef *hsd)
 Abort the current transfer and disable the SD.
HAL_StatusTypeDef HAL_SD_Abort_IT (SD_HandleTypeDef *hsd)
 Abort the current transfer and disable the SD (IT mode).

Detailed Description

management functions

  ==============================================================================
                      ##### Peripheral Control functions #####
  ==============================================================================
  [..]
    This subsection provides a set of functions allowing to control the SD card
    operations and get the related information


Function Documentation

HAL_StatusTypeDef HAL_SD_Abort ( SD_HandleTypeDef hsd)

Abort the current transfer and disable the SD.

Parameters:
hsd,:pointer to a SD_HandleTypeDef structure that contains the configuration information for SD module.
Return values:
HALstatus

Definition at line 2837 of file stm32h7xx_hal_sd.c.

References __HAL_SD_CLEAR_FLAG, __HAL_SD_DISABLE_IT, __SD_HandleTypeDef::Context, __SD_HandleTypeDef::ErrorCode, HAL_SD_CARD_RECEIVING, HAL_SD_CARD_SENDING, HAL_SD_ERROR_NONE, HAL_SD_GetCardState(), HAL_SD_STATE_READY, __SD_HandleTypeDef::Instance, SD_CONTEXT_NONE, and __SD_HandleTypeDef::State.

HAL_StatusTypeDef HAL_SD_Abort_IT ( SD_HandleTypeDef hsd)

Abort the current transfer and disable the SD (IT mode).

Parameters:
hsd,:pointer to a SD_HandleTypeDef structure that contains the configuration information for SD module.
Return values:
HALstatus

Definition at line 2874 of file stm32h7xx_hal_sd.c.

References __HAL_SD_CLEAR_FLAG, __HAL_SD_DISABLE_IT, __SD_HandleTypeDef::AbortCpltCallback, __SD_HandleTypeDef::ErrorCode, HAL_SD_AbortCallback(), HAL_SD_CARD_RECEIVING, HAL_SD_CARD_SENDING, HAL_SD_ERROR_NONE, HAL_SD_GetCardState(), HAL_SD_STATE_READY, __SD_HandleTypeDef::Instance, and __SD_HandleTypeDef::State.

HAL_StatusTypeDef HAL_SD_ConfigSpeedBusOperation ( SD_HandleTypeDef hsd,
uint32_t  SpeedMode 
)

Configure the speed bus mode.

Parameters:
hsd,:Pointer to the SD handle
SpeedMode,:Specifies the SD card speed bus mode This parameter can be one of the following values:
  • SDMMC_SPEED_MODE_AUTO: Max speed mode supported by the card
  • SDMMC_SPEED_MODE_DEFAULT: Default Speed/SDR12 mode
  • SDMMC_SPEED_MODE_HIGH: High Speed/SDR25 mode
  • SDMMC_SPEED_MODE_ULTRA: Ultra high speed mode
Return values:
HALstatus

Definition at line 2563 of file stm32h7xx_hal_sd.c.

References __HAL_SD_CLEAR_FLAG, assert_param, BLOCKSIZE, CARD_HIGH_SPEED, CARD_SDHC_SDXC, CARD_ULTRA_HIGH_SPEED, HAL_SD_CardInfoTypeDef::CardSpeed, HAL_SD_CardInfoTypeDef::CardType, __SD_HandleTypeDef::ErrorCode, HAL_GetTick(), HAL_SD_CARD_TRANSFER, HAL_SD_ERROR_NONE, HAL_SD_ERROR_PARAM, HAL_SD_ERROR_TIMEOUT, HAL_SD_ERROR_UNSUPPORTED_FEATURE, HAL_SD_GetCardState(), HAL_SD_STATE_BUSY, HAL_SD_STATE_READY, __SD_HandleTypeDef::Init, __SD_HandleTypeDef::Instance, SD_HighSpeed(), __SD_HandleTypeDef::SdCard, and __SD_HandleTypeDef::State.

HAL_StatusTypeDef HAL_SD_ConfigWideBusOperation ( SD_HandleTypeDef hsd,
uint32_t  WideMode 
)

Enables wide bus operation for the requested card if supported by card.

Parameters:
hsd,:Pointer to SD handle
WideMode,:Specifies the SD card wide bus mode This parameter can be one of the following values:
  • SDMMC_BUS_WIDE_8B: 8-bit data transfer
  • SDMMC_BUS_WIDE_4B: 4-bit data transfer
  • SDMMC_BUS_WIDE_1B: 1-bit data transfer
Return values:
HALstatus

Definition at line 2399 of file stm32h7xx_hal_sd.c.

References __HAL_SD_CLEAR_FLAG, assert_param, BLOCKSIZE, CARD_HIGH_SPEED, CARD_SECURED, CARD_ULTRA_HIGH_SPEED, HAL_SD_CardInfoTypeDef::CardSpeed, HAL_SD_CardInfoTypeDef::CardType, __SD_HandleTypeDef::ErrorCode, HAL_RCCEx_GetPeriphCLKFreq(), HAL_SD_ERROR_NONE, HAL_SD_ERROR_PARAM, HAL_SD_ERROR_UNSUPPORTED_FEATURE, HAL_SD_STATE_BUSY, HAL_SD_STATE_READY, __SD_HandleTypeDef::Init, __SAI_HandleTypeDef::Init, __SD_HandleTypeDef::Instance, RCC_PERIPHCLK_SDMMC, SD_HIGH_SPEED_FREQ, SD_NORMAL_SPEED_FREQ, SD_WideBus_Disable(), SD_WideBus_Enable(), __SD_HandleTypeDef::SdCard, and __SD_HandleTypeDef::State.

Referenced by HAL_SD_Init().

HAL_StatusTypeDef HAL_SD_GetCardCID ( SD_HandleTypeDef hsd,
HAL_SD_CardCIDTypeDef pCID 
)

Returns information the information of the card which are stored on the CID register.

Parameters:
hsd,:Pointer to SD handle
pCID,:Pointer to a HAL_SD_CardCIDTypeDef structure that contains all CID register parameters
Return values:
HALstatus

Definition at line 2157 of file stm32h7xx_hal_sd.c.

References __SD_HandleTypeDef::CID, HAL_SD_CardCIDTypeDef::CID_CRC, HAL_SD_CardCIDTypeDef::ManufactDate, HAL_SD_CardCIDTypeDef::ManufacturerID, HAL_SD_CardCIDTypeDef::OEM_AppliID, HAL_SD_CardCIDTypeDef::ProdName1, HAL_SD_CardCIDTypeDef::ProdName2, HAL_SD_CardCIDTypeDef::ProdRev, HAL_SD_CardCIDTypeDef::ProdSN, HAL_SD_CardCIDTypeDef::Reserved1, and HAL_SD_CardCIDTypeDef::Reserved2.

HAL_StatusTypeDef HAL_SD_GetCardCSD ( SD_HandleTypeDef hsd,
HAL_SD_CardCSDTypeDef pCSD 
)

Returns information the information of the card which are stored on the CSD register.

Parameters:
hsd,:Pointer to SD handle
pCSD,:Pointer to a HAL_SD_CardCSDTypeDef structure that contains all CSD register parameters
Return values:
HALstatus

< Reserved

Definition at line 2190 of file stm32h7xx_hal_sd.c.

References __HAL_SD_CLEAR_FLAG, HAL_SD_CardInfoTypeDef::BlockNbr, HAL_SD_CardInfoTypeDef::BlockSize, CARD_SDHC_SDXC, CARD_SDSC, HAL_SD_CardCSDTypeDef::CardComdClasses, HAL_SD_CardInfoTypeDef::CardType, HAL_SD_CardCSDTypeDef::ContentProtectAppli, HAL_SD_CardCSDTypeDef::CopyFlag, __SD_HandleTypeDef::CSD, HAL_SD_CardCSDTypeDef::CSD_CRC, HAL_SD_CardCSDTypeDef::CSDStruct, HAL_SD_CardCSDTypeDef::DeviceSize, HAL_SD_CardCSDTypeDef::DeviceSizeMul, HAL_SD_CardCSDTypeDef::DSRImpl, HAL_SD_CardCSDTypeDef::ECC, HAL_SD_CardCSDTypeDef::EraseGrMul, HAL_SD_CardCSDTypeDef::EraseGrSize, __SD_HandleTypeDef::ErrorCode, HAL_SD_CardCSDTypeDef::FileFormat, HAL_SD_CardCSDTypeDef::FileFormatGroup, HAL_SD_ERROR_UNSUPPORTED_FEATURE, HAL_SD_STATE_READY, HAL_SD_CardInfoTypeDef::LogBlockNbr, HAL_SD_CardInfoTypeDef::LogBlockSize, HAL_SD_CardCSDTypeDef::ManDeflECC, HAL_SD_CardCSDTypeDef::MaxBusClkFrec, HAL_SD_CardCSDTypeDef::MaxRdCurrentVDDMax, HAL_SD_CardCSDTypeDef::MaxRdCurrentVDDMin, HAL_SD_CardCSDTypeDef::MaxWrBlockLen, HAL_SD_CardCSDTypeDef::MaxWrCurrentVDDMax, HAL_SD_CardCSDTypeDef::MaxWrCurrentVDDMin, HAL_SD_CardCSDTypeDef::NSAC, HAL_SD_CardCSDTypeDef::PartBlockRead, HAL_SD_CardCSDTypeDef::PermWrProtect, HAL_SD_CardCSDTypeDef::RdBlockLen, HAL_SD_CardCSDTypeDef::RdBlockMisalign, HAL_SD_CardCSDTypeDef::Reserved1, HAL_SD_CardCSDTypeDef::Reserved2, HAL_SD_CardCSDTypeDef::Reserved3, HAL_SD_CardCSDTypeDef::Reserved4, __SD_HandleTypeDef::SdCard, __SD_HandleTypeDef::State, HAL_SD_CardCSDTypeDef::SysSpecVersion, HAL_SD_CardCSDTypeDef::TAAC, HAL_SD_CardCSDTypeDef::TempWrProtect, HAL_SD_CardCSDTypeDef::WrBlockMisalign, HAL_SD_CardCSDTypeDef::WriteBlockPaPartial, HAL_SD_CardCSDTypeDef::WrProtectGrEnable, HAL_SD_CardCSDTypeDef::WrProtectGrSize, and HAL_SD_CardCSDTypeDef::WrSpeedFact.

Referenced by SD_InitCard().

HAL_StatusTypeDef HAL_SD_GetCardInfo ( SD_HandleTypeDef hsd,
HAL_SD_CardInfoTypeDef pCardInfo 
)

Gets the SD card info.

Parameters:
hsd,:Pointer to SD handle
pCardInfo,:Pointer to the HAL_SD_CardInfoTypeDef structure that will contain the SD card status information
Return values:
HALstatus

Definition at line 2374 of file stm32h7xx_hal_sd.c.

References HAL_SD_CardInfoTypeDef::BlockNbr, HAL_SD_CardInfoTypeDef::BlockSize, HAL_SD_CardInfoTypeDef::CardType, HAL_SD_CardInfoTypeDef::CardVersion, HAL_SD_CardInfoTypeDef::Class, HAL_SD_CardInfoTypeDef::LogBlockNbr, HAL_SD_CardInfoTypeDef::LogBlockSize, HAL_SD_CardInfoTypeDef::RelCardAdd, and __SD_HandleTypeDef::SdCard.

Gets the current sd card data state.

Parameters:
hsd,:pointer to SD handle
Return values:
Cardstate

Definition at line 2814 of file stm32h7xx_hal_sd.c.

References __SD_HandleTypeDef::ErrorCode, HAL_SD_ERROR_NONE, and SD_SendStatus().

Referenced by HAL_SD_Abort(), HAL_SD_Abort_IT(), HAL_SD_ConfigSpeedBusOperation(), and HAL_SD_Init().

HAL_StatusTypeDef HAL_SD_GetCardStatus ( SD_HandleTypeDef hsd,
HAL_SD_CardStatusTypeDef pStatus 
)