L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

SD_Exported_Functions_Group2

SD_Exported_Functions_Group2
[SD_Exported_Functions]

Data transfer functions. More...

Functions

HAL_SD_ErrorTypedef HAL_SD_ReadBlocks (SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card.
HAL_SD_ErrorTypedef HAL_SD_WriteBlocks (SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)
 Allows to write block(s) to a specified address in a card.
HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA (SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card.
HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA (SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks)
 Writes block(s) to a specified address in a card.
HAL_SD_ErrorTypedef HAL_SD_CheckReadOperation (SD_HandleTypeDef *hsd, uint32_t Timeout)
 This function waits until the SD DMA data read transfer is finished.
HAL_SD_ErrorTypedef HAL_SD_CheckWriteOperation (SD_HandleTypeDef *hsd, uint32_t Timeout)
 This function waits until the SD DMA data write transfer is finished.
HAL_SD_ErrorTypedef HAL_SD_Erase (SD_HandleTypeDef *hsd, uint64_t startaddr, uint64_t endaddr)
 Erases the specified memory area of the given SD card.
void HAL_SD_IRQHandler (SD_HandleTypeDef *hsd)
 This function handles SD card interrupt request.
__weak void HAL_SD_XferCpltCallback (SD_HandleTypeDef *hsd)
 SD end of transfer callback.
__weak void HAL_SD_XferErrorCallback (SD_HandleTypeDef *hsd)
 SD Transfer Error callback.
__weak void HAL_SD_DMA_RxCpltCallback (DMA_HandleTypeDef *hdma)
 SD Transfer complete Rx callback in non-blocking mode.
__weak void HAL_SD_DMA_RxErrorCallback (DMA_HandleTypeDef *hdma)
 SD DMA transfer complete Rx error callback.
__weak void HAL_SD_DMA_TxCpltCallback (DMA_HandleTypeDef *hdma)
 SD Transfer complete Tx callback in non-blocking mode.
__weak void HAL_SD_DMA_TxErrorCallback (DMA_HandleTypeDef *hdma)
 SD DMA transfer complete error Tx callback.

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_ErrorTypedef HAL_SD_CheckReadOperation ( SD_HandleTypeDef *  hsd,
uint32_t  Timeout 
)

This function waits until the SD DMA data read transfer is finished.

This API should be called after HAL_SD_ReadBlocks_DMA() function to insure that all data sent by the card is already transferred by the DMA controller.

Parameters:
hsd,:SD handle
Timeout,:Timeout duration
Return values:
SDCard error state

Definition at line 1087 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_CheckWriteOperation ( SD_HandleTypeDef *  hsd,
uint32_t  Timeout 
)

This function waits until the SD DMA data write transfer is finished.

This API should be called after HAL_SD_WriteBlocks_DMA() function to insure that all data sent by the card is already transferred by the DMA controller.

Parameters:
hsd,:SD handle
Timeout,:Timeout duration
Return values:
SDCard error state

Definition at line 1147 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_DMA_RxCpltCallback ( DMA_HandleTypeDef *  hdma )

SD Transfer complete Rx callback in non-blocking mode.

Parameters:
hdma,:pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values:
None

Definition at line 1404 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_DMA_RxErrorCallback ( DMA_HandleTypeDef *  hdma )

SD DMA transfer complete Rx error callback.

Parameters:
hdma,:pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values:
None

Definition at line 1417 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_DMA_TxCpltCallback ( DMA_HandleTypeDef *  hdma )

SD Transfer complete Tx callback in non-blocking mode.

Parameters:
hdma,:pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values:
None

Definition at line 1430 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_DMA_TxErrorCallback ( DMA_HandleTypeDef *  hdma )

SD DMA transfer complete error Tx callback.

Parameters:
hdma,:pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values:
None

Definition at line 1443 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_Erase ( SD_HandleTypeDef *  hsd,
uint64_t  startaddr,
uint64_t  endaddr 
)

Erases the specified memory area of the given SD card.

Parameters:
hsd,:SD handle
startaddr,:Start byte address
endaddr,:End byte address
Return values:
SDCard error state

Definition at line 1210 of file stm32l4xx_hal_sd.c.

void HAL_SD_IRQHandler ( SD_HandleTypeDef *  hsd )

This function handles SD card interrupt request.

Parameters:
hsd,:SD handle
Return values:
None

Definition at line 1314 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_ReadBlocks ( SD_HandleTypeDef *  hsd,
uint32_t *  pReadBuffer,
uint64_t  ReadAddr,
uint32_t  BlockSize,
uint32_t  NumberOfBlocks 
)

Reads block(s) from a specified address in a card.

The Data transfer is managed by polling mode.

Parameters:
hsd,:SD handle
pReadBuffer,:pointer to the buffer that will contain the received data
ReadAddr,:Address from where data is to be read
BlockSize,:SD card Data block size
Note:
BlockSize must be 512 bytes.
Parameters:
NumberOfBlocks,:Number of SD blocks to read
Return values:
SDCard error state

Definition at line 462 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA ( SD_HandleTypeDef *  hsd,
uint32_t *  pReadBuffer,
uint64_t  ReadAddr,
uint32_t  BlockSize,
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 the function HAL_SD_CheckReadOperation() to check the completion of the read process
Parameters:
hsd,:SD handle
pReadBuffer,:Pointer to the buffer that will contain the received data
ReadAddr,:Address from where data is to be read
BlockSize,:SD card Data block size
Note:
BlockSize must be 512 bytes.
Parameters:
NumberOfBlocks,:Number of blocks to read.
Return values:
SDCard error state

Definition at line 848 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_WriteBlocks ( SD_HandleTypeDef *  hsd,
uint32_t *  pWriteBuffer,
uint64_t  WriteAddr,
uint32_t  BlockSize,
uint32_t  NumberOfBlocks 
)

Allows to write block(s) to a specified address in a card.

The Data transfer is managed by polling mode.

Parameters:
hsd,:SD handle
pWriteBuffer,:pointer to the buffer that will contain the data to transmit
WriteAddr,:Address from where data is to be written
BlockSize,:SD card Data block size
Note:
BlockSize must be 512 bytes.
Parameters:
NumberOfBlocks,:Number of SD blocks to write
Return values:
SDCard error state

Definition at line 638 of file stm32l4xx_hal_sd.c.

HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA ( SD_HandleTypeDef *  hsd,
uint32_t *  pWriteBuffer,
uint64_t  WriteAddr,
uint32_t  BlockSize,
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 the function HAL_SD_CheckWriteOperation() to check the completion of the write process (by SD current status polling).
Parameters:
hsd,:SD handle
pWriteBuffer,:pointer to the buffer that will contain the data to transmit
WriteAddr,:Address from where data is to be read
BlockSize,:the SD card Data block size
Note:
BlockSize must be 512 bytes.
Parameters:
NumberOfBlocks,:Number of blocks to write
Return values:
SDCard error state

Definition at line 968 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_XferCpltCallback ( SD_HandleTypeDef *  hsd )

SD end of transfer callback.

Parameters:
hsd,:SD handle
Return values:
None

Definition at line 1379 of file stm32l4xx_hal_sd.c.

__weak void HAL_SD_XferErrorCallback ( SD_HandleTypeDef *  hsd )

SD Transfer Error callback.

Parameters:
hsd,:SD handle
Return values:
None

Definition at line 1391 of file stm32l4xx_hal_sd.c.