STM32F4xx_HAL_Driver  1.8.3
Input and Output operation functions

Data transfer functions. More...

+ Collaboration diagram for Input and Output operation functions:

Functions

HAL_StatusTypeDef HAL_SD_ReadBlocks (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout)
 Reads block(s) from a specified address in a card. The Data transfer is managed by polling mode. More...
 
HAL_StatusTypeDef HAL_SD_WriteBlocks (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout)
 Allows to write block(s) to a specified address in a card. The Data transfer is managed by polling mode. More...
 
HAL_StatusTypeDef HAL_SD_Erase (SD_HandleTypeDef *hsd, uint32_t BlockStartAdd, uint32_t BlockEndAdd)
 Erases the specified memory area of the given SD card. More...
 
HAL_StatusTypeDef HAL_SD_ReadBlocks_IT (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card. The Data transfer is managed in interrupt mode. More...
 
HAL_StatusTypeDef HAL_SD_WriteBlocks_IT (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Writes block(s) to a specified address in a card. The Data transfer is managed in interrupt mode. More...
 
HAL_StatusTypeDef HAL_SD_ReadBlocks_DMA (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card. The Data transfer is managed by DMA mode. More...
 
HAL_StatusTypeDef HAL_SD_WriteBlocks_DMA (SD_HandleTypeDef *hsd, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Writes block(s) to a specified address in a card. The Data transfer is managed by DMA mode. More...
 
void HAL_SD_IRQHandler (SD_HandleTypeDef *hsd)
 This function handles SD card interrupt request. More...
 
void HAL_SD_TxCpltCallback (SD_HandleTypeDef *hsd)
 Tx Transfer completed callbacks. More...
 
void HAL_SD_RxCpltCallback (SD_HandleTypeDef *hsd)
 Rx Transfer completed callbacks. More...
 
void HAL_SD_ErrorCallback (SD_HandleTypeDef *hsd)
 SD error callbacks. More...
 
void HAL_SD_AbortCallback (SD_HandleTypeDef *hsd)
 SD Abort callbacks. More...
 
HAL_StatusTypeDef HAL_SD_RegisterCallback (SD_HandleTypeDef *hsd, HAL_SD_CallbackIDTypeDef CallbackID, pSD_CallbackTypeDef pCallback)
 Register a User SD Callback To be used instead of the weak (surcharged) predefined callback. More...
 
HAL_StatusTypeDef HAL_SD_UnRegisterCallback (SD_HandleTypeDef *hsd, HAL_SD_CallbackIDTypeDef CallbackID)
 Unregister a User SD Callback SD Callback is redirected to the weak (surcharged) predefined callback. More...
 
HAL_SD_StateTypeDef HAL_SD_GetState (SD_HandleTypeDef *hsd)
 return the SD state More...
 
uint32_t HAL_SD_GetError (SD_HandleTypeDef *hsd)
 Return the SD error code. More...
 

Detailed Description

Data transfer functions.

  ==============================================================================
                        ##### IO operation functions #####
  ==============================================================================
  [..]
    This subsection provides a set of functions allowing to manage the data
    transfer from/to SD card.

Function Documentation

◆ HAL_SD_AbortCallback()

__weak void HAL_SD_AbortCallback ( SD_HandleTypeDef hsd)

SD Abort callbacks.

Parameters
hsdPointer SD handle
Return values
None

Definition at line 1802 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_Erase()

HAL_StatusTypeDef HAL_SD_Erase ( SD_HandleTypeDef hsd,
uint32_t  BlockStartAdd,
uint32_t  BlockEndAdd 
)

Erases the specified memory area of the given SD card.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
Parameters
hsdPointer to SD handle
BlockStartAddStart Block address
BlockEndAddEnd Block address
Return values
HALstatus

Definition at line 1418 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_ErrorCallback()

__weak void HAL_SD_ErrorCallback ( SD_HandleTypeDef hsd)

SD error callbacks.

Parameters
hsdPointer SD handle
Return values
None

Definition at line 1787 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_GetError()

uint32_t HAL_SD_GetError ( SD_HandleTypeDef hsd)

Return the SD error code.

Parameters
hsd: Pointer to a SD_HandleTypeDef structure that contains the configuration information.
Return values
SDError Code

Definition at line 1747 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_GetState()

HAL_SD_StateTypeDef HAL_SD_GetState ( SD_HandleTypeDef hsd)

return the SD state

Parameters
hsdPointer to sd handle
Return values
HALstate

Definition at line 1736 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_IRQHandler()

void HAL_SD_IRQHandler ( SD_HandleTypeDef hsd)

This function handles SD card interrupt request.

Parameters
hsdPointer to SD handle
Return values
None

Definition at line 1520 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_ReadBlocks()

HAL_StatusTypeDef HAL_SD_ReadBlocks ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks,
uint32_t  Timeout 
)

Reads block(s) from a specified address in a card. The Data transfer is managed by polling mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
Parameters
hsdPointer to SD handle
pDatapointer to the buffer that will contain the received data
BlockAddBlock Address from where data is to be read
NumberOfBlocksNumber of SD blocks to read
TimeoutSpecify timeout value
Return values
HALstatus

Definition at line 570 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_ReadBlocks_DMA()

HAL_StatusTypeDef HAL_SD_ReadBlocks_DMA ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks 
)

Reads block(s) from a specified address in a card. The Data transfer is managed by DMA mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
You could also check the DMA transfer process through the SD Rx interrupt event.
Parameters
hsdPointer SD handle
pDataPointer to the buffer that will contain the received data
BlockAddBlock Address from where data is to be read
NumberOfBlocksNumber of blocks to read.
Return values
HALstatus

Definition at line 1174 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_ReadBlocks_IT()

HAL_StatusTypeDef HAL_SD_ReadBlocks_IT ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks 
)

Reads block(s) from a specified address in a card. The Data transfer is managed in interrupt mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
You could also check the IT transfer process through the SD Rx interrupt event.
Parameters
hsdPointer to SD handle
pDataPointer to the buffer that will contain the received data
BlockAddBlock Address from where data is to be read
NumberOfBlocksNumber of blocks to read.
Return values
HALstatus

Definition at line 981 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_RegisterCallback()

HAL_StatusTypeDef HAL_SD_RegisterCallback ( SD_HandleTypeDef hsd,
HAL_SD_CallbackIDTypeDef  CallbackID,
pSD_CallbackTypeDef  pCallback 
)

Register a User SD Callback To be used instead of the weak (surcharged) predefined callback.

Parameters
hsd: SD handle
CallbackID: ID of the callback to be registered This parameter can be one of the following values:
pCallback: pointer to the Callback function
Return values
status

Definition at line 1828 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_RxCpltCallback()

__weak void HAL_SD_RxCpltCallback ( SD_HandleTypeDef hsd)

Rx Transfer completed callbacks.

Parameters
hsdPointer SD handle
Return values
None

Definition at line 1772 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_TxCpltCallback()

__weak void HAL_SD_TxCpltCallback ( SD_HandleTypeDef hsd)

Tx Transfer completed callbacks.

Parameters
hsdPointer to SD handle
Return values
None

Definition at line 1757 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_UnRegisterCallback()

HAL_StatusTypeDef HAL_SD_UnRegisterCallback ( SD_HandleTypeDef hsd,
HAL_SD_CallbackIDTypeDef  CallbackID 
)

Unregister a User SD Callback SD Callback is redirected to the weak (surcharged) predefined callback.

Parameters
hsd: SD handle
CallbackID: ID of the callback to be unregistered This parameter can be one of the following values:
Return values
status

Definition at line 1917 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_WriteBlocks()

HAL_StatusTypeDef HAL_SD_WriteBlocks ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks,
uint32_t  Timeout 
)

Allows to write block(s) to a specified address in a card. The Data transfer is managed by polling mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
Parameters
hsdPointer to SD handle
pDatapointer to the buffer that will contain the data to transmit
BlockAddBlock Address where data will be written
NumberOfBlocksNumber of SD blocks to write
TimeoutSpecify timeout value
Return values
HALstatus

Definition at line 789 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_WriteBlocks_DMA()

HAL_StatusTypeDef HAL_SD_WriteBlocks_DMA ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks 
)

Writes block(s) to a specified address in a card. The Data transfer is managed by DMA mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
You could also check the DMA transfer process through the SD Tx interrupt event.
Parameters
hsdPointer to SD handle
pDataPointer to the buffer that will contain the data to transmit
BlockAddBlock Address where data will be written
NumberOfBlocksNumber of blocks to write
Return values
HALstatus

Definition at line 1295 of file stm32f4xx_hal_sd.c.

◆ HAL_SD_WriteBlocks_IT()

HAL_StatusTypeDef HAL_SD_WriteBlocks_IT ( SD_HandleTypeDef hsd,
uint8_t *  pData,
uint32_t  BlockAdd,
uint32_t  NumberOfBlocks 
)

Writes block(s) to a specified address in a card. The Data transfer is managed in interrupt mode.

Note
This API should be followed by a check on the card state through HAL_SD_GetCardState().
You could also check the IT transfer process through the SD Tx interrupt event.
Parameters
hsdPointer to SD handle
pDataPointer to the buffer that will contain the data to transmit
BlockAddBlock Address where data will be written
NumberOfBlocksNumber of blocks to write
Return values
HALstatus

Definition at line 1077 of file stm32f4xx_hal_sd.c.