mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Parent:
394:83f921546702
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 354:e67efb2aab0e 1 /**
mbed_official 354:e67efb2aab0e 2 ******************************************************************************
mbed_official 354:e67efb2aab0e 3 * @file stm32l1xx_hal_sd.h
mbed_official 354:e67efb2aab0e 4 * @author MCD Application Team
mbed_official 354:e67efb2aab0e 5 * @version V1.0.0
mbed_official 354:e67efb2aab0e 6 * @date 5-September-2014
mbed_official 354:e67efb2aab0e 7 * @brief Header file of SD HAL module.
mbed_official 354:e67efb2aab0e 8 ******************************************************************************
mbed_official 354:e67efb2aab0e 9 * @attention
mbed_official 354:e67efb2aab0e 10 *
mbed_official 354:e67efb2aab0e 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 354:e67efb2aab0e 12 *
mbed_official 354:e67efb2aab0e 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 354:e67efb2aab0e 14 * are permitted provided that the following conditions are met:
mbed_official 354:e67efb2aab0e 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 354:e67efb2aab0e 16 * this list of conditions and the following disclaimer.
mbed_official 354:e67efb2aab0e 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 354:e67efb2aab0e 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 354:e67efb2aab0e 19 * and/or other materials provided with the distribution.
mbed_official 354:e67efb2aab0e 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 354:e67efb2aab0e 21 * may be used to endorse or promote products derived from this software
mbed_official 354:e67efb2aab0e 22 * without specific prior written permission.
mbed_official 354:e67efb2aab0e 23 *
mbed_official 354:e67efb2aab0e 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 354:e67efb2aab0e 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 354:e67efb2aab0e 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 354:e67efb2aab0e 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 354:e67efb2aab0e 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 354:e67efb2aab0e 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 354:e67efb2aab0e 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 354:e67efb2aab0e 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 354:e67efb2aab0e 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 354:e67efb2aab0e 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 354:e67efb2aab0e 34 *
mbed_official 354:e67efb2aab0e 35 ******************************************************************************
mbed_official 354:e67efb2aab0e 36 */
mbed_official 354:e67efb2aab0e 37
mbed_official 354:e67efb2aab0e 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 354:e67efb2aab0e 39 #ifndef __STM32L1xx_HAL_SD_H
mbed_official 354:e67efb2aab0e 40 #define __STM32L1xx_HAL_SD_H
mbed_official 354:e67efb2aab0e 41
mbed_official 354:e67efb2aab0e 42 #if defined(STM32L151xD) || defined(STM32L152xD) || defined(STM32L162xD)
mbed_official 354:e67efb2aab0e 43
mbed_official 354:e67efb2aab0e 44 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 45 extern "C" {
mbed_official 354:e67efb2aab0e 46 #endif
mbed_official 354:e67efb2aab0e 47
mbed_official 354:e67efb2aab0e 48 /* Includes ------------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 49 #include "stm32l1xx_ll_sdmmc.h"
mbed_official 354:e67efb2aab0e 50
mbed_official 354:e67efb2aab0e 51 /** @addtogroup STM32L1xx_HAL_Driver
mbed_official 354:e67efb2aab0e 52 * @{
mbed_official 354:e67efb2aab0e 53 */
mbed_official 354:e67efb2aab0e 54
mbed_official 354:e67efb2aab0e 55 /** @addtogroup SD
mbed_official 354:e67efb2aab0e 56 * @{
mbed_official 354:e67efb2aab0e 57 */
mbed_official 354:e67efb2aab0e 58
mbed_official 354:e67efb2aab0e 59 /* Exported types ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 60 /** @defgroup SD_Exported_Types SD Exported Types
mbed_official 354:e67efb2aab0e 61 * @{
mbed_official 354:e67efb2aab0e 62 */
mbed_official 354:e67efb2aab0e 63
mbed_official 354:e67efb2aab0e 64 #define SD_InitTypeDef SDIO_InitTypeDef
mbed_official 354:e67efb2aab0e 65 #define SD_TypeDef SDIO_TypeDef
mbed_official 354:e67efb2aab0e 66
mbed_official 354:e67efb2aab0e 67 /**
mbed_official 354:e67efb2aab0e 68 * @brief SDIO Handle Structure definition
mbed_official 354:e67efb2aab0e 69 */
mbed_official 354:e67efb2aab0e 70 typedef struct
mbed_official 354:e67efb2aab0e 71 {
mbed_official 354:e67efb2aab0e 72 SD_TypeDef *Instance; /*!< SDIO register base address */
mbed_official 354:e67efb2aab0e 73
mbed_official 354:e67efb2aab0e 74 SD_InitTypeDef Init; /*!< SD required parameters */
mbed_official 354:e67efb2aab0e 75
mbed_official 354:e67efb2aab0e 76 HAL_LockTypeDef Lock; /*!< SD locking object */
mbed_official 354:e67efb2aab0e 77
mbed_official 354:e67efb2aab0e 78 uint32_t CardType; /*!< SD card type */
mbed_official 354:e67efb2aab0e 79
mbed_official 354:e67efb2aab0e 80 uint32_t RCA; /*!< SD relative card address */
mbed_official 354:e67efb2aab0e 81
mbed_official 354:e67efb2aab0e 82 uint32_t CSD[4]; /*!< SD card specific data table */
mbed_official 354:e67efb2aab0e 83
mbed_official 354:e67efb2aab0e 84 uint32_t CID[4]; /*!< SD card identification number table */
mbed_official 354:e67efb2aab0e 85
mbed_official 354:e67efb2aab0e 86 __IO uint32_t SdTransferCplt; /*!< SD transfer complete flag in non blocking mode */
mbed_official 354:e67efb2aab0e 87
mbed_official 354:e67efb2aab0e 88 __IO uint32_t SdTransferErr; /*!< SD transfer error flag in non blocking mode */
mbed_official 354:e67efb2aab0e 89
mbed_official 354:e67efb2aab0e 90 __IO uint32_t DmaTransferCplt; /*!< SD DMA transfer complete flag */
mbed_official 354:e67efb2aab0e 91
mbed_official 354:e67efb2aab0e 92 __IO uint32_t SdOperation; /*!< SD transfer operation (read/write) */
mbed_official 354:e67efb2aab0e 93
mbed_official 354:e67efb2aab0e 94 DMA_HandleTypeDef *hdmarx; /*!< SD Rx DMA handle parameters */
mbed_official 354:e67efb2aab0e 95
mbed_official 354:e67efb2aab0e 96 DMA_HandleTypeDef *hdmatx; /*!< SD Tx DMA handle parameters */
mbed_official 354:e67efb2aab0e 97
mbed_official 354:e67efb2aab0e 98 }SD_HandleTypeDef;
mbed_official 354:e67efb2aab0e 99
mbed_official 354:e67efb2aab0e 100 /**
mbed_official 354:e67efb2aab0e 101 * @brief Card Specific Data: CSD Register
mbed_official 354:e67efb2aab0e 102 */
mbed_official 354:e67efb2aab0e 103 typedef struct
mbed_official 354:e67efb2aab0e 104 {
mbed_official 354:e67efb2aab0e 105 __IO uint8_t CSDStruct; /*!< CSD structure */
mbed_official 354:e67efb2aab0e 106 __IO uint8_t SysSpecVersion; /*!< System specification version */
mbed_official 354:e67efb2aab0e 107 __IO uint8_t Reserved1; /*!< Reserved */
mbed_official 354:e67efb2aab0e 108 __IO uint8_t TAAC; /*!< Data read access time 1 */
mbed_official 354:e67efb2aab0e 109 __IO uint8_t NSAC; /*!< Data read access time 2 in CLK cycles */
mbed_official 354:e67efb2aab0e 110 __IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */
mbed_official 354:e67efb2aab0e 111 __IO uint16_t CardComdClasses; /*!< Card command classes */
mbed_official 354:e67efb2aab0e 112 __IO uint8_t RdBlockLen; /*!< Max. read data block length */
mbed_official 354:e67efb2aab0e 113 __IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */
mbed_official 354:e67efb2aab0e 114 __IO uint8_t WrBlockMisalign; /*!< Write block misalignment */
mbed_official 354:e67efb2aab0e 115 __IO uint8_t RdBlockMisalign; /*!< Read block misalignment */
mbed_official 354:e67efb2aab0e 116 __IO uint8_t DSRImpl; /*!< DSR implemented */
mbed_official 354:e67efb2aab0e 117 __IO uint8_t Reserved2; /*!< Reserved */
mbed_official 354:e67efb2aab0e 118 __IO uint32_t DeviceSize; /*!< Device Size */
mbed_official 354:e67efb2aab0e 119 __IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */
mbed_official 354:e67efb2aab0e 120 __IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */
mbed_official 354:e67efb2aab0e 121 __IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */
mbed_official 354:e67efb2aab0e 122 __IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */
mbed_official 354:e67efb2aab0e 123 __IO uint8_t DeviceSizeMul; /*!< Device size multiplier */
mbed_official 354:e67efb2aab0e 124 __IO uint8_t EraseGrSize; /*!< Erase group size */
mbed_official 354:e67efb2aab0e 125 __IO uint8_t EraseGrMul; /*!< Erase group size multiplier */
mbed_official 354:e67efb2aab0e 126 __IO uint8_t WrProtectGrSize; /*!< Write protect group size */
mbed_official 354:e67efb2aab0e 127 __IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */
mbed_official 354:e67efb2aab0e 128 __IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */
mbed_official 354:e67efb2aab0e 129 __IO uint8_t WrSpeedFact; /*!< Write speed factor */
mbed_official 354:e67efb2aab0e 130 __IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */
mbed_official 354:e67efb2aab0e 131 __IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */
mbed_official 354:e67efb2aab0e 132 __IO uint8_t Reserved3; /*!< Reserved */
mbed_official 354:e67efb2aab0e 133 __IO uint8_t ContentProtectAppli; /*!< Content protection application */
mbed_official 354:e67efb2aab0e 134 __IO uint8_t FileFormatGrouop; /*!< File format group */
mbed_official 354:e67efb2aab0e 135 __IO uint8_t CopyFlag; /*!< Copy flag (OTP) */
mbed_official 354:e67efb2aab0e 136 __IO uint8_t PermWrProtect; /*!< Permanent write protection */
mbed_official 354:e67efb2aab0e 137 __IO uint8_t TempWrProtect; /*!< Temporary write protection */
mbed_official 354:e67efb2aab0e 138 __IO uint8_t FileFormat; /*!< File format */
mbed_official 354:e67efb2aab0e 139 __IO uint8_t ECC; /*!< ECC code */
mbed_official 354:e67efb2aab0e 140 __IO uint8_t CSD_CRC; /*!< CSD CRC */
mbed_official 354:e67efb2aab0e 141 __IO uint8_t Reserved4; /*!< Always 1 */
mbed_official 354:e67efb2aab0e 142
mbed_official 354:e67efb2aab0e 143 }HAL_SD_CSDTypedef;
mbed_official 354:e67efb2aab0e 144
mbed_official 354:e67efb2aab0e 145 /**
mbed_official 354:e67efb2aab0e 146 * @brief Card Identification Data: CID Register
mbed_official 354:e67efb2aab0e 147 */
mbed_official 354:e67efb2aab0e 148 typedef struct
mbed_official 354:e67efb2aab0e 149 {
mbed_official 354:e67efb2aab0e 150 __IO uint8_t ManufacturerID; /*!< Manufacturer ID */
mbed_official 354:e67efb2aab0e 151 __IO uint16_t OEM_AppliID; /*!< OEM/Application ID */
mbed_official 354:e67efb2aab0e 152 __IO uint32_t ProdName1; /*!< Product Name part1 */
mbed_official 354:e67efb2aab0e 153 __IO uint8_t ProdName2; /*!< Product Name part2 */
mbed_official 354:e67efb2aab0e 154 __IO uint8_t ProdRev; /*!< Product Revision */
mbed_official 354:e67efb2aab0e 155 __IO uint32_t ProdSN; /*!< Product Serial Number */
mbed_official 354:e67efb2aab0e 156 __IO uint8_t Reserved1; /*!< Reserved1 */
mbed_official 354:e67efb2aab0e 157 __IO uint16_t ManufactDate; /*!< Manufacturing Date */
mbed_official 354:e67efb2aab0e 158 __IO uint8_t CID_CRC; /*!< CID CRC */
mbed_official 354:e67efb2aab0e 159 __IO uint8_t Reserved2; /*!< Always 1 */
mbed_official 354:e67efb2aab0e 160
mbed_official 354:e67efb2aab0e 161 }HAL_SD_CIDTypedef;
mbed_official 354:e67efb2aab0e 162
mbed_official 354:e67efb2aab0e 163 /**
mbed_official 354:e67efb2aab0e 164 * @brief SD Card Status returned by ACMD13
mbed_official 354:e67efb2aab0e 165 */
mbed_official 354:e67efb2aab0e 166 typedef struct
mbed_official 354:e67efb2aab0e 167 {
mbed_official 354:e67efb2aab0e 168 __IO uint8_t DAT_BUS_WIDTH; /*!< Shows the currently defined data bus width */
mbed_official 354:e67efb2aab0e 169 __IO uint8_t SECURED_MODE; /*!< Card is in secured mode of operation */
mbed_official 354:e67efb2aab0e 170 __IO uint16_t SD_CARD_TYPE; /*!< Carries information about card type */
mbed_official 354:e67efb2aab0e 171 __IO uint32_t SIZE_OF_PROTECTED_AREA; /*!< Carries information about the capacity of protected area */
mbed_official 354:e67efb2aab0e 172 __IO uint8_t SPEED_CLASS; /*!< Carries information about the speed class of the card */
mbed_official 354:e67efb2aab0e 173 __IO uint8_t PERFORMANCE_MOVE; /*!< Carries information about the card's performance move */
mbed_official 354:e67efb2aab0e 174 __IO uint8_t AU_SIZE; /*!< Carries information about the card's allocation unit size */
mbed_official 354:e67efb2aab0e 175 __IO uint16_t ERASE_SIZE; /*!< Determines the number of AUs to be erased in one operation */
mbed_official 354:e67efb2aab0e 176 __IO uint8_t ERASE_TIMEOUT; /*!< Determines the timeout for any number of AU erase */
mbed_official 354:e67efb2aab0e 177 __IO uint8_t ERASE_OFFSET; /*!< Carries information about the erase offset */
mbed_official 354:e67efb2aab0e 178
mbed_official 354:e67efb2aab0e 179 }HAL_SD_CardStatusTypedef;
mbed_official 354:e67efb2aab0e 180
mbed_official 354:e67efb2aab0e 181 /**
mbed_official 354:e67efb2aab0e 182 * @brief SD Card information structure
mbed_official 354:e67efb2aab0e 183 */
mbed_official 354:e67efb2aab0e 184 typedef struct
mbed_official 354:e67efb2aab0e 185 {
mbed_official 354:e67efb2aab0e 186 HAL_SD_CSDTypedef SD_csd; /*!< SD card specific data register */
mbed_official 354:e67efb2aab0e 187 HAL_SD_CIDTypedef SD_cid; /*!< SD card identification number register */
mbed_official 354:e67efb2aab0e 188 uint64_t CardCapacity; /*!< Card capacity */
mbed_official 354:e67efb2aab0e 189 uint32_t CardBlockSize; /*!< Card block size */
mbed_official 354:e67efb2aab0e 190 uint16_t RCA; /*!< SD relative card address */
mbed_official 354:e67efb2aab0e 191 uint8_t CardType; /*!< SD card type */
mbed_official 354:e67efb2aab0e 192
mbed_official 354:e67efb2aab0e 193 }HAL_SD_CardInfoTypedef;
mbed_official 354:e67efb2aab0e 194
mbed_official 354:e67efb2aab0e 195 /**
mbed_official 354:e67efb2aab0e 196 * @brief SD Error status enumeration Structure definition
mbed_official 354:e67efb2aab0e 197 */
mbed_official 354:e67efb2aab0e 198 typedef enum
mbed_official 354:e67efb2aab0e 199 {
mbed_official 354:e67efb2aab0e 200 /**
mbed_official 354:e67efb2aab0e 201 * @brief SD specific error defines
mbed_official 354:e67efb2aab0e 202 */
mbed_official 354:e67efb2aab0e 203 SD_CMD_CRC_FAIL = (1), /*!< Command response received (but CRC check failed) */
mbed_official 354:e67efb2aab0e 204 SD_DATA_CRC_FAIL = (2), /*!< Data block sent/received (CRC check failed) */
mbed_official 354:e67efb2aab0e 205 SD_CMD_RSP_TIMEOUT = (3), /*!< Command response timeout */
mbed_official 354:e67efb2aab0e 206 SD_DATA_TIMEOUT = (4), /*!< Data timeout */
mbed_official 354:e67efb2aab0e 207 SD_TX_UNDERRUN = (5), /*!< Transmit FIFO underrun */
mbed_official 354:e67efb2aab0e 208 SD_RX_OVERRUN = (6), /*!< Receive FIFO overrun */
mbed_official 354:e67efb2aab0e 209 SD_START_BIT_ERR = (7), /*!< Start bit not detected on all data signals in wide bus mode */
mbed_official 354:e67efb2aab0e 210 SD_CMD_OUT_OF_RANGE = (8), /*!< Command's argument was out of range. */
mbed_official 354:e67efb2aab0e 211 SD_ADDR_MISALIGNED = (9), /*!< Misaligned address */
mbed_official 354:e67efb2aab0e 212 SD_BLOCK_LEN_ERR = (10), /*!< Transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */
mbed_official 354:e67efb2aab0e 213 SD_ERASE_SEQ_ERR = (11), /*!< An error in the sequence of erase command occurs. */
mbed_official 354:e67efb2aab0e 214 SD_BAD_ERASE_PARAM = (12), /*!< An invalid selection for erase groups */
mbed_official 354:e67efb2aab0e 215 SD_WRITE_PROT_VIOLATION = (13), /*!< Attempt to program a write protect block */
mbed_official 354:e67efb2aab0e 216 SD_LOCK_UNLOCK_FAILED = (14), /*!< Sequence or password error has been detected in unlock command or if there was an attempt to access a locked card */
mbed_official 354:e67efb2aab0e 217 SD_COM_CRC_FAILED = (15), /*!< CRC check of the previous command failed */
mbed_official 354:e67efb2aab0e 218 SD_ILLEGAL_CMD = (16), /*!< Command is not legal for the card state */
mbed_official 354:e67efb2aab0e 219 SD_CARD_ECC_FAILED = (17), /*!< Card internal ECC was applied but failed to correct the data */
mbed_official 354:e67efb2aab0e 220 SD_CC_ERROR = (18), /*!< Internal card controller error */
mbed_official 354:e67efb2aab0e 221 SD_GENERAL_UNKNOWN_ERROR = (19), /*!< General or unknown error */
mbed_official 354:e67efb2aab0e 222 SD_STREAM_READ_UNDERRUN = (20), /*!< The card could not sustain data transfer in stream read operation. */
mbed_official 354:e67efb2aab0e 223 SD_STREAM_WRITE_OVERRUN = (21), /*!< The card could not sustain data programming in stream mode */
mbed_official 354:e67efb2aab0e 224 SD_CID_CSD_OVERWRITE = (22), /*!< CID/CSD overwrite error */
mbed_official 354:e67efb2aab0e 225 SD_WP_ERASE_SKIP = (23), /*!< Only partial address space was erased */
mbed_official 354:e67efb2aab0e 226 SD_CARD_ECC_DISABLED = (24), /*!< Command has been executed without using internal ECC */
mbed_official 354:e67efb2aab0e 227 SD_ERASE_RESET = (25), /*!< Erase sequence was cleared before executing because an out of erase sequence command was received */
mbed_official 354:e67efb2aab0e 228 SD_AKE_SEQ_ERROR = (26), /*!< Error in sequence of authentication. */
mbed_official 354:e67efb2aab0e 229 SD_INVALID_VOLTRANGE = (27),
mbed_official 354:e67efb2aab0e 230 SD_ADDR_OUT_OF_RANGE = (28),
mbed_official 354:e67efb2aab0e 231 SD_SWITCH_ERROR = (29),
mbed_official 354:e67efb2aab0e 232 SD_SDIO_DISABLED = (30),
mbed_official 354:e67efb2aab0e 233 SD_SDIO_FUNCTION_BUSY = (31),
mbed_official 354:e67efb2aab0e 234 SD_SDIO_FUNCTION_FAILED = (32),
mbed_official 354:e67efb2aab0e 235 SD_SDIO_UNKNOWN_FUNCTION = (33),
mbed_official 354:e67efb2aab0e 236
mbed_official 354:e67efb2aab0e 237 /**
mbed_official 354:e67efb2aab0e 238 * @brief Standard error defines
mbed_official 354:e67efb2aab0e 239 */
mbed_official 354:e67efb2aab0e 240 SD_INTERNAL_ERROR = (34),
mbed_official 354:e67efb2aab0e 241 SD_NOT_CONFIGURED = (35),
mbed_official 354:e67efb2aab0e 242 SD_REQUEST_PENDING = (36),
mbed_official 354:e67efb2aab0e 243 SD_REQUEST_NOT_APPLICABLE = (37),
mbed_official 354:e67efb2aab0e 244 SD_INVALID_PARAMETER = (38),
mbed_official 354:e67efb2aab0e 245 SD_UNSUPPORTED_FEATURE = (39),
mbed_official 354:e67efb2aab0e 246 SD_UNSUPPORTED_HW = (40),
mbed_official 354:e67efb2aab0e 247 SD_ERROR = (41),
mbed_official 354:e67efb2aab0e 248 SD_OK = (0)
mbed_official 354:e67efb2aab0e 249
mbed_official 354:e67efb2aab0e 250 }HAL_SD_ErrorTypedef;
mbed_official 354:e67efb2aab0e 251
mbed_official 354:e67efb2aab0e 252 /**
mbed_official 354:e67efb2aab0e 253 * @brief SD Transfer state enumeration structure
mbed_official 354:e67efb2aab0e 254 */
mbed_official 354:e67efb2aab0e 255 typedef enum
mbed_official 354:e67efb2aab0e 256 {
mbed_official 354:e67efb2aab0e 257 SD_TRANSFER_OK = 0, /*!< Transfer success */
mbed_official 354:e67efb2aab0e 258 SD_TRANSFER_BUSY = 1, /*!< Transfer is occurring */
mbed_official 354:e67efb2aab0e 259 SD_TRANSFER_ERROR = 2 /*!< Transfer failed */
mbed_official 354:e67efb2aab0e 260
mbed_official 354:e67efb2aab0e 261 }HAL_SD_TransferStateTypedef;
mbed_official 354:e67efb2aab0e 262
mbed_official 354:e67efb2aab0e 263 /**
mbed_official 354:e67efb2aab0e 264 * @brief SD Card State enumeration structure
mbed_official 354:e67efb2aab0e 265 */
mbed_official 354:e67efb2aab0e 266 typedef enum
mbed_official 354:e67efb2aab0e 267 {
mbed_official 354:e67efb2aab0e 268 SD_CARD_READY = ((uint32_t)0x00000001), /*!< Card state is ready */
mbed_official 354:e67efb2aab0e 269 SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002), /*!< Card is in identification state */
mbed_official 354:e67efb2aab0e 270 SD_CARD_STANDBY = ((uint32_t)0x00000003), /*!< Card is in standby state */
mbed_official 354:e67efb2aab0e 271 SD_CARD_TRANSFER = ((uint32_t)0x00000004), /*!< Card is in transfer state */
mbed_official 354:e67efb2aab0e 272 SD_CARD_SENDING = ((uint32_t)0x00000005), /*!< Card is sending an operation */
mbed_official 354:e67efb2aab0e 273 SD_CARD_RECEIVING = ((uint32_t)0x00000006), /*!< Card is receiving operation information */
mbed_official 354:e67efb2aab0e 274 SD_CARD_PROGRAMMING = ((uint32_t)0x00000007), /*!< Card is in programming state */
mbed_official 354:e67efb2aab0e 275 SD_CARD_DISCONNECTED = ((uint32_t)0x00000008), /*!< Card is disconnected */
mbed_official 354:e67efb2aab0e 276 SD_CARD_ERROR = ((uint32_t)0x000000FF) /*!< Card is in error state */
mbed_official 354:e67efb2aab0e 277
mbed_official 354:e67efb2aab0e 278 }HAL_SD_CardStateTypedef;
mbed_official 354:e67efb2aab0e 279
mbed_official 354:e67efb2aab0e 280 /**
mbed_official 354:e67efb2aab0e 281 * @brief SD Operation enumeration structure
mbed_official 354:e67efb2aab0e 282 */
mbed_official 354:e67efb2aab0e 283 typedef enum
mbed_official 354:e67efb2aab0e 284 {
mbed_official 354:e67efb2aab0e 285 SD_READ_SINGLE_BLOCK = 0, /*!< Read single block operation */
mbed_official 354:e67efb2aab0e 286 SD_READ_MULTIPLE_BLOCK = 1, /*!< Read multiple blocks operation */
mbed_official 354:e67efb2aab0e 287 SD_WRITE_SINGLE_BLOCK = 2, /*!< Write single block operation */
mbed_official 354:e67efb2aab0e 288 SD_WRITE_MULTIPLE_BLOCK = 3 /*!< Write multiple blocks operation */
mbed_official 354:e67efb2aab0e 289
mbed_official 354:e67efb2aab0e 290 }HAL_SD_OperationTypedef;
mbed_official 354:e67efb2aab0e 291
mbed_official 354:e67efb2aab0e 292 /**
mbed_official 354:e67efb2aab0e 293 * @}
mbed_official 354:e67efb2aab0e 294 */
mbed_official 354:e67efb2aab0e 295
mbed_official 354:e67efb2aab0e 296 /* Exported constants --------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 297 /** @defgroup SD_Exported_Constants SD Exported Constants
mbed_official 354:e67efb2aab0e 298 * @{
mbed_official 354:e67efb2aab0e 299 */
mbed_official 354:e67efb2aab0e 300
mbed_official 354:e67efb2aab0e 301 /**
mbed_official 354:e67efb2aab0e 302 * @brief SD Commands Index
mbed_official 354:e67efb2aab0e 303 */
mbed_official 354:e67efb2aab0e 304 #define SD_CMD_GO_IDLE_STATE ((uint8_t)0) /*!< Resets the SD memory card. */
mbed_official 354:e67efb2aab0e 305 #define SD_CMD_SEND_OP_COND ((uint8_t)1) /*!< Sends host capacity support information and activates the card's initialization process. */
mbed_official 354:e67efb2aab0e 306 #define SD_CMD_ALL_SEND_CID ((uint8_t)2) /*!< Asks any card connected to the host to send the CID numbers on the CMD line. */
mbed_official 354:e67efb2aab0e 307 #define SD_CMD_SET_REL_ADDR ((uint8_t)3) /*!< Asks the card to publish a new relative address (RCA). */
mbed_official 354:e67efb2aab0e 308 #define SD_CMD_SET_DSR ((uint8_t)4) /*!< Programs the DSR of all cards. */
mbed_official 354:e67efb2aab0e 309 #define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5) /*!< Sends host capacity support information (HCS) and asks the accessed card to send its
mbed_official 354:e67efb2aab0e 310 operating condition register (OCR) content in the response on the CMD line. */
mbed_official 354:e67efb2aab0e 311 #define SD_CMD_HS_SWITCH ((uint8_t)6) /*!< Checks switchable function (mode 0) and switch card function (mode 1). */
mbed_official 354:e67efb2aab0e 312 #define SD_CMD_SEL_DESEL_CARD ((uint8_t)7) /*!< Selects the card by its own relative address and gets deselected by any other address */
mbed_official 354:e67efb2aab0e 313 #define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8) /*!< Sends SD Memory Card interface condition, which includes host supply voltage information
mbed_official 354:e67efb2aab0e 314 and asks the card whether card supports voltage. */
mbed_official 354:e67efb2aab0e 315 #define SD_CMD_SEND_CSD ((uint8_t)9) /*!< Addressed card sends its card specific data (CSD) on the CMD line. */
mbed_official 354:e67efb2aab0e 316 #define SD_CMD_SEND_CID ((uint8_t)10) /*!< Addressed card sends its card identification (CID) on the CMD line. */
mbed_official 354:e67efb2aab0e 317 #define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11) /*!< SD card doesn't support it. */
mbed_official 354:e67efb2aab0e 318 #define SD_CMD_STOP_TRANSMISSION ((uint8_t)12) /*!< Forces the card to stop transmission. */
mbed_official 354:e67efb2aab0e 319 #define SD_CMD_SEND_STATUS ((uint8_t)13) /*!< Addressed card sends its status register. */
mbed_official 354:e67efb2aab0e 320 #define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
mbed_official 354:e67efb2aab0e 321 #define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15) /*!< Sends an addressed card into the inactive state. */
mbed_official 354:e67efb2aab0e 322 #define SD_CMD_SET_BLOCKLEN ((uint8_t)16) /*!< Sets the block length (in bytes for SDSC) for all following block commands
mbed_official 354:e67efb2aab0e 323 (read, write, lock). Default block length is fixed to 512 Bytes. Not effective
mbed_official 354:e67efb2aab0e 324 for SDHS and SDXC. */
mbed_official 354:e67efb2aab0e 325 #define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17) /*!< Reads single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of
mbed_official 354:e67efb2aab0e 326 fixed 512 bytes in case of SDHC and SDXC. */
mbed_official 354:e67efb2aab0e 327 #define SD_CMD_READ_MULT_BLOCK ((uint8_t)18) /*!< Continuously transfers data blocks from card to host until interrupted by
mbed_official 354:e67efb2aab0e 328 STOP_TRANSMISSION command. */
mbed_official 354:e67efb2aab0e 329 #define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19) /*!< 64 bytes tuning pattern is sent for SDR50 and SDR104. */
mbed_official 354:e67efb2aab0e 330 #define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20) /*!< Speed class control command. */
mbed_official 354:e67efb2aab0e 331 #define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23) /*!< Specify block count for CMD18 and CMD25. */
mbed_official 354:e67efb2aab0e 332 #define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24) /*!< Writes single block of size selected by SET_BLOCKLEN in case of SDSC, and a block of
mbed_official 354:e67efb2aab0e 333 fixed 512 bytes in case of SDHC and SDXC. */
mbed_official 354:e67efb2aab0e 334 #define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25) /*!< Continuously writes blocks of data until a STOP_TRANSMISSION follows. */
mbed_official 354:e67efb2aab0e 335 #define SD_CMD_PROG_CID ((uint8_t)26) /*!< Reserved for manufacturers. */
mbed_official 354:e67efb2aab0e 336 #define SD_CMD_PROG_CSD ((uint8_t)27) /*!< Programming of the programmable bits of the CSD. */
mbed_official 354:e67efb2aab0e 337 #define SD_CMD_SET_WRITE_PROT ((uint8_t)28) /*!< Sets the write protection bit of the addressed group. */
mbed_official 354:e67efb2aab0e 338 #define SD_CMD_CLR_WRITE_PROT ((uint8_t)29) /*!< Clears the write protection bit of the addressed group. */
mbed_official 354:e67efb2aab0e 339 #define SD_CMD_SEND_WRITE_PROT ((uint8_t)30) /*!< Asks the card to send the status of the write protection bits. */
mbed_official 354:e67efb2aab0e 340 #define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32) /*!< Sets the address of the first write block to be erased. (For SD card only). */
mbed_official 354:e67efb2aab0e 341 #define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33) /*!< Sets the address of the last write block of the continuous range to be erased. */
mbed_official 354:e67efb2aab0e 342 #define SD_CMD_ERASE_GRP_START ((uint8_t)35) /*!< Sets the address of the first write block to be erased. Reserved for each command
mbed_official 354:e67efb2aab0e 343 system set by switch function command (CMD6). */
mbed_official 354:e67efb2aab0e 344 #define SD_CMD_ERASE_GRP_END ((uint8_t)36) /*!< Sets the address of the last write block of the continuous range to be erased.
mbed_official 354:e67efb2aab0e 345 Reserved for each command system set by switch function command (CMD6). */
mbed_official 354:e67efb2aab0e 346 #define SD_CMD_ERASE ((uint8_t)38) /*!< Reserved for SD security applications. */
mbed_official 354:e67efb2aab0e 347 #define SD_CMD_FAST_IO ((uint8_t)39) /*!< SD card doesn't support it (Reserved). */
mbed_official 354:e67efb2aab0e 348 #define SD_CMD_GO_IRQ_STATE ((uint8_t)40) /*!< SD card doesn't support it (Reserved). */
mbed_official 354:e67efb2aab0e 349 #define SD_CMD_LOCK_UNLOCK ((uint8_t)42) /*!< Sets/resets the password or lock/unlock the card. The size of the data block is set by
mbed_official 354:e67efb2aab0e 350 the SET_BLOCK_LEN command. */
mbed_official 354:e67efb2aab0e 351 #define SD_CMD_APP_CMD ((uint8_t)55) /*!< Indicates to the card that the next command is an application specific command rather
mbed_official 354:e67efb2aab0e 352 than a standard command. */
mbed_official 354:e67efb2aab0e 353 #define SD_CMD_GEN_CMD ((uint8_t)56) /*!< Used either to transfer a data block to the card or to get a data block from the card
mbed_official 354:e67efb2aab0e 354 for general purpose/application specific commands. */
mbed_official 354:e67efb2aab0e 355 #define SD_CMD_NO_CMD ((uint8_t)64)
mbed_official 354:e67efb2aab0e 356
mbed_official 354:e67efb2aab0e 357 /**
mbed_official 354:e67efb2aab0e 358 * @brief Following commands are SD Card Specific commands.
mbed_official 354:e67efb2aab0e 359 * SDIO_APP_CMD should be sent before sending these commands.
mbed_official 354:e67efb2aab0e 360 */
mbed_official 354:e67efb2aab0e 361 #define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /*!< (ACMD6) Defines the data bus width to be used for data transfer. The allowed data bus
mbed_official 354:e67efb2aab0e 362 widths are given in SCR register. */
mbed_official 354:e67efb2aab0e 363 #define SD_CMD_SD_APP_STAUS ((uint8_t)13) /*!< (ACMD13) Sends the SD status. */
mbed_official 354:e67efb2aab0e 364 #define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) /*!< (ACMD22) Sends the number of the written (without errors) write blocks. Responds with
mbed_official 354:e67efb2aab0e 365 32bit+CRC data block. */
mbed_official 354:e67efb2aab0e 366 #define SD_CMD_SD_APP_OP_COND ((uint8_t)41) /*!< (ACMD41) Sends host capacity support information (HCS) and asks the accessed card to
mbed_official 354:e67efb2aab0e 367 send its operating condition register (OCR) content in the response on the CMD line. */
mbed_official 354:e67efb2aab0e 368 #define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) /*!< (ACMD42) Connects/Disconnects the 50 KOhm pull-up resistor on CD/DAT3 (pin 1) of the card. */
mbed_official 354:e67efb2aab0e 369 #define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51) /*!< Reads the SD Configuration Register (SCR). */
mbed_official 354:e67efb2aab0e 370 #define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52) /*!< For SD I/O card only, reserved for security specification. */
mbed_official 354:e67efb2aab0e 371 #define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53) /*!< For SD I/O card only, reserved for security specification. */
mbed_official 354:e67efb2aab0e 372
mbed_official 354:e67efb2aab0e 373 /**
mbed_official 354:e67efb2aab0e 374 * @brief Following commands are SD Card Specific security commands.
mbed_official 354:e67efb2aab0e 375 * SD_CMD_APP_CMD should be sent before sending these commands.
mbed_official 354:e67efb2aab0e 376 */
mbed_official 354:e67efb2aab0e 377 #define SD_CMD_SD_APP_GET_MKB ((uint8_t)43) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 378 #define SD_CMD_SD_APP_GET_MID ((uint8_t)44) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 379 #define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 380 #define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 381 #define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 382 #define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 383 #define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 384 #define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 385 #define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 386 #define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 387 #define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48) /*!< For SD card only */
mbed_official 354:e67efb2aab0e 388
mbed_official 354:e67efb2aab0e 389 /**
mbed_official 354:e67efb2aab0e 390 * @brief Supported SD Memory Cards
mbed_official 354:e67efb2aab0e 391 */
mbed_official 354:e67efb2aab0e 392 #define STD_CAPACITY_SD_CARD_V1_1 ((uint32_t)0x00000000)
mbed_official 354:e67efb2aab0e 393 #define STD_CAPACITY_SD_CARD_V2_0 ((uint32_t)0x00000001)
mbed_official 354:e67efb2aab0e 394 #define HIGH_CAPACITY_SD_CARD ((uint32_t)0x00000002)
mbed_official 354:e67efb2aab0e 395 #define MULTIMEDIA_CARD ((uint32_t)0x00000003)
mbed_official 354:e67efb2aab0e 396 #define SECURE_DIGITAL_IO_CARD ((uint32_t)0x00000004)
mbed_official 354:e67efb2aab0e 397 #define HIGH_SPEED_MULTIMEDIA_CARD ((uint32_t)0x00000005)
mbed_official 354:e67efb2aab0e 398 #define SECURE_DIGITAL_IO_COMBO_CARD ((uint32_t)0x00000006)
mbed_official 354:e67efb2aab0e 399 #define HIGH_CAPACITY_MMC_CARD ((uint32_t)0x00000007)
mbed_official 354:e67efb2aab0e 400 /**
mbed_official 354:e67efb2aab0e 401 * @}
mbed_official 354:e67efb2aab0e 402 */
mbed_official 354:e67efb2aab0e 403
mbed_official 354:e67efb2aab0e 404 /* Exported macro ------------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 405 /** @defgroup SD_Exported_macros SD Exported Macros
mbed_official 354:e67efb2aab0e 406 * @brief macros to handle interrupts and specific clock configurations
mbed_official 354:e67efb2aab0e 407 * @{
mbed_official 354:e67efb2aab0e 408 */
mbed_official 354:e67efb2aab0e 409
mbed_official 354:e67efb2aab0e 410 /**
mbed_official 354:e67efb2aab0e 411 * @brief Enable the SD device.
mbed_official 354:e67efb2aab0e 412 * @retval None
mbed_official 354:e67efb2aab0e 413 */
mbed_official 354:e67efb2aab0e 414 #define __HAL_SD_SDIO_ENABLE() __SDIO_ENABLE()
mbed_official 354:e67efb2aab0e 415
mbed_official 354:e67efb2aab0e 416 /**
mbed_official 354:e67efb2aab0e 417 * @brief Disable the SD device.
mbed_official 354:e67efb2aab0e 418 * @retval None
mbed_official 354:e67efb2aab0e 419 */
mbed_official 354:e67efb2aab0e 420 #define __HAL_SD_SDIO_DISABLE() __SDIO_DISABLE()
mbed_official 354:e67efb2aab0e 421
mbed_official 354:e67efb2aab0e 422 /**
mbed_official 354:e67efb2aab0e 423 * @brief Enable the SDIO DMA transfer.
mbed_official 354:e67efb2aab0e 424 * @retval None
mbed_official 354:e67efb2aab0e 425 */
mbed_official 354:e67efb2aab0e 426 #define __HAL_SD_SDIO_DMA_ENABLE() __SDIO_DMA_ENABLE()
mbed_official 354:e67efb2aab0e 427
mbed_official 354:e67efb2aab0e 428 /**
mbed_official 354:e67efb2aab0e 429 * @brief Disable the SDIO DMA transfer.
mbed_official 354:e67efb2aab0e 430 * @retval None
mbed_official 354:e67efb2aab0e 431 */
mbed_official 354:e67efb2aab0e 432 #define __HAL_SD_SDIO_DMA_DISABLE() __SDIO_DMA_DISABLE()
mbed_official 354:e67efb2aab0e 433
mbed_official 354:e67efb2aab0e 434 /**
mbed_official 354:e67efb2aab0e 435 * @brief Enable the SD device interrupt.
mbed_official 354:e67efb2aab0e 436 * @param __HANDLE__: SD Handle
mbed_official 354:e67efb2aab0e 437 * @param __INTERRUPT__: specifies the SDIO interrupt sources to be enabled.
mbed_official 354:e67efb2aab0e 438 * This parameter can be one or a combination of the following values:
mbed_official 354:e67efb2aab0e 439 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 440 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 441 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 354:e67efb2aab0e 442 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 354:e67efb2aab0e 443 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 354:e67efb2aab0e 444 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 354:e67efb2aab0e 445 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 446 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 354:e67efb2aab0e 447 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 354:e67efb2aab0e 448 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 354:e67efb2aab0e 449 * bus mode interrupt
mbed_official 354:e67efb2aab0e 450 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 451 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 354:e67efb2aab0e 452 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 354:e67efb2aab0e 453 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 354:e67efb2aab0e 454 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 354:e67efb2aab0e 455 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 354:e67efb2aab0e 456 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 354:e67efb2aab0e 457 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 354:e67efb2aab0e 458 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 354:e67efb2aab0e 459 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 354:e67efb2aab0e 460 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 354:e67efb2aab0e 461 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 354:e67efb2aab0e 462 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 354:e67efb2aab0e 463 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 354:e67efb2aab0e 464 * @retval None
mbed_official 354:e67efb2aab0e 465 */
mbed_official 354:e67efb2aab0e 466 #define __HAL_SD_SDIO_ENABLE_IT(__HANDLE__, __INTERRUPT__) __SDIO_ENABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
mbed_official 354:e67efb2aab0e 467
mbed_official 354:e67efb2aab0e 468 /**
mbed_official 354:e67efb2aab0e 469 * @brief Disable the SD device interrupt.
mbed_official 354:e67efb2aab0e 470 * @param __HANDLE__: SD Handle
mbed_official 354:e67efb2aab0e 471 * @param __INTERRUPT__: specifies the SDIO interrupt sources to be disabled.
mbed_official 354:e67efb2aab0e 472 * This parameter can be one or a combination of the following values:
mbed_official 354:e67efb2aab0e 473 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 474 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 475 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 354:e67efb2aab0e 476 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 354:e67efb2aab0e 477 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 354:e67efb2aab0e 478 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 354:e67efb2aab0e 479 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 480 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 354:e67efb2aab0e 481 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 354:e67efb2aab0e 482 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 354:e67efb2aab0e 483 * bus mode interrupt
mbed_official 354:e67efb2aab0e 484 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 485 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 354:e67efb2aab0e 486 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 354:e67efb2aab0e 487 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 354:e67efb2aab0e 488 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 354:e67efb2aab0e 489 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 354:e67efb2aab0e 490 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 354:e67efb2aab0e 491 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 354:e67efb2aab0e 492 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 354:e67efb2aab0e 493 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 354:e67efb2aab0e 494 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 354:e67efb2aab0e 495 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 354:e67efb2aab0e 496 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 354:e67efb2aab0e 497 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 354:e67efb2aab0e 498 * @retval None
mbed_official 354:e67efb2aab0e 499 */
mbed_official 354:e67efb2aab0e 500 #define __HAL_SD_SDIO_DISABLE_IT(__HANDLE__, __INTERRUPT__) __SDIO_DISABLE_IT((__HANDLE__)->Instance, (__INTERRUPT__))
mbed_official 354:e67efb2aab0e 501
mbed_official 354:e67efb2aab0e 502 /**
mbed_official 354:e67efb2aab0e 503 * @brief Check whether the specified SD flag is set or not.
mbed_official 354:e67efb2aab0e 504 * @param __HANDLE__: SD Handle
mbed_official 354:e67efb2aab0e 505 * @param __FLAG__: specifies the flag to check.
mbed_official 354:e67efb2aab0e 506 * This parameter can be one of the following values:
mbed_official 354:e67efb2aab0e 507 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
mbed_official 354:e67efb2aab0e 508 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
mbed_official 354:e67efb2aab0e 509 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
mbed_official 354:e67efb2aab0e 510 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
mbed_official 354:e67efb2aab0e 511 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
mbed_official 354:e67efb2aab0e 512 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
mbed_official 354:e67efb2aab0e 513 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
mbed_official 354:e67efb2aab0e 514 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
mbed_official 354:e67efb2aab0e 515 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
mbed_official 354:e67efb2aab0e 516 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode.
mbed_official 354:e67efb2aab0e 517 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
mbed_official 354:e67efb2aab0e 518 * @arg SDIO_FLAG_CMDACT: Command transfer in progress
mbed_official 354:e67efb2aab0e 519 * @arg SDIO_FLAG_TXACT: Data transmit in progress
mbed_official 354:e67efb2aab0e 520 * @arg SDIO_FLAG_RXACT: Data receive in progress
mbed_official 354:e67efb2aab0e 521 * @arg SDIO_FLAG_TXFIFOHE: Transmit FIFO Half Empty
mbed_official 354:e67efb2aab0e 522 * @arg SDIO_FLAG_RXFIFOHF: Receive FIFO Half Full
mbed_official 354:e67efb2aab0e 523 * @arg SDIO_FLAG_TXFIFOF: Transmit FIFO full
mbed_official 354:e67efb2aab0e 524 * @arg SDIO_FLAG_RXFIFOF: Receive FIFO full
mbed_official 354:e67efb2aab0e 525 * @arg SDIO_FLAG_TXFIFOE: Transmit FIFO empty
mbed_official 354:e67efb2aab0e 526 * @arg SDIO_FLAG_RXFIFOE: Receive FIFO empty
mbed_official 354:e67efb2aab0e 527 * @arg SDIO_FLAG_TXDAVL: Data available in transmit FIFO
mbed_official 354:e67efb2aab0e 528 * @arg SDIO_FLAG_RXDAVL: Data available in receive FIFO
mbed_official 354:e67efb2aab0e 529 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
mbed_official 354:e67efb2aab0e 530 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 354:e67efb2aab0e 531 * @retval The new state of SD FLAG (SET or RESET).
mbed_official 354:e67efb2aab0e 532 */
mbed_official 354:e67efb2aab0e 533 #define __HAL_SD_SDIO_GET_FLAG(__HANDLE__, __FLAG__) __SDIO_GET_FLAG((__HANDLE__)->Instance, (__FLAG__))
mbed_official 354:e67efb2aab0e 534
mbed_official 354:e67efb2aab0e 535 /**
mbed_official 354:e67efb2aab0e 536 * @brief Clear the SD's pending flags.
mbed_official 354:e67efb2aab0e 537 * @param __HANDLE__: SD Handle
mbed_official 354:e67efb2aab0e 538 * @param __FLAG__: specifies the flag to clear.
mbed_official 354:e67efb2aab0e 539 * This parameter can be one or a combination of the following values:
mbed_official 354:e67efb2aab0e 540 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
mbed_official 354:e67efb2aab0e 541 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
mbed_official 354:e67efb2aab0e 542 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
mbed_official 354:e67efb2aab0e 543 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
mbed_official 354:e67efb2aab0e 544 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
mbed_official 354:e67efb2aab0e 545 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
mbed_official 354:e67efb2aab0e 546 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
mbed_official 354:e67efb2aab0e 547 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
mbed_official 354:e67efb2aab0e 548 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
mbed_official 354:e67efb2aab0e 549 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode
mbed_official 354:e67efb2aab0e 550 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
mbed_official 354:e67efb2aab0e 551 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
mbed_official 354:e67efb2aab0e 552 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 354:e67efb2aab0e 553 * @retval None
mbed_official 354:e67efb2aab0e 554 */
mbed_official 354:e67efb2aab0e 555 #define __HAL_SD_SDIO_CLEAR_FLAG(__HANDLE__, __FLAG__) __SDIO_CLEAR_FLAG((__HANDLE__)->Instance, (__FLAG__))
mbed_official 354:e67efb2aab0e 556
mbed_official 354:e67efb2aab0e 557 /**
mbed_official 354:e67efb2aab0e 558 * @brief Check whether the specified SD interrupt has occurred or not.
mbed_official 354:e67efb2aab0e 559 * @param __HANDLE__: SD Handle
mbed_official 354:e67efb2aab0e 560 * @param __INTERRUPT__: specifies the SDIO interrupt source to check.
mbed_official 354:e67efb2aab0e 561 * This parameter can be one of the following values:
mbed_official 354:e67efb2aab0e 562 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 563 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 564 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 354:e67efb2aab0e 565 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 354:e67efb2aab0e 566 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 354:e67efb2aab0e 567 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 354:e67efb2aab0e 568 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 569 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 354:e67efb2aab0e 570 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 354:e67efb2aab0e 571 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 354:e67efb2aab0e 572 * bus mode interrupt
mbed_official 354:e67efb2aab0e 573 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 574 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 354:e67efb2aab0e 575 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 354:e67efb2aab0e 576 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 354:e67efb2aab0e 577 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 354:e67efb2aab0e 578 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 354:e67efb2aab0e 579 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 354:e67efb2aab0e 580 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 354:e67efb2aab0e 581 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 354:e67efb2aab0e 582 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 354:e67efb2aab0e 583 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 354:e67efb2aab0e 584 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 354:e67efb2aab0e 585 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 354:e67efb2aab0e 586 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 354:e67efb2aab0e 587 * @retval The new state of SD IT (SET or RESET).
mbed_official 354:e67efb2aab0e 588 */
mbed_official 354:e67efb2aab0e 589 #define __HAL_SD_SDIO_GET_IT (__HANDLE__, __INTERRUPT__) __SDIO_GET_IT ((__HANDLE__)->Instance, __INTERRUPT__)
mbed_official 354:e67efb2aab0e 590
mbed_official 354:e67efb2aab0e 591 /**
mbed_official 354:e67efb2aab0e 592 * @brief Clear the SD's interrupt pending bits.
mbed_official 354:e67efb2aab0e 593 * @param __HANDLE__ : SD Handle
mbed_official 354:e67efb2aab0e 594 * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
mbed_official 354:e67efb2aab0e 595 * This parameter can be one or a combination of the following values:
mbed_official 354:e67efb2aab0e 596 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 597 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 354:e67efb2aab0e 598 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 354:e67efb2aab0e 599 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 354:e67efb2aab0e 600 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 354:e67efb2aab0e 601 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 354:e67efb2aab0e 602 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 354:e67efb2aab0e 603 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 354:e67efb2aab0e 604 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIO_DCOUNT, is zero) interrupt
mbed_official 354:e67efb2aab0e 605 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 354:e67efb2aab0e 606 * bus mode interrupt
mbed_official 354:e67efb2aab0e 607 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 354:e67efb2aab0e 608 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 354:e67efb2aab0e 609 * @retval None
mbed_official 354:e67efb2aab0e 610 */
mbed_official 354:e67efb2aab0e 611 #define __HAL_SD_SDIO_CLEAR_IT(__HANDLE__, __INTERRUPT__) __SDIO_CLEAR_IT((__HANDLE__)->Instance, (__INTERRUPT__))
mbed_official 354:e67efb2aab0e 612 /**
mbed_official 354:e67efb2aab0e 613 * @}
mbed_official 354:e67efb2aab0e 614 */
mbed_official 354:e67efb2aab0e 615
mbed_official 354:e67efb2aab0e 616 /* Exported functions --------------------------------------------------------*/
mbed_official 354:e67efb2aab0e 617 /** @addtogroup SD_Exported_Functions
mbed_official 354:e67efb2aab0e 618 * @{
mbed_official 354:e67efb2aab0e 619 */
mbed_official 354:e67efb2aab0e 620
mbed_official 354:e67efb2aab0e 621 /* Initialization and de-initialization functions **********************************/
mbed_official 354:e67efb2aab0e 622 /** @addtogroup SD_Exported_Functions_Group1
mbed_official 354:e67efb2aab0e 623 * @{
mbed_official 354:e67efb2aab0e 624 */
mbed_official 354:e67efb2aab0e 625 HAL_SD_ErrorTypedef HAL_SD_Init(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *SDCardInfo);
mbed_official 354:e67efb2aab0e 626 HAL_StatusTypeDef HAL_SD_DeInit (SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 627 void HAL_SD_MspInit(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 628 void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 629 /**
mbed_official 354:e67efb2aab0e 630 * @}
mbed_official 354:e67efb2aab0e 631 */
mbed_official 354:e67efb2aab0e 632
mbed_official 354:e67efb2aab0e 633 /* I/O operation functions *****************************************************/
mbed_official 354:e67efb2aab0e 634 /** @addtogroup SD_Exported_Functions_Group2
mbed_official 354:e67efb2aab0e 635 * @{
mbed_official 354:e67efb2aab0e 636 */
mbed_official 354:e67efb2aab0e 637 /* Blocking mode: Polling */
mbed_official 354:e67efb2aab0e 638 HAL_SD_ErrorTypedef HAL_SD_ReadBlocks(SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
mbed_official 354:e67efb2aab0e 639 HAL_SD_ErrorTypedef HAL_SD_WriteBlocks(SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
mbed_official 354:e67efb2aab0e 640 HAL_SD_ErrorTypedef HAL_SD_Erase(SD_HandleTypeDef *hsd, uint64_t startaddr, uint64_t endaddr);
mbed_official 354:e67efb2aab0e 641
mbed_official 354:e67efb2aab0e 642 /* Non-Blocking mode: Interrupt */
mbed_official 354:e67efb2aab0e 643 void HAL_SD_IRQHandler(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 644
mbed_official 354:e67efb2aab0e 645 /* Callback in non blocking modes (DMA) */
mbed_official 354:e67efb2aab0e 646 void HAL_SD_DMA_RxCpltCallback(DMA_HandleTypeDef *hdma);
mbed_official 354:e67efb2aab0e 647 void HAL_SD_DMA_RxErrorCallback(DMA_HandleTypeDef *hdma);
mbed_official 354:e67efb2aab0e 648 void HAL_SD_DMA_TxCpltCallback(DMA_HandleTypeDef *hdma);
mbed_official 354:e67efb2aab0e 649 void HAL_SD_DMA_TxErrorCallback(DMA_HandleTypeDef *hdma);
mbed_official 354:e67efb2aab0e 650 void HAL_SD_XferCpltCallback(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 651 void HAL_SD_XferErrorCallback(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 652
mbed_official 354:e67efb2aab0e 653 /* Non-Blocking mode: DMA */
mbed_official 354:e67efb2aab0e 654 HAL_SD_ErrorTypedef HAL_SD_ReadBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pReadBuffer, uint64_t ReadAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
mbed_official 354:e67efb2aab0e 655 HAL_SD_ErrorTypedef HAL_SD_WriteBlocks_DMA(SD_HandleTypeDef *hsd, uint32_t *pWriteBuffer, uint64_t WriteAddr, uint32_t BlockSize, uint32_t NumberOfBlocks);
mbed_official 354:e67efb2aab0e 656 HAL_SD_ErrorTypedef HAL_SD_CheckWriteOperation(SD_HandleTypeDef *hsd, uint32_t Timeout);
mbed_official 354:e67efb2aab0e 657 HAL_SD_ErrorTypedef HAL_SD_CheckReadOperation(SD_HandleTypeDef *hsd, uint32_t Timeout);
mbed_official 354:e67efb2aab0e 658 /**
mbed_official 354:e67efb2aab0e 659 * @}
mbed_official 354:e67efb2aab0e 660 */
mbed_official 354:e67efb2aab0e 661
mbed_official 354:e67efb2aab0e 662 /* Peripheral Control functions ************************************************/
mbed_official 354:e67efb2aab0e 663 /** @addtogroup SD_Exported_Functions_Group3
mbed_official 354:e67efb2aab0e 664 * @{
mbed_official 354:e67efb2aab0e 665 */
mbed_official 354:e67efb2aab0e 666 HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTypedef *pCardInfo);
mbed_official 354:e67efb2aab0e 667 HAL_SD_ErrorTypedef HAL_SD_WideBusOperation_Config(SD_HandleTypeDef *hsd, uint32_t WideMode);
mbed_official 354:e67efb2aab0e 668 HAL_SD_ErrorTypedef HAL_SD_StopTransfer(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 669 HAL_SD_ErrorTypedef HAL_SD_HighSpeed (SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 670 /**
mbed_official 354:e67efb2aab0e 671 * @}
mbed_official 354:e67efb2aab0e 672 */
mbed_official 354:e67efb2aab0e 673
mbed_official 354:e67efb2aab0e 674 /* Peripheral State functions **************************************************/
mbed_official 354:e67efb2aab0e 675 /** @addtogroup SD_Exported_Functions_Group4
mbed_official 354:e67efb2aab0e 676 * @{
mbed_official 354:e67efb2aab0e 677 */
mbed_official 354:e67efb2aab0e 678 HAL_SD_ErrorTypedef HAL_SD_SendSDStatus(SD_HandleTypeDef *hsd, uint32_t *pSDstatus);
mbed_official 354:e67efb2aab0e 679 HAL_SD_ErrorTypedef HAL_SD_GetCardStatus(SD_HandleTypeDef *hsd, HAL_SD_CardStatusTypedef *pCardStatus);
mbed_official 354:e67efb2aab0e 680 HAL_SD_TransferStateTypedef HAL_SD_GetStatus(SD_HandleTypeDef *hsd);
mbed_official 354:e67efb2aab0e 681 /**
mbed_official 354:e67efb2aab0e 682 * @}
mbed_official 354:e67efb2aab0e 683 */
mbed_official 354:e67efb2aab0e 684
mbed_official 354:e67efb2aab0e 685 /**
mbed_official 354:e67efb2aab0e 686 * @}
mbed_official 354:e67efb2aab0e 687 */
mbed_official 354:e67efb2aab0e 688
mbed_official 354:e67efb2aab0e 689 /**
mbed_official 354:e67efb2aab0e 690 * @}
mbed_official 354:e67efb2aab0e 691 */
mbed_official 354:e67efb2aab0e 692
mbed_official 354:e67efb2aab0e 693 /**
mbed_official 354:e67efb2aab0e 694 * @}
mbed_official 354:e67efb2aab0e 695 */
mbed_official 354:e67efb2aab0e 696
mbed_official 354:e67efb2aab0e 697 #ifdef __cplusplus
mbed_official 354:e67efb2aab0e 698 }
mbed_official 354:e67efb2aab0e 699 #endif
mbed_official 354:e67efb2aab0e 700
mbed_official 354:e67efb2aab0e 701 #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
mbed_official 354:e67efb2aab0e 702
mbed_official 354:e67efb2aab0e 703 #endif /* __STM32L1xx_HAL_SD_H */
mbed_official 354:e67efb2aab0e 704
mbed_official 354:e67efb2aab0e 705 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/