STM32F479xx HAL User Manual
Functions
MMC_Exported_Functions_Group2
MMC_Exported_Functions

Data transfer functions. More...

Functions

HAL_StatusTypeDef HAL_MMC_ReadBlocks (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout)
 Reads block(s) from a specified address in a card.
HAL_StatusTypeDef HAL_MMC_WriteBlocks (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks, uint32_t Timeout)
 Allows to write block(s) to a specified address in a card.
HAL_StatusTypeDef HAL_MMC_ReadBlocks_IT (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card.
HAL_StatusTypeDef HAL_MMC_WriteBlocks_IT (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Writes block(s) to a specified address in a card.
HAL_StatusTypeDef HAL_MMC_ReadBlocks_DMA (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Reads block(s) from a specified address in a card.
HAL_StatusTypeDef HAL_MMC_WriteBlocks_DMA (MMC_HandleTypeDef *hmmc, uint8_t *pData, uint32_t BlockAdd, uint32_t NumberOfBlocks)
 Writes block(s) to a specified address in a card.
HAL_StatusTypeDef HAL_MMC_Erase (MMC_HandleTypeDef *hmmc, uint32_t BlockStartAdd, uint32_t BlockEndAdd)
 Erases the specified memory area of the given MMC card.
void HAL_MMC_IRQHandler (MMC_HandleTypeDef *hmmc)
 This function handles MMC card interrupt request.
HAL_MMC_StateTypeDef HAL_MMC_GetState (MMC_HandleTypeDef *hmmc)
 return the MMC state
uint32_t HAL_MMC_GetError (MMC_HandleTypeDef *hmmc)
 Return the MMC error code.
__weak void HAL_MMC_TxCpltCallback (MMC_HandleTypeDef *hmmc)
 Tx Transfer completed callbacks.
__weak void HAL_MMC_RxCpltCallback (MMC_HandleTypeDef *hmmc)
 Rx Transfer completed callbacks.
__weak void HAL_MMC_ErrorCallback (MMC_HandleTypeDef *hmmc)
 MMC error callbacks.
__weak void HAL_MMC_AbortCallback (MMC_HandleTypeDef *hmmc)
 MMC Abort callbacks.
HAL_StatusTypeDef HAL_MMC_RegisterCallback (MMC_HandleTypeDef *hmmc, HAL_MMC_CallbackIDTypeDef CallbackId, pMMC_CallbackTypeDef pCallback)
 Register a User MMC Callback To be used instead of the weak (surcharged) predefined callback.
HAL_StatusTypeDef HAL_MMC_UnRegisterCallback (MMC_HandleTypeDef *hmmc, HAL_MMC_CallbackIDTypeDef CallbackId)
 Unregister a User MMC Callback MMC Callback is redirected to the weak (surcharged) predefined callback.

Detailed Description

Data transfer functions.

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


Function Documentation

__weak void HAL_MMC_AbortCallback ( MMC_HandleTypeDef *  hmmc)

MMC Abort callbacks.

Parameters:
hmmc,:Pointer MMC handle
Return values:
None

Definition at line 1757 of file stm32f4xx_hal_mmc.c.

Referenced by HAL_MMC_Abort_IT(), HAL_MMC_Init(), HAL_MMC_IRQHandler(), HAL_MMC_UnRegisterCallback(), MMC_DMARxAbort(), and MMC_DMATxAbort().

HAL_StatusTypeDef HAL_MMC_Erase ( MMC_HandleTypeDef *  hmmc,
uint32_t  BlockStartAdd,
uint32_t  BlockEndAdd 
)

Erases the specified memory area of the given MMC card.

Note:
This API should be followed by a check on the card state through HAL_MMC_GetCardState().
Parameters:
hmmc,:Pointer to MMC handle
BlockStartAdd,:Start Block address
BlockEndAdd,:End Block address
Return values:
HALstatus

Definition at line 1380 of file stm32f4xx_hal_mmc.c.

__weak void HAL_MMC_ErrorCallback ( MMC_HandleTypeDef *  hmmc)

MMC error callbacks.

Parameters:
hmmc,:Pointer MMC handle
Return values:
None

Definition at line 1742 of file stm32f4xx_hal_mmc.c.

Referenced by HAL_MMC_Init(), HAL_MMC_IRQHandler(), HAL_MMC_UnRegisterCallback(), MMC_DMAError(), MMC_DMAReceiveCplt(), MMC_DMARxAbort(), and MMC_DMATxAbort().

uint32_t HAL_MMC_GetError ( MMC_HandleTypeDef *  hmmc)

Return the MMC error code.

Parameters:
hmmc: Pointer to a MMC_HandleTypeDef structure that contains the configuration information.
Return values:
MMCError Code

Definition at line 1702 of file stm32f4xx_hal_mmc.c.

HAL_MMC_StateTypeDef HAL_MMC_GetState ( MMC_HandleTypeDef *  hmmc)

return the MMC state

Parameters:
hmmc,:Pointer to mmc handle
Return values:
HALstate

Definition at line 1691 of file stm32f4xx_hal_mmc.c.

void HAL_MMC_IRQHandler ( MMC_HandleTypeDef *  hmmc)

This function handles MMC card interrupt request.

Parameters:
hmmc,:Pointer to MMC handle
Return values:
None

Definition at line 1477 of file stm32f4xx_hal_mmc.c.

References HAL_DMA_Abort_IT(), HAL_MMC_AbortCallback(), HAL_MMC_ErrorCallback(), HAL_MMC_RxCpltCallback(), HAL_MMC_TxCpltCallback(), MMC_DMARxAbort(), MMC_DMATxAbort(), MMC_Read_IT(), and MMC_Write_IT().

HAL_StatusTypeDef HAL_MMC_ReadBlocks ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
Parameters:
hmmc,:Pointer to MMC handle
pData,:pointer to the buffer that will contain the received data
BlockAdd,:Block Address from where data is to be read
NumberOfBlocks,:Number of MMC blocks to read
Timeout,:Specify timeout value
Return values:
HALstatus

Definition at line 564 of file stm32f4xx_hal_mmc.c.

References HAL_GetTick().

HAL_StatusTypeDef HAL_MMC_ReadBlocks_DMA ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
You could also check the DMA transfer process through the MMC Rx interrupt event.
Parameters:
hmmc,:Pointer MMC handle
pData,:Pointer to the buffer that will contain the received data
BlockAdd,:Block Address from where data is to be read
NumberOfBlocks,:Number of blocks to read.
Return values:
HALstatus

Definition at line 1140 of file stm32f4xx_hal_mmc.c.

References DMA_PERIPH_TO_MEMORY, HAL_DMA_ERROR_NONE, HAL_DMA_Start_IT(), MMC_DMAError(), and MMC_DMAReceiveCplt().

HAL_StatusTypeDef HAL_MMC_ReadBlocks_IT ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
You could also check the IT transfer process through the MMC Rx interrupt event.
Parameters:
hmmc,:Pointer to MMC handle
pData,:Pointer to the buffer that will contain the received data
BlockAdd,:Block Address from where data is to be read
NumberOfBlocks,:Number of blocks to read.
Return values:
HALstatus

Definition at line 948 of file stm32f4xx_hal_mmc.c.

HAL_StatusTypeDef HAL_MMC_RegisterCallback ( MMC_HandleTypeDef *  hmmc,
HAL_MMC_CallbackIDTypeDef  CallbackId,
pMMC_CallbackTypeDef  pCallback 
)

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

Parameters:
hmmc: MMC handle
CallbackId: ID of the callback to be registered This parameter can be one of the following values:
  • HAL_MMC_TX_CPLT_CB_ID MMC Tx Complete Callback ID
  • HAL_MMC_RX_CPLT_CB_ID MMC Rx Complete Callback ID
  • HAL_MMC_ERROR_CB_ID MMC Error Callback ID
  • HAL_MMC_ABORT_CB_ID MMC Abort Callback ID
  • HAL_MMC_MSP_INIT_CB_ID MMC MspInit Callback ID
  • HAL_MMC_MSP_DEINIT_CB_ID MMC MspDeInit Callback ID
pCallback: pointer to the Callback function
Return values:
status

Definition at line 1783 of file stm32f4xx_hal_mmc.c.

__weak void HAL_MMC_RxCpltCallback ( MMC_HandleTypeDef *  hmmc)

Rx Transfer completed callbacks.

Parameters:
hmmc,:Pointer MMC handle
Return values:
None

Definition at line 1727 of file stm32f4xx_hal_mmc.c.

Referenced by HAL_MMC_Init(), HAL_MMC_IRQHandler(), HAL_MMC_UnRegisterCallback(), and MMC_DMAReceiveCplt().

__weak void HAL_MMC_TxCpltCallback ( MMC_HandleTypeDef *  hmmc)

Tx Transfer completed callbacks.

Parameters:
hmmc,:Pointer to MMC handle
Return values:
None

Definition at line 1712 of file stm32f4xx_hal_mmc.c.

Referenced by HAL_MMC_Init(), HAL_MMC_IRQHandler(), and HAL_MMC_UnRegisterCallback().

HAL_StatusTypeDef HAL_MMC_UnRegisterCallback ( MMC_HandleTypeDef *  hmmc,
HAL_MMC_CallbackIDTypeDef  CallbackId 
)

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

Parameters:
hmmc: MMC handle
CallbackId: ID of the callback to be unregistered This parameter can be one of the following values:
  • HAL_MMC_TX_CPLT_CB_ID MMC Tx Complete Callback ID
  • HAL_MMC_RX_CPLT_CB_ID MMC Rx Complete Callback ID
  • HAL_MMC_ERROR_CB_ID MMC Error Callback ID
  • HAL_MMC_ABORT_CB_ID MMC Abort Callback ID
  • HAL_MMC_MSP_INIT_CB_ID MMC MspInit Callback ID
  • HAL_MMC_MSP_DEINIT_CB_ID MMC MspDeInit Callback ID
Return values:
status

Definition at line 1872 of file stm32f4xx_hal_mmc.c.

References HAL_MMC_AbortCallback(), HAL_MMC_ErrorCallback(), HAL_MMC_MspDeInit(), HAL_MMC_MspInit(), HAL_MMC_RxCpltCallback(), and HAL_MMC_TxCpltCallback().

HAL_StatusTypeDef HAL_MMC_WriteBlocks ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
Parameters:
hmmc,:Pointer to MMC handle
pData,:pointer to the buffer that will contain the data to transmit
BlockAdd,:Block Address where data will be written
NumberOfBlocks,:Number of MMC blocks to write
Timeout,:Specify timeout value
Return values:
HALstatus

Definition at line 769 of file stm32f4xx_hal_mmc.c.

References HAL_GetTick().

HAL_StatusTypeDef HAL_MMC_WriteBlocks_DMA ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
You could also check the DMA transfer process through the MMC Tx interrupt event.
Parameters:
hmmc,:Pointer to MMC handle
pData,:Pointer to the buffer that will contain the data to transmit
BlockAdd,:Block Address where data will be written
NumberOfBlocks,:Number of blocks to write
Return values:
HALstatus

Definition at line 1261 of file stm32f4xx_hal_mmc.c.

References DMA_MEMORY_TO_PERIPH, HAL_DMA_Start_IT(), MMC_DMAError(), and MMC_DMATransmitCplt().

HAL_StatusTypeDef HAL_MMC_WriteBlocks_IT ( MMC_HandleTypeDef *  hmmc,
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_MMC_GetCardState().
You could also check the IT transfer process through the MMC Tx interrupt event.
Parameters:
hmmc,:Pointer to MMC handle
pData,:Pointer to the buffer that will contain the data to transmit
BlockAdd,:Block Address where data will be written
NumberOfBlocks,:Number of blocks to write
Return values:
HALstatus

Definition at line 1044 of file stm32f4xx_hal_mmc.c.