mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
107:4f6c30876dfa
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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