Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 02 14:17:43 2015 +0100
Revision:
106:ba1f97679dad
Parent:
101:7cff1c4259d7
Child:
110:165afa46840b
Release 106  of the mbed library

Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports

Who changed what in which revision?

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