STM32F439xx HAL User Manual
Data Structures | Defines | Enumerations | Functions
stm32f4xx_hal_mmc.h File Reference

Header file of MMC HAL module. More...

#include "stm32f4xx_ll_sdmmc.h"

Go to the source code of this file.

Data Structures

struct  HAL_MMC_CardInfoTypeDef
 MMC Card Information Structure definition. More...
struct  MMC_HandleTypeDef
 MMC handle Structure definition. More...
struct  HAL_MMC_CardCSDTypeDef
struct  HAL_MMC_CardCIDTypeDef
struct  HAL_MMC_CardStatusTypeDef

Defines

#define MMC_InitTypeDef   SDIO_InitTypeDef
#define MMC_TypeDef   SDIO_TypeDef
#define BLOCKSIZE   512U
#define CAPACITY   0x400000U
#define HAL_MMC_ERROR_NONE   SDMMC_ERROR_NONE
#define HAL_MMC_ERROR_CMD_CRC_FAIL   SDMMC_ERROR_CMD_CRC_FAIL
#define HAL_MMC_ERROR_DATA_CRC_FAIL   SDMMC_ERROR_DATA_CRC_FAIL
#define HAL_MMC_ERROR_CMD_RSP_TIMEOUT   SDMMC_ERROR_CMD_RSP_TIMEOUT
#define HAL_MMC_ERROR_DATA_TIMEOUT   SDMMC_ERROR_DATA_TIMEOUT
#define HAL_MMC_ERROR_TX_UNDERRUN   SDMMC_ERROR_TX_UNDERRUN
#define HAL_MMC_ERROR_RX_OVERRUN   SDMMC_ERROR_RX_OVERRUN
#define HAL_MMC_ERROR_ADDR_MISALIGNED   SDMMC_ERROR_ADDR_MISALIGNED
#define HAL_MMC_ERROR_BLOCK_LEN_ERR   SDMMC_ERROR_BLOCK_LEN_ERR
#define HAL_MMC_ERROR_ERASE_SEQ_ERR   SDMMC_ERROR_ERASE_SEQ_ERR
#define HAL_MMC_ERROR_BAD_ERASE_PARAM   SDMMC_ERROR_BAD_ERASE_PARAM
#define HAL_MMC_ERROR_WRITE_PROT_VIOLATION   SDMMC_ERROR_WRITE_PROT_VIOLATION
#define HAL_MMC_ERROR_LOCK_UNLOCK_FAILED   SDMMC_ERROR_LOCK_UNLOCK_FAILED
#define HAL_MMC_ERROR_COM_CRC_FAILED   SDMMC_ERROR_COM_CRC_FAILED
#define HAL_MMC_ERROR_ILLEGAL_CMD   SDMMC_ERROR_ILLEGAL_CMD
#define HAL_MMC_ERROR_CARD_ECC_FAILED   SDMMC_ERROR_CARD_ECC_FAILED
#define HAL_MMC_ERROR_CC_ERR   SDMMC_ERROR_CC_ERR
#define HAL_MMC_ERROR_GENERAL_UNKNOWN_ERR   SDMMC_ERROR_GENERAL_UNKNOWN_ERR
#define HAL_MMC_ERROR_STREAM_READ_UNDERRUN   SDMMC_ERROR_STREAM_READ_UNDERRUN
#define HAL_MMC_ERROR_STREAM_WRITE_OVERRUN   SDMMC_ERROR_STREAM_WRITE_OVERRUN
#define HAL_MMC_ERROR_CID_CSD_OVERWRITE   SDMMC_ERROR_CID_CSD_OVERWRITE
#define HAL_MMC_ERROR_WP_ERASE_SKIP   SDMMC_ERROR_WP_ERASE_SKIP
#define HAL_MMC_ERROR_CARD_ECC_DISABLED   SDMMC_ERROR_CARD_ECC_DISABLED
#define HAL_MMC_ERROR_ERASE_RESET   SDMMC_ERROR_ERASE_RESET
#define HAL_MMC_ERROR_AKE_SEQ_ERR   SDMMC_ERROR_AKE_SEQ_ERR
#define HAL_MMC_ERROR_INVALID_VOLTRANGE   SDMMC_ERROR_INVALID_VOLTRANGE
#define HAL_MMC_ERROR_ADDR_OUT_OF_RANGE   SDMMC_ERROR_ADDR_OUT_OF_RANGE
#define HAL_MMC_ERROR_REQUEST_NOT_APPLICABLE   SDMMC_ERROR_REQUEST_NOT_APPLICABLE
#define HAL_MMC_ERROR_PARAM   SDMMC_ERROR_INVALID_PARAMETER
#define HAL_MMC_ERROR_UNSUPPORTED_FEATURE   SDMMC_ERROR_UNSUPPORTED_FEATURE
#define HAL_MMC_ERROR_BUSY   SDMMC_ERROR_BUSY
#define HAL_MMC_ERROR_DMA   SDMMC_ERROR_DMA
#define HAL_MMC_ERROR_TIMEOUT   SDMMC_ERROR_TIMEOUT
#define MMC_CONTEXT_NONE   0x00000000U
#define MMC_CONTEXT_READ_SINGLE_BLOCK   0x00000001U
#define MMC_CONTEXT_READ_MULTIPLE_BLOCK   0x00000002U
#define MMC_CONTEXT_WRITE_SINGLE_BLOCK   0x00000010U
#define MMC_CONTEXT_WRITE_MULTIPLE_BLOCK   0x00000020U
#define MMC_CONTEXT_IT   0x00000008U
#define MMC_CONTEXT_DMA   0x00000080U
#define MMC_HIGH_VOLTAGE_RANGE   0x80FF8000U
#define MMC_DUAL_VOLTAGE_RANGE   0x80FF8080U
#define eMMC_HIGH_VOLTAGE_RANGE   0xC0FF8000U
#define eMMC_DUAL_VOLTAGE_RANGE   0xC0FF8080U
#define MMC_INVALID_VOLTAGE_RANGE   0x0001FF01U
#define MMC_HIGH_VOLTAGE_CARD   0x00000000U
#define MMC_DUAL_VOLTAGE_CARD   0x00000001U
#define __HAL_MMC_ENABLE(__HANDLE__)   __SDIO_ENABLE((__HANDLE__)->Instance)
 Enable the MMC device.
#define __HAL_MMC_DISABLE(__HANDLE__)   __SDIO_DISABLE((__HANDLE__)->Instance)
 Disable the MMC device.
#define __HAL_MMC_DMA_ENABLE(__HANDLE__)   __SDIO_DMA_ENABLE((__HANDLE__)->Instance)
 Enable the SDMMC DMA transfer.
#define __HAL_MMC_DMA_DISABLE(__HANDLE__)   __SDIO_DMA_DISABLE((__HANDLE__)->Instance)
 Disable the SDMMC DMA transfer.
#define __HAL_MMC_ENABLE_IT(__HANDLE__, __INTERRUPT__)   __SDIO_ENABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
 Enable the MMC device interrupt.
#define __HAL_MMC_DISABLE_IT(__HANDLE__, __INTERRUPT__)   __SDIO_DISABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
 Disable the MMC device interrupt.
#define __HAL_MMC_GET_FLAG(__HANDLE__, __FLAG__)   __SDIO_GET_FLAG((__HANDLE__)->Instance, (__FLAG__))
 Check whether the specified MMC flag is set or not.
#define __HAL_MMC_CLEAR_FLAG(__HANDLE__, __FLAG__)   __SDIO_CLEAR_FLAG((__HANDLE__)->Instance, (__FLAG__))
 Clear the MMC's pending flags.
#define __HAL_MMC_GET_IT(__HANDLE__, __INTERRUPT__)   __SDIO_GET_IT((__HANDLE__)->Instance, (__INTERRUPT__))
 Check whether the specified MMC interrupt has occurred or not.
#define __HAL_MMC_CLEAR_IT(__HANDLE__, __INTERRUPT__)   __SDIO_CLEAR_IT((__HANDLE__)->Instance, (__INTERRUPT__))
 Clear the MMC's interrupt pending bits.

Enumerations

enum  HAL_MMC_StateTypeDef {
  HAL_MMC_STATE_RESET = 0x00000000U, HAL_MMC_STATE_READY = 0x00000001U, HAL_MMC_STATE_TIMEOUT = 0x00000002U, HAL_MMC_STATE_BUSY = 0x00000003U,
  HAL_MMC_STATE_PROGRAMMING = 0x00000004U, HAL_MMC_STATE_RECEIVING = 0x00000005U, HAL_MMC_STATE_TRANSFER = 0x00000006U, HAL_MMC_STATE_ERROR = 0x0000000FU
}
enum  HAL_MMC_CardStateTypeDef {
  HAL_MMC_CARD_READY = 0x00000001U, HAL_MMC_CARD_IDENTIFICATION = 0x00000002U, HAL_MMC_CARD_STANDBY = 0x00000003U, HAL_MMC_CARD_TRANSFER = 0x00000004U,
  HAL_MMC_CARD_SENDING = 0x00000005U, HAL_MMC_CARD_RECEIVING = 0x00000006U, HAL_MMC_CARD_PROGRAMMING = 0x00000007U, HAL_MMC_CARD_DISCONNECTED = 0x00000008U,
  HAL_MMC_CARD_ERROR = 0x000000FFU
}

Functions

HAL_StatusTypeDef HAL_MMC_Init (MMC_HandleTypeDef *hmmc)
 Initializes the MMC according to the specified parameters in the MMC_HandleTypeDef and create the associated handle.
HAL_StatusTypeDef HAL_MMC_InitCard (MMC_HandleTypeDef *hmmc)
 Initializes the MMC Card.
HAL_StatusTypeDef HAL_MMC_DeInit (MMC_HandleTypeDef *hmmc)
 De-Initializes the MMC card.
__weak void HAL_MMC_MspInit (MMC_HandleTypeDef *hmmc)
 Initializes the MMC MSP.
__weak void HAL_MMC_MspDeInit (MMC_HandleTypeDef *hmmc)
 De-Initialize MMC MSP.
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_Erase (MMC_HandleTypeDef *hmmc, uint32_t BlockStartAdd, uint32_t BlockEndAdd)
 Erases the specified memory area of the given MMC 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.
void HAL_MMC_IRQHandler (MMC_HandleTypeDef *hmmc)
 This function handles MMC card interrupt request.
__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_ConfigWideBusOperation (MMC_HandleTypeDef *hmmc, uint32_t WideMode)
 Enables wide bus operation for the requested card if supported by card.
HAL_MMC_CardStateTypeDef HAL_MMC_GetCardState (MMC_HandleTypeDef *hmmc)
 Gets the current mmc card data state.
HAL_StatusTypeDef HAL_MMC_GetCardCID (MMC_HandleTypeDef *hmmc, HAL_MMC_CardCIDTypeDef *pCID)
 Returns information the information of the card which are stored on the CID register.
HAL_StatusTypeDef HAL_MMC_GetCardCSD (MMC_HandleTypeDef *hmmc, HAL_MMC_CardCSDTypeDef *pCSD)
 Returns information the information of the card which are stored on the CSD register.
HAL_StatusTypeDef HAL_MMC_GetCardInfo (MMC_HandleTypeDef *hmmc, HAL_MMC_CardInfoTypeDef *pCardInfo)
 Gets the MMC card info.
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.
HAL_StatusTypeDef HAL_MMC_Abort (MMC_HandleTypeDef *hmmc)
 Abort the current transfer and disable the MMC.
HAL_StatusTypeDef HAL_MMC_Abort_IT (MMC_HandleTypeDef *hmmc)
 Abort the current transfer and disable the MMC (IT mode).

Detailed Description

Header file of MMC HAL module.

Author:
MCD Application Team
Attention:

© COPYRIGHT(c) 2017 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32f4xx_hal_mmc.h.