Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_F746ZG/stm32f7xx_ll_sdmmc.h@121:672067c3ada4, 2016-04-14 (annotated)
- Committer:
- elijahorr
- Date:
- Thu Apr 14 07:28:54 2016 +0000
- Revision:
- 121:672067c3ada4
- Parent:
- 116:c0f6e94411f5
.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 115:87f2f5183dfb | 1 | /** |
Kojto | 115:87f2f5183dfb | 2 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 3 | * @file stm32f7xx_ll_sdmmc.h |
Kojto | 115:87f2f5183dfb | 4 | * @author MCD Application Team |
Kojto | 116:c0f6e94411f5 | 5 | * @version V1.0.4 |
Kojto | 116:c0f6e94411f5 | 6 | * @date 09-December-2015 |
Kojto | 115:87f2f5183dfb | 7 | * @brief Header file of SDMMC HAL module. |
Kojto | 115:87f2f5183dfb | 8 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 9 | * @attention |
Kojto | 115:87f2f5183dfb | 10 | * |
Kojto | 115:87f2f5183dfb | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Kojto | 115:87f2f5183dfb | 12 | * |
Kojto | 115:87f2f5183dfb | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 115:87f2f5183dfb | 14 | * are permitted provided that the following conditions are met: |
Kojto | 115:87f2f5183dfb | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 115:87f2f5183dfb | 16 | * this list of conditions and the following disclaimer. |
Kojto | 115:87f2f5183dfb | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 115:87f2f5183dfb | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 115:87f2f5183dfb | 19 | * and/or other materials provided with the distribution. |
Kojto | 115:87f2f5183dfb | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 115:87f2f5183dfb | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 115:87f2f5183dfb | 22 | * without specific prior written permission. |
Kojto | 115:87f2f5183dfb | 23 | * |
Kojto | 115:87f2f5183dfb | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 115:87f2f5183dfb | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 115:87f2f5183dfb | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 115:87f2f5183dfb | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 115:87f2f5183dfb | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 115:87f2f5183dfb | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 115:87f2f5183dfb | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 115:87f2f5183dfb | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 115:87f2f5183dfb | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 115:87f2f5183dfb | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 115:87f2f5183dfb | 34 | * |
Kojto | 115:87f2f5183dfb | 35 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 36 | */ |
Kojto | 115:87f2f5183dfb | 37 | |
Kojto | 115:87f2f5183dfb | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 39 | #ifndef __STM32F7xx_LL_SDMMC_H |
Kojto | 115:87f2f5183dfb | 40 | #define __STM32F7xx_LL_SDMMC_H |
Kojto | 115:87f2f5183dfb | 41 | |
Kojto | 115:87f2f5183dfb | 42 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 43 | extern "C" { |
Kojto | 115:87f2f5183dfb | 44 | #endif |
Kojto | 115:87f2f5183dfb | 45 | |
Kojto | 115:87f2f5183dfb | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 47 | #include "stm32f7xx_hal_def.h" |
Kojto | 115:87f2f5183dfb | 48 | |
Kojto | 115:87f2f5183dfb | 49 | /** @addtogroup STM32F7xx_Driver |
Kojto | 115:87f2f5183dfb | 50 | * @{ |
Kojto | 115:87f2f5183dfb | 51 | */ |
Kojto | 115:87f2f5183dfb | 52 | |
Kojto | 115:87f2f5183dfb | 53 | /** @addtogroup SDMMC_LL |
Kojto | 115:87f2f5183dfb | 54 | * @{ |
Kojto | 115:87f2f5183dfb | 55 | */ |
Kojto | 115:87f2f5183dfb | 56 | |
Kojto | 115:87f2f5183dfb | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 58 | /** @defgroup SDMMC_LL_Exported_Types SDMMC_LL Exported Types |
Kojto | 115:87f2f5183dfb | 59 | * @{ |
Kojto | 115:87f2f5183dfb | 60 | */ |
Kojto | 115:87f2f5183dfb | 61 | |
Kojto | 115:87f2f5183dfb | 62 | /** |
Kojto | 115:87f2f5183dfb | 63 | * @brief SDMMC Configuration Structure definition |
Kojto | 115:87f2f5183dfb | 64 | */ |
Kojto | 115:87f2f5183dfb | 65 | typedef struct |
Kojto | 115:87f2f5183dfb | 66 | { |
Kojto | 115:87f2f5183dfb | 67 | uint32_t ClockEdge; /*!< Specifies the clock transition on which the bit capture is made. |
Kojto | 115:87f2f5183dfb | 68 | This parameter can be a value of @ref SDMMC_LL_Clock_Edge */ |
Kojto | 115:87f2f5183dfb | 69 | |
Kojto | 115:87f2f5183dfb | 70 | uint32_t ClockBypass; /*!< Specifies whether the SDMMC Clock divider bypass is |
Kojto | 115:87f2f5183dfb | 71 | enabled or disabled. |
Kojto | 115:87f2f5183dfb | 72 | This parameter can be a value of @ref SDMMC_LL_Clock_Bypass */ |
Kojto | 115:87f2f5183dfb | 73 | |
Kojto | 115:87f2f5183dfb | 74 | uint32_t ClockPowerSave; /*!< Specifies whether SDMMC Clock output is enabled or |
Kojto | 115:87f2f5183dfb | 75 | disabled when the bus is idle. |
Kojto | 115:87f2f5183dfb | 76 | This parameter can be a value of @ref SDMMC_LL_Clock_Power_Save */ |
Kojto | 115:87f2f5183dfb | 77 | |
Kojto | 115:87f2f5183dfb | 78 | uint32_t BusWide; /*!< Specifies the SDMMC bus width. |
Kojto | 115:87f2f5183dfb | 79 | This parameter can be a value of @ref SDMMC_LL_Bus_Wide */ |
Kojto | 115:87f2f5183dfb | 80 | |
Kojto | 115:87f2f5183dfb | 81 | uint32_t HardwareFlowControl; /*!< Specifies whether the SDMMC hardware flow control is enabled or disabled. |
Kojto | 115:87f2f5183dfb | 82 | This parameter can be a value of @ref SDMMC_LL_Hardware_Flow_Control */ |
Kojto | 115:87f2f5183dfb | 83 | |
Kojto | 115:87f2f5183dfb | 84 | uint32_t ClockDiv; /*!< Specifies the clock frequency of the SDMMC controller. |
Kojto | 115:87f2f5183dfb | 85 | This parameter can be a value between Min_Data = 0 and Max_Data = 255 */ |
Kojto | 115:87f2f5183dfb | 86 | |
Kojto | 115:87f2f5183dfb | 87 | }SDMMC_InitTypeDef; |
Kojto | 115:87f2f5183dfb | 88 | |
Kojto | 115:87f2f5183dfb | 89 | |
Kojto | 115:87f2f5183dfb | 90 | /** |
Kojto | 115:87f2f5183dfb | 91 | * @brief SDMMC Command Control structure |
Kojto | 115:87f2f5183dfb | 92 | */ |
Kojto | 115:87f2f5183dfb | 93 | typedef struct |
Kojto | 115:87f2f5183dfb | 94 | { |
Kojto | 115:87f2f5183dfb | 95 | uint32_t Argument; /*!< Specifies the SDMMC command argument which is sent |
Kojto | 115:87f2f5183dfb | 96 | to a card as part of a command message. If a command |
Kojto | 115:87f2f5183dfb | 97 | contains an argument, it must be loaded into this register |
Kojto | 115:87f2f5183dfb | 98 | before writing the command to the command register. */ |
Kojto | 115:87f2f5183dfb | 99 | |
Kojto | 115:87f2f5183dfb | 100 | uint32_t CmdIndex; /*!< Specifies the SDMMC command index. It must be Min_Data = 0 and |
Kojto | 115:87f2f5183dfb | 101 | Max_Data = 64 */ |
Kojto | 115:87f2f5183dfb | 102 | |
Kojto | 115:87f2f5183dfb | 103 | uint32_t Response; /*!< Specifies the SDMMC response type. |
Kojto | 115:87f2f5183dfb | 104 | This parameter can be a value of @ref SDMMC_LL_Response_Type */ |
Kojto | 115:87f2f5183dfb | 105 | |
Kojto | 115:87f2f5183dfb | 106 | uint32_t WaitForInterrupt; /*!< Specifies whether SDMMC wait for interrupt request is |
Kojto | 115:87f2f5183dfb | 107 | enabled or disabled. |
Kojto | 115:87f2f5183dfb | 108 | This parameter can be a value of @ref SDMMC_LL_Wait_Interrupt_State */ |
Kojto | 115:87f2f5183dfb | 109 | |
Kojto | 115:87f2f5183dfb | 110 | uint32_t CPSM; /*!< Specifies whether SDMMC Command path state machine (CPSM) |
Kojto | 115:87f2f5183dfb | 111 | is enabled or disabled. |
Kojto | 115:87f2f5183dfb | 112 | This parameter can be a value of @ref SDMMC_LL_CPSM_State */ |
Kojto | 115:87f2f5183dfb | 113 | }SDMMC_CmdInitTypeDef; |
Kojto | 115:87f2f5183dfb | 114 | |
Kojto | 115:87f2f5183dfb | 115 | |
Kojto | 115:87f2f5183dfb | 116 | /** |
Kojto | 115:87f2f5183dfb | 117 | * @brief SDMMC Data Control structure |
Kojto | 115:87f2f5183dfb | 118 | */ |
Kojto | 115:87f2f5183dfb | 119 | typedef struct |
Kojto | 115:87f2f5183dfb | 120 | { |
Kojto | 115:87f2f5183dfb | 121 | uint32_t DataTimeOut; /*!< Specifies the data timeout period in card bus clock periods. */ |
Kojto | 115:87f2f5183dfb | 122 | |
Kojto | 115:87f2f5183dfb | 123 | uint32_t DataLength; /*!< Specifies the number of data bytes to be transferred. */ |
Kojto | 115:87f2f5183dfb | 124 | |
Kojto | 115:87f2f5183dfb | 125 | uint32_t DataBlockSize; /*!< Specifies the data block size for block transfer. |
Kojto | 115:87f2f5183dfb | 126 | This parameter can be a value of @ref SDMMC_LL_Data_Block_Size */ |
Kojto | 115:87f2f5183dfb | 127 | |
Kojto | 115:87f2f5183dfb | 128 | uint32_t TransferDir; /*!< Specifies the data transfer direction, whether the transfer |
Kojto | 115:87f2f5183dfb | 129 | is a read or write. |
Kojto | 115:87f2f5183dfb | 130 | This parameter can be a value of @ref SDMMC_LL_Transfer_Direction */ |
Kojto | 115:87f2f5183dfb | 131 | |
Kojto | 115:87f2f5183dfb | 132 | uint32_t TransferMode; /*!< Specifies whether data transfer is in stream or block mode. |
Kojto | 115:87f2f5183dfb | 133 | This parameter can be a value of @ref SDMMC_LL_Transfer_Type */ |
Kojto | 115:87f2f5183dfb | 134 | |
Kojto | 115:87f2f5183dfb | 135 | uint32_t DPSM; /*!< Specifies whether SDMMC Data path state machine (DPSM) |
Kojto | 115:87f2f5183dfb | 136 | is enabled or disabled. |
Kojto | 115:87f2f5183dfb | 137 | This parameter can be a value of @ref SDMMC_LL_DPSM_State */ |
Kojto | 115:87f2f5183dfb | 138 | }SDMMC_DataInitTypeDef; |
Kojto | 115:87f2f5183dfb | 139 | |
Kojto | 115:87f2f5183dfb | 140 | /** |
Kojto | 115:87f2f5183dfb | 141 | * @} |
Kojto | 115:87f2f5183dfb | 142 | */ |
Kojto | 115:87f2f5183dfb | 143 | |
Kojto | 115:87f2f5183dfb | 144 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 145 | /** @defgroup SDMMC_LL_Exported_Constants SDMMC_LL Exported Constants |
Kojto | 115:87f2f5183dfb | 146 | * @{ |
Kojto | 115:87f2f5183dfb | 147 | */ |
Kojto | 115:87f2f5183dfb | 148 | |
Kojto | 115:87f2f5183dfb | 149 | /** @defgroup SDMMC_LL_Clock_Edge Clock Edge |
Kojto | 115:87f2f5183dfb | 150 | * @{ |
Kojto | 115:87f2f5183dfb | 151 | */ |
Kojto | 115:87f2f5183dfb | 152 | #define SDMMC_CLOCK_EDGE_RISING ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 153 | #define SDMMC_CLOCK_EDGE_FALLING SDMMC_CLKCR_NEGEDGE |
Kojto | 115:87f2f5183dfb | 154 | |
Kojto | 115:87f2f5183dfb | 155 | #define IS_SDMMC_CLOCK_EDGE(EDGE) (((EDGE) == SDMMC_CLOCK_EDGE_RISING) || \ |
Kojto | 115:87f2f5183dfb | 156 | ((EDGE) == SDMMC_CLOCK_EDGE_FALLING)) |
Kojto | 115:87f2f5183dfb | 157 | /** |
Kojto | 115:87f2f5183dfb | 158 | * @} |
Kojto | 115:87f2f5183dfb | 159 | */ |
Kojto | 115:87f2f5183dfb | 160 | |
Kojto | 115:87f2f5183dfb | 161 | /** @defgroup SDMMC_LL_Clock_Bypass Clock Bypass |
Kojto | 115:87f2f5183dfb | 162 | * @{ |
Kojto | 115:87f2f5183dfb | 163 | */ |
Kojto | 115:87f2f5183dfb | 164 | #define SDMMC_CLOCK_BYPASS_DISABLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 165 | #define SDMMC_CLOCK_BYPASS_ENABLE SDMMC_CLKCR_BYPASS |
Kojto | 115:87f2f5183dfb | 166 | |
Kojto | 115:87f2f5183dfb | 167 | #define IS_SDMMC_CLOCK_BYPASS(BYPASS) (((BYPASS) == SDMMC_CLOCK_BYPASS_DISABLE) || \ |
Kojto | 115:87f2f5183dfb | 168 | ((BYPASS) == SDMMC_CLOCK_BYPASS_ENABLE)) |
Kojto | 115:87f2f5183dfb | 169 | /** |
Kojto | 115:87f2f5183dfb | 170 | * @} |
Kojto | 115:87f2f5183dfb | 171 | */ |
Kojto | 115:87f2f5183dfb | 172 | |
Kojto | 115:87f2f5183dfb | 173 | /** @defgroup SDMMC_LL_Clock_Power_Save Clock Power Saving |
Kojto | 115:87f2f5183dfb | 174 | * @{ |
Kojto | 115:87f2f5183dfb | 175 | */ |
Kojto | 115:87f2f5183dfb | 176 | #define SDMMC_CLOCK_POWER_SAVE_DISABLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 177 | #define SDMMC_CLOCK_POWER_SAVE_ENABLE SDMMC_CLKCR_PWRSAV |
Kojto | 115:87f2f5183dfb | 178 | |
Kojto | 115:87f2f5183dfb | 179 | #define IS_SDMMC_CLOCK_POWER_SAVE(SAVE) (((SAVE) == SDMMC_CLOCK_POWER_SAVE_DISABLE) || \ |
Kojto | 115:87f2f5183dfb | 180 | ((SAVE) == SDMMC_CLOCK_POWER_SAVE_ENABLE)) |
Kojto | 115:87f2f5183dfb | 181 | /** |
Kojto | 115:87f2f5183dfb | 182 | * @} |
Kojto | 115:87f2f5183dfb | 183 | */ |
Kojto | 115:87f2f5183dfb | 184 | |
Kojto | 115:87f2f5183dfb | 185 | /** @defgroup SDMMC_LL_Bus_Wide Bus Width |
Kojto | 115:87f2f5183dfb | 186 | * @{ |
Kojto | 115:87f2f5183dfb | 187 | */ |
Kojto | 115:87f2f5183dfb | 188 | #define SDMMC_BUS_WIDE_1B ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 189 | #define SDMMC_BUS_WIDE_4B SDMMC_CLKCR_WIDBUS_0 |
Kojto | 115:87f2f5183dfb | 190 | #define SDMMC_BUS_WIDE_8B SDMMC_CLKCR_WIDBUS_1 |
Kojto | 115:87f2f5183dfb | 191 | |
Kojto | 115:87f2f5183dfb | 192 | #define IS_SDMMC_BUS_WIDE(WIDE) (((WIDE) == SDMMC_BUS_WIDE_1B) || \ |
Kojto | 115:87f2f5183dfb | 193 | ((WIDE) == SDMMC_BUS_WIDE_4B) || \ |
Kojto | 115:87f2f5183dfb | 194 | ((WIDE) == SDMMC_BUS_WIDE_8B)) |
Kojto | 115:87f2f5183dfb | 195 | /** |
Kojto | 115:87f2f5183dfb | 196 | * @} |
Kojto | 115:87f2f5183dfb | 197 | */ |
Kojto | 115:87f2f5183dfb | 198 | |
Kojto | 115:87f2f5183dfb | 199 | /** @defgroup SDMMC_LL_Hardware_Flow_Control Hardware Flow Control |
Kojto | 115:87f2f5183dfb | 200 | * @{ |
Kojto | 115:87f2f5183dfb | 201 | */ |
Kojto | 115:87f2f5183dfb | 202 | #define SDMMC_HARDWARE_FLOW_CONTROL_DISABLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 203 | #define SDMMC_HARDWARE_FLOW_CONTROL_ENABLE SDMMC_CLKCR_HWFC_EN |
Kojto | 115:87f2f5183dfb | 204 | |
Kojto | 115:87f2f5183dfb | 205 | #define IS_SDMMC_HARDWARE_FLOW_CONTROL(CONTROL) (((CONTROL) == SDMMC_HARDWARE_FLOW_CONTROL_DISABLE) || \ |
Kojto | 115:87f2f5183dfb | 206 | ((CONTROL) == SDMMC_HARDWARE_FLOW_CONTROL_ENABLE)) |
Kojto | 115:87f2f5183dfb | 207 | /** |
Kojto | 115:87f2f5183dfb | 208 | * @} |
Kojto | 115:87f2f5183dfb | 209 | */ |
Kojto | 115:87f2f5183dfb | 210 | |
Kojto | 115:87f2f5183dfb | 211 | /** @defgroup SDMMC_LL_Clock_Division Clock Division |
Kojto | 115:87f2f5183dfb | 212 | * @{ |
Kojto | 115:87f2f5183dfb | 213 | */ |
Kojto | 115:87f2f5183dfb | 214 | #define IS_SDMMC_CLKDIV(DIV) ((DIV) <= 0xFF) |
Kojto | 115:87f2f5183dfb | 215 | /** |
Kojto | 115:87f2f5183dfb | 216 | * @} |
Kojto | 115:87f2f5183dfb | 217 | */ |
Kojto | 115:87f2f5183dfb | 218 | |
Kojto | 115:87f2f5183dfb | 219 | /** @defgroup SDMMC_LL_Command_Index Command Index |
Kojto | 115:87f2f5183dfb | 220 | * @{ |
Kojto | 115:87f2f5183dfb | 221 | */ |
Kojto | 115:87f2f5183dfb | 222 | #define IS_SDMMC_CMD_INDEX(INDEX) ((INDEX) < 0x40) |
Kojto | 115:87f2f5183dfb | 223 | /** |
Kojto | 115:87f2f5183dfb | 224 | * @} |
Kojto | 115:87f2f5183dfb | 225 | */ |
Kojto | 115:87f2f5183dfb | 226 | |
Kojto | 115:87f2f5183dfb | 227 | /** @defgroup SDMMC_LL_Response_Type Response Type |
Kojto | 115:87f2f5183dfb | 228 | * @{ |
Kojto | 115:87f2f5183dfb | 229 | */ |
Kojto | 115:87f2f5183dfb | 230 | #define SDMMC_RESPONSE_NO ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 231 | #define SDMMC_RESPONSE_SHORT SDMMC_CMD_WAITRESP_0 |
Kojto | 115:87f2f5183dfb | 232 | #define SDMMC_RESPONSE_LONG SDMMC_CMD_WAITRESP |
Kojto | 115:87f2f5183dfb | 233 | |
Kojto | 115:87f2f5183dfb | 234 | #define IS_SDMMC_RESPONSE(RESPONSE) (((RESPONSE) == SDMMC_RESPONSE_NO) || \ |
Kojto | 115:87f2f5183dfb | 235 | ((RESPONSE) == SDMMC_RESPONSE_SHORT) || \ |
Kojto | 115:87f2f5183dfb | 236 | ((RESPONSE) == SDMMC_RESPONSE_LONG)) |
Kojto | 115:87f2f5183dfb | 237 | /** |
Kojto | 115:87f2f5183dfb | 238 | * @} |
Kojto | 115:87f2f5183dfb | 239 | */ |
Kojto | 115:87f2f5183dfb | 240 | |
Kojto | 115:87f2f5183dfb | 241 | /** @defgroup SDMMC_LL_Wait_Interrupt_State Wait Interrupt |
Kojto | 115:87f2f5183dfb | 242 | * @{ |
Kojto | 115:87f2f5183dfb | 243 | */ |
Kojto | 115:87f2f5183dfb | 244 | #define SDMMC_WAIT_NO ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 245 | #define SDMMC_WAIT_IT SDMMC_CMD_WAITINT |
Kojto | 115:87f2f5183dfb | 246 | #define SDMMC_WAIT_PEND SDMMC_CMD_WAITPEND |
Kojto | 115:87f2f5183dfb | 247 | |
Kojto | 115:87f2f5183dfb | 248 | #define IS_SDMMC_WAIT(WAIT) (((WAIT) == SDMMC_WAIT_NO) || \ |
Kojto | 115:87f2f5183dfb | 249 | ((WAIT) == SDMMC_WAIT_IT) || \ |
Kojto | 115:87f2f5183dfb | 250 | ((WAIT) == SDMMC_WAIT_PEND)) |
Kojto | 115:87f2f5183dfb | 251 | /** |
Kojto | 115:87f2f5183dfb | 252 | * @} |
Kojto | 115:87f2f5183dfb | 253 | */ |
Kojto | 115:87f2f5183dfb | 254 | |
Kojto | 115:87f2f5183dfb | 255 | /** @defgroup SDMMC_LL_CPSM_State CPSM State |
Kojto | 115:87f2f5183dfb | 256 | * @{ |
Kojto | 115:87f2f5183dfb | 257 | */ |
Kojto | 115:87f2f5183dfb | 258 | #define SDMMC_CPSM_DISABLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 259 | #define SDMMC_CPSM_ENABLE SDMMC_CMD_CPSMEN |
Kojto | 115:87f2f5183dfb | 260 | |
Kojto | 115:87f2f5183dfb | 261 | #define IS_SDMMC_CPSM(CPSM) (((CPSM) == SDMMC_CPSM_DISABLE) || \ |
Kojto | 115:87f2f5183dfb | 262 | ((CPSM) == SDMMC_CPSM_ENABLE)) |
Kojto | 115:87f2f5183dfb | 263 | /** |
Kojto | 115:87f2f5183dfb | 264 | * @} |
Kojto | 115:87f2f5183dfb | 265 | */ |
Kojto | 115:87f2f5183dfb | 266 | |
Kojto | 115:87f2f5183dfb | 267 | /** @defgroup SDMMC_LL_Response_Registers Response Register |
Kojto | 115:87f2f5183dfb | 268 | * @{ |
Kojto | 115:87f2f5183dfb | 269 | */ |
Kojto | 115:87f2f5183dfb | 270 | #define SDMMC_RESP1 ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 271 | #define SDMMC_RESP2 ((uint32_t)0x00000004) |
Kojto | 115:87f2f5183dfb | 272 | #define SDMMC_RESP3 ((uint32_t)0x00000008) |
Kojto | 115:87f2f5183dfb | 273 | #define SDMMC_RESP4 ((uint32_t)0x0000000C) |
Kojto | 115:87f2f5183dfb | 274 | |
Kojto | 115:87f2f5183dfb | 275 | #define IS_SDMMC_RESP(RESP) (((RESP) == SDMMC_RESP1) || \ |
Kojto | 115:87f2f5183dfb | 276 | ((RESP) == SDMMC_RESP2) || \ |
Kojto | 115:87f2f5183dfb | 277 | ((RESP) == SDMMC_RESP3) || \ |
Kojto | 115:87f2f5183dfb | 278 | ((RESP) == SDMMC_RESP4)) |
Kojto | 115:87f2f5183dfb | 279 | /** |
Kojto | 115:87f2f5183dfb | 280 | * @} |
Kojto | 115:87f2f5183dfb | 281 | */ |
Kojto | 115:87f2f5183dfb | 282 | |
Kojto | 115:87f2f5183dfb | 283 | /** @defgroup SDMMC_LL_Data_Length Data Lenght |
Kojto | 115:87f2f5183dfb | 284 | * @{ |
Kojto | 115:87f2f5183dfb | 285 | */ |
Kojto | 115:87f2f5183dfb | 286 | #define IS_SDMMC_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF) |
Kojto | 115:87f2f5183dfb | 287 | /** |
Kojto | 115:87f2f5183dfb | 288 | * @} |
Kojto | 115:87f2f5183dfb | 289 | */ |
Kojto | 115:87f2f5183dfb | 290 | |
Kojto | 115:87f2f5183dfb | 291 | /** @defgroup SDMMC_LL_Data_Block_Size Data Block Size |
Kojto | 115:87f2f5183dfb | 292 | * @{ |
Kojto | 115:87f2f5183dfb | 293 | */ |
Kojto | 115:87f2f5183dfb | 294 | #define SDMMC_DATABLOCK_SIZE_1B ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 295 | #define SDMMC_DATABLOCK_SIZE_2B SDMMC_DCTRL_DBLOCKSIZE_0 |
Kojto | 115:87f2f5183dfb | 296 | #define SDMMC_DATABLOCK_SIZE_4B SDMMC_DCTRL_DBLOCKSIZE_1 |
Kojto | 115:87f2f5183dfb | 297 | #define SDMMC_DATABLOCK_SIZE_8B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_1) |
Kojto | 115:87f2f5183dfb | 298 | #define SDMMC_DATABLOCK_SIZE_16B SDMMC_DCTRL_DBLOCKSIZE_2 |
Kojto | 115:87f2f5183dfb | 299 | #define SDMMC_DATABLOCK_SIZE_32B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_2) |
Kojto | 115:87f2f5183dfb | 300 | #define SDMMC_DATABLOCK_SIZE_64B (SDMMC_DCTRL_DBLOCKSIZE_1|SDMMC_DCTRL_DBLOCKSIZE_2) |
Kojto | 115:87f2f5183dfb | 301 | #define SDMMC_DATABLOCK_SIZE_128B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_1|SDMMC_DCTRL_DBLOCKSIZE_2) |
Kojto | 115:87f2f5183dfb | 302 | #define SDMMC_DATABLOCK_SIZE_256B SDMMC_DCTRL_DBLOCKSIZE_3 |
Kojto | 115:87f2f5183dfb | 303 | #define SDMMC_DATABLOCK_SIZE_512B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 304 | #define SDMMC_DATABLOCK_SIZE_1024B (SDMMC_DCTRL_DBLOCKSIZE_1|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 305 | #define SDMMC_DATABLOCK_SIZE_2048B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_1|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 306 | #define SDMMC_DATABLOCK_SIZE_4096B (SDMMC_DCTRL_DBLOCKSIZE_2|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 307 | #define SDMMC_DATABLOCK_SIZE_8192B (SDMMC_DCTRL_DBLOCKSIZE_0|SDMMC_DCTRL_DBLOCKSIZE_2|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 308 | #define SDMMC_DATABLOCK_SIZE_16384B (SDMMC_DCTRL_DBLOCKSIZE_1|SDMMC_DCTRL_DBLOCKSIZE_2|SDMMC_DCTRL_DBLOCKSIZE_3) |
Kojto | 115:87f2f5183dfb | 309 | |
Kojto | 115:87f2f5183dfb | 310 | #define IS_SDMMC_BLOCK_SIZE(SIZE) (((SIZE) == SDMMC_DATABLOCK_SIZE_1B) || \ |
Kojto | 115:87f2f5183dfb | 311 | ((SIZE) == SDMMC_DATABLOCK_SIZE_2B) || \ |
Kojto | 115:87f2f5183dfb | 312 | ((SIZE) == SDMMC_DATABLOCK_SIZE_4B) || \ |
Kojto | 115:87f2f5183dfb | 313 | ((SIZE) == SDMMC_DATABLOCK_SIZE_8B) || \ |
Kojto | 115:87f2f5183dfb | 314 | ((SIZE) == SDMMC_DATABLOCK_SIZE_16B) || \ |
Kojto | 115:87f2f5183dfb | 315 | ((SIZE) == SDMMC_DATABLOCK_SIZE_32B) || \ |
Kojto | 115:87f2f5183dfb | 316 | ((SIZE) == SDMMC_DATABLOCK_SIZE_64B) || \ |
Kojto | 115:87f2f5183dfb | 317 | ((SIZE) == SDMMC_DATABLOCK_SIZE_128B) || \ |
Kojto | 115:87f2f5183dfb | 318 | ((SIZE) == SDMMC_DATABLOCK_SIZE_256B) || \ |
Kojto | 115:87f2f5183dfb | 319 | ((SIZE) == SDMMC_DATABLOCK_SIZE_512B) || \ |
Kojto | 115:87f2f5183dfb | 320 | ((SIZE) == SDMMC_DATABLOCK_SIZE_1024B) || \ |
Kojto | 115:87f2f5183dfb | 321 | ((SIZE) == SDMMC_DATABLOCK_SIZE_2048B) || \ |
Kojto | 115:87f2f5183dfb | 322 | ((SIZE) == SDMMC_DATABLOCK_SIZE_4096B) || \ |
Kojto | 115:87f2f5183dfb | 323 | ((SIZE) == SDMMC_DATABLOCK_SIZE_8192B) || \ |
Kojto | 115:87f2f5183dfb | 324 | ((SIZE) == SDMMC_DATABLOCK_SIZE_16384B)) |
Kojto | 115:87f2f5183dfb | 325 | /** |
Kojto | 115:87f2f5183dfb | 326 | * @} |
Kojto | 115:87f2f5183dfb | 327 | */ |
Kojto | 115:87f2f5183dfb | 328 | |
Kojto | 115:87f2f5183dfb | 329 | /** @defgroup SDMMC_LL_Transfer_Direction Transfer Direction |
Kojto | 115:87f2f5183dfb | 330 | * @{ |
Kojto | 115:87f2f5183dfb | 331 | */ |
Kojto | 115:87f2f5183dfb | 332 | #define SDMMC_TRANSFER_DIR_TO_CARD ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 333 | #define SDMMC_TRANSFER_DIR_TO_SDMMC SDMMC_DCTRL_DTDIR |
Kojto | 115:87f2f5183dfb | 334 | |
Kojto | 115:87f2f5183dfb | 335 | #define IS_SDMMC_TRANSFER_DIR(DIR) (((DIR) == SDMMC_TRANSFER_DIR_TO_CARD) || \ |
Kojto | 115:87f2f5183dfb | 336 | ((DIR) == SDMMC_TRANSFER_DIR_TO_SDMMC)) |
Kojto | 115:87f2f5183dfb | 337 | /** |
Kojto | 115:87f2f5183dfb | 338 | * @} |
Kojto | 115:87f2f5183dfb | 339 | */ |
Kojto | 115:87f2f5183dfb | 340 | |
Kojto | 115:87f2f5183dfb | 341 | /** @defgroup SDMMC_LL_Transfer_Type Transfer Type |
Kojto | 115:87f2f5183dfb | 342 | * @{ |
Kojto | 115:87f2f5183dfb | 343 | */ |
Kojto | 115:87f2f5183dfb | 344 | #define SDMMC_TRANSFER_MODE_BLOCK ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 345 | #define SDMMC_TRANSFER_MODE_STREAM SDMMC_DCTRL_DTMODE |
Kojto | 115:87f2f5183dfb | 346 | |
Kojto | 115:87f2f5183dfb | 347 | #define IS_SDMMC_TRANSFER_MODE(MODE) (((MODE) == SDMMC_TRANSFER_MODE_BLOCK) || \ |
Kojto | 115:87f2f5183dfb | 348 | ((MODE) == SDMMC_TRANSFER_MODE_STREAM)) |
Kojto | 115:87f2f5183dfb | 349 | /** |
Kojto | 115:87f2f5183dfb | 350 | * @} |
Kojto | 115:87f2f5183dfb | 351 | */ |
Kojto | 115:87f2f5183dfb | 352 | |
Kojto | 115:87f2f5183dfb | 353 | /** @defgroup SDMMC_LL_DPSM_State DPSM State |
Kojto | 115:87f2f5183dfb | 354 | * @{ |
Kojto | 115:87f2f5183dfb | 355 | */ |
Kojto | 115:87f2f5183dfb | 356 | #define SDMMC_DPSM_DISABLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 357 | #define SDMMC_DPSM_ENABLE SDMMC_DCTRL_DTEN |
Kojto | 115:87f2f5183dfb | 358 | |
Kojto | 115:87f2f5183dfb | 359 | #define IS_SDMMC_DPSM(DPSM) (((DPSM) == SDMMC_DPSM_DISABLE) ||\ |
Kojto | 115:87f2f5183dfb | 360 | ((DPSM) == SDMMC_DPSM_ENABLE)) |
Kojto | 115:87f2f5183dfb | 361 | /** |
Kojto | 115:87f2f5183dfb | 362 | * @} |
Kojto | 115:87f2f5183dfb | 363 | */ |
Kojto | 115:87f2f5183dfb | 364 | |
Kojto | 115:87f2f5183dfb | 365 | /** @defgroup SDMMC_LL_Read_Wait_Mode Read Wait Mode |
Kojto | 115:87f2f5183dfb | 366 | * @{ |
Kojto | 115:87f2f5183dfb | 367 | */ |
Kojto | 115:87f2f5183dfb | 368 | #define SDMMC_READ_WAIT_MODE_DATA2 ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 369 | #define SDMMC_READ_WAIT_MODE_CLK (SDMMC_DCTRL_RWMOD) |
Kojto | 115:87f2f5183dfb | 370 | |
Kojto | 115:87f2f5183dfb | 371 | #define IS_SDMMC_READWAIT_MODE(MODE) (((MODE) == SDMMC_READ_WAIT_MODE_CLK) || \ |
Kojto | 115:87f2f5183dfb | 372 | ((MODE) == SDMMC_READ_WAIT_MODE_DATA2)) |
Kojto | 115:87f2f5183dfb | 373 | /** |
Kojto | 115:87f2f5183dfb | 374 | * @} |
Kojto | 115:87f2f5183dfb | 375 | */ |
Kojto | 115:87f2f5183dfb | 376 | |
Kojto | 115:87f2f5183dfb | 377 | /** @defgroup SDMMC_LL_Interrupt_sources Interrupt Sources |
Kojto | 115:87f2f5183dfb | 378 | * @{ |
Kojto | 115:87f2f5183dfb | 379 | */ |
Kojto | 115:87f2f5183dfb | 380 | #define SDMMC_IT_CCRCFAIL SDMMC_STA_CCRCFAIL |
Kojto | 115:87f2f5183dfb | 381 | #define SDMMC_IT_DCRCFAIL SDMMC_STA_DCRCFAIL |
Kojto | 115:87f2f5183dfb | 382 | #define SDMMC_IT_CTIMEOUT SDMMC_STA_CTIMEOUT |
Kojto | 115:87f2f5183dfb | 383 | #define SDMMC_IT_DTIMEOUT SDMMC_STA_DTIMEOUT |
Kojto | 115:87f2f5183dfb | 384 | #define SDMMC_IT_TXUNDERR SDMMC_STA_TXUNDERR |
Kojto | 115:87f2f5183dfb | 385 | #define SDMMC_IT_RXOVERR SDMMC_STA_RXOVERR |
Kojto | 115:87f2f5183dfb | 386 | #define SDMMC_IT_CMDREND SDMMC_STA_CMDREND |
Kojto | 115:87f2f5183dfb | 387 | #define SDMMC_IT_CMDSENT SDMMC_STA_CMDSENT |
Kojto | 115:87f2f5183dfb | 388 | #define SDMMC_IT_DATAEND SDMMC_STA_DATAEND |
Kojto | 115:87f2f5183dfb | 389 | #define SDMMC_IT_DBCKEND SDMMC_STA_DBCKEND |
Kojto | 115:87f2f5183dfb | 390 | #define SDMMC_IT_CMDACT SDMMC_STA_CMDACT |
Kojto | 115:87f2f5183dfb | 391 | #define SDMMC_IT_TXACT SDMMC_STA_TXACT |
Kojto | 115:87f2f5183dfb | 392 | #define SDMMC_IT_RXACT SDMMC_STA_RXACT |
Kojto | 115:87f2f5183dfb | 393 | #define SDMMC_IT_TXFIFOHE SDMMC_STA_TXFIFOHE |
Kojto | 115:87f2f5183dfb | 394 | #define SDMMC_IT_RXFIFOHF SDMMC_STA_RXFIFOHF |
Kojto | 115:87f2f5183dfb | 395 | #define SDMMC_IT_TXFIFOF SDMMC_STA_TXFIFOF |
Kojto | 115:87f2f5183dfb | 396 | #define SDMMC_IT_RXFIFOF SDMMC_STA_RXFIFOF |
Kojto | 115:87f2f5183dfb | 397 | #define SDMMC_IT_TXFIFOE SDMMC_STA_TXFIFOE |
Kojto | 115:87f2f5183dfb | 398 | #define SDMMC_IT_RXFIFOE SDMMC_STA_RXFIFOE |
Kojto | 115:87f2f5183dfb | 399 | #define SDMMC_IT_TXDAVL SDMMC_STA_TXDAVL |
Kojto | 115:87f2f5183dfb | 400 | #define SDMMC_IT_RXDAVL SDMMC_STA_RXDAVL |
Kojto | 115:87f2f5183dfb | 401 | #define SDMMC_IT_SDIOIT SDMMC_STA_SDIOIT |
Kojto | 115:87f2f5183dfb | 402 | /** |
Kojto | 115:87f2f5183dfb | 403 | * @} |
Kojto | 115:87f2f5183dfb | 404 | */ |
Kojto | 115:87f2f5183dfb | 405 | |
Kojto | 115:87f2f5183dfb | 406 | /** @defgroup SDMMC_LL_Flags Flags |
Kojto | 115:87f2f5183dfb | 407 | * @{ |
Kojto | 115:87f2f5183dfb | 408 | */ |
Kojto | 115:87f2f5183dfb | 409 | #define SDMMC_FLAG_CCRCFAIL SDMMC_STA_CCRCFAIL |
Kojto | 115:87f2f5183dfb | 410 | #define SDMMC_FLAG_DCRCFAIL SDMMC_STA_DCRCFAIL |
Kojto | 115:87f2f5183dfb | 411 | #define SDMMC_FLAG_CTIMEOUT SDMMC_STA_CTIMEOUT |
Kojto | 115:87f2f5183dfb | 412 | #define SDMMC_FLAG_DTIMEOUT SDMMC_STA_DTIMEOUT |
Kojto | 115:87f2f5183dfb | 413 | #define SDMMC_FLAG_TXUNDERR SDMMC_STA_TXUNDERR |
Kojto | 115:87f2f5183dfb | 414 | #define SDMMC_FLAG_RXOVERR SDMMC_STA_RXOVERR |
Kojto | 115:87f2f5183dfb | 415 | #define SDMMC_FLAG_CMDREND SDMMC_STA_CMDREND |
Kojto | 115:87f2f5183dfb | 416 | #define SDMMC_FLAG_CMDSENT SDMMC_STA_CMDSENT |
Kojto | 115:87f2f5183dfb | 417 | #define SDMMC_FLAG_DATAEND SDMMC_STA_DATAEND |
Kojto | 115:87f2f5183dfb | 418 | #define SDMMC_FLAG_DBCKEND SDMMC_STA_DBCKEND |
Kojto | 115:87f2f5183dfb | 419 | #define SDMMC_FLAG_CMDACT SDMMC_STA_CMDACT |
Kojto | 115:87f2f5183dfb | 420 | #define SDMMC_FLAG_TXACT SDMMC_STA_TXACT |
Kojto | 115:87f2f5183dfb | 421 | #define SDMMC_FLAG_RXACT SDMMC_STA_RXACT |
Kojto | 115:87f2f5183dfb | 422 | #define SDMMC_FLAG_TXFIFOHE SDMMC_STA_TXFIFOHE |
Kojto | 115:87f2f5183dfb | 423 | #define SDMMC_FLAG_RXFIFOHF SDMMC_STA_RXFIFOHF |
Kojto | 115:87f2f5183dfb | 424 | #define SDMMC_FLAG_TXFIFOF SDMMC_STA_TXFIFOF |
Kojto | 115:87f2f5183dfb | 425 | #define SDMMC_FLAG_RXFIFOF SDMMC_STA_RXFIFOF |
Kojto | 115:87f2f5183dfb | 426 | #define SDMMC_FLAG_TXFIFOE SDMMC_STA_TXFIFOE |
Kojto | 115:87f2f5183dfb | 427 | #define SDMMC_FLAG_RXFIFOE SDMMC_STA_RXFIFOE |
Kojto | 115:87f2f5183dfb | 428 | #define SDMMC_FLAG_TXDAVL SDMMC_STA_TXDAVL |
Kojto | 115:87f2f5183dfb | 429 | #define SDMMC_FLAG_RXDAVL SDMMC_STA_RXDAVL |
Kojto | 115:87f2f5183dfb | 430 | #define SDMMC_FLAG_SDIOIT SDMMC_STA_SDIOIT |
Kojto | 115:87f2f5183dfb | 431 | /** |
Kojto | 115:87f2f5183dfb | 432 | * @} |
Kojto | 115:87f2f5183dfb | 433 | */ |
Kojto | 115:87f2f5183dfb | 434 | |
Kojto | 115:87f2f5183dfb | 435 | /** |
Kojto | 115:87f2f5183dfb | 436 | * @} |
Kojto | 115:87f2f5183dfb | 437 | */ |
Kojto | 115:87f2f5183dfb | 438 | |
Kojto | 115:87f2f5183dfb | 439 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 440 | /** @defgroup SDMMC_LL_Exported_macros SDMMC_LL Exported Macros |
Kojto | 115:87f2f5183dfb | 441 | * @{ |
Kojto | 115:87f2f5183dfb | 442 | */ |
Kojto | 115:87f2f5183dfb | 443 | |
Kojto | 115:87f2f5183dfb | 444 | /** @defgroup SDMMC_LL_Register Bits And Addresses Definitions |
Kojto | 115:87f2f5183dfb | 445 | * @brief SDMMC_LL registers bit address in the alias region |
Kojto | 115:87f2f5183dfb | 446 | * @{ |
Kojto | 115:87f2f5183dfb | 447 | */ |
Kojto | 115:87f2f5183dfb | 448 | /* ---------------------- SDMMC registers bit mask --------------------------- */ |
Kojto | 115:87f2f5183dfb | 449 | /* --- CLKCR Register ---*/ |
Kojto | 115:87f2f5183dfb | 450 | /* CLKCR register clear mask */ |
Kojto | 115:87f2f5183dfb | 451 | #define CLKCR_CLEAR_MASK ((uint32_t)(SDMMC_CLKCR_CLKDIV | SDMMC_CLKCR_PWRSAV |\ |
Kojto | 115:87f2f5183dfb | 452 | SDMMC_CLKCR_BYPASS | SDMMC_CLKCR_WIDBUS |\ |
Kojto | 115:87f2f5183dfb | 453 | SDMMC_CLKCR_NEGEDGE | SDMMC_CLKCR_HWFC_EN)) |
Kojto | 115:87f2f5183dfb | 454 | |
Kojto | 115:87f2f5183dfb | 455 | /* --- DCTRL Register ---*/ |
Kojto | 115:87f2f5183dfb | 456 | /* SDMMC DCTRL Clear Mask */ |
Kojto | 115:87f2f5183dfb | 457 | #define DCTRL_CLEAR_MASK ((uint32_t)(SDMMC_DCTRL_DTEN | SDMMC_DCTRL_DTDIR |\ |
Kojto | 115:87f2f5183dfb | 458 | SDMMC_DCTRL_DTMODE | SDMMC_DCTRL_DBLOCKSIZE)) |
Kojto | 115:87f2f5183dfb | 459 | |
Kojto | 115:87f2f5183dfb | 460 | /* --- CMD Register ---*/ |
Kojto | 115:87f2f5183dfb | 461 | /* CMD Register clear mask */ |
Kojto | 115:87f2f5183dfb | 462 | #define CMD_CLEAR_MASK ((uint32_t)(SDMMC_CMD_CMDINDEX | SDMMC_CMD_WAITRESP |\ |
Kojto | 115:87f2f5183dfb | 463 | SDMMC_CMD_WAITINT | SDMMC_CMD_WAITPEND |\ |
Kojto | 115:87f2f5183dfb | 464 | SDMMC_CMD_CPSMEN | SDMMC_CMD_SDIOSUSPEND)) |
Kojto | 115:87f2f5183dfb | 465 | |
Kojto | 115:87f2f5183dfb | 466 | /* SDMMC Initialization Frequency (400KHz max) */ |
Kojto | 115:87f2f5183dfb | 467 | #define SDMMC_INIT_CLK_DIV ((uint8_t)0x76) |
Kojto | 115:87f2f5183dfb | 468 | |
Kojto | 115:87f2f5183dfb | 469 | /* SDMMC Data Transfer Frequency (25MHz max) */ |
Kojto | 115:87f2f5183dfb | 470 | #define SDMMC_TRANSFER_CLK_DIV ((uint8_t)0x0) |
Kojto | 115:87f2f5183dfb | 471 | |
Kojto | 115:87f2f5183dfb | 472 | /** |
Kojto | 115:87f2f5183dfb | 473 | * @} |
Kojto | 115:87f2f5183dfb | 474 | */ |
Kojto | 115:87f2f5183dfb | 475 | |
Kojto | 115:87f2f5183dfb | 476 | /** @defgroup SDMMC_LL_Interrupt_Clock Interrupt And Clock Configuration |
Kojto | 115:87f2f5183dfb | 477 | * @brief macros to handle interrupts and specific clock configurations |
Kojto | 115:87f2f5183dfb | 478 | * @{ |
Kojto | 115:87f2f5183dfb | 479 | */ |
Kojto | 115:87f2f5183dfb | 480 | |
Kojto | 115:87f2f5183dfb | 481 | /** |
Kojto | 115:87f2f5183dfb | 482 | * @brief Enable the SDMMC device. |
Kojto | 115:87f2f5183dfb | 483 | * @param __INSTANCE__: SDMMC Instance |
Kojto | 115:87f2f5183dfb | 484 | * @retval None |
Kojto | 115:87f2f5183dfb | 485 | */ |
Kojto | 115:87f2f5183dfb | 486 | #define __SDMMC_ENABLE(__INSTANCE__) ((__INSTANCE__)->CLKCR |= SDMMC_CLKCR_CLKEN) |
Kojto | 115:87f2f5183dfb | 487 | |
Kojto | 115:87f2f5183dfb | 488 | /** |
Kojto | 115:87f2f5183dfb | 489 | * @brief Disable the SDMMC device. |
Kojto | 115:87f2f5183dfb | 490 | * @param __INSTANCE__: SDMMC Instance |
Kojto | 115:87f2f5183dfb | 491 | * @retval None |
Kojto | 115:87f2f5183dfb | 492 | */ |
Kojto | 115:87f2f5183dfb | 493 | #define __SDMMC_DISABLE(__INSTANCE__) ((__INSTANCE__)->CLKCR &= ~SDMMC_CLKCR_CLKEN) |
Kojto | 115:87f2f5183dfb | 494 | |
Kojto | 115:87f2f5183dfb | 495 | /** |
Kojto | 115:87f2f5183dfb | 496 | * @brief Enable the SDMMC DMA transfer. |
Kojto | 115:87f2f5183dfb | 497 | * @param __INSTANCE__: SDMMC Instance |
Kojto | 115:87f2f5183dfb | 498 | * @retval None |
Kojto | 115:87f2f5183dfb | 499 | */ |
Kojto | 115:87f2f5183dfb | 500 | #define __SDMMC_DMA_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDMMC_DCTRL_DMAEN) |
Kojto | 115:87f2f5183dfb | 501 | /** |
Kojto | 115:87f2f5183dfb | 502 | * @brief Disable the SDMMC DMA transfer. |
Kojto | 115:87f2f5183dfb | 503 | * @param __INSTANCE__: SDMMC Instance |
Kojto | 115:87f2f5183dfb | 504 | * @retval None |
Kojto | 115:87f2f5183dfb | 505 | */ |
Kojto | 115:87f2f5183dfb | 506 | #define __SDMMC_DMA_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDMMC_DCTRL_DMAEN) |
Kojto | 115:87f2f5183dfb | 507 | |
Kojto | 115:87f2f5183dfb | 508 | /** |
Kojto | 115:87f2f5183dfb | 509 | * @brief Enable the SDMMC device interrupt. |
Kojto | 115:87f2f5183dfb | 510 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 511 | * @param __INTERRUPT__ : specifies the SDMMC interrupt sources to be enabled. |
Kojto | 115:87f2f5183dfb | 512 | * This parameter can be one or a combination of the following values: |
Kojto | 115:87f2f5183dfb | 513 | * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 514 | * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 515 | * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt |
Kojto | 115:87f2f5183dfb | 516 | * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt |
Kojto | 115:87f2f5183dfb | 517 | * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt |
Kojto | 115:87f2f5183dfb | 518 | * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt |
Kojto | 115:87f2f5183dfb | 519 | * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 520 | * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt |
Kojto | 115:87f2f5183dfb | 521 | * @arg SDMMC_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt |
Kojto | 115:87f2f5183dfb | 522 | * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 523 | * @arg SDMMC_IT_CMDACT: Command transfer in progress interrupt |
Kojto | 115:87f2f5183dfb | 524 | * @arg SDMMC_IT_TXACT: Data transmit in progress interrupt |
Kojto | 115:87f2f5183dfb | 525 | * @arg SDMMC_IT_RXACT: Data receive in progress interrupt |
Kojto | 115:87f2f5183dfb | 526 | * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt |
Kojto | 115:87f2f5183dfb | 527 | * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt |
Kojto | 115:87f2f5183dfb | 528 | * @arg SDMMC_IT_TXFIFOF: Transmit FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 529 | * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 530 | * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 531 | * @arg SDMMC_IT_RXFIFOE: Receive FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 532 | * @arg SDMMC_IT_TXDAVL: Data available in transmit FIFO interrupt |
Kojto | 115:87f2f5183dfb | 533 | * @arg SDMMC_IT_RXDAVL: Data available in receive FIFO interrupt |
Kojto | 115:87f2f5183dfb | 534 | * @arg SDMMC_IT_SDIOIT: SD I/O interrupt received interrupt |
Kojto | 115:87f2f5183dfb | 535 | * @retval None |
Kojto | 115:87f2f5183dfb | 536 | */ |
Kojto | 115:87f2f5183dfb | 537 | #define __SDMMC_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK |= (__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 538 | |
Kojto | 115:87f2f5183dfb | 539 | /** |
Kojto | 115:87f2f5183dfb | 540 | * @brief Disable the SDMMC device interrupt. |
Kojto | 115:87f2f5183dfb | 541 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 542 | * @param __INTERRUPT__ : specifies the SDMMC interrupt sources to be disabled. |
Kojto | 115:87f2f5183dfb | 543 | * This parameter can be one or a combination of the following values: |
Kojto | 115:87f2f5183dfb | 544 | * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 545 | * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 546 | * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt |
Kojto | 115:87f2f5183dfb | 547 | * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt |
Kojto | 115:87f2f5183dfb | 548 | * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt |
Kojto | 115:87f2f5183dfb | 549 | * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt |
Kojto | 115:87f2f5183dfb | 550 | * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 551 | * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt |
Kojto | 115:87f2f5183dfb | 552 | * @arg SDMMC_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt |
Kojto | 115:87f2f5183dfb | 553 | * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 554 | * @arg SDMMC_IT_CMDACT: Command transfer in progress interrupt |
Kojto | 115:87f2f5183dfb | 555 | * @arg SDMMC_IT_TXACT: Data transmit in progress interrupt |
Kojto | 115:87f2f5183dfb | 556 | * @arg SDMMC_IT_RXACT: Data receive in progress interrupt |
Kojto | 115:87f2f5183dfb | 557 | * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt |
Kojto | 115:87f2f5183dfb | 558 | * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt |
Kojto | 115:87f2f5183dfb | 559 | * @arg SDMMC_IT_TXFIFOF: Transmit FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 560 | * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 561 | * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 562 | * @arg SDMMC_IT_RXFIFOE: Receive FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 563 | * @arg SDMMC_IT_TXDAVL: Data available in transmit FIFO interrupt |
Kojto | 115:87f2f5183dfb | 564 | * @arg SDMMC_IT_RXDAVL: Data available in receive FIFO interrupt |
Kojto | 115:87f2f5183dfb | 565 | * @arg SDMMC_IT_SDIOIT: SD I/O interrupt received interrupt |
Kojto | 115:87f2f5183dfb | 566 | * @retval None |
Kojto | 115:87f2f5183dfb | 567 | */ |
Kojto | 115:87f2f5183dfb | 568 | #define __SDMMC_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK &= ~(__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 569 | |
Kojto | 115:87f2f5183dfb | 570 | /** |
Kojto | 115:87f2f5183dfb | 571 | * @brief Checks whether the specified SDMMC flag is set or not. |
Kojto | 115:87f2f5183dfb | 572 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 573 | * @param __FLAG__: specifies the flag to check. |
Kojto | 115:87f2f5183dfb | 574 | * This parameter can be one of the following values: |
Kojto | 115:87f2f5183dfb | 575 | * @arg SDMMC_FLAG_CCRCFAIL: Command response received (CRC check failed) |
Kojto | 115:87f2f5183dfb | 576 | * @arg SDMMC_FLAG_DCRCFAIL: Data block sent/received (CRC check failed) |
Kojto | 115:87f2f5183dfb | 577 | * @arg SDMMC_FLAG_CTIMEOUT: Command response timeout |
Kojto | 115:87f2f5183dfb | 578 | * @arg SDMMC_FLAG_DTIMEOUT: Data timeout |
Kojto | 115:87f2f5183dfb | 579 | * @arg SDMMC_FLAG_TXUNDERR: Transmit FIFO underrun error |
Kojto | 115:87f2f5183dfb | 580 | * @arg SDMMC_FLAG_RXOVERR: Received FIFO overrun error |
Kojto | 115:87f2f5183dfb | 581 | * @arg SDMMC_FLAG_CMDREND: Command response received (CRC check passed) |
Kojto | 115:87f2f5183dfb | 582 | * @arg SDMMC_FLAG_CMDSENT: Command sent (no response required) |
Kojto | 115:87f2f5183dfb | 583 | * @arg SDMMC_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero) |
Kojto | 115:87f2f5183dfb | 584 | * @arg SDMMC_FLAG_DBCKEND: Data block sent/received (CRC check passed) |
Kojto | 115:87f2f5183dfb | 585 | * @arg SDMMC_FLAG_CMDACT: Command transfer in progress |
Kojto | 115:87f2f5183dfb | 586 | * @arg SDMMC_FLAG_TXACT: Data transmit in progress |
Kojto | 115:87f2f5183dfb | 587 | * @arg SDMMC_FLAG_RXACT: Data receive in progress |
Kojto | 115:87f2f5183dfb | 588 | * @arg SDMMC_FLAG_TXFIFOHE: Transmit FIFO Half Empty |
Kojto | 115:87f2f5183dfb | 589 | * @arg SDMMC_FLAG_RXFIFOHF: Receive FIFO Half Full |
Kojto | 115:87f2f5183dfb | 590 | * @arg SDMMC_FLAG_TXFIFOF: Transmit FIFO full |
Kojto | 115:87f2f5183dfb | 591 | * @arg SDMMC_FLAG_RXFIFOF: Receive FIFO full |
Kojto | 115:87f2f5183dfb | 592 | * @arg SDMMC_FLAG_TXFIFOE: Transmit FIFO empty |
Kojto | 115:87f2f5183dfb | 593 | * @arg SDMMC_FLAG_RXFIFOE: Receive FIFO empty |
Kojto | 115:87f2f5183dfb | 594 | * @arg SDMMC_FLAG_TXDAVL: Data available in transmit FIFO |
Kojto | 115:87f2f5183dfb | 595 | * @arg SDMMC_FLAG_RXDAVL: Data available in receive FIFO |
Kojto | 115:87f2f5183dfb | 596 | * @arg SDMMC_FLAG_SDMMCIT: SD I/O interrupt received |
Kojto | 115:87f2f5183dfb | 597 | * @retval The new state of SDMMC_FLAG (SET or RESET). |
Kojto | 115:87f2f5183dfb | 598 | */ |
Kojto | 115:87f2f5183dfb | 599 | #define __SDMMC_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->STA &(__FLAG__)) != RESET) |
Kojto | 115:87f2f5183dfb | 600 | |
Kojto | 115:87f2f5183dfb | 601 | |
Kojto | 115:87f2f5183dfb | 602 | /** |
Kojto | 115:87f2f5183dfb | 603 | * @brief Clears the SDMMC pending flags. |
Kojto | 115:87f2f5183dfb | 604 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 605 | * @param __FLAG__: specifies the flag to clear. |
Kojto | 115:87f2f5183dfb | 606 | * This parameter can be one or a combination of the following values: |
Kojto | 115:87f2f5183dfb | 607 | * @arg SDMMC_FLAG_CCRCFAIL: Command response received (CRC check failed) |
Kojto | 115:87f2f5183dfb | 608 | * @arg SDMMC_FLAG_DCRCFAIL: Data block sent/received (CRC check failed) |
Kojto | 115:87f2f5183dfb | 609 | * @arg SDMMC_FLAG_CTIMEOUT: Command response timeout |
Kojto | 115:87f2f5183dfb | 610 | * @arg SDMMC_FLAG_DTIMEOUT: Data timeout |
Kojto | 115:87f2f5183dfb | 611 | * @arg SDMMC_FLAG_TXUNDERR: Transmit FIFO underrun error |
Kojto | 115:87f2f5183dfb | 612 | * @arg SDMMC_FLAG_RXOVERR: Received FIFO overrun error |
Kojto | 115:87f2f5183dfb | 613 | * @arg SDMMC_FLAG_CMDREND: Command response received (CRC check passed) |
Kojto | 115:87f2f5183dfb | 614 | * @arg SDMMC_FLAG_CMDSENT: Command sent (no response required) |
Kojto | 115:87f2f5183dfb | 615 | * @arg SDMMC_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero) |
Kojto | 115:87f2f5183dfb | 616 | * @arg SDMMC_FLAG_DBCKEND: Data block sent/received (CRC check passed) |
Kojto | 115:87f2f5183dfb | 617 | * @arg SDMMC_FLAG_SDMMCIT: SD I/O interrupt received |
Kojto | 115:87f2f5183dfb | 618 | * @retval None |
Kojto | 115:87f2f5183dfb | 619 | */ |
Kojto | 115:87f2f5183dfb | 620 | #define __SDMMC_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->ICR = (__FLAG__)) |
Kojto | 115:87f2f5183dfb | 621 | |
Kojto | 115:87f2f5183dfb | 622 | /** |
Kojto | 115:87f2f5183dfb | 623 | * @brief Checks whether the specified SDMMC interrupt has occurred or not. |
Kojto | 115:87f2f5183dfb | 624 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 625 | * @param __INTERRUPT__: specifies the SDMMC interrupt source to check. |
Kojto | 115:87f2f5183dfb | 626 | * This parameter can be one of the following values: |
Kojto | 115:87f2f5183dfb | 627 | * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 628 | * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 629 | * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt |
Kojto | 115:87f2f5183dfb | 630 | * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt |
Kojto | 115:87f2f5183dfb | 631 | * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt |
Kojto | 115:87f2f5183dfb | 632 | * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt |
Kojto | 115:87f2f5183dfb | 633 | * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 634 | * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt |
Kojto | 115:87f2f5183dfb | 635 | * @arg SDMMC_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt |
Kojto | 115:87f2f5183dfb | 636 | * @arg SDMMC_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 637 | * @arg SDMMC_IT_CMDACT: Command transfer in progress interrupt |
Kojto | 115:87f2f5183dfb | 638 | * @arg SDMMC_IT_TXACT: Data transmit in progress interrupt |
Kojto | 115:87f2f5183dfb | 639 | * @arg SDMMC_IT_RXACT: Data receive in progress interrupt |
Kojto | 115:87f2f5183dfb | 640 | * @arg SDMMC_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt |
Kojto | 115:87f2f5183dfb | 641 | * @arg SDMMC_IT_RXFIFOHF: Receive FIFO Half Full interrupt |
Kojto | 115:87f2f5183dfb | 642 | * @arg SDMMC_IT_TXFIFOF: Transmit FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 643 | * @arg SDMMC_IT_RXFIFOF: Receive FIFO full interrupt |
Kojto | 115:87f2f5183dfb | 644 | * @arg SDMMC_IT_TXFIFOE: Transmit FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 645 | * @arg SDMMC_IT_RXFIFOE: Receive FIFO empty interrupt |
Kojto | 115:87f2f5183dfb | 646 | * @arg SDMMC_IT_TXDAVL: Data available in transmit FIFO interrupt |
Kojto | 115:87f2f5183dfb | 647 | * @arg SDMMC_IT_RXDAVL: Data available in receive FIFO interrupt |
Kojto | 115:87f2f5183dfb | 648 | * @arg SDMMC_IT_SDIOIT: SD I/O interrupt received interrupt |
Kojto | 115:87f2f5183dfb | 649 | * @retval The new state of SDMMC_IT (SET or RESET). |
Kojto | 115:87f2f5183dfb | 650 | */ |
Kojto | 115:87f2f5183dfb | 651 | #define __SDMMC_GET_IT (__INSTANCE__, __INTERRUPT__) (((__INSTANCE__)->STA &(__INTERRUPT__)) == (__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 652 | |
Kojto | 115:87f2f5183dfb | 653 | /** |
Kojto | 115:87f2f5183dfb | 654 | * @brief Clears the SDMMC's interrupt pending bits. |
Kojto | 115:87f2f5183dfb | 655 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 656 | * @param __INTERRUPT__: specifies the interrupt pending bit to clear. |
Kojto | 115:87f2f5183dfb | 657 | * This parameter can be one or a combination of the following values: |
Kojto | 115:87f2f5183dfb | 658 | * @arg SDMMC_IT_CCRCFAIL: Command response received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 659 | * @arg SDMMC_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt |
Kojto | 115:87f2f5183dfb | 660 | * @arg SDMMC_IT_CTIMEOUT: Command response timeout interrupt |
Kojto | 115:87f2f5183dfb | 661 | * @arg SDMMC_IT_DTIMEOUT: Data timeout interrupt |
Kojto | 115:87f2f5183dfb | 662 | * @arg SDMMC_IT_TXUNDERR: Transmit FIFO underrun error interrupt |
Kojto | 115:87f2f5183dfb | 663 | * @arg SDMMC_IT_RXOVERR: Received FIFO overrun error interrupt |
Kojto | 115:87f2f5183dfb | 664 | * @arg SDMMC_IT_CMDREND: Command response received (CRC check passed) interrupt |
Kojto | 115:87f2f5183dfb | 665 | * @arg SDMMC_IT_CMDSENT: Command sent (no response required) interrupt |
Kojto | 115:87f2f5183dfb | 666 | * @arg SDMMC_IT_DATAEND: Data end (data counter, SDMMC_DCOUNT, is zero) interrupt |
Kojto | 115:87f2f5183dfb | 667 | * @arg SDMMC_IT_SDIOIT: SD I/O interrupt received interrupt |
Kojto | 115:87f2f5183dfb | 668 | * @retval None |
Kojto | 115:87f2f5183dfb | 669 | */ |
Kojto | 115:87f2f5183dfb | 670 | #define __SDMMC_CLEAR_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->ICR = (__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 671 | |
Kojto | 115:87f2f5183dfb | 672 | /** |
Kojto | 115:87f2f5183dfb | 673 | * @brief Enable Start the SD I/O Read Wait operation. |
Kojto | 115:87f2f5183dfb | 674 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 675 | * @retval None |
Kojto | 115:87f2f5183dfb | 676 | */ |
Kojto | 115:87f2f5183dfb | 677 | #define __SDMMC_START_READWAIT_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDMMC_DCTRL_RWSTART) |
Kojto | 115:87f2f5183dfb | 678 | |
Kojto | 115:87f2f5183dfb | 679 | /** |
Kojto | 115:87f2f5183dfb | 680 | * @brief Disable Start the SD I/O Read Wait operations. |
Kojto | 115:87f2f5183dfb | 681 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 682 | * @retval None |
Kojto | 115:87f2f5183dfb | 683 | */ |
Kojto | 115:87f2f5183dfb | 684 | #define __SDMMC_START_READWAIT_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDMMC_DCTRL_RWSTART) |
Kojto | 115:87f2f5183dfb | 685 | |
Kojto | 115:87f2f5183dfb | 686 | /** |
Kojto | 115:87f2f5183dfb | 687 | * @brief Enable Start the SD I/O Read Wait operation. |
Kojto | 115:87f2f5183dfb | 688 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 689 | * @retval None |
Kojto | 115:87f2f5183dfb | 690 | */ |
Kojto | 115:87f2f5183dfb | 691 | #define __SDMMC_STOP_READWAIT_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDMMC_DCTRL_RWSTOP) |
Kojto | 115:87f2f5183dfb | 692 | |
Kojto | 115:87f2f5183dfb | 693 | /** |
Kojto | 115:87f2f5183dfb | 694 | * @brief Disable Stop the SD I/O Read Wait operations. |
Kojto | 115:87f2f5183dfb | 695 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 696 | * @retval None |
Kojto | 115:87f2f5183dfb | 697 | */ |
Kojto | 115:87f2f5183dfb | 698 | #define __SDMMC_STOP_READWAIT_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDMMC_DCTRL_RWSTOP) |
Kojto | 115:87f2f5183dfb | 699 | |
Kojto | 115:87f2f5183dfb | 700 | /** |
Kojto | 115:87f2f5183dfb | 701 | * @brief Enable the SD I/O Mode Operation. |
Kojto | 115:87f2f5183dfb | 702 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 703 | * @retval None |
Kojto | 115:87f2f5183dfb | 704 | */ |
Kojto | 115:87f2f5183dfb | 705 | #define __SDMMC_OPERATION_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDMMC_DCTRL_SDIOEN) |
Kojto | 115:87f2f5183dfb | 706 | |
Kojto | 115:87f2f5183dfb | 707 | /** |
Kojto | 115:87f2f5183dfb | 708 | * @brief Disable the SD I/O Mode Operation. |
Kojto | 115:87f2f5183dfb | 709 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 710 | * @retval None |
Kojto | 115:87f2f5183dfb | 711 | */ |
Kojto | 115:87f2f5183dfb | 712 | #define __SDMMC_OPERATION_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDMMC_DCTRL_SDIOEN) |
Kojto | 115:87f2f5183dfb | 713 | |
Kojto | 115:87f2f5183dfb | 714 | /** |
Kojto | 115:87f2f5183dfb | 715 | * @brief Enable the SD I/O Suspend command sending. |
Kojto | 115:87f2f5183dfb | 716 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 717 | * @retval None |
Kojto | 115:87f2f5183dfb | 718 | */ |
Kojto | 115:87f2f5183dfb | 719 | #define __SDMMC_SUSPEND_CMD_ENABLE(__INSTANCE__) ((__INSTANCE__)->CMD |= SDMMC_CMD_SDIOSUSPEND) |
Kojto | 115:87f2f5183dfb | 720 | |
Kojto | 115:87f2f5183dfb | 721 | /** |
Kojto | 115:87f2f5183dfb | 722 | * @brief Disable the SD I/O Suspend command sending. |
Kojto | 115:87f2f5183dfb | 723 | * @param __INSTANCE__ : Pointer to SDMMC register base |
Kojto | 115:87f2f5183dfb | 724 | * @retval None |
Kojto | 115:87f2f5183dfb | 725 | */ |
Kojto | 115:87f2f5183dfb | 726 | #define __SDMMC_SUSPEND_CMD_DISABLE(__INSTANCE__) ((__INSTANCE__)->CMD &= ~SDMMC_CMD_SDIOSUSPEND) |
Kojto | 115:87f2f5183dfb | 727 | |
Kojto | 115:87f2f5183dfb | 728 | /** |
Kojto | 115:87f2f5183dfb | 729 | * @} |
Kojto | 115:87f2f5183dfb | 730 | */ |
Kojto | 115:87f2f5183dfb | 731 | |
Kojto | 115:87f2f5183dfb | 732 | /** |
Kojto | 115:87f2f5183dfb | 733 | * @} |
Kojto | 115:87f2f5183dfb | 734 | */ |
Kojto | 115:87f2f5183dfb | 735 | |
Kojto | 115:87f2f5183dfb | 736 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 737 | /** @addtogroup SDMMC_LL_Exported_Functions |
Kojto | 115:87f2f5183dfb | 738 | * @{ |
Kojto | 115:87f2f5183dfb | 739 | */ |
Kojto | 115:87f2f5183dfb | 740 | |
Kojto | 115:87f2f5183dfb | 741 | /* Initialization/de-initialization functions **********************************/ |
Kojto | 115:87f2f5183dfb | 742 | /** @addtogroup HAL_SDMMC_LL_Group1 |
Kojto | 115:87f2f5183dfb | 743 | * @{ |
Kojto | 115:87f2f5183dfb | 744 | */ |
Kojto | 115:87f2f5183dfb | 745 | HAL_StatusTypeDef SDMMC_Init(SDMMC_TypeDef *SDMMCx, SDMMC_InitTypeDef Init); |
Kojto | 115:87f2f5183dfb | 746 | /** |
Kojto | 115:87f2f5183dfb | 747 | * @} |
Kojto | 115:87f2f5183dfb | 748 | */ |
Kojto | 115:87f2f5183dfb | 749 | |
Kojto | 115:87f2f5183dfb | 750 | /* I/O operation functions *****************************************************/ |
Kojto | 115:87f2f5183dfb | 751 | /** @addtogroup HAL_SDMMC_LL_Group2 |
Kojto | 115:87f2f5183dfb | 752 | * @{ |
Kojto | 115:87f2f5183dfb | 753 | */ |
Kojto | 115:87f2f5183dfb | 754 | /* Blocking mode: Polling */ |
Kojto | 115:87f2f5183dfb | 755 | uint32_t SDMMC_ReadFIFO(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 756 | HAL_StatusTypeDef SDMMC_WriteFIFO(SDMMC_TypeDef *SDMMCx, uint32_t *pWriteData); |
Kojto | 115:87f2f5183dfb | 757 | /** |
Kojto | 115:87f2f5183dfb | 758 | * @} |
Kojto | 115:87f2f5183dfb | 759 | */ |
Kojto | 115:87f2f5183dfb | 760 | |
Kojto | 115:87f2f5183dfb | 761 | /* Peripheral Control functions ************************************************/ |
Kojto | 115:87f2f5183dfb | 762 | /** @addtogroup HAL_SDMMC_LL_Group3 |
Kojto | 115:87f2f5183dfb | 763 | * @{ |
Kojto | 115:87f2f5183dfb | 764 | */ |
Kojto | 115:87f2f5183dfb | 765 | HAL_StatusTypeDef SDMMC_PowerState_ON(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 766 | HAL_StatusTypeDef SDMMC_PowerState_OFF(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 767 | uint32_t SDMMC_GetPowerState(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 768 | |
Kojto | 115:87f2f5183dfb | 769 | /* Command path state machine (CPSM) management functions */ |
Kojto | 115:87f2f5183dfb | 770 | HAL_StatusTypeDef SDMMC_SendCommand(SDMMC_TypeDef *SDMMCx, SDMMC_CmdInitTypeDef *Command); |
Kojto | 115:87f2f5183dfb | 771 | uint8_t SDMMC_GetCommandResponse(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 772 | uint32_t SDMMC_GetResponse(SDMMC_TypeDef *SDMMCx, uint32_t Response); |
Kojto | 115:87f2f5183dfb | 773 | |
Kojto | 115:87f2f5183dfb | 774 | /* Data path state machine (DPSM) management functions */ |
Kojto | 115:87f2f5183dfb | 775 | HAL_StatusTypeDef SDMMC_DataConfig(SDMMC_TypeDef *SDMMCx, SDMMC_DataInitTypeDef* Data); |
Kojto | 115:87f2f5183dfb | 776 | uint32_t SDMMC_GetDataCounter(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 777 | uint32_t SDMMC_GetFIFOCount(SDMMC_TypeDef *SDMMCx); |
Kojto | 115:87f2f5183dfb | 778 | |
Kojto | 115:87f2f5183dfb | 779 | /* SDMMC Cards mode management functions */ |
Kojto | 115:87f2f5183dfb | 780 | HAL_StatusTypeDef SDMMC_SetSDMMCReadWaitMode(SDMMC_TypeDef *SDMMCx, uint32_t SDMMC_ReadWaitMode); |
Kojto | 115:87f2f5183dfb | 781 | |
Kojto | 115:87f2f5183dfb | 782 | /** |
Kojto | 115:87f2f5183dfb | 783 | * @} |
Kojto | 115:87f2f5183dfb | 784 | */ |
Kojto | 115:87f2f5183dfb | 785 | |
Kojto | 115:87f2f5183dfb | 786 | /** |
Kojto | 115:87f2f5183dfb | 787 | * @} |
Kojto | 115:87f2f5183dfb | 788 | */ |
Kojto | 115:87f2f5183dfb | 789 | |
Kojto | 115:87f2f5183dfb | 790 | /** |
Kojto | 115:87f2f5183dfb | 791 | * @} |
Kojto | 115:87f2f5183dfb | 792 | */ |
Kojto | 115:87f2f5183dfb | 793 | |
Kojto | 115:87f2f5183dfb | 794 | /** |
Kojto | 115:87f2f5183dfb | 795 | * @} |
Kojto | 115:87f2f5183dfb | 796 | */ |
Kojto | 115:87f2f5183dfb | 797 | |
Kojto | 115:87f2f5183dfb | 798 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 799 | } |
Kojto | 115:87f2f5183dfb | 800 | #endif |
Kojto | 115:87f2f5183dfb | 801 | |
Kojto | 115:87f2f5183dfb | 802 | #endif /* __STM32F7xx_LL_SDMMC_H */ |
Kojto | 115:87f2f5183dfb | 803 | |
Kojto | 115:87f2f5183dfb | 804 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |