Einstein Filho
/
MANGUEBAJA2019_BOX
Mangue Baja Box
mbed/TARGET_NUCLEO_F103RB/stm32f10x_sdio.h@0:0dee8840a1c0, 2019-07-29 (annotated)
- Committer:
- einsteingustavo
- Date:
- Mon Jul 29 20:38:00 2019 +0000
- Revision:
- 0:0dee8840a1c0
Mangue Baja Box
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
einsteingustavo | 0:0dee8840a1c0 | 1 | /** |
einsteingustavo | 0:0dee8840a1c0 | 2 | ****************************************************************************** |
einsteingustavo | 0:0dee8840a1c0 | 3 | * @file stm32f10x_sdio.h |
einsteingustavo | 0:0dee8840a1c0 | 4 | * @author MCD Application Team |
einsteingustavo | 0:0dee8840a1c0 | 5 | * @version V3.6.1 |
einsteingustavo | 0:0dee8840a1c0 | 6 | * @date 05-March-2012 |
einsteingustavo | 0:0dee8840a1c0 | 7 | * @brief This file contains all the functions prototypes for the SDIO firmware |
einsteingustavo | 0:0dee8840a1c0 | 8 | * library. |
einsteingustavo | 0:0dee8840a1c0 | 9 | ******************************************************************************* |
einsteingustavo | 0:0dee8840a1c0 | 10 | * Copyright (c) 2014, STMicroelectronics |
einsteingustavo | 0:0dee8840a1c0 | 11 | * All rights reserved. |
einsteingustavo | 0:0dee8840a1c0 | 12 | * |
einsteingustavo | 0:0dee8840a1c0 | 13 | * Redistribution and use in source and binary forms, with or without |
einsteingustavo | 0:0dee8840a1c0 | 14 | * modification, are permitted provided that the following conditions are met: |
einsteingustavo | 0:0dee8840a1c0 | 15 | * |
einsteingustavo | 0:0dee8840a1c0 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
einsteingustavo | 0:0dee8840a1c0 | 17 | * this list of conditions and the following disclaimer. |
einsteingustavo | 0:0dee8840a1c0 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
einsteingustavo | 0:0dee8840a1c0 | 19 | * this list of conditions and the following disclaimer in the documentation |
einsteingustavo | 0:0dee8840a1c0 | 20 | * and/or other materials provided with the distribution. |
einsteingustavo | 0:0dee8840a1c0 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
einsteingustavo | 0:0dee8840a1c0 | 22 | * may be used to endorse or promote products derived from this software |
einsteingustavo | 0:0dee8840a1c0 | 23 | * without specific prior written permission. |
einsteingustavo | 0:0dee8840a1c0 | 24 | * |
einsteingustavo | 0:0dee8840a1c0 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
einsteingustavo | 0:0dee8840a1c0 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
einsteingustavo | 0:0dee8840a1c0 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
einsteingustavo | 0:0dee8840a1c0 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
einsteingustavo | 0:0dee8840a1c0 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
einsteingustavo | 0:0dee8840a1c0 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
einsteingustavo | 0:0dee8840a1c0 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
einsteingustavo | 0:0dee8840a1c0 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
einsteingustavo | 0:0dee8840a1c0 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
einsteingustavo | 0:0dee8840a1c0 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
einsteingustavo | 0:0dee8840a1c0 | 35 | ******************************************************************************* |
einsteingustavo | 0:0dee8840a1c0 | 36 | */ |
einsteingustavo | 0:0dee8840a1c0 | 37 | |
einsteingustavo | 0:0dee8840a1c0 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
einsteingustavo | 0:0dee8840a1c0 | 39 | #ifndef __STM32F10x_SDIO_H |
einsteingustavo | 0:0dee8840a1c0 | 40 | #define __STM32F10x_SDIO_H |
einsteingustavo | 0:0dee8840a1c0 | 41 | |
einsteingustavo | 0:0dee8840a1c0 | 42 | #ifdef __cplusplus |
einsteingustavo | 0:0dee8840a1c0 | 43 | extern "C" { |
einsteingustavo | 0:0dee8840a1c0 | 44 | #endif |
einsteingustavo | 0:0dee8840a1c0 | 45 | |
einsteingustavo | 0:0dee8840a1c0 | 46 | /* Includes ------------------------------------------------------------------*/ |
einsteingustavo | 0:0dee8840a1c0 | 47 | #include "stm32f10x.h" |
einsteingustavo | 0:0dee8840a1c0 | 48 | |
einsteingustavo | 0:0dee8840a1c0 | 49 | /** @addtogroup STM32F10x_StdPeriph_Driver |
einsteingustavo | 0:0dee8840a1c0 | 50 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 51 | */ |
einsteingustavo | 0:0dee8840a1c0 | 52 | |
einsteingustavo | 0:0dee8840a1c0 | 53 | /** @addtogroup SDIO |
einsteingustavo | 0:0dee8840a1c0 | 54 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 55 | */ |
einsteingustavo | 0:0dee8840a1c0 | 56 | |
einsteingustavo | 0:0dee8840a1c0 | 57 | /** @defgroup SDIO_Exported_Types |
einsteingustavo | 0:0dee8840a1c0 | 58 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 59 | */ |
einsteingustavo | 0:0dee8840a1c0 | 60 | |
einsteingustavo | 0:0dee8840a1c0 | 61 | typedef struct |
einsteingustavo | 0:0dee8840a1c0 | 62 | { |
einsteingustavo | 0:0dee8840a1c0 | 63 | uint32_t SDIO_ClockEdge; /*!< Specifies the clock transition on which the bit capture is made. |
einsteingustavo | 0:0dee8840a1c0 | 64 | This parameter can be a value of @ref SDIO_Clock_Edge */ |
einsteingustavo | 0:0dee8840a1c0 | 65 | |
einsteingustavo | 0:0dee8840a1c0 | 66 | uint32_t SDIO_ClockBypass; /*!< Specifies whether the SDIO Clock divider bypass is |
einsteingustavo | 0:0dee8840a1c0 | 67 | enabled or disabled. |
einsteingustavo | 0:0dee8840a1c0 | 68 | This parameter can be a value of @ref SDIO_Clock_Bypass */ |
einsteingustavo | 0:0dee8840a1c0 | 69 | |
einsteingustavo | 0:0dee8840a1c0 | 70 | uint32_t SDIO_ClockPowerSave; /*!< Specifies whether SDIO Clock output is enabled or |
einsteingustavo | 0:0dee8840a1c0 | 71 | disabled when the bus is idle. |
einsteingustavo | 0:0dee8840a1c0 | 72 | This parameter can be a value of @ref SDIO_Clock_Power_Save */ |
einsteingustavo | 0:0dee8840a1c0 | 73 | |
einsteingustavo | 0:0dee8840a1c0 | 74 | uint32_t SDIO_BusWide; /*!< Specifies the SDIO bus width. |
einsteingustavo | 0:0dee8840a1c0 | 75 | This parameter can be a value of @ref SDIO_Bus_Wide */ |
einsteingustavo | 0:0dee8840a1c0 | 76 | |
einsteingustavo | 0:0dee8840a1c0 | 77 | uint32_t SDIO_HardwareFlowControl; /*!< Specifies whether the SDIO hardware flow control is enabled or disabled. |
einsteingustavo | 0:0dee8840a1c0 | 78 | This parameter can be a value of @ref SDIO_Hardware_Flow_Control */ |
einsteingustavo | 0:0dee8840a1c0 | 79 | |
einsteingustavo | 0:0dee8840a1c0 | 80 | uint8_t SDIO_ClockDiv; /*!< Specifies the clock frequency of the SDIO controller. |
einsteingustavo | 0:0dee8840a1c0 | 81 | This parameter can be a value between 0x00 and 0xFF. */ |
einsteingustavo | 0:0dee8840a1c0 | 82 | |
einsteingustavo | 0:0dee8840a1c0 | 83 | } SDIO_InitTypeDef; |
einsteingustavo | 0:0dee8840a1c0 | 84 | |
einsteingustavo | 0:0dee8840a1c0 | 85 | typedef struct |
einsteingustavo | 0:0dee8840a1c0 | 86 | { |
einsteingustavo | 0:0dee8840a1c0 | 87 | uint32_t SDIO_Argument; /*!< Specifies the SDIO command argument which is sent |
einsteingustavo | 0:0dee8840a1c0 | 88 | to a card as part of a command message. If a command |
einsteingustavo | 0:0dee8840a1c0 | 89 | contains an argument, it must be loaded into this register |
einsteingustavo | 0:0dee8840a1c0 | 90 | before writing the command to the command register */ |
einsteingustavo | 0:0dee8840a1c0 | 91 | |
einsteingustavo | 0:0dee8840a1c0 | 92 | uint32_t SDIO_CmdIndex; /*!< Specifies the SDIO command index. It must be lower than 0x40. */ |
einsteingustavo | 0:0dee8840a1c0 | 93 | |
einsteingustavo | 0:0dee8840a1c0 | 94 | uint32_t SDIO_Response; /*!< Specifies the SDIO response type. |
einsteingustavo | 0:0dee8840a1c0 | 95 | This parameter can be a value of @ref SDIO_Response_Type */ |
einsteingustavo | 0:0dee8840a1c0 | 96 | |
einsteingustavo | 0:0dee8840a1c0 | 97 | uint32_t SDIO_Wait; /*!< Specifies whether SDIO wait-for-interrupt request is enabled or disabled. |
einsteingustavo | 0:0dee8840a1c0 | 98 | This parameter can be a value of @ref SDIO_Wait_Interrupt_State */ |
einsteingustavo | 0:0dee8840a1c0 | 99 | |
einsteingustavo | 0:0dee8840a1c0 | 100 | uint32_t SDIO_CPSM; /*!< Specifies whether SDIO Command path state machine (CPSM) |
einsteingustavo | 0:0dee8840a1c0 | 101 | is enabled or disabled. |
einsteingustavo | 0:0dee8840a1c0 | 102 | This parameter can be a value of @ref SDIO_CPSM_State */ |
einsteingustavo | 0:0dee8840a1c0 | 103 | } SDIO_CmdInitTypeDef; |
einsteingustavo | 0:0dee8840a1c0 | 104 | |
einsteingustavo | 0:0dee8840a1c0 | 105 | typedef struct |
einsteingustavo | 0:0dee8840a1c0 | 106 | { |
einsteingustavo | 0:0dee8840a1c0 | 107 | uint32_t SDIO_DataTimeOut; /*!< Specifies the data timeout period in card bus clock periods. */ |
einsteingustavo | 0:0dee8840a1c0 | 108 | |
einsteingustavo | 0:0dee8840a1c0 | 109 | uint32_t SDIO_DataLength; /*!< Specifies the number of data bytes to be transferred. */ |
einsteingustavo | 0:0dee8840a1c0 | 110 | |
einsteingustavo | 0:0dee8840a1c0 | 111 | uint32_t SDIO_DataBlockSize; /*!< Specifies the data block size for block transfer. |
einsteingustavo | 0:0dee8840a1c0 | 112 | This parameter can be a value of @ref SDIO_Data_Block_Size */ |
einsteingustavo | 0:0dee8840a1c0 | 113 | |
einsteingustavo | 0:0dee8840a1c0 | 114 | uint32_t SDIO_TransferDir; /*!< Specifies the data transfer direction, whether the transfer |
einsteingustavo | 0:0dee8840a1c0 | 115 | is a read or write. |
einsteingustavo | 0:0dee8840a1c0 | 116 | This parameter can be a value of @ref SDIO_Transfer_Direction */ |
einsteingustavo | 0:0dee8840a1c0 | 117 | |
einsteingustavo | 0:0dee8840a1c0 | 118 | uint32_t SDIO_TransferMode; /*!< Specifies whether data transfer is in stream or block mode. |
einsteingustavo | 0:0dee8840a1c0 | 119 | This parameter can be a value of @ref SDIO_Transfer_Type */ |
einsteingustavo | 0:0dee8840a1c0 | 120 | |
einsteingustavo | 0:0dee8840a1c0 | 121 | uint32_t SDIO_DPSM; /*!< Specifies whether SDIO Data path state machine (DPSM) |
einsteingustavo | 0:0dee8840a1c0 | 122 | is enabled or disabled. |
einsteingustavo | 0:0dee8840a1c0 | 123 | This parameter can be a value of @ref SDIO_DPSM_State */ |
einsteingustavo | 0:0dee8840a1c0 | 124 | } SDIO_DataInitTypeDef; |
einsteingustavo | 0:0dee8840a1c0 | 125 | |
einsteingustavo | 0:0dee8840a1c0 | 126 | /** |
einsteingustavo | 0:0dee8840a1c0 | 127 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 128 | */ |
einsteingustavo | 0:0dee8840a1c0 | 129 | |
einsteingustavo | 0:0dee8840a1c0 | 130 | /** @defgroup SDIO_Exported_Constants |
einsteingustavo | 0:0dee8840a1c0 | 131 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 132 | */ |
einsteingustavo | 0:0dee8840a1c0 | 133 | |
einsteingustavo | 0:0dee8840a1c0 | 134 | /** @defgroup SDIO_Clock_Edge |
einsteingustavo | 0:0dee8840a1c0 | 135 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 136 | */ |
einsteingustavo | 0:0dee8840a1c0 | 137 | |
einsteingustavo | 0:0dee8840a1c0 | 138 | #define SDIO_ClockEdge_Rising ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 139 | #define SDIO_ClockEdge_Falling ((uint32_t)0x00002000) |
einsteingustavo | 0:0dee8840a1c0 | 140 | #define IS_SDIO_CLOCK_EDGE(EDGE) (((EDGE) == SDIO_ClockEdge_Rising) || \ |
einsteingustavo | 0:0dee8840a1c0 | 141 | ((EDGE) == SDIO_ClockEdge_Falling)) |
einsteingustavo | 0:0dee8840a1c0 | 142 | /** |
einsteingustavo | 0:0dee8840a1c0 | 143 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 144 | */ |
einsteingustavo | 0:0dee8840a1c0 | 145 | |
einsteingustavo | 0:0dee8840a1c0 | 146 | /** @defgroup SDIO_Clock_Bypass |
einsteingustavo | 0:0dee8840a1c0 | 147 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 148 | */ |
einsteingustavo | 0:0dee8840a1c0 | 149 | |
einsteingustavo | 0:0dee8840a1c0 | 150 | #define SDIO_ClockBypass_Disable ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 151 | #define SDIO_ClockBypass_Enable ((uint32_t)0x00000400) |
einsteingustavo | 0:0dee8840a1c0 | 152 | #define IS_SDIO_CLOCK_BYPASS(BYPASS) (((BYPASS) == SDIO_ClockBypass_Disable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 153 | ((BYPASS) == SDIO_ClockBypass_Enable)) |
einsteingustavo | 0:0dee8840a1c0 | 154 | /** |
einsteingustavo | 0:0dee8840a1c0 | 155 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 156 | */ |
einsteingustavo | 0:0dee8840a1c0 | 157 | |
einsteingustavo | 0:0dee8840a1c0 | 158 | /** @defgroup SDIO_Clock_Power_Save |
einsteingustavo | 0:0dee8840a1c0 | 159 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 160 | */ |
einsteingustavo | 0:0dee8840a1c0 | 161 | |
einsteingustavo | 0:0dee8840a1c0 | 162 | #define SDIO_ClockPowerSave_Disable ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 163 | #define SDIO_ClockPowerSave_Enable ((uint32_t)0x00000200) |
einsteingustavo | 0:0dee8840a1c0 | 164 | #define IS_SDIO_CLOCK_POWER_SAVE(SAVE) (((SAVE) == SDIO_ClockPowerSave_Disable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 165 | ((SAVE) == SDIO_ClockPowerSave_Enable)) |
einsteingustavo | 0:0dee8840a1c0 | 166 | /** |
einsteingustavo | 0:0dee8840a1c0 | 167 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 168 | */ |
einsteingustavo | 0:0dee8840a1c0 | 169 | |
einsteingustavo | 0:0dee8840a1c0 | 170 | /** @defgroup SDIO_Bus_Wide |
einsteingustavo | 0:0dee8840a1c0 | 171 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 172 | */ |
einsteingustavo | 0:0dee8840a1c0 | 173 | |
einsteingustavo | 0:0dee8840a1c0 | 174 | #define SDIO_BusWide_1b ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 175 | #define SDIO_BusWide_4b ((uint32_t)0x00000800) |
einsteingustavo | 0:0dee8840a1c0 | 176 | #define SDIO_BusWide_8b ((uint32_t)0x00001000) |
einsteingustavo | 0:0dee8840a1c0 | 177 | #define IS_SDIO_BUS_WIDE(WIDE) (((WIDE) == SDIO_BusWide_1b) || ((WIDE) == SDIO_BusWide_4b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 178 | ((WIDE) == SDIO_BusWide_8b)) |
einsteingustavo | 0:0dee8840a1c0 | 179 | |
einsteingustavo | 0:0dee8840a1c0 | 180 | /** |
einsteingustavo | 0:0dee8840a1c0 | 181 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 182 | */ |
einsteingustavo | 0:0dee8840a1c0 | 183 | |
einsteingustavo | 0:0dee8840a1c0 | 184 | /** @defgroup SDIO_Hardware_Flow_Control |
einsteingustavo | 0:0dee8840a1c0 | 185 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 186 | */ |
einsteingustavo | 0:0dee8840a1c0 | 187 | |
einsteingustavo | 0:0dee8840a1c0 | 188 | #define SDIO_HardwareFlowControl_Disable ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 189 | #define SDIO_HardwareFlowControl_Enable ((uint32_t)0x00004000) |
einsteingustavo | 0:0dee8840a1c0 | 190 | #define IS_SDIO_HARDWARE_FLOW_CONTROL(CONTROL) (((CONTROL) == SDIO_HardwareFlowControl_Disable) || \ |
einsteingustavo | 0:0dee8840a1c0 | 191 | ((CONTROL) == SDIO_HardwareFlowControl_Enable)) |
einsteingustavo | 0:0dee8840a1c0 | 192 | /** |
einsteingustavo | 0:0dee8840a1c0 | 193 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 194 | */ |
einsteingustavo | 0:0dee8840a1c0 | 195 | |
einsteingustavo | 0:0dee8840a1c0 | 196 | /** @defgroup SDIO_Power_State |
einsteingustavo | 0:0dee8840a1c0 | 197 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 198 | */ |
einsteingustavo | 0:0dee8840a1c0 | 199 | |
einsteingustavo | 0:0dee8840a1c0 | 200 | #define SDIO_PowerState_OFF ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 201 | #define SDIO_PowerState_ON ((uint32_t)0x00000003) |
einsteingustavo | 0:0dee8840a1c0 | 202 | #define IS_SDIO_POWER_STATE(STATE) (((STATE) == SDIO_PowerState_OFF) || ((STATE) == SDIO_PowerState_ON)) |
einsteingustavo | 0:0dee8840a1c0 | 203 | /** |
einsteingustavo | 0:0dee8840a1c0 | 204 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 205 | */ |
einsteingustavo | 0:0dee8840a1c0 | 206 | |
einsteingustavo | 0:0dee8840a1c0 | 207 | |
einsteingustavo | 0:0dee8840a1c0 | 208 | /** @defgroup SDIO_Interrupt_sources |
einsteingustavo | 0:0dee8840a1c0 | 209 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 210 | */ |
einsteingustavo | 0:0dee8840a1c0 | 211 | |
einsteingustavo | 0:0dee8840a1c0 | 212 | #define SDIO_IT_CCRCFAIL ((uint32_t)0x00000001) |
einsteingustavo | 0:0dee8840a1c0 | 213 | #define SDIO_IT_DCRCFAIL ((uint32_t)0x00000002) |
einsteingustavo | 0:0dee8840a1c0 | 214 | #define SDIO_IT_CTIMEOUT ((uint32_t)0x00000004) |
einsteingustavo | 0:0dee8840a1c0 | 215 | #define SDIO_IT_DTIMEOUT ((uint32_t)0x00000008) |
einsteingustavo | 0:0dee8840a1c0 | 216 | #define SDIO_IT_TXUNDERR ((uint32_t)0x00000010) |
einsteingustavo | 0:0dee8840a1c0 | 217 | #define SDIO_IT_RXOVERR ((uint32_t)0x00000020) |
einsteingustavo | 0:0dee8840a1c0 | 218 | #define SDIO_IT_CMDREND ((uint32_t)0x00000040) |
einsteingustavo | 0:0dee8840a1c0 | 219 | #define SDIO_IT_CMDSENT ((uint32_t)0x00000080) |
einsteingustavo | 0:0dee8840a1c0 | 220 | #define SDIO_IT_DATAEND ((uint32_t)0x00000100) |
einsteingustavo | 0:0dee8840a1c0 | 221 | #define SDIO_IT_STBITERR ((uint32_t)0x00000200) |
einsteingustavo | 0:0dee8840a1c0 | 222 | #define SDIO_IT_DBCKEND ((uint32_t)0x00000400) |
einsteingustavo | 0:0dee8840a1c0 | 223 | #define SDIO_IT_CMDACT ((uint32_t)0x00000800) |
einsteingustavo | 0:0dee8840a1c0 | 224 | #define SDIO_IT_TXACT ((uint32_t)0x00001000) |
einsteingustavo | 0:0dee8840a1c0 | 225 | #define SDIO_IT_RXACT ((uint32_t)0x00002000) |
einsteingustavo | 0:0dee8840a1c0 | 226 | #define SDIO_IT_TXFIFOHE ((uint32_t)0x00004000) |
einsteingustavo | 0:0dee8840a1c0 | 227 | #define SDIO_IT_RXFIFOHF ((uint32_t)0x00008000) |
einsteingustavo | 0:0dee8840a1c0 | 228 | #define SDIO_IT_TXFIFOF ((uint32_t)0x00010000) |
einsteingustavo | 0:0dee8840a1c0 | 229 | #define SDIO_IT_RXFIFOF ((uint32_t)0x00020000) |
einsteingustavo | 0:0dee8840a1c0 | 230 | #define SDIO_IT_TXFIFOE ((uint32_t)0x00040000) |
einsteingustavo | 0:0dee8840a1c0 | 231 | #define SDIO_IT_RXFIFOE ((uint32_t)0x00080000) |
einsteingustavo | 0:0dee8840a1c0 | 232 | #define SDIO_IT_TXDAVL ((uint32_t)0x00100000) |
einsteingustavo | 0:0dee8840a1c0 | 233 | #define SDIO_IT_RXDAVL ((uint32_t)0x00200000) |
einsteingustavo | 0:0dee8840a1c0 | 234 | #define SDIO_IT_SDIOIT ((uint32_t)0x00400000) |
einsteingustavo | 0:0dee8840a1c0 | 235 | #define SDIO_IT_CEATAEND ((uint32_t)0x00800000) |
einsteingustavo | 0:0dee8840a1c0 | 236 | #define IS_SDIO_IT(IT) ((((IT) & (uint32_t)0xFF000000) == 0x00) && ((IT) != (uint32_t)0x00)) |
einsteingustavo | 0:0dee8840a1c0 | 237 | /** |
einsteingustavo | 0:0dee8840a1c0 | 238 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 239 | */ |
einsteingustavo | 0:0dee8840a1c0 | 240 | |
einsteingustavo | 0:0dee8840a1c0 | 241 | /** @defgroup SDIO_Command_Index |
einsteingustavo | 0:0dee8840a1c0 | 242 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 243 | */ |
einsteingustavo | 0:0dee8840a1c0 | 244 | |
einsteingustavo | 0:0dee8840a1c0 | 245 | #define IS_SDIO_CMD_INDEX(INDEX) ((INDEX) < 0x40) |
einsteingustavo | 0:0dee8840a1c0 | 246 | /** |
einsteingustavo | 0:0dee8840a1c0 | 247 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 248 | */ |
einsteingustavo | 0:0dee8840a1c0 | 249 | |
einsteingustavo | 0:0dee8840a1c0 | 250 | /** @defgroup SDIO_Response_Type |
einsteingustavo | 0:0dee8840a1c0 | 251 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 252 | */ |
einsteingustavo | 0:0dee8840a1c0 | 253 | |
einsteingustavo | 0:0dee8840a1c0 | 254 | #define SDIO_Response_No ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 255 | #define SDIO_Response_Short ((uint32_t)0x00000040) |
einsteingustavo | 0:0dee8840a1c0 | 256 | #define SDIO_Response_Long ((uint32_t)0x000000C0) |
einsteingustavo | 0:0dee8840a1c0 | 257 | #define IS_SDIO_RESPONSE(RESPONSE) (((RESPONSE) == SDIO_Response_No) || \ |
einsteingustavo | 0:0dee8840a1c0 | 258 | ((RESPONSE) == SDIO_Response_Short) || \ |
einsteingustavo | 0:0dee8840a1c0 | 259 | ((RESPONSE) == SDIO_Response_Long)) |
einsteingustavo | 0:0dee8840a1c0 | 260 | /** |
einsteingustavo | 0:0dee8840a1c0 | 261 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 262 | */ |
einsteingustavo | 0:0dee8840a1c0 | 263 | |
einsteingustavo | 0:0dee8840a1c0 | 264 | /** @defgroup SDIO_Wait_Interrupt_State |
einsteingustavo | 0:0dee8840a1c0 | 265 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 266 | */ |
einsteingustavo | 0:0dee8840a1c0 | 267 | |
einsteingustavo | 0:0dee8840a1c0 | 268 | #define SDIO_Wait_No ((uint32_t)0x00000000) /*!< SDIO No Wait, TimeOut is enabled */ |
einsteingustavo | 0:0dee8840a1c0 | 269 | #define SDIO_Wait_IT ((uint32_t)0x00000100) /*!< SDIO Wait Interrupt Request */ |
einsteingustavo | 0:0dee8840a1c0 | 270 | #define SDIO_Wait_Pend ((uint32_t)0x00000200) /*!< SDIO Wait End of transfer */ |
einsteingustavo | 0:0dee8840a1c0 | 271 | #define IS_SDIO_WAIT(WAIT) (((WAIT) == SDIO_Wait_No) || ((WAIT) == SDIO_Wait_IT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 272 | ((WAIT) == SDIO_Wait_Pend)) |
einsteingustavo | 0:0dee8840a1c0 | 273 | /** |
einsteingustavo | 0:0dee8840a1c0 | 274 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 275 | */ |
einsteingustavo | 0:0dee8840a1c0 | 276 | |
einsteingustavo | 0:0dee8840a1c0 | 277 | /** @defgroup SDIO_CPSM_State |
einsteingustavo | 0:0dee8840a1c0 | 278 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 279 | */ |
einsteingustavo | 0:0dee8840a1c0 | 280 | |
einsteingustavo | 0:0dee8840a1c0 | 281 | #define SDIO_CPSM_Disable ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 282 | #define SDIO_CPSM_Enable ((uint32_t)0x00000400) |
einsteingustavo | 0:0dee8840a1c0 | 283 | #define IS_SDIO_CPSM(CPSM) (((CPSM) == SDIO_CPSM_Enable) || ((CPSM) == SDIO_CPSM_Disable)) |
einsteingustavo | 0:0dee8840a1c0 | 284 | /** |
einsteingustavo | 0:0dee8840a1c0 | 285 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 286 | */ |
einsteingustavo | 0:0dee8840a1c0 | 287 | |
einsteingustavo | 0:0dee8840a1c0 | 288 | /** @defgroup SDIO_Response_Registers |
einsteingustavo | 0:0dee8840a1c0 | 289 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 290 | */ |
einsteingustavo | 0:0dee8840a1c0 | 291 | |
einsteingustavo | 0:0dee8840a1c0 | 292 | #define SDIO_RESP1 ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 293 | #define SDIO_RESP2 ((uint32_t)0x00000004) |
einsteingustavo | 0:0dee8840a1c0 | 294 | #define SDIO_RESP3 ((uint32_t)0x00000008) |
einsteingustavo | 0:0dee8840a1c0 | 295 | #define SDIO_RESP4 ((uint32_t)0x0000000C) |
einsteingustavo | 0:0dee8840a1c0 | 296 | #define IS_SDIO_RESP(RESP) (((RESP) == SDIO_RESP1) || ((RESP) == SDIO_RESP2) || \ |
einsteingustavo | 0:0dee8840a1c0 | 297 | ((RESP) == SDIO_RESP3) || ((RESP) == SDIO_RESP4)) |
einsteingustavo | 0:0dee8840a1c0 | 298 | /** |
einsteingustavo | 0:0dee8840a1c0 | 299 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 300 | */ |
einsteingustavo | 0:0dee8840a1c0 | 301 | |
einsteingustavo | 0:0dee8840a1c0 | 302 | /** @defgroup SDIO_Data_Length |
einsteingustavo | 0:0dee8840a1c0 | 303 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 304 | */ |
einsteingustavo | 0:0dee8840a1c0 | 305 | |
einsteingustavo | 0:0dee8840a1c0 | 306 | #define IS_SDIO_DATA_LENGTH(LENGTH) ((LENGTH) <= 0x01FFFFFF) |
einsteingustavo | 0:0dee8840a1c0 | 307 | /** |
einsteingustavo | 0:0dee8840a1c0 | 308 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 309 | */ |
einsteingustavo | 0:0dee8840a1c0 | 310 | |
einsteingustavo | 0:0dee8840a1c0 | 311 | /** @defgroup SDIO_Data_Block_Size |
einsteingustavo | 0:0dee8840a1c0 | 312 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 313 | */ |
einsteingustavo | 0:0dee8840a1c0 | 314 | |
einsteingustavo | 0:0dee8840a1c0 | 315 | #define SDIO_DataBlockSize_1b ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 316 | #define SDIO_DataBlockSize_2b ((uint32_t)0x00000010) |
einsteingustavo | 0:0dee8840a1c0 | 317 | #define SDIO_DataBlockSize_4b ((uint32_t)0x00000020) |
einsteingustavo | 0:0dee8840a1c0 | 318 | #define SDIO_DataBlockSize_8b ((uint32_t)0x00000030) |
einsteingustavo | 0:0dee8840a1c0 | 319 | #define SDIO_DataBlockSize_16b ((uint32_t)0x00000040) |
einsteingustavo | 0:0dee8840a1c0 | 320 | #define SDIO_DataBlockSize_32b ((uint32_t)0x00000050) |
einsteingustavo | 0:0dee8840a1c0 | 321 | #define SDIO_DataBlockSize_64b ((uint32_t)0x00000060) |
einsteingustavo | 0:0dee8840a1c0 | 322 | #define SDIO_DataBlockSize_128b ((uint32_t)0x00000070) |
einsteingustavo | 0:0dee8840a1c0 | 323 | #define SDIO_DataBlockSize_256b ((uint32_t)0x00000080) |
einsteingustavo | 0:0dee8840a1c0 | 324 | #define SDIO_DataBlockSize_512b ((uint32_t)0x00000090) |
einsteingustavo | 0:0dee8840a1c0 | 325 | #define SDIO_DataBlockSize_1024b ((uint32_t)0x000000A0) |
einsteingustavo | 0:0dee8840a1c0 | 326 | #define SDIO_DataBlockSize_2048b ((uint32_t)0x000000B0) |
einsteingustavo | 0:0dee8840a1c0 | 327 | #define SDIO_DataBlockSize_4096b ((uint32_t)0x000000C0) |
einsteingustavo | 0:0dee8840a1c0 | 328 | #define SDIO_DataBlockSize_8192b ((uint32_t)0x000000D0) |
einsteingustavo | 0:0dee8840a1c0 | 329 | #define SDIO_DataBlockSize_16384b ((uint32_t)0x000000E0) |
einsteingustavo | 0:0dee8840a1c0 | 330 | #define IS_SDIO_BLOCK_SIZE(SIZE) (((SIZE) == SDIO_DataBlockSize_1b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 331 | ((SIZE) == SDIO_DataBlockSize_2b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 332 | ((SIZE) == SDIO_DataBlockSize_4b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 333 | ((SIZE) == SDIO_DataBlockSize_8b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 334 | ((SIZE) == SDIO_DataBlockSize_16b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 335 | ((SIZE) == SDIO_DataBlockSize_32b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 336 | ((SIZE) == SDIO_DataBlockSize_64b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 337 | ((SIZE) == SDIO_DataBlockSize_128b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 338 | ((SIZE) == SDIO_DataBlockSize_256b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 339 | ((SIZE) == SDIO_DataBlockSize_512b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 340 | ((SIZE) == SDIO_DataBlockSize_1024b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 341 | ((SIZE) == SDIO_DataBlockSize_2048b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 342 | ((SIZE) == SDIO_DataBlockSize_4096b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 343 | ((SIZE) == SDIO_DataBlockSize_8192b) || \ |
einsteingustavo | 0:0dee8840a1c0 | 344 | ((SIZE) == SDIO_DataBlockSize_16384b)) |
einsteingustavo | 0:0dee8840a1c0 | 345 | /** |
einsteingustavo | 0:0dee8840a1c0 | 346 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 347 | */ |
einsteingustavo | 0:0dee8840a1c0 | 348 | |
einsteingustavo | 0:0dee8840a1c0 | 349 | /** @defgroup SDIO_Transfer_Direction |
einsteingustavo | 0:0dee8840a1c0 | 350 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 351 | */ |
einsteingustavo | 0:0dee8840a1c0 | 352 | |
einsteingustavo | 0:0dee8840a1c0 | 353 | #define SDIO_TransferDir_ToCard ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 354 | #define SDIO_TransferDir_ToSDIO ((uint32_t)0x00000002) |
einsteingustavo | 0:0dee8840a1c0 | 355 | #define IS_SDIO_TRANSFER_DIR(DIR) (((DIR) == SDIO_TransferDir_ToCard) || \ |
einsteingustavo | 0:0dee8840a1c0 | 356 | ((DIR) == SDIO_TransferDir_ToSDIO)) |
einsteingustavo | 0:0dee8840a1c0 | 357 | /** |
einsteingustavo | 0:0dee8840a1c0 | 358 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 359 | */ |
einsteingustavo | 0:0dee8840a1c0 | 360 | |
einsteingustavo | 0:0dee8840a1c0 | 361 | /** @defgroup SDIO_Transfer_Type |
einsteingustavo | 0:0dee8840a1c0 | 362 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 363 | */ |
einsteingustavo | 0:0dee8840a1c0 | 364 | |
einsteingustavo | 0:0dee8840a1c0 | 365 | #define SDIO_TransferMode_Block ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 366 | #define SDIO_TransferMode_Stream ((uint32_t)0x00000004) |
einsteingustavo | 0:0dee8840a1c0 | 367 | #define IS_SDIO_TRANSFER_MODE(MODE) (((MODE) == SDIO_TransferMode_Stream) || \ |
einsteingustavo | 0:0dee8840a1c0 | 368 | ((MODE) == SDIO_TransferMode_Block)) |
einsteingustavo | 0:0dee8840a1c0 | 369 | /** |
einsteingustavo | 0:0dee8840a1c0 | 370 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 371 | */ |
einsteingustavo | 0:0dee8840a1c0 | 372 | |
einsteingustavo | 0:0dee8840a1c0 | 373 | /** @defgroup SDIO_DPSM_State |
einsteingustavo | 0:0dee8840a1c0 | 374 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 375 | */ |
einsteingustavo | 0:0dee8840a1c0 | 376 | |
einsteingustavo | 0:0dee8840a1c0 | 377 | #define SDIO_DPSM_Disable ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 378 | #define SDIO_DPSM_Enable ((uint32_t)0x00000001) |
einsteingustavo | 0:0dee8840a1c0 | 379 | #define IS_SDIO_DPSM(DPSM) (((DPSM) == SDIO_DPSM_Enable) || ((DPSM) == SDIO_DPSM_Disable)) |
einsteingustavo | 0:0dee8840a1c0 | 380 | /** |
einsteingustavo | 0:0dee8840a1c0 | 381 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 382 | */ |
einsteingustavo | 0:0dee8840a1c0 | 383 | |
einsteingustavo | 0:0dee8840a1c0 | 384 | /** @defgroup SDIO_Flags |
einsteingustavo | 0:0dee8840a1c0 | 385 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 386 | */ |
einsteingustavo | 0:0dee8840a1c0 | 387 | |
einsteingustavo | 0:0dee8840a1c0 | 388 | #define SDIO_FLAG_CCRCFAIL ((uint32_t)0x00000001) |
einsteingustavo | 0:0dee8840a1c0 | 389 | #define SDIO_FLAG_DCRCFAIL ((uint32_t)0x00000002) |
einsteingustavo | 0:0dee8840a1c0 | 390 | #define SDIO_FLAG_CTIMEOUT ((uint32_t)0x00000004) |
einsteingustavo | 0:0dee8840a1c0 | 391 | #define SDIO_FLAG_DTIMEOUT ((uint32_t)0x00000008) |
einsteingustavo | 0:0dee8840a1c0 | 392 | #define SDIO_FLAG_TXUNDERR ((uint32_t)0x00000010) |
einsteingustavo | 0:0dee8840a1c0 | 393 | #define SDIO_FLAG_RXOVERR ((uint32_t)0x00000020) |
einsteingustavo | 0:0dee8840a1c0 | 394 | #define SDIO_FLAG_CMDREND ((uint32_t)0x00000040) |
einsteingustavo | 0:0dee8840a1c0 | 395 | #define SDIO_FLAG_CMDSENT ((uint32_t)0x00000080) |
einsteingustavo | 0:0dee8840a1c0 | 396 | #define SDIO_FLAG_DATAEND ((uint32_t)0x00000100) |
einsteingustavo | 0:0dee8840a1c0 | 397 | #define SDIO_FLAG_STBITERR ((uint32_t)0x00000200) |
einsteingustavo | 0:0dee8840a1c0 | 398 | #define SDIO_FLAG_DBCKEND ((uint32_t)0x00000400) |
einsteingustavo | 0:0dee8840a1c0 | 399 | #define SDIO_FLAG_CMDACT ((uint32_t)0x00000800) |
einsteingustavo | 0:0dee8840a1c0 | 400 | #define SDIO_FLAG_TXACT ((uint32_t)0x00001000) |
einsteingustavo | 0:0dee8840a1c0 | 401 | #define SDIO_FLAG_RXACT ((uint32_t)0x00002000) |
einsteingustavo | 0:0dee8840a1c0 | 402 | #define SDIO_FLAG_TXFIFOHE ((uint32_t)0x00004000) |
einsteingustavo | 0:0dee8840a1c0 | 403 | #define SDIO_FLAG_RXFIFOHF ((uint32_t)0x00008000) |
einsteingustavo | 0:0dee8840a1c0 | 404 | #define SDIO_FLAG_TXFIFOF ((uint32_t)0x00010000) |
einsteingustavo | 0:0dee8840a1c0 | 405 | #define SDIO_FLAG_RXFIFOF ((uint32_t)0x00020000) |
einsteingustavo | 0:0dee8840a1c0 | 406 | #define SDIO_FLAG_TXFIFOE ((uint32_t)0x00040000) |
einsteingustavo | 0:0dee8840a1c0 | 407 | #define SDIO_FLAG_RXFIFOE ((uint32_t)0x00080000) |
einsteingustavo | 0:0dee8840a1c0 | 408 | #define SDIO_FLAG_TXDAVL ((uint32_t)0x00100000) |
einsteingustavo | 0:0dee8840a1c0 | 409 | #define SDIO_FLAG_RXDAVL ((uint32_t)0x00200000) |
einsteingustavo | 0:0dee8840a1c0 | 410 | #define SDIO_FLAG_SDIOIT ((uint32_t)0x00400000) |
einsteingustavo | 0:0dee8840a1c0 | 411 | #define SDIO_FLAG_CEATAEND ((uint32_t)0x00800000) |
einsteingustavo | 0:0dee8840a1c0 | 412 | #define IS_SDIO_FLAG(FLAG) (((FLAG) == SDIO_FLAG_CCRCFAIL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 413 | ((FLAG) == SDIO_FLAG_DCRCFAIL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 414 | ((FLAG) == SDIO_FLAG_CTIMEOUT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 415 | ((FLAG) == SDIO_FLAG_DTIMEOUT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 416 | ((FLAG) == SDIO_FLAG_TXUNDERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 417 | ((FLAG) == SDIO_FLAG_RXOVERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 418 | ((FLAG) == SDIO_FLAG_CMDREND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 419 | ((FLAG) == SDIO_FLAG_CMDSENT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 420 | ((FLAG) == SDIO_FLAG_DATAEND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 421 | ((FLAG) == SDIO_FLAG_STBITERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 422 | ((FLAG) == SDIO_FLAG_DBCKEND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 423 | ((FLAG) == SDIO_FLAG_CMDACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 424 | ((FLAG) == SDIO_FLAG_TXACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 425 | ((FLAG) == SDIO_FLAG_RXACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 426 | ((FLAG) == SDIO_FLAG_TXFIFOHE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 427 | ((FLAG) == SDIO_FLAG_RXFIFOHF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 428 | ((FLAG) == SDIO_FLAG_TXFIFOF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 429 | ((FLAG) == SDIO_FLAG_RXFIFOF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 430 | ((FLAG) == SDIO_FLAG_TXFIFOE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 431 | ((FLAG) == SDIO_FLAG_RXFIFOE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 432 | ((FLAG) == SDIO_FLAG_TXDAVL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 433 | ((FLAG) == SDIO_FLAG_RXDAVL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 434 | ((FLAG) == SDIO_FLAG_SDIOIT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 435 | ((FLAG) == SDIO_FLAG_CEATAEND)) |
einsteingustavo | 0:0dee8840a1c0 | 436 | |
einsteingustavo | 0:0dee8840a1c0 | 437 | #define IS_SDIO_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFF3FF800) == 0x00) && ((FLAG) != (uint32_t)0x00)) |
einsteingustavo | 0:0dee8840a1c0 | 438 | |
einsteingustavo | 0:0dee8840a1c0 | 439 | #define IS_SDIO_GET_IT(IT) (((IT) == SDIO_IT_CCRCFAIL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 440 | ((IT) == SDIO_IT_DCRCFAIL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 441 | ((IT) == SDIO_IT_CTIMEOUT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 442 | ((IT) == SDIO_IT_DTIMEOUT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 443 | ((IT) == SDIO_IT_TXUNDERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 444 | ((IT) == SDIO_IT_RXOVERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 445 | ((IT) == SDIO_IT_CMDREND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 446 | ((IT) == SDIO_IT_CMDSENT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 447 | ((IT) == SDIO_IT_DATAEND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 448 | ((IT) == SDIO_IT_STBITERR) || \ |
einsteingustavo | 0:0dee8840a1c0 | 449 | ((IT) == SDIO_IT_DBCKEND) || \ |
einsteingustavo | 0:0dee8840a1c0 | 450 | ((IT) == SDIO_IT_CMDACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 451 | ((IT) == SDIO_IT_TXACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 452 | ((IT) == SDIO_IT_RXACT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 453 | ((IT) == SDIO_IT_TXFIFOHE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 454 | ((IT) == SDIO_IT_RXFIFOHF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 455 | ((IT) == SDIO_IT_TXFIFOF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 456 | ((IT) == SDIO_IT_RXFIFOF) || \ |
einsteingustavo | 0:0dee8840a1c0 | 457 | ((IT) == SDIO_IT_TXFIFOE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 458 | ((IT) == SDIO_IT_RXFIFOE) || \ |
einsteingustavo | 0:0dee8840a1c0 | 459 | ((IT) == SDIO_IT_TXDAVL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 460 | ((IT) == SDIO_IT_RXDAVL) || \ |
einsteingustavo | 0:0dee8840a1c0 | 461 | ((IT) == SDIO_IT_SDIOIT) || \ |
einsteingustavo | 0:0dee8840a1c0 | 462 | ((IT) == SDIO_IT_CEATAEND)) |
einsteingustavo | 0:0dee8840a1c0 | 463 | |
einsteingustavo | 0:0dee8840a1c0 | 464 | #define IS_SDIO_CLEAR_IT(IT) ((((IT) & (uint32_t)0xFF3FF800) == 0x00) && ((IT) != (uint32_t)0x00)) |
einsteingustavo | 0:0dee8840a1c0 | 465 | |
einsteingustavo | 0:0dee8840a1c0 | 466 | /** |
einsteingustavo | 0:0dee8840a1c0 | 467 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 468 | */ |
einsteingustavo | 0:0dee8840a1c0 | 469 | |
einsteingustavo | 0:0dee8840a1c0 | 470 | /** @defgroup SDIO_Read_Wait_Mode |
einsteingustavo | 0:0dee8840a1c0 | 471 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 472 | */ |
einsteingustavo | 0:0dee8840a1c0 | 473 | |
einsteingustavo | 0:0dee8840a1c0 | 474 | #define SDIO_ReadWaitMode_CLK ((uint32_t)0x00000001) |
einsteingustavo | 0:0dee8840a1c0 | 475 | #define SDIO_ReadWaitMode_DATA2 ((uint32_t)0x00000000) |
einsteingustavo | 0:0dee8840a1c0 | 476 | #define IS_SDIO_READWAIT_MODE(MODE) (((MODE) == SDIO_ReadWaitMode_CLK) || \ |
einsteingustavo | 0:0dee8840a1c0 | 477 | ((MODE) == SDIO_ReadWaitMode_DATA2)) |
einsteingustavo | 0:0dee8840a1c0 | 478 | /** |
einsteingustavo | 0:0dee8840a1c0 | 479 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 480 | */ |
einsteingustavo | 0:0dee8840a1c0 | 481 | |
einsteingustavo | 0:0dee8840a1c0 | 482 | /** |
einsteingustavo | 0:0dee8840a1c0 | 483 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 484 | */ |
einsteingustavo | 0:0dee8840a1c0 | 485 | |
einsteingustavo | 0:0dee8840a1c0 | 486 | /** @defgroup SDIO_Exported_Macros |
einsteingustavo | 0:0dee8840a1c0 | 487 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 488 | */ |
einsteingustavo | 0:0dee8840a1c0 | 489 | |
einsteingustavo | 0:0dee8840a1c0 | 490 | /** |
einsteingustavo | 0:0dee8840a1c0 | 491 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 492 | */ |
einsteingustavo | 0:0dee8840a1c0 | 493 | |
einsteingustavo | 0:0dee8840a1c0 | 494 | /** @defgroup SDIO_Exported_Functions |
einsteingustavo | 0:0dee8840a1c0 | 495 | * @{ |
einsteingustavo | 0:0dee8840a1c0 | 496 | */ |
einsteingustavo | 0:0dee8840a1c0 | 497 | |
einsteingustavo | 0:0dee8840a1c0 | 498 | void SDIO_DeInit(void); |
einsteingustavo | 0:0dee8840a1c0 | 499 | void SDIO_Init(SDIO_InitTypeDef* SDIO_InitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 500 | void SDIO_StructInit(SDIO_InitTypeDef* SDIO_InitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 501 | void SDIO_ClockCmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 502 | void SDIO_SetPowerState(uint32_t SDIO_PowerState); |
einsteingustavo | 0:0dee8840a1c0 | 503 | uint32_t SDIO_GetPowerState(void); |
einsteingustavo | 0:0dee8840a1c0 | 504 | void SDIO_ITConfig(uint32_t SDIO_IT, FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 505 | void SDIO_DMACmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 506 | void SDIO_SendCommand(SDIO_CmdInitTypeDef *SDIO_CmdInitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 507 | void SDIO_CmdStructInit(SDIO_CmdInitTypeDef* SDIO_CmdInitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 508 | uint8_t SDIO_GetCommandResponse(void); |
einsteingustavo | 0:0dee8840a1c0 | 509 | uint32_t SDIO_GetResponse(uint32_t SDIO_RESP); |
einsteingustavo | 0:0dee8840a1c0 | 510 | void SDIO_DataConfig(SDIO_DataInitTypeDef* SDIO_DataInitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 511 | void SDIO_DataStructInit(SDIO_DataInitTypeDef* SDIO_DataInitStruct); |
einsteingustavo | 0:0dee8840a1c0 | 512 | uint32_t SDIO_GetDataCounter(void); |
einsteingustavo | 0:0dee8840a1c0 | 513 | uint32_t SDIO_ReadData(void); |
einsteingustavo | 0:0dee8840a1c0 | 514 | void SDIO_WriteData(uint32_t Data); |
einsteingustavo | 0:0dee8840a1c0 | 515 | uint32_t SDIO_GetFIFOCount(void); |
einsteingustavo | 0:0dee8840a1c0 | 516 | void SDIO_StartSDIOReadWait(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 517 | void SDIO_StopSDIOReadWait(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 518 | void SDIO_SetSDIOReadWaitMode(uint32_t SDIO_ReadWaitMode); |
einsteingustavo | 0:0dee8840a1c0 | 519 | void SDIO_SetSDIOOperation(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 520 | void SDIO_SendSDIOSuspendCmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 521 | void SDIO_CommandCompletionCmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 522 | void SDIO_CEATAITCmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 523 | void SDIO_SendCEATACmd(FunctionalState NewState); |
einsteingustavo | 0:0dee8840a1c0 | 524 | FlagStatus SDIO_GetFlagStatus(uint32_t SDIO_FLAG); |
einsteingustavo | 0:0dee8840a1c0 | 525 | void SDIO_ClearFlag(uint32_t SDIO_FLAG); |
einsteingustavo | 0:0dee8840a1c0 | 526 | ITStatus SDIO_GetITStatus(uint32_t SDIO_IT); |
einsteingustavo | 0:0dee8840a1c0 | 527 | void SDIO_ClearITPendingBit(uint32_t SDIO_IT); |
einsteingustavo | 0:0dee8840a1c0 | 528 | |
einsteingustavo | 0:0dee8840a1c0 | 529 | #ifdef __cplusplus |
einsteingustavo | 0:0dee8840a1c0 | 530 | } |
einsteingustavo | 0:0dee8840a1c0 | 531 | #endif |
einsteingustavo | 0:0dee8840a1c0 | 532 | |
einsteingustavo | 0:0dee8840a1c0 | 533 | #endif /* __STM32F10x_SDIO_H */ |
einsteingustavo | 0:0dee8840a1c0 | 534 | /** |
einsteingustavo | 0:0dee8840a1c0 | 535 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 536 | */ |
einsteingustavo | 0:0dee8840a1c0 | 537 | |
einsteingustavo | 0:0dee8840a1c0 | 538 | /** |
einsteingustavo | 0:0dee8840a1c0 | 539 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 540 | */ |
einsteingustavo | 0:0dee8840a1c0 | 541 | |
einsteingustavo | 0:0dee8840a1c0 | 542 | /** |
einsteingustavo | 0:0dee8840a1c0 | 543 | * @} |
einsteingustavo | 0:0dee8840a1c0 | 544 | */ |
einsteingustavo | 0:0dee8840a1c0 | 545 | |
einsteingustavo | 0:0dee8840a1c0 | 546 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
einsteingustavo | 0:0dee8840a1c0 | 547 |