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