Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TUKS-COURSE-TIMER by
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:
-
SD Card error state
Definition at line 1095 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:
-
SD Card error state
Definition at line 1155 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 1418 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 1434 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 1450 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 1466 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:
-
SD Card error state
Definition at line 1218 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 1322 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:
-
SD Card error state
Definition at line 470 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:
-
SD Card error state
Definition at line 856 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:
-
SD Card error state
Definition at line 646 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:
-
SD Card error state
Definition at line 976 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 1387 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 1402 of file stm32l4xx_hal_sd.c.
Generated on Tue Jul 12 2022 17:38:59 by
