GameOpener / mbed-src

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Thu Mar 12 14:30:49 2015 +0000
Revision:
489:119543c9f674
Synchronized with git revision 051854181516992fb498d51f9ee6e70cbad9e083

Full URL: https://github.com/mbedmicro/mbed/commit/051854181516992fb498d51f9ee6e70cbad9e083/

Fix ksdk mcu HAL - stopbit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_ll_sdmmc.h
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief Header file of low layer SDMMC HAL module.
mbed_official 489:119543c9f674 8 ******************************************************************************
mbed_official 489:119543c9f674 9 * @attention
mbed_official 489:119543c9f674 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 14 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 16 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 19 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 21 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 22 * without specific prior written permission.
mbed_official 489:119543c9f674 23 *
mbed_official 489:119543c9f674 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 34 *
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 */
mbed_official 489:119543c9f674 37
mbed_official 489:119543c9f674 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 489:119543c9f674 39 #ifndef __stm32f1xx_LL_SD_H
mbed_official 489:119543c9f674 40 #define __stm32f1xx_LL_SD_H
mbed_official 489:119543c9f674 41
mbed_official 489:119543c9f674 42 #if defined(STM32F103xE) || defined(STM32F103xG)
mbed_official 489:119543c9f674 43
mbed_official 489:119543c9f674 44 #ifdef __cplusplus
mbed_official 489:119543c9f674 45 extern "C" {
mbed_official 489:119543c9f674 46 #endif
mbed_official 489:119543c9f674 47
mbed_official 489:119543c9f674 48 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 49 #include "stm32f1xx_hal_def.h"
mbed_official 489:119543c9f674 50
mbed_official 489:119543c9f674 51 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 52 * @{
mbed_official 489:119543c9f674 53 */
mbed_official 489:119543c9f674 54
mbed_official 489:119543c9f674 55 /** @addtogroup SDMMC_LL
mbed_official 489:119543c9f674 56 * @{
mbed_official 489:119543c9f674 57 */
mbed_official 489:119543c9f674 58
mbed_official 489:119543c9f674 59 /* Exported types ------------------------------------------------------------*/
mbed_official 489:119543c9f674 60 /** @defgroup SDMMC_LL_Exported_Types SDMMC_LL Exported Types
mbed_official 489:119543c9f674 61 * @{
mbed_official 489:119543c9f674 62 */
mbed_official 489:119543c9f674 63
mbed_official 489:119543c9f674 64 /**
mbed_official 489:119543c9f674 65 * @brief SDMMC Configuration Structure definition
mbed_official 489:119543c9f674 66 */
mbed_official 489:119543c9f674 67 typedef struct
mbed_official 489:119543c9f674 68 {
mbed_official 489:119543c9f674 69 uint32_t ClockEdge; /*!< Specifies the clock transition on which the bit capture is made.
mbed_official 489:119543c9f674 70 This parameter can be a value of @ref SDMMC_LL_Clock_Edge */
mbed_official 489:119543c9f674 71
mbed_official 489:119543c9f674 72 uint32_t ClockBypass; /*!< Specifies whether the SDIO Clock divider bypass is
mbed_official 489:119543c9f674 73 enabled or disabled.
mbed_official 489:119543c9f674 74 This parameter can be a value of @ref SDMMC_LL_Clock_Bypass */
mbed_official 489:119543c9f674 75
mbed_official 489:119543c9f674 76 uint32_t ClockPowerSave; /*!< Specifies whether SDIO Clock output is enabled or
mbed_official 489:119543c9f674 77 disabled when the bus is idle.
mbed_official 489:119543c9f674 78 This parameter can be a value of @ref SDMMC_LL_Clock_Power_Save */
mbed_official 489:119543c9f674 79
mbed_official 489:119543c9f674 80 uint32_t BusWide; /*!< Specifies the SDIO bus width.
mbed_official 489:119543c9f674 81 This parameter can be a value of @ref SDMMC_LL_Bus_Wide */
mbed_official 489:119543c9f674 82
mbed_official 489:119543c9f674 83 uint32_t HardwareFlowControl; /*!< Specifies whether the SDIO hardware flow control is enabled or disabled.
mbed_official 489:119543c9f674 84 This parameter can be a value of @ref SDMMC_LL_Hardware_Flow_Control */
mbed_official 489:119543c9f674 85
mbed_official 489:119543c9f674 86 uint32_t ClockDiv; /*!< Specifies the clock frequency of the SDIO controller.
mbed_official 489:119543c9f674 87 This parameter can be a value between Min_Data = 0 and Max_Data = 255 */
mbed_official 489:119543c9f674 88
mbed_official 489:119543c9f674 89 }SDIO_InitTypeDef;
mbed_official 489:119543c9f674 90
mbed_official 489:119543c9f674 91
mbed_official 489:119543c9f674 92 /**
mbed_official 489:119543c9f674 93 * @brief SDIO Command Control structure
mbed_official 489:119543c9f674 94 */
mbed_official 489:119543c9f674 95 typedef struct
mbed_official 489:119543c9f674 96 {
mbed_official 489:119543c9f674 97 uint32_t Argument; /*!< Specifies the SDIO command argument which is sent
mbed_official 489:119543c9f674 98 to a card as part of a command message. If a command
mbed_official 489:119543c9f674 99 contains an argument, it must be loaded into this register
mbed_official 489:119543c9f674 100 before writing the command to the command register. */
mbed_official 489:119543c9f674 101
mbed_official 489:119543c9f674 102 uint32_t CmdIndex; /*!< Specifies the SDIO command index. It must be Min_Data = 0 and
mbed_official 489:119543c9f674 103 Max_Data = 64 */
mbed_official 489:119543c9f674 104
mbed_official 489:119543c9f674 105 uint32_t Response; /*!< Specifies the SDIO response type.
mbed_official 489:119543c9f674 106 This parameter can be a value of @ref SDMMC_LL_Response_Type */
mbed_official 489:119543c9f674 107
mbed_official 489:119543c9f674 108 uint32_t WaitForInterrupt; /*!< Specifies whether SDIO wait for interrupt request is
mbed_official 489:119543c9f674 109 enabled or disabled.
mbed_official 489:119543c9f674 110 This parameter can be a value of @ref SDMMC_LL_Wait_Interrupt_State */
mbed_official 489:119543c9f674 111
mbed_official 489:119543c9f674 112 uint32_t CPSM; /*!< Specifies whether SDIO Command path state machine (CPSM)
mbed_official 489:119543c9f674 113 is enabled or disabled.
mbed_official 489:119543c9f674 114 This parameter can be a value of @ref SDMMC_LL_CPSM_State */
mbed_official 489:119543c9f674 115 }SDIO_CmdInitTypeDef;
mbed_official 489:119543c9f674 116
mbed_official 489:119543c9f674 117
mbed_official 489:119543c9f674 118 /**
mbed_official 489:119543c9f674 119 * @brief SDIO Data Control structure
mbed_official 489:119543c9f674 120 */
mbed_official 489:119543c9f674 121 typedef struct
mbed_official 489:119543c9f674 122 {
mbed_official 489:119543c9f674 123 uint32_t DataTimeOut; /*!< Specifies the data timeout period in card bus clock periods. */
mbed_official 489:119543c9f674 124
mbed_official 489:119543c9f674 125 uint32_t DataLength; /*!< Specifies the number of data bytes to be transferred. */
mbed_official 489:119543c9f674 126
mbed_official 489:119543c9f674 127 uint32_t DataBlockSize; /*!< Specifies the data block size for block transfer.
mbed_official 489:119543c9f674 128 This parameter can be a value of @ref SDMMC_LL_Data_Block_Size */
mbed_official 489:119543c9f674 129
mbed_official 489:119543c9f674 130 uint32_t TransferDir; /*!< Specifies the data transfer direction, whether the transfer
mbed_official 489:119543c9f674 131 is a read or write.
mbed_official 489:119543c9f674 132 This parameter can be a value of @ref SDMMC_LL_Transfer_Direction */
mbed_official 489:119543c9f674 133
mbed_official 489:119543c9f674 134 uint32_t TransferMode; /*!< Specifies whether data transfer is in stream or block mode.
mbed_official 489:119543c9f674 135 This parameter can be a value of @ref SDMMC_LL_Transfer_Type */
mbed_official 489:119543c9f674 136
mbed_official 489:119543c9f674 137 uint32_t DPSM; /*!< Specifies whether SDIO Data path state machine (DPSM)
mbed_official 489:119543c9f674 138 is enabled or disabled.
mbed_official 489:119543c9f674 139 This parameter can be a value of @ref SDMMC_LL_DPSM_State */
mbed_official 489:119543c9f674 140 }SDIO_DataInitTypeDef;
mbed_official 489:119543c9f674 141
mbed_official 489:119543c9f674 142 /**
mbed_official 489:119543c9f674 143 * @}
mbed_official 489:119543c9f674 144 */
mbed_official 489:119543c9f674 145
mbed_official 489:119543c9f674 146 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 147 /** @defgroup SDMMC_LL_Exported_Constants SDMMC_LL Exported Constants
mbed_official 489:119543c9f674 148 * @{
mbed_official 489:119543c9f674 149 */
mbed_official 489:119543c9f674 150
mbed_official 489:119543c9f674 151 /** @defgroup SDMMC_LL_Clock_Edge Clock Edge
mbed_official 489:119543c9f674 152 * @{
mbed_official 489:119543c9f674 153 */
mbed_official 489:119543c9f674 154 #define SDIO_CLOCK_EDGE_RISING ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 155 #define SDIO_CLOCK_EDGE_FALLING SDIO_CLKCR_NEGEDGE
mbed_official 489:119543c9f674 156
mbed_official 489:119543c9f674 157 #define IS_SDIO_CLOCK_EDGE(EDGE) (((EDGE) == SDIO_CLOCK_EDGE_RISING) || \
mbed_official 489:119543c9f674 158 ((EDGE) == SDIO_CLOCK_EDGE_FALLING))
mbed_official 489:119543c9f674 159 /**
mbed_official 489:119543c9f674 160 * @}
mbed_official 489:119543c9f674 161 */
mbed_official 489:119543c9f674 162
mbed_official 489:119543c9f674 163 /** @defgroup SDMMC_LL_Clock_Bypass Clock Bypass
mbed_official 489:119543c9f674 164 * @{
mbed_official 489:119543c9f674 165 */
mbed_official 489:119543c9f674 166 #define SDIO_CLOCK_BYPASS_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 167 #define SDIO_CLOCK_BYPASS_ENABLE SDIO_CLKCR_BYPASS
mbed_official 489:119543c9f674 168
mbed_official 489:119543c9f674 169 #define IS_SDIO_CLOCK_BYPASS(BYPASS) (((BYPASS) == SDIO_CLOCK_BYPASS_DISABLE) || \
mbed_official 489:119543c9f674 170 ((BYPASS) == SDIO_CLOCK_BYPASS_ENABLE))
mbed_official 489:119543c9f674 171 /**
mbed_official 489:119543c9f674 172 * @}
mbed_official 489:119543c9f674 173 */
mbed_official 489:119543c9f674 174
mbed_official 489:119543c9f674 175 /** @defgroup SDMMC_LL_Clock_Power_Save Clock Power Saving
mbed_official 489:119543c9f674 176 * @{
mbed_official 489:119543c9f674 177 */
mbed_official 489:119543c9f674 178 #define SDIO_CLOCK_POWER_SAVE_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 179 #define SDIO_CLOCK_POWER_SAVE_ENABLE SDIO_CLKCR_PWRSAV
mbed_official 489:119543c9f674 180
mbed_official 489:119543c9f674 181 #define IS_SDIO_CLOCK_POWER_SAVE(SAVE) (((SAVE) == SDIO_CLOCK_POWER_SAVE_DISABLE) || \
mbed_official 489:119543c9f674 182 ((SAVE) == SDIO_CLOCK_POWER_SAVE_ENABLE))
mbed_official 489:119543c9f674 183 /**
mbed_official 489:119543c9f674 184 * @}
mbed_official 489:119543c9f674 185 */
mbed_official 489:119543c9f674 186
mbed_official 489:119543c9f674 187 /** @defgroup SDMMC_LL_Bus_Wide Bus Width
mbed_official 489:119543c9f674 188 * @{
mbed_official 489:119543c9f674 189 */
mbed_official 489:119543c9f674 190 #define SDIO_BUS_WIDE_1B ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 191 #define SDIO_BUS_WIDE_4B SDIO_CLKCR_WIDBUS_0
mbed_official 489:119543c9f674 192 #define SDIO_BUS_WIDE_8B SDIO_CLKCR_WIDBUS_1
mbed_official 489:119543c9f674 193
mbed_official 489:119543c9f674 194 #define IS_SDIO_BUS_WIDE(WIDE) (((WIDE) == SDIO_BUS_WIDE_1B) || \
mbed_official 489:119543c9f674 195 ((WIDE) == SDIO_BUS_WIDE_4B) || \
mbed_official 489:119543c9f674 196 ((WIDE) == SDIO_BUS_WIDE_8B))
mbed_official 489:119543c9f674 197 /**
mbed_official 489:119543c9f674 198 * @}
mbed_official 489:119543c9f674 199 */
mbed_official 489:119543c9f674 200
mbed_official 489:119543c9f674 201 /** @defgroup SDMMC_LL_Hardware_Flow_Control Hardware Flow Control
mbed_official 489:119543c9f674 202 * @{
mbed_official 489:119543c9f674 203 */
mbed_official 489:119543c9f674 204 #define SDIO_HARDWARE_FLOW_CONTROL_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 205 #define SDIO_HARDWARE_FLOW_CONTROL_ENABLE SDIO_CLKCR_HWFC_EN
mbed_official 489:119543c9f674 206
mbed_official 489:119543c9f674 207 #define IS_SDIO_HARDWARE_FLOW_CONTROL(CONTROL) (((CONTROL) == SDIO_HARDWARE_FLOW_CONTROL_DISABLE) || \
mbed_official 489:119543c9f674 208 ((CONTROL) == SDIO_HARDWARE_FLOW_CONTROL_ENABLE))
mbed_official 489:119543c9f674 209 /**
mbed_official 489:119543c9f674 210 * @}
mbed_official 489:119543c9f674 211 */
mbed_official 489:119543c9f674 212
mbed_official 489:119543c9f674 213 /** @defgroup SDMMC_LL_Clock_Division Clock Division
mbed_official 489:119543c9f674 214 * @{
mbed_official 489:119543c9f674 215 */
mbed_official 489:119543c9f674 216 #define IS_SDIO_CLKDIV(DIV) ((DIV) <= 0xFF)
mbed_official 489:119543c9f674 217 /**
mbed_official 489:119543c9f674 218 * @}
mbed_official 489:119543c9f674 219 */
mbed_official 489:119543c9f674 220
mbed_official 489:119543c9f674 221 /** @defgroup SDMMC_LL_Command_Index Command Index
mbed_official 489:119543c9f674 222 * @{
mbed_official 489:119543c9f674 223 */
mbed_official 489:119543c9f674 224 #define IS_SDIO_CMD_INDEX(INDEX) ((INDEX) < 0x40)
mbed_official 489:119543c9f674 225 /**
mbed_official 489:119543c9f674 226 * @}
mbed_official 489:119543c9f674 227 */
mbed_official 489:119543c9f674 228
mbed_official 489:119543c9f674 229 /** @defgroup SDMMC_LL_Response_Type Response Type
mbed_official 489:119543c9f674 230 * @{
mbed_official 489:119543c9f674 231 */
mbed_official 489:119543c9f674 232 #define SDIO_RESPONSE_NO ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 233 #define SDIO_RESPONSE_SHORT SDIO_CMD_WAITRESP_0
mbed_official 489:119543c9f674 234 #define SDIO_RESPONSE_LONG SDIO_CMD_WAITRESP
mbed_official 489:119543c9f674 235
mbed_official 489:119543c9f674 236 #define IS_SDIO_RESPONSE(RESPONSE) (((RESPONSE) == SDIO_RESPONSE_NO) || \
mbed_official 489:119543c9f674 237 ((RESPONSE) == SDIO_RESPONSE_SHORT) || \
mbed_official 489:119543c9f674 238 ((RESPONSE) == SDIO_RESPONSE_LONG))
mbed_official 489:119543c9f674 239 /**
mbed_official 489:119543c9f674 240 * @}
mbed_official 489:119543c9f674 241 */
mbed_official 489:119543c9f674 242
mbed_official 489:119543c9f674 243 /** @defgroup SDMMC_LL_Wait_Interrupt_State Wait Interrupt
mbed_official 489:119543c9f674 244 * @{
mbed_official 489:119543c9f674 245 */
mbed_official 489:119543c9f674 246 #define SDIO_WAIT_NO ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 247 #define SDIO_WAIT_IT SDIO_CMD_WAITINT
mbed_official 489:119543c9f674 248 #define SDIO_WAIT_PEND SDIO_CMD_WAITPEND
mbed_official 489:119543c9f674 249
mbed_official 489:119543c9f674 250 #define IS_SDIO_WAIT(WAIT) (((WAIT) == SDIO_WAIT_NO) || \
mbed_official 489:119543c9f674 251 ((WAIT) == SDIO_WAIT_IT) || \
mbed_official 489:119543c9f674 252 ((WAIT) == SDIO_WAIT_PEND))
mbed_official 489:119543c9f674 253 /**
mbed_official 489:119543c9f674 254 * @}
mbed_official 489:119543c9f674 255 */
mbed_official 489:119543c9f674 256
mbed_official 489:119543c9f674 257 /** @defgroup SDMMC_LL_CPSM_State CPSM State
mbed_official 489:119543c9f674 258 * @{
mbed_official 489:119543c9f674 259 */
mbed_official 489:119543c9f674 260 #define SDIO_CPSM_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 261 #define SDIO_CPSM_ENABLE SDIO_CMD_CPSMEN
mbed_official 489:119543c9f674 262
mbed_official 489:119543c9f674 263 #define IS_SDIO_CPSM(CPSM) (((CPSM) == SDIO_CPSM_DISABLE) || \
mbed_official 489:119543c9f674 264 ((CPSM) == SDIO_CPSM_ENABLE))
mbed_official 489:119543c9f674 265 /**
mbed_official 489:119543c9f674 266 * @}
mbed_official 489:119543c9f674 267 */
mbed_official 489:119543c9f674 268
mbed_official 489:119543c9f674 269 /** @defgroup SDMMC_LL_Response_Registers Response Register
mbed_official 489:119543c9f674 270 * @{
mbed_official 489:119543c9f674 271 */
mbed_official 489:119543c9f674 272 #define SDIO_RESP1 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 273 #define SDIO_RESP2 ((uint32_t)0x00000004)
mbed_official 489:119543c9f674 274 #define SDIO_RESP3 ((uint32_t)0x00000008)
mbed_official 489:119543c9f674 275 #define SDIO_RESP4 ((uint32_t)0x0000000C)
mbed_official 489:119543c9f674 276
mbed_official 489:119543c9f674 277 #define IS_SDIO_RESP(RESP) (((RESP) == SDIO_RESP1) || \
mbed_official 489:119543c9f674 278 ((RESP) == SDIO_RESP2) || \
mbed_official 489:119543c9f674 279 ((RESP) == SDIO_RESP3) || \
mbed_official 489:119543c9f674 280 ((RESP) == SDIO_RESP4))
mbed_official 489:119543c9f674 281 /**
mbed_official 489:119543c9f674 282 * @}
mbed_official 489:119543c9f674 283 */
mbed_official 489:119543c9f674 284
mbed_official 489:119543c9f674 285 /** @defgroup SDMMC_LL_Data_Length Data Lenght
mbed_official 489:119543c9f674 286 * @{
mbed_official 489:119543c9f674 287 */
mbed_official 489:119543c9f674 288 #define IS_SDIO_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF)
mbed_official 489:119543c9f674 289 /**
mbed_official 489:119543c9f674 290 * @}
mbed_official 489:119543c9f674 291 */
mbed_official 489:119543c9f674 292
mbed_official 489:119543c9f674 293 /** @defgroup SDMMC_LL_Data_Block_Size Data Block Size
mbed_official 489:119543c9f674 294 * @{
mbed_official 489:119543c9f674 295 */
mbed_official 489:119543c9f674 296 #define SDIO_DATABLOCK_SIZE_1B ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 297 #define SDIO_DATABLOCK_SIZE_2B SDIO_DCTRL_DBLOCKSIZE_0
mbed_official 489:119543c9f674 298 #define SDIO_DATABLOCK_SIZE_4B SDIO_DCTRL_DBLOCKSIZE_1
mbed_official 489:119543c9f674 299 #define SDIO_DATABLOCK_SIZE_8B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_1)
mbed_official 489:119543c9f674 300 #define SDIO_DATABLOCK_SIZE_16B SDIO_DCTRL_DBLOCKSIZE_2
mbed_official 489:119543c9f674 301 #define SDIO_DATABLOCK_SIZE_32B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_2)
mbed_official 489:119543c9f674 302 #define SDIO_DATABLOCK_SIZE_64B (SDIO_DCTRL_DBLOCKSIZE_1|SDIO_DCTRL_DBLOCKSIZE_2)
mbed_official 489:119543c9f674 303 #define SDIO_DATABLOCK_SIZE_128B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_1|SDIO_DCTRL_DBLOCKSIZE_2)
mbed_official 489:119543c9f674 304 #define SDIO_DATABLOCK_SIZE_256B SDIO_DCTRL_DBLOCKSIZE_3
mbed_official 489:119543c9f674 305 #define SDIO_DATABLOCK_SIZE_512B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 306 #define SDIO_DATABLOCK_SIZE_1024B (SDIO_DCTRL_DBLOCKSIZE_1|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 307 #define SDIO_DATABLOCK_SIZE_2048B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_1|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 308 #define SDIO_DATABLOCK_SIZE_4096B (SDIO_DCTRL_DBLOCKSIZE_2|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 309 #define SDIO_DATABLOCK_SIZE_8192B (SDIO_DCTRL_DBLOCKSIZE_0|SDIO_DCTRL_DBLOCKSIZE_2|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 310 #define SDIO_DATABLOCK_SIZE_16384B (SDIO_DCTRL_DBLOCKSIZE_1|SDIO_DCTRL_DBLOCKSIZE_2|SDIO_DCTRL_DBLOCKSIZE_3)
mbed_official 489:119543c9f674 311
mbed_official 489:119543c9f674 312 #define IS_SDIO_BLOCK_SIZE(SIZE) (((SIZE) == SDIO_DATABLOCK_SIZE_1B) || \
mbed_official 489:119543c9f674 313 ((SIZE) == SDIO_DATABLOCK_SIZE_2B) || \
mbed_official 489:119543c9f674 314 ((SIZE) == SDIO_DATABLOCK_SIZE_4B) || \
mbed_official 489:119543c9f674 315 ((SIZE) == SDIO_DATABLOCK_SIZE_8B) || \
mbed_official 489:119543c9f674 316 ((SIZE) == SDIO_DATABLOCK_SIZE_16B) || \
mbed_official 489:119543c9f674 317 ((SIZE) == SDIO_DATABLOCK_SIZE_32B) || \
mbed_official 489:119543c9f674 318 ((SIZE) == SDIO_DATABLOCK_SIZE_64B) || \
mbed_official 489:119543c9f674 319 ((SIZE) == SDIO_DATABLOCK_SIZE_128B) || \
mbed_official 489:119543c9f674 320 ((SIZE) == SDIO_DATABLOCK_SIZE_256B) || \
mbed_official 489:119543c9f674 321 ((SIZE) == SDIO_DATABLOCK_SIZE_512B) || \
mbed_official 489:119543c9f674 322 ((SIZE) == SDIO_DATABLOCK_SIZE_1024B) || \
mbed_official 489:119543c9f674 323 ((SIZE) == SDIO_DATABLOCK_SIZE_2048B) || \
mbed_official 489:119543c9f674 324 ((SIZE) == SDIO_DATABLOCK_SIZE_4096B) || \
mbed_official 489:119543c9f674 325 ((SIZE) == SDIO_DATABLOCK_SIZE_8192B) || \
mbed_official 489:119543c9f674 326 ((SIZE) == SDIO_DATABLOCK_SIZE_16384B))
mbed_official 489:119543c9f674 327 /**
mbed_official 489:119543c9f674 328 * @}
mbed_official 489:119543c9f674 329 */
mbed_official 489:119543c9f674 330
mbed_official 489:119543c9f674 331 /** @defgroup SDMMC_LL_Transfer_Direction Transfer Direction
mbed_official 489:119543c9f674 332 * @{
mbed_official 489:119543c9f674 333 */
mbed_official 489:119543c9f674 334 #define SDIO_TRANSFER_DIR_TO_CARD ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 335 #define SDIO_TRANSFER_DIR_TO_SDIO SDIO_DCTRL_DTDIR
mbed_official 489:119543c9f674 336
mbed_official 489:119543c9f674 337 #define IS_SDIO_TRANSFER_DIR(DIR) (((DIR) == SDIO_TRANSFER_DIR_TO_CARD) || \
mbed_official 489:119543c9f674 338 ((DIR) == SDIO_TRANSFER_DIR_TO_SDIO))
mbed_official 489:119543c9f674 339 /**
mbed_official 489:119543c9f674 340 * @}
mbed_official 489:119543c9f674 341 */
mbed_official 489:119543c9f674 342
mbed_official 489:119543c9f674 343 /** @defgroup SDMMC_LL_Transfer_Type Transfer Type
mbed_official 489:119543c9f674 344 * @{
mbed_official 489:119543c9f674 345 */
mbed_official 489:119543c9f674 346 #define SDIO_TRANSFER_MODE_BLOCK ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 347 #define SDIO_TRANSFER_MODE_STREAM SDIO_DCTRL_DTMODE
mbed_official 489:119543c9f674 348
mbed_official 489:119543c9f674 349 #define IS_SDIO_TRANSFER_MODE(MODE) (((MODE) == SDIO_TRANSFER_MODE_BLOCK) || \
mbed_official 489:119543c9f674 350 ((MODE) == SDIO_TRANSFER_MODE_STREAM))
mbed_official 489:119543c9f674 351 /**
mbed_official 489:119543c9f674 352 * @}
mbed_official 489:119543c9f674 353 */
mbed_official 489:119543c9f674 354
mbed_official 489:119543c9f674 355 /** @defgroup SDMMC_LL_DPSM_State DPSM State
mbed_official 489:119543c9f674 356 * @{
mbed_official 489:119543c9f674 357 */
mbed_official 489:119543c9f674 358 #define SDIO_DPSM_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 359 #define SDIO_DPSM_ENABLE SDIO_DCTRL_DTEN
mbed_official 489:119543c9f674 360
mbed_official 489:119543c9f674 361 #define IS_SDIO_DPSM(DPSM) (((DPSM) == SDIO_DPSM_DISABLE) ||\
mbed_official 489:119543c9f674 362 ((DPSM) == SDIO_DPSM_ENABLE))
mbed_official 489:119543c9f674 363 /**
mbed_official 489:119543c9f674 364 * @}
mbed_official 489:119543c9f674 365 */
mbed_official 489:119543c9f674 366
mbed_official 489:119543c9f674 367 /** @defgroup SDMMC_LL_Read_Wait_Mode Read Wait Mode
mbed_official 489:119543c9f674 368 * @{
mbed_official 489:119543c9f674 369 */
mbed_official 489:119543c9f674 370 #define SDIO_READ_WAIT_MODE_DATA2 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 371 #define SDIO_READ_WAIT_MODE_CLK (SDIO_DCTRL_RWMOD)
mbed_official 489:119543c9f674 372
mbed_official 489:119543c9f674 373 #define IS_SDIO_READWAIT_MODE(MODE) (((MODE) == SDIO_READ_WAIT_MODE_CLK) || \
mbed_official 489:119543c9f674 374 ((MODE) == SDIO_READ_WAIT_MODE_DATA2))
mbed_official 489:119543c9f674 375 /**
mbed_official 489:119543c9f674 376 * @}
mbed_official 489:119543c9f674 377 */
mbed_official 489:119543c9f674 378
mbed_official 489:119543c9f674 379 /** @defgroup SDMMC_LL_Interrupt_sources Interrupt Sources
mbed_official 489:119543c9f674 380 * @{
mbed_official 489:119543c9f674 381 */
mbed_official 489:119543c9f674 382 #define SDIO_IT_CCRCFAIL SDIO_STA_CCRCFAIL
mbed_official 489:119543c9f674 383 #define SDIO_IT_DCRCFAIL SDIO_STA_DCRCFAIL
mbed_official 489:119543c9f674 384 #define SDIO_IT_CTIMEOUT SDIO_STA_CTIMEOUT
mbed_official 489:119543c9f674 385 #define SDIO_IT_DTIMEOUT SDIO_STA_DTIMEOUT
mbed_official 489:119543c9f674 386 #define SDIO_IT_TXUNDERR SDIO_STA_TXUNDERR
mbed_official 489:119543c9f674 387 #define SDIO_IT_RXOVERR SDIO_STA_RXOVERR
mbed_official 489:119543c9f674 388 #define SDIO_IT_CMDREND SDIO_STA_CMDREND
mbed_official 489:119543c9f674 389 #define SDIO_IT_CMDSENT SDIO_STA_CMDSENT
mbed_official 489:119543c9f674 390 #define SDIO_IT_DATAEND SDIO_STA_DATAEND
mbed_official 489:119543c9f674 391 #define SDIO_IT_STBITERR SDIO_STA_STBITERR
mbed_official 489:119543c9f674 392 #define SDIO_IT_DBCKEND SDIO_STA_DBCKEND
mbed_official 489:119543c9f674 393 #define SDIO_IT_CMDACT SDIO_STA_CMDACT
mbed_official 489:119543c9f674 394 #define SDIO_IT_TXACT SDIO_STA_TXACT
mbed_official 489:119543c9f674 395 #define SDIO_IT_RXACT SDIO_STA_RXACT
mbed_official 489:119543c9f674 396 #define SDIO_IT_TXFIFOHE SDIO_STA_TXFIFOHE
mbed_official 489:119543c9f674 397 #define SDIO_IT_RXFIFOHF SDIO_STA_RXFIFOHF
mbed_official 489:119543c9f674 398 #define SDIO_IT_TXFIFOF SDIO_STA_TXFIFOF
mbed_official 489:119543c9f674 399 #define SDIO_IT_RXFIFOF SDIO_STA_RXFIFOF
mbed_official 489:119543c9f674 400 #define SDIO_IT_TXFIFOE SDIO_STA_TXFIFOE
mbed_official 489:119543c9f674 401 #define SDIO_IT_RXFIFOE SDIO_STA_RXFIFOE
mbed_official 489:119543c9f674 402 #define SDIO_IT_TXDAVL SDIO_STA_TXDAVL
mbed_official 489:119543c9f674 403 #define SDIO_IT_RXDAVL SDIO_STA_RXDAVL
mbed_official 489:119543c9f674 404 #define SDIO_IT_SDIOIT SDIO_STA_SDIOIT
mbed_official 489:119543c9f674 405 #define SDIO_IT_CEATAEND SDIO_STA_CEATAEND
mbed_official 489:119543c9f674 406
mbed_official 489:119543c9f674 407 /**
mbed_official 489:119543c9f674 408 * @}
mbed_official 489:119543c9f674 409 */
mbed_official 489:119543c9f674 410
mbed_official 489:119543c9f674 411 /** @defgroup SDMMC_LL_Flags Flags
mbed_official 489:119543c9f674 412 * @{
mbed_official 489:119543c9f674 413 */
mbed_official 489:119543c9f674 414 #define SDIO_FLAG_CCRCFAIL SDIO_STA_CCRCFAIL
mbed_official 489:119543c9f674 415 #define SDIO_FLAG_DCRCFAIL SDIO_STA_DCRCFAIL
mbed_official 489:119543c9f674 416 #define SDIO_FLAG_CTIMEOUT SDIO_STA_CTIMEOUT
mbed_official 489:119543c9f674 417 #define SDIO_FLAG_DTIMEOUT SDIO_STA_DTIMEOUT
mbed_official 489:119543c9f674 418 #define SDIO_FLAG_TXUNDERR SDIO_STA_TXUNDERR
mbed_official 489:119543c9f674 419 #define SDIO_FLAG_RXOVERR SDIO_STA_RXOVERR
mbed_official 489:119543c9f674 420 #define SDIO_FLAG_CMDREND SDIO_STA_CMDREND
mbed_official 489:119543c9f674 421 #define SDIO_FLAG_CMDSENT SDIO_STA_CMDSENT
mbed_official 489:119543c9f674 422 #define SDIO_FLAG_DATAEND SDIO_STA_DATAEND
mbed_official 489:119543c9f674 423 #define SDIO_FLAG_STBITERR SDIO_STA_STBITERR
mbed_official 489:119543c9f674 424 #define SDIO_FLAG_DBCKEND SDIO_STA_DBCKEND
mbed_official 489:119543c9f674 425 #define SDIO_FLAG_CMDACT SDIO_STA_CMDACT
mbed_official 489:119543c9f674 426 #define SDIO_FLAG_TXACT SDIO_STA_TXACT
mbed_official 489:119543c9f674 427 #define SDIO_FLAG_RXACT SDIO_STA_RXACT
mbed_official 489:119543c9f674 428 #define SDIO_FLAG_TXFIFOHE SDIO_STA_TXFIFOHE
mbed_official 489:119543c9f674 429 #define SDIO_FLAG_RXFIFOHF SDIO_STA_RXFIFOHF
mbed_official 489:119543c9f674 430 #define SDIO_FLAG_TXFIFOF SDIO_STA_TXFIFOF
mbed_official 489:119543c9f674 431 #define SDIO_FLAG_RXFIFOF SDIO_STA_RXFIFOF
mbed_official 489:119543c9f674 432 #define SDIO_FLAG_TXFIFOE SDIO_STA_TXFIFOE
mbed_official 489:119543c9f674 433 #define SDIO_FLAG_RXFIFOE SDIO_STA_RXFIFOE
mbed_official 489:119543c9f674 434 #define SDIO_FLAG_TXDAVL SDIO_STA_TXDAVL
mbed_official 489:119543c9f674 435 #define SDIO_FLAG_RXDAVL SDIO_STA_RXDAVL
mbed_official 489:119543c9f674 436 #define SDIO_FLAG_SDIOIT SDIO_STA_SDIOIT
mbed_official 489:119543c9f674 437 #define SDIO_FLAG_CEATAEND SDIO_STA_CEATAEND
mbed_official 489:119543c9f674 438
mbed_official 489:119543c9f674 439 /**
mbed_official 489:119543c9f674 440 * @}
mbed_official 489:119543c9f674 441 */
mbed_official 489:119543c9f674 442
mbed_official 489:119543c9f674 443 /**
mbed_official 489:119543c9f674 444 * @}
mbed_official 489:119543c9f674 445 */
mbed_official 489:119543c9f674 446
mbed_official 489:119543c9f674 447 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 448 /** @defgroup SDMMC_LL_Exported_macros SDMMC_LL Exported Macros
mbed_official 489:119543c9f674 449 * @{
mbed_official 489:119543c9f674 450 */
mbed_official 489:119543c9f674 451
mbed_official 489:119543c9f674 452 /** @defgroup SDMMC_LL_Register Bits And Addresses Definitions
mbed_official 489:119543c9f674 453 * @brief SDMMC_LL registers bit address in the alias region
mbed_official 489:119543c9f674 454 * @{
mbed_official 489:119543c9f674 455 */
mbed_official 489:119543c9f674 456
mbed_official 489:119543c9f674 457 /* ---------------------- SDIO registers bit mask --------------------------- */
mbed_official 489:119543c9f674 458 /* --- CLKCR Register ---*/
mbed_official 489:119543c9f674 459 /* CLKCR register clear mask */
mbed_official 489:119543c9f674 460 #define CLKCR_CLEAR_MASK ((uint32_t)(SDIO_CLKCR_CLKDIV | SDIO_CLKCR_PWRSAV |\
mbed_official 489:119543c9f674 461 SDIO_CLKCR_BYPASS | SDIO_CLKCR_WIDBUS |\
mbed_official 489:119543c9f674 462 SDIO_CLKCR_NEGEDGE | SDIO_CLKCR_HWFC_EN))
mbed_official 489:119543c9f674 463
mbed_official 489:119543c9f674 464 /* --- DCTRL Register ---*/
mbed_official 489:119543c9f674 465 /* SDIO DCTRL Clear Mask */
mbed_official 489:119543c9f674 466 #define DCTRL_CLEAR_MASK ((uint32_t)(SDIO_DCTRL_DTEN | SDIO_DCTRL_DTDIR |\
mbed_official 489:119543c9f674 467 SDIO_DCTRL_DTMODE | SDIO_DCTRL_DBLOCKSIZE))
mbed_official 489:119543c9f674 468
mbed_official 489:119543c9f674 469 /* --- CMD Register ---*/
mbed_official 489:119543c9f674 470 /* CMD Register clear mask */
mbed_official 489:119543c9f674 471 #define CMD_CLEAR_MASK ((uint32_t)(SDIO_CMD_CMDINDEX | SDIO_CMD_WAITRESP |\
mbed_official 489:119543c9f674 472 SDIO_CMD_WAITINT | SDIO_CMD_WAITPEND |\
mbed_official 489:119543c9f674 473 SDIO_CMD_CPSMEN | SDIO_CMD_SDIOSUSPEND))
mbed_official 489:119543c9f674 474
mbed_official 489:119543c9f674 475 /* SDIO RESP Registers Address */
mbed_official 489:119543c9f674 476 #define SDIO_RESP_ADDR ((uint32_t)(SDIO_BASE + 0x14))
mbed_official 489:119543c9f674 477
mbed_official 489:119543c9f674 478 /* SDIO Intialization Frequency (400KHz max) */
mbed_official 489:119543c9f674 479 #define SDIO_INIT_CLK_DIV ((uint8_t)0xC3)
mbed_official 489:119543c9f674 480
mbed_official 489:119543c9f674 481 /* SDIO Data Transfer Frequency */
mbed_official 489:119543c9f674 482 #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x9)
mbed_official 489:119543c9f674 483
mbed_official 489:119543c9f674 484 /**
mbed_official 489:119543c9f674 485 * @}
mbed_official 489:119543c9f674 486 */
mbed_official 489:119543c9f674 487
mbed_official 489:119543c9f674 488 /** @defgroup SDMMC_LL_Interrupt_Clock Interrupt And Clock Configuration
mbed_official 489:119543c9f674 489 * @brief macros to handle interrupts and specific clock configurations
mbed_official 489:119543c9f674 490 * @{
mbed_official 489:119543c9f674 491 */
mbed_official 489:119543c9f674 492
mbed_official 489:119543c9f674 493 /**
mbed_official 489:119543c9f674 494 * @brief Enable the SDIO device.
mbed_official 489:119543c9f674 495 * @param __INSTANCE__: SDIO Instance
mbed_official 489:119543c9f674 496 * @retval None
mbed_official 489:119543c9f674 497 */
mbed_official 489:119543c9f674 498 #define __SDIO_ENABLE(__INSTANCE__) ((__INSTANCE__)->CLKCR |= SDIO_CLKCR_CLKEN)
mbed_official 489:119543c9f674 499
mbed_official 489:119543c9f674 500 /**
mbed_official 489:119543c9f674 501 * @brief Disable the SDIO device.
mbed_official 489:119543c9f674 502 * @param __INSTANCE__: SDIO Instance
mbed_official 489:119543c9f674 503 * @retval None
mbed_official 489:119543c9f674 504 */
mbed_official 489:119543c9f674 505 #define __SDIO_DISABLE(__INSTANCE__) ((__INSTANCE__)->CLKCR &= ~SDIO_CLKCR_CLKEN)
mbed_official 489:119543c9f674 506
mbed_official 489:119543c9f674 507 /**
mbed_official 489:119543c9f674 508 * @brief Enable the SDIO DMA transfer.
mbed_official 489:119543c9f674 509 * @param None
mbed_official 489:119543c9f674 510 * @retval None
mbed_official 489:119543c9f674 511 */
mbed_official 489:119543c9f674 512 #define __SDIO_DMA_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDIO_DCTRL_DMAEN)
mbed_official 489:119543c9f674 513 /**
mbed_official 489:119543c9f674 514 * @brief Disable the SDIO DMA transfer.
mbed_official 489:119543c9f674 515 * @param None
mbed_official 489:119543c9f674 516 * @retval None
mbed_official 489:119543c9f674 517 */
mbed_official 489:119543c9f674 518 #define __SDIO_DMA_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDIO_DCTRL_DMAEN)
mbed_official 489:119543c9f674 519
mbed_official 489:119543c9f674 520 /**
mbed_official 489:119543c9f674 521 * @brief Enable the SDIO device interrupt.
mbed_official 489:119543c9f674 522 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 523 * @param __INTERRUPT__ : specifies the SDIO interrupt sources to be enabled.
mbed_official 489:119543c9f674 524 * This parameter can be one or a combination of the following values:
mbed_official 489:119543c9f674 525 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 489:119543c9f674 526 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 489:119543c9f674 527 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 489:119543c9f674 528 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 489:119543c9f674 529 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 489:119543c9f674 530 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 489:119543c9f674 531 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 489:119543c9f674 532 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 489:119543c9f674 533 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 489:119543c9f674 534 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 489:119543c9f674 535 * bus mode interrupt
mbed_official 489:119543c9f674 536 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 489:119543c9f674 537 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 489:119543c9f674 538 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 489:119543c9f674 539 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 489:119543c9f674 540 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 489:119543c9f674 541 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 489:119543c9f674 542 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 489:119543c9f674 543 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 489:119543c9f674 544 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 489:119543c9f674 545 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 489:119543c9f674 546 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 489:119543c9f674 547 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 489:119543c9f674 548 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 489:119543c9f674 549 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 489:119543c9f674 550 * @retval None
mbed_official 489:119543c9f674 551 */
mbed_official 489:119543c9f674 552 #define __SDIO_ENABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK |= (__INTERRUPT__))
mbed_official 489:119543c9f674 553
mbed_official 489:119543c9f674 554 /**
mbed_official 489:119543c9f674 555 * @brief Disable the SDIO device interrupt.
mbed_official 489:119543c9f674 556 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 557 * @param __INTERRUPT__ : specifies the SDIO interrupt sources to be disabled.
mbed_official 489:119543c9f674 558 * This parameter can be one or a combination of the following values:
mbed_official 489:119543c9f674 559 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 489:119543c9f674 560 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 489:119543c9f674 561 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 489:119543c9f674 562 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 489:119543c9f674 563 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 489:119543c9f674 564 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 489:119543c9f674 565 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 489:119543c9f674 566 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 489:119543c9f674 567 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 489:119543c9f674 568 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 489:119543c9f674 569 * bus mode interrupt
mbed_official 489:119543c9f674 570 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 489:119543c9f674 571 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 489:119543c9f674 572 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 489:119543c9f674 573 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 489:119543c9f674 574 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 489:119543c9f674 575 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 489:119543c9f674 576 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 489:119543c9f674 577 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 489:119543c9f674 578 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 489:119543c9f674 579 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 489:119543c9f674 580 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 489:119543c9f674 581 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 489:119543c9f674 582 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 489:119543c9f674 583 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 489:119543c9f674 584 * @retval None
mbed_official 489:119543c9f674 585 */
mbed_official 489:119543c9f674 586 #define __SDIO_DISABLE_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->MASK &= ~(__INTERRUPT__))
mbed_official 489:119543c9f674 587
mbed_official 489:119543c9f674 588 /**
mbed_official 489:119543c9f674 589 * @brief Checks whether the specified SDIO flag is set or not.
mbed_official 489:119543c9f674 590 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 591 * @param __FLAG__: specifies the flag to check.
mbed_official 489:119543c9f674 592 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 593 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
mbed_official 489:119543c9f674 594 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
mbed_official 489:119543c9f674 595 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
mbed_official 489:119543c9f674 596 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
mbed_official 489:119543c9f674 597 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
mbed_official 489:119543c9f674 598 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
mbed_official 489:119543c9f674 599 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
mbed_official 489:119543c9f674 600 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
mbed_official 489:119543c9f674 601 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
mbed_official 489:119543c9f674 602 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode.
mbed_official 489:119543c9f674 603 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
mbed_official 489:119543c9f674 604 * @arg SDIO_FLAG_CMDACT: Command transfer in progress
mbed_official 489:119543c9f674 605 * @arg SDIO_FLAG_TXACT: Data transmit in progress
mbed_official 489:119543c9f674 606 * @arg SDIO_FLAG_RXACT: Data receive in progress
mbed_official 489:119543c9f674 607 * @arg SDIO_FLAG_TXFIFOHE: Transmit FIFO Half Empty
mbed_official 489:119543c9f674 608 * @arg SDIO_FLAG_RXFIFOHF: Receive FIFO Half Full
mbed_official 489:119543c9f674 609 * @arg SDIO_FLAG_TXFIFOF: Transmit FIFO full
mbed_official 489:119543c9f674 610 * @arg SDIO_FLAG_RXFIFOF: Receive FIFO full
mbed_official 489:119543c9f674 611 * @arg SDIO_FLAG_TXFIFOE: Transmit FIFO empty
mbed_official 489:119543c9f674 612 * @arg SDIO_FLAG_RXFIFOE: Receive FIFO empty
mbed_official 489:119543c9f674 613 * @arg SDIO_FLAG_TXDAVL: Data available in transmit FIFO
mbed_official 489:119543c9f674 614 * @arg SDIO_FLAG_RXDAVL: Data available in receive FIFO
mbed_official 489:119543c9f674 615 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
mbed_official 489:119543c9f674 616 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 489:119543c9f674 617 * @retval The new state of SDIO_FLAG (SET or RESET).
mbed_official 489:119543c9f674 618 */
mbed_official 489:119543c9f674 619 #define __SDIO_GET_FLAG(__INSTANCE__, __FLAG__) (((__INSTANCE__)->STA &(__FLAG__)) != RESET)
mbed_official 489:119543c9f674 620
mbed_official 489:119543c9f674 621
mbed_official 489:119543c9f674 622 /**
mbed_official 489:119543c9f674 623 * @brief Clears the SDIO pending flags.
mbed_official 489:119543c9f674 624 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 625 * @param __FLAG__: specifies the flag to clear.
mbed_official 489:119543c9f674 626 * This parameter can be one or a combination of the following values:
mbed_official 489:119543c9f674 627 * @arg SDIO_FLAG_CCRCFAIL: Command response received (CRC check failed)
mbed_official 489:119543c9f674 628 * @arg SDIO_FLAG_DCRCFAIL: Data block sent/received (CRC check failed)
mbed_official 489:119543c9f674 629 * @arg SDIO_FLAG_CTIMEOUT: Command response timeout
mbed_official 489:119543c9f674 630 * @arg SDIO_FLAG_DTIMEOUT: Data timeout
mbed_official 489:119543c9f674 631 * @arg SDIO_FLAG_TXUNDERR: Transmit FIFO underrun error
mbed_official 489:119543c9f674 632 * @arg SDIO_FLAG_RXOVERR: Received FIFO overrun error
mbed_official 489:119543c9f674 633 * @arg SDIO_FLAG_CMDREND: Command response received (CRC check passed)
mbed_official 489:119543c9f674 634 * @arg SDIO_FLAG_CMDSENT: Command sent (no response required)
mbed_official 489:119543c9f674 635 * @arg SDIO_FLAG_DATAEND: Data end (data counter, SDIDCOUNT, is zero)
mbed_official 489:119543c9f674 636 * @arg SDIO_FLAG_STBITERR: Start bit not detected on all data signals in wide bus mode
mbed_official 489:119543c9f674 637 * @arg SDIO_FLAG_DBCKEND: Data block sent/received (CRC check passed)
mbed_official 489:119543c9f674 638 * @arg SDIO_FLAG_SDIOIT: SD I/O interrupt received
mbed_official 489:119543c9f674 639 * @arg SDIO_FLAG_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 489:119543c9f674 640 * @retval None
mbed_official 489:119543c9f674 641 */
mbed_official 489:119543c9f674 642 #define __SDIO_CLEAR_FLAG(__INSTANCE__, __FLAG__) ((__INSTANCE__)->ICR = (__FLAG__))
mbed_official 489:119543c9f674 643
mbed_official 489:119543c9f674 644 /**
mbed_official 489:119543c9f674 645 * @brief Checks whether the specified SDIO interrupt has occurred or not.
mbed_official 489:119543c9f674 646 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 647 * @param __INTERRUPT__: specifies the SDIO interrupt source to check.
mbed_official 489:119543c9f674 648 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 649 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 489:119543c9f674 650 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 489:119543c9f674 651 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 489:119543c9f674 652 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 489:119543c9f674 653 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 489:119543c9f674 654 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 489:119543c9f674 655 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 489:119543c9f674 656 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 489:119543c9f674 657 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIDCOUNT, is zero) interrupt
mbed_official 489:119543c9f674 658 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 489:119543c9f674 659 * bus mode interrupt
mbed_official 489:119543c9f674 660 * @arg SDIO_IT_DBCKEND: Data block sent/received (CRC check passed) interrupt
mbed_official 489:119543c9f674 661 * @arg SDIO_IT_CMDACT: Command transfer in progress interrupt
mbed_official 489:119543c9f674 662 * @arg SDIO_IT_TXACT: Data transmit in progress interrupt
mbed_official 489:119543c9f674 663 * @arg SDIO_IT_RXACT: Data receive in progress interrupt
mbed_official 489:119543c9f674 664 * @arg SDIO_IT_TXFIFOHE: Transmit FIFO Half Empty interrupt
mbed_official 489:119543c9f674 665 * @arg SDIO_IT_RXFIFOHF: Receive FIFO Half Full interrupt
mbed_official 489:119543c9f674 666 * @arg SDIO_IT_TXFIFOF: Transmit FIFO full interrupt
mbed_official 489:119543c9f674 667 * @arg SDIO_IT_RXFIFOF: Receive FIFO full interrupt
mbed_official 489:119543c9f674 668 * @arg SDIO_IT_TXFIFOE: Transmit FIFO empty interrupt
mbed_official 489:119543c9f674 669 * @arg SDIO_IT_RXFIFOE: Receive FIFO empty interrupt
mbed_official 489:119543c9f674 670 * @arg SDIO_IT_TXDAVL: Data available in transmit FIFO interrupt
mbed_official 489:119543c9f674 671 * @arg SDIO_IT_RXDAVL: Data available in receive FIFO interrupt
mbed_official 489:119543c9f674 672 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 489:119543c9f674 673 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61 interrupt
mbed_official 489:119543c9f674 674 * @retval The new state of SDIO_IT (SET or RESET).
mbed_official 489:119543c9f674 675 */
mbed_official 489:119543c9f674 676 #define __SDIO_GET_IT (__INSTANCE__, __INTERRUPT__) (((__INSTANCE__)->STA &(__INTERRUPT__)) == (__INTERRUPT__))
mbed_official 489:119543c9f674 677
mbed_official 489:119543c9f674 678 /**
mbed_official 489:119543c9f674 679 * @brief Clears the SDIO's interrupt pending bits.
mbed_official 489:119543c9f674 680 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 681 * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
mbed_official 489:119543c9f674 682 * This parameter can be one or a combination of the following values:
mbed_official 489:119543c9f674 683 * @arg SDIO_IT_CCRCFAIL: Command response received (CRC check failed) interrupt
mbed_official 489:119543c9f674 684 * @arg SDIO_IT_DCRCFAIL: Data block sent/received (CRC check failed) interrupt
mbed_official 489:119543c9f674 685 * @arg SDIO_IT_CTIMEOUT: Command response timeout interrupt
mbed_official 489:119543c9f674 686 * @arg SDIO_IT_DTIMEOUT: Data timeout interrupt
mbed_official 489:119543c9f674 687 * @arg SDIO_IT_TXUNDERR: Transmit FIFO underrun error interrupt
mbed_official 489:119543c9f674 688 * @arg SDIO_IT_RXOVERR: Received FIFO overrun error interrupt
mbed_official 489:119543c9f674 689 * @arg SDIO_IT_CMDREND: Command response received (CRC check passed) interrupt
mbed_official 489:119543c9f674 690 * @arg SDIO_IT_CMDSENT: Command sent (no response required) interrupt
mbed_official 489:119543c9f674 691 * @arg SDIO_IT_DATAEND: Data end (data counter, SDIO_DCOUNT, is zero) interrupt
mbed_official 489:119543c9f674 692 * @arg SDIO_IT_STBITERR: Start bit not detected on all data signals in wide
mbed_official 489:119543c9f674 693 * bus mode interrupt
mbed_official 489:119543c9f674 694 * @arg SDIO_IT_SDIOIT: SD I/O interrupt received interrupt
mbed_official 489:119543c9f674 695 * @arg SDIO_IT_CEATAEND: CE-ATA command completion signal received for CMD61
mbed_official 489:119543c9f674 696 * @retval None
mbed_official 489:119543c9f674 697 */
mbed_official 489:119543c9f674 698 #define __SDIO_CLEAR_IT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->ICR = (__INTERRUPT__))
mbed_official 489:119543c9f674 699
mbed_official 489:119543c9f674 700 /**
mbed_official 489:119543c9f674 701 * @brief Enable Start the SD I/O Read Wait operation.
mbed_official 489:119543c9f674 702 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 703 * @retval None
mbed_official 489:119543c9f674 704 */
mbed_official 489:119543c9f674 705 #define __SDIO_START_READWAIT_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDIO_DCTRL_RWSTART)
mbed_official 489:119543c9f674 706
mbed_official 489:119543c9f674 707 /**
mbed_official 489:119543c9f674 708 * @brief Disable Start the SD I/O Read Wait operations.
mbed_official 489:119543c9f674 709 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 710 * @retval None
mbed_official 489:119543c9f674 711 */
mbed_official 489:119543c9f674 712 #define __SDIO_START_READWAIT_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDIO_DCTRL_RWSTART)
mbed_official 489:119543c9f674 713
mbed_official 489:119543c9f674 714 /**
mbed_official 489:119543c9f674 715 * @brief Enable Start the SD I/O Read Wait operation.
mbed_official 489:119543c9f674 716 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 717 * @retval None
mbed_official 489:119543c9f674 718 */
mbed_official 489:119543c9f674 719 #define __SDIO_STOP_READWAIT_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDIO_DCTRL_RWSTOP)
mbed_official 489:119543c9f674 720
mbed_official 489:119543c9f674 721 /**
mbed_official 489:119543c9f674 722 * @brief Disable Stop the SD I/O Read Wait operations.
mbed_official 489:119543c9f674 723 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 724 * @retval None
mbed_official 489:119543c9f674 725 */
mbed_official 489:119543c9f674 726 #define __SDIO_STOP_READWAIT_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDIO_DCTRL_RWSTOP)
mbed_official 489:119543c9f674 727
mbed_official 489:119543c9f674 728 /**
mbed_official 489:119543c9f674 729 * @brief Enable the SD I/O Mode Operation.
mbed_official 489:119543c9f674 730 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 731 * @retval None
mbed_official 489:119543c9f674 732 */
mbed_official 489:119543c9f674 733 #define __SDIO_OPERATION_ENABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL |= SDIO_DCTRL_SDIOEN)
mbed_official 489:119543c9f674 734
mbed_official 489:119543c9f674 735 /**
mbed_official 489:119543c9f674 736 * @brief Disable the SD I/O Mode Operation.
mbed_official 489:119543c9f674 737 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 738 * @retval None
mbed_official 489:119543c9f674 739 */
mbed_official 489:119543c9f674 740 #define __SDIO_OPERATION_DISABLE(__INSTANCE__) ((__INSTANCE__)->DCTRL &= ~SDIO_DCTRL_SDIOEN)
mbed_official 489:119543c9f674 741
mbed_official 489:119543c9f674 742 /**
mbed_official 489:119543c9f674 743 * @brief Enable the SD I/O Suspend command sending.
mbed_official 489:119543c9f674 744 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 745 * @retval None
mbed_official 489:119543c9f674 746 */
mbed_official 489:119543c9f674 747 #define __SDIO_SUSPEND_CMD_ENABLE(__INSTANCE__) ((__INSTANCE__)->CMD |= SDIO_CMD_SDIOSUSPEND)
mbed_official 489:119543c9f674 748
mbed_official 489:119543c9f674 749 /**
mbed_official 489:119543c9f674 750 * @brief Disable the SD I/O Suspend command sending.
mbed_official 489:119543c9f674 751 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 752 * @retval None
mbed_official 489:119543c9f674 753 */
mbed_official 489:119543c9f674 754 #define __SDIO_SUSPEND_CMD_DISABLE(__INSTANCE__) ((__INSTANCE__)->CMD &= ~SDIO_CMD_SDIOSUSPEND)
mbed_official 489:119543c9f674 755
mbed_official 489:119543c9f674 756 /**
mbed_official 489:119543c9f674 757 * @brief Enable the command completion signal.
mbed_official 489:119543c9f674 758 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 759 * @retval None
mbed_official 489:119543c9f674 760 */
mbed_official 489:119543c9f674 761 #define __SDIO_CEATA_CMD_COMPLETION_ENABLE(__INSTANCE__) ((__INSTANCE__)->CMD |= SDIO_CMD_ENCMDCOMPL)
mbed_official 489:119543c9f674 762
mbed_official 489:119543c9f674 763 /**
mbed_official 489:119543c9f674 764 * @brief Disable the command completion signal.
mbed_official 489:119543c9f674 765 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 766 * @retval None
mbed_official 489:119543c9f674 767 */
mbed_official 489:119543c9f674 768 #define __SDIO_CEATA_CMD_COMPLETION_DISABLE(__INSTANCE__) ((__INSTANCE__)->CMD &= ~SDIO_CMD_ENCMDCOMPL)
mbed_official 489:119543c9f674 769
mbed_official 489:119543c9f674 770 /**
mbed_official 489:119543c9f674 771 * @brief Enable the CE-ATA interrupt.
mbed_official 489:119543c9f674 772 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 773 * @retval None
mbed_official 489:119543c9f674 774 */
mbed_official 489:119543c9f674 775 #define __SDIO_CEATA_ENABLE_IT(__INSTANCE__) ((__INSTANCE__)->CMD &= ~SDIO_CMD_NIEN)
mbed_official 489:119543c9f674 776
mbed_official 489:119543c9f674 777 /**
mbed_official 489:119543c9f674 778 * @brief Disable the CE-ATA interrupt.
mbed_official 489:119543c9f674 779 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 780 * @retval None
mbed_official 489:119543c9f674 781 */
mbed_official 489:119543c9f674 782 #define __SDIO_CEATA_DISABLE_IT(__INSTANCE__) ((__INSTANCE__)->CMD |= SDIO_CMD_NIEN)
mbed_official 489:119543c9f674 783
mbed_official 489:119543c9f674 784 /**
mbed_official 489:119543c9f674 785 * @brief Enable send CE-ATA command (CMD61).
mbed_official 489:119543c9f674 786 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 787 * @retval None
mbed_official 489:119543c9f674 788 */
mbed_official 489:119543c9f674 789 #define __SDIO_CEATA_SENDCMD_ENABLE(__INSTANCE__) ((__INSTANCE__)->CMD |= SDIO_CMD_CEATACMD)
mbed_official 489:119543c9f674 790
mbed_official 489:119543c9f674 791 /**
mbed_official 489:119543c9f674 792 * @brief Disable send CE-ATA command (CMD61).
mbed_official 489:119543c9f674 793 * @param __INSTANCE__ : Pointer to SDIO register base
mbed_official 489:119543c9f674 794 * @retval None
mbed_official 489:119543c9f674 795 */
mbed_official 489:119543c9f674 796 #define __SDIO_CEATA_SENDCMD_DISABLE(__INSTANCE__) ((__INSTANCE__)->CMD &= ~SDIO_CMD_CEATACMD)
mbed_official 489:119543c9f674 797
mbed_official 489:119543c9f674 798 /**
mbed_official 489:119543c9f674 799 * @}
mbed_official 489:119543c9f674 800 */
mbed_official 489:119543c9f674 801
mbed_official 489:119543c9f674 802 /**
mbed_official 489:119543c9f674 803 * @}
mbed_official 489:119543c9f674 804 */
mbed_official 489:119543c9f674 805
mbed_official 489:119543c9f674 806 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 807 /** @addtogroup SDMMC_LL_Exported_Functions
mbed_official 489:119543c9f674 808 * @{
mbed_official 489:119543c9f674 809 */
mbed_official 489:119543c9f674 810
mbed_official 489:119543c9f674 811 /* Initialization/de-initialization functions **********************************/
mbed_official 489:119543c9f674 812 /** @addtogroup HAL_SDMMC_LL_Group1
mbed_official 489:119543c9f674 813 * @{
mbed_official 489:119543c9f674 814 */
mbed_official 489:119543c9f674 815 HAL_StatusTypeDef SDIO_Init(SDIO_TypeDef *SDIOx, SDIO_InitTypeDef Init);
mbed_official 489:119543c9f674 816 /**
mbed_official 489:119543c9f674 817 * @}
mbed_official 489:119543c9f674 818 */
mbed_official 489:119543c9f674 819
mbed_official 489:119543c9f674 820 /* I/O operation functions *****************************************************/
mbed_official 489:119543c9f674 821 /** @addtogroup HAL_SDMMC_LL_Group2
mbed_official 489:119543c9f674 822 * @{
mbed_official 489:119543c9f674 823 */
mbed_official 489:119543c9f674 824 /* Blocking mode: Polling */
mbed_official 489:119543c9f674 825 uint32_t SDIO_ReadFIFO(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 826 HAL_StatusTypeDef SDIO_WriteFIFO(SDIO_TypeDef *SDIOx, uint32_t *pWriteData);
mbed_official 489:119543c9f674 827 /**
mbed_official 489:119543c9f674 828 * @}
mbed_official 489:119543c9f674 829 */
mbed_official 489:119543c9f674 830
mbed_official 489:119543c9f674 831 /* Peripheral Control functions ************************************************/
mbed_official 489:119543c9f674 832 /** @addtogroup HAL_SDMMC_LL_Group3
mbed_official 489:119543c9f674 833 * @{
mbed_official 489:119543c9f674 834 */
mbed_official 489:119543c9f674 835 HAL_StatusTypeDef SDIO_PowerState_ON(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 836 HAL_StatusTypeDef SDIO_PowerState_OFF(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 837 uint32_t SDIO_GetPowerState(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 838
mbed_official 489:119543c9f674 839 /* Command path state machine (CPSM) management functions */
mbed_official 489:119543c9f674 840 HAL_StatusTypeDef SDIO_SendCommand(SDIO_TypeDef *SDIOx, SDIO_CmdInitTypeDef *Command);
mbed_official 489:119543c9f674 841 uint8_t SDIO_GetCommandResponse(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 842 uint32_t SDIO_GetResponse(SDIO_TypeDef *SDIOx, uint32_t Response);
mbed_official 489:119543c9f674 843
mbed_official 489:119543c9f674 844 /* Data path state machine (DPSM) management functions */
mbed_official 489:119543c9f674 845 HAL_StatusTypeDef SDIO_DataConfig(SDIO_TypeDef *SDIOx, SDIO_DataInitTypeDef* Data);
mbed_official 489:119543c9f674 846 uint32_t SDIO_GetDataCounter(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 847 uint32_t SDIO_GetFIFOCount(SDIO_TypeDef *SDIOx);
mbed_official 489:119543c9f674 848
mbed_official 489:119543c9f674 849 /* SDIO Cards mode management functions */
mbed_official 489:119543c9f674 850 HAL_StatusTypeDef SDIO_SetSDIOReadWaitMode(SDIO_TypeDef *SDIOx, uint32_t SDIO_ReadWaitMode);
mbed_official 489:119543c9f674 851
mbed_official 489:119543c9f674 852 /**
mbed_official 489:119543c9f674 853 * @}
mbed_official 489:119543c9f674 854 */
mbed_official 489:119543c9f674 855
mbed_official 489:119543c9f674 856 /**
mbed_official 489:119543c9f674 857 * @}
mbed_official 489:119543c9f674 858 */
mbed_official 489:119543c9f674 859
mbed_official 489:119543c9f674 860 /**
mbed_official 489:119543c9f674 861 * @}
mbed_official 489:119543c9f674 862 */
mbed_official 489:119543c9f674 863
mbed_official 489:119543c9f674 864 /**
mbed_official 489:119543c9f674 865 * @}
mbed_official 489:119543c9f674 866 */
mbed_official 489:119543c9f674 867
mbed_official 489:119543c9f674 868 #ifdef __cplusplus
mbed_official 489:119543c9f674 869 }
mbed_official 489:119543c9f674 870 #endif
mbed_official 489:119543c9f674 871
mbed_official 489:119543c9f674 872 #endif /* STM32F103xE || STM32F103xG */
mbed_official 489:119543c9f674 873
mbed_official 489:119543c9f674 874 #endif /* __stm32f1xx_LL_SD_H */
mbed_official 489:119543c9f674 875
mbed_official 489:119543c9f674 876 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/