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