A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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