久久精品国产精品国产精品污,男人扒开添女人下部免费视频,一级国产69式性姿势免费视频,夜鲁夜鲁很鲁在线视频 视频,欧美丰满少妇一区二区三区,国产偷国产偷亚洲高清人乐享,中文 在线 日韩 亚洲 欧美,熟妇人妻无乱码中文字幕真矢织江,一区二区三区人妻制服国产

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

STM32之SDIO例程

發(fā)布時間:2025/3/15 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 STM32之SDIO例程 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

移植ST官方demo,做了部分修改

#include "stm32f10x.h" #include "sdio_sd.h"/* RCC時鐘配置 */ void RCC_config(void) { ErrorStatus HSEStartUpStatus;/* RCC寄存器設(shè)置為默認配置 */RCC_DeInit();/* 打開外部高速時鐘 */RCC_HSEConfig(RCC_HSE_ON);/* 等待外部高速時鐘穩(wěn)定 */HSEStartUpStatus = RCC_WaitForHSEStartUp();if(HSEStartUpStatus == SUCCESS) { /* 設(shè)置HCLK = SYSCLK */RCC_HCLKConfig(RCC_SYSCLK_Div1);/* 設(shè)置PCLK2 = HCLK */RCC_PCLK2Config(RCC_HCLK_Div1);/* 設(shè)置PCLK1 = HCLK / 2 */RCC_PCLK1Config(RCC_HCLK_Div2);/* 設(shè)置FLASH代碼延時 */FLASH_SetLatency(FLASH_Latency_2);/* 使能預(yù)取址緩存 */FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);/* 設(shè)置PLL時鐘源為HSE倍頻9 72MHz */RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);/* 使能PLL */RCC_PLLCmd(ENABLE);/* 等待PLL穩(wěn)定 */while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);/* 設(shè)置PLL為系統(tǒng)時鐘源 */RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);/* 等待系統(tǒng)時鐘源切換到PLL */while(RCC_GetSYSCLKSource() != 0x08);} }/* 中斷配置 */ void NVIC_config(void) {/* 選擇中斷分組2 */NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); }uint8_t wbuf[512]; uint8_t rbuf[512];int main(void) {/* 時鐘配置 */RCC_config();/* 中斷配置 */NVIC_config();if(SD_Init() == SD_OK){for(uint16_t i = 0; i < 512; i++)wbuf[i] = i+1;SD_WriteBlock(wbuf, 0x00, 512);SD_WaitWriteOperation();while(SD_GetStatus() != SD_TRANSFER_OK);SD_ReadBlock(rbuf, 0x00, 512);SD_WaitReadOperation();while(SD_GetStatus() != SD_TRANSFER_OK);}while(1){} } /********************************************************************************* @file stm32_eval_sdio_sd.h* @author MCD Application Team* @version V4.5.0* @date 07-March-2011* @brief This file contains all the functions prototypes for the SD Card * stm32_eval_sdio_sd driver firmware library.******************************************************************************* @attention** THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.** <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32_EVAL_SDIO_SD_H #define __STM32_EVAL_SDIO_SD_H#ifdef __cplusplusextern "C" { #endif/* Includes ------------------------------------------------------------------*/ #include "stm32f10x.h"/** @addtogroup Utilities* @{*//** @addtogroup STM32_EVAL* @{*/ /** @addtogroup Common* @{*//** @addtogroup STM32_EVAL_SDIO_SD* @{*/#define SDIO_FIFO_ADDRESS ((uint32_t)0x40018080) /** * @brief SDIO Intialization Frequency (400KHz max)*/ #define SDIO_INIT_CLK_DIV ((uint8_t)0xB2) /** * @brief SDIO Data Transfer Frequency (25MHz max) */ #define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x01) /** @defgroup STM32_EVAL_SDIO_SD_Exported_Types* @{*/ typedef enum { /** * @brief SDIO specific error defines */ SD_CMD_CRC_FAIL = (1), /*!< Command response received (but CRC check failed) */SD_DATA_CRC_FAIL = (2), /*!< Data bock sent/received (CRC check Failed) */SD_CMD_RSP_TIMEOUT = (3), /*!< Command response timeout */SD_DATA_TIMEOUT = (4), /*!< Data time out */SD_TX_UNDERRUN = (5), /*!< Transmit FIFO under-run */SD_RX_OVERRUN = (6), /*!< Receive FIFO over-run */SD_START_BIT_ERR = (7), /*!< Start bit not detected on all data signals in widE bus mode */SD_CMD_OUT_OF_RANGE = (8), /*!< CMD's argument was out of range.*/SD_ADDR_MISALIGNED = (9), /*!< Misaligned address */SD_BLOCK_LEN_ERR = (10), /*!< Transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */SD_ERASE_SEQ_ERR = (11), /*!< An error in the sequence of erase command occurs.*/SD_BAD_ERASE_PARAM = (12), /*!< An Invalid selection for erase groups */SD_WRITE_PROT_VIOLATION = (13), /*!< Attempt to program a write protect block */SD_LOCK_UNLOCK_FAILED = (14), /*!< Sequence or password error has been detected in unlock command or if there was an attempt to access a locked card */SD_COM_CRC_FAILED = (15), /*!< CRC check of the previous command failed */SD_ILLEGAL_CMD = (16), /*!< Command is not legal for the card state */SD_CARD_ECC_FAILED = (17), /*!< Card internal ECC was applied but failed to correct the data */SD_CC_ERROR = (18), /*!< Internal card controller error */SD_GENERAL_UNKNOWN_ERROR = (19), /*!< General or Unknown error */SD_STREAM_READ_UNDERRUN = (20), /*!< The card could not sustain data transfer in stream read operation. */SD_STREAM_WRITE_OVERRUN = (21), /*!< The card could not sustain data programming in stream mode */SD_CID_CSD_OVERWRITE = (22), /*!< CID/CSD overwrite error */SD_WP_ERASE_SKIP = (23), /*!< only partial address space was erased */SD_CARD_ECC_DISABLED = (24), /*!< Command has been executed without using internal ECC */SD_ERASE_RESET = (25), /*!< Erase sequence was cleared before executing because an out of erase sequence command was received */SD_AKE_SEQ_ERROR = (26), /*!< Error in sequence of authentication. */SD_INVALID_VOLTRANGE = (27),SD_ADDR_OUT_OF_RANGE = (28),SD_SWITCH_ERROR = (29),SD_SDIO_DISABLED = (30),SD_SDIO_FUNCTION_BUSY = (31),SD_SDIO_FUNCTION_FAILED = (32),SD_SDIO_UNKNOWN_FUNCTION = (33),/** * @brief Standard error defines */ SD_INTERNAL_ERROR, SD_NOT_CONFIGURED,SD_REQUEST_PENDING, SD_REQUEST_NOT_APPLICABLE, SD_INVALID_PARAMETER, SD_UNSUPPORTED_FEATURE, SD_UNSUPPORTED_HW, SD_ERROR, SD_OK = 0 } SD_Error;/** * @brief SDIO Transfer state */ typedef enum {SD_TRANSFER_OK = 0,SD_TRANSFER_BUSY = 1,SD_TRANSFER_ERROR } SDTransferState;/** * @brief SD Card States */ typedef enum {SD_CARD_READY = ((uint32_t)0x00000001),SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002),SD_CARD_STANDBY = ((uint32_t)0x00000003),SD_CARD_TRANSFER = ((uint32_t)0x00000004),SD_CARD_SENDING = ((uint32_t)0x00000005),SD_CARD_RECEIVING = ((uint32_t)0x00000006),SD_CARD_PROGRAMMING = ((uint32_t)0x00000007),SD_CARD_DISCONNECTED = ((uint32_t)0x00000008),SD_CARD_ERROR = ((uint32_t)0x000000FF) }SDCardState;/** * @brief Card Specific Data: CSD Register */ typedef struct {__IO uint8_t CSDStruct; /*!< CSD structure */__IO uint8_t SysSpecVersion; /*!< System specification version */__IO uint8_t Reserved1; /*!< Reserved */__IO uint8_t TAAC; /*!< Data read access-time 1 */__IO uint8_t NSAC; /*!< Data read access-time 2 in CLK cycles */__IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */__IO uint16_t CardComdClasses; /*!< Card command classes */__IO uint8_t RdBlockLen; /*!< Max. read data block length */__IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */__IO uint8_t WrBlockMisalign; /*!< Write block misalignment */__IO uint8_t RdBlockMisalign; /*!< Read block misalignment */__IO uint8_t DSRImpl; /*!< DSR implemented */__IO uint8_t Reserved2; /*!< Reserved */__IO uint32_t DeviceSize; /*!< Device Size */__IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */__IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */__IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */__IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */__IO uint8_t DeviceSizeMul; /*!< Device size multiplier */__IO uint8_t EraseGrSize; /*!< Erase group size */__IO uint8_t EraseGrMul; /*!< Erase group size multiplier */__IO uint8_t WrProtectGrSize; /*!< Write protect group size */__IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */__IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */__IO uint8_t WrSpeedFact; /*!< Write speed factor */__IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */__IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */__IO uint8_t Reserved3; /*!< Reserded */__IO uint8_t ContentProtectAppli; /*!< Content protection application */__IO uint8_t FileFormatGrouop; /*!< File format group */__IO uint8_t CopyFlag; /*!< Copy flag (OTP) */__IO uint8_t PermWrProtect; /*!< Permanent write protection */__IO uint8_t TempWrProtect; /*!< Temporary write protection */__IO uint8_t FileFormat; /*!< File Format */__IO uint8_t ECC; /*!< ECC code */__IO uint8_t CSD_CRC; /*!< CSD CRC */__IO uint8_t Reserved4; /*!< always 1*/ } SD_CSD;/** * @brief Card Identification Data: CID Register */ typedef struct {__IO uint8_t ManufacturerID; /*!< ManufacturerID */__IO uint16_t OEM_AppliID; /*!< OEM/Application ID */__IO uint32_t ProdName1; /*!< Product Name part1 */__IO uint8_t ProdName2; /*!< Product Name part2*/__IO uint8_t ProdRev; /*!< Product Revision */__IO uint32_t ProdSN; /*!< Product Serial Number */__IO uint8_t Reserved1; /*!< Reserved1 */__IO uint16_t ManufactDate; /*!< Manufacturing Date */__IO uint8_t CID_CRC; /*!< CID CRC */__IO uint8_t Reserved2; /*!< always 1 */ } SD_CID;/** * @brief SD Card Status */ typedef struct {__IO uint8_t DAT_BUS_WIDTH;__IO uint8_t SECURED_MODE;__IO uint16_t SD_CARD_TYPE;__IO uint32_t SIZE_OF_PROTECTED_AREA;__IO uint8_t SPEED_CLASS;__IO uint8_t PERFORMANCE_MOVE;__IO uint8_t AU_SIZE;__IO uint16_t ERASE_SIZE;__IO uint8_t ERASE_TIMEOUT;__IO uint8_t ERASE_OFFSET; } SD_CardStatus;/** * @brief SD Card information */ typedef struct {SD_CSD SD_csd;SD_CID SD_cid;uint32_t CardCapacity; /*!< Card Capacity */uint32_t CardBlockSize; /*!< Card Block Size */uint16_t RCA;uint8_t CardType; } SD_CardInfo;/*** @}*//** @defgroup STM32_EVAL_SDIO_SD_Exported_Constants* @{*/ /** * @brief SDIO Commands Index */ #define SD_CMD_GO_IDLE_STATE ((uint8_t)0) #define SD_CMD_SEND_OP_COND ((uint8_t)1) #define SD_CMD_ALL_SEND_CID ((uint8_t)2) #define SD_CMD_SET_REL_ADDR ((uint8_t)3) /*!< SDIO_SEND_REL_ADDR for SD Card */ #define SD_CMD_SET_DSR ((uint8_t)4) #define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5) #define SD_CMD_HS_SWITCH ((uint8_t)6) #define SD_CMD_SEL_DESEL_CARD ((uint8_t)7) #define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8) #define SD_CMD_SEND_CSD ((uint8_t)9) #define SD_CMD_SEND_CID ((uint8_t)10) #define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11) /*!< SD Card doesn't support it */ #define SD_CMD_STOP_TRANSMISSION ((uint8_t)12) #define SD_CMD_SEND_STATUS ((uint8_t)13) #define SD_CMD_HS_BUSTEST_READ ((uint8_t)14) #define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15) #define SD_CMD_SET_BLOCKLEN ((uint8_t)16) #define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17) #define SD_CMD_READ_MULT_BLOCK ((uint8_t)18) #define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19) #define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20) /*!< SD Card doesn't support it */ #define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23) /*!< SD Card doesn't support it */ #define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24) #define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25) #define SD_CMD_PROG_CID ((uint8_t)26) /*!< reserved for manufacturers */ #define SD_CMD_PROG_CSD ((uint8_t)27) #define SD_CMD_SET_WRITE_PROT ((uint8_t)28) #define SD_CMD_CLR_WRITE_PROT ((uint8_t)29) #define SD_CMD_SEND_WRITE_PROT ((uint8_t)30) #define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32) /*!< To set the address of the first writeblock to be erased. (For SD card only) */ #define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33) /*!< To set the address of the last write block of thecontinuous range to be erased. (For SD card only) */ #define SD_CMD_ERASE_GRP_START ((uint8_t)35) /*!< To set the address of the first write block to be erased.(For MMC card only spec 3.31) */#define SD_CMD_ERASE_GRP_END ((uint8_t)36) /*!< To set the address of the last write block of thecontinuous range to be erased. (For MMC card only spec 3.31) */#define SD_CMD_ERASE ((uint8_t)38) #define SD_CMD_FAST_IO ((uint8_t)39) /*!< SD Card doesn't support it */ #define SD_CMD_GO_IRQ_STATE ((uint8_t)40) /*!< SD Card doesn't support it */ #define SD_CMD_LOCK_UNLOCK ((uint8_t)42) #define SD_CMD_APP_CMD ((uint8_t)55) #define SD_CMD_GEN_CMD ((uint8_t)56) #define SD_CMD_NO_CMD ((uint8_t)64)/** * @brief Following commands are SD Card Specific commands.* SDIO_APP_CMD should be sent before sending these commands. */ #define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /*!< For SD Card only */ #define SD_CMD_SD_APP_STAUS ((uint8_t)13) /*!< For SD Card only */ #define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) /*!< For SD Card only */ #define SD_CMD_SD_APP_OP_COND ((uint8_t)41) /*!< For SD Card only */ #define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) /*!< For SD Card only */ #define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51) /*!< For SD Card only */ #define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52) /*!< For SD I/O Card only */ #define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53) /*!< For SD I/O Card only *//** * @brief Following commands are SD Card Specific security commands.* SDIO_APP_CMD should be sent before sending these commands. */ #define SD_CMD_SD_APP_GET_MKB ((uint8_t)43) /*!< For SD Card only */ #define SD_CMD_SD_APP_GET_MID ((uint8_t)44) /*!< For SD Card only */ #define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45) /*!< For SD Card only */ #define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46) /*!< For SD Card only */ #define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47) /*!< For SD Card only */ #define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48) /*!< For SD Card only */ #define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18) /*!< For SD Card only */ #define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25) /*!< For SD Card only */ #define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38) /*!< For SD Card only */ #define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49) /*!< For SD Card only */ #define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48) /*!< For SD Card only *//* Uncomment the following line to select the SDIO Data transfer mode */ #define SD_DMA_MODE ((uint32_t)0x00000000) /*#define SD_POLLING_MODE ((uint32_t)0x00000002)*//*** @brief SD detection on its memory slot*/ #define SD_PRESENT ((uint8_t)0x01) #define SD_NOT_PRESENT ((uint8_t)0x00)/** * @brief Supported SD Memory Cards */ #define SDIO_STD_CAPACITY_SD_CARD_V1_1 ((uint32_t)0x00000000) #define SDIO_STD_CAPACITY_SD_CARD_V2_0 ((uint32_t)0x00000001) #define SDIO_HIGH_CAPACITY_SD_CARD ((uint32_t)0x00000002) #define SDIO_MULTIMEDIA_CARD ((uint32_t)0x00000003) #define SDIO_SECURE_DIGITAL_IO_CARD ((uint32_t)0x00000004) #define SDIO_HIGH_SPEED_MULTIMEDIA_CARD ((uint32_t)0x00000005) #define SDIO_SECURE_DIGITAL_IO_COMBO_CARD ((uint32_t)0x00000006) #define SDIO_HIGH_CAPACITY_MMC_CARD ((uint32_t)0x00000007)/*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Exported_Macros* @{*/ /*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Exported_Functions* @{*/ void SD_DeInit(void); SD_Error SD_Init(void); SDTransferState SD_GetStatus(void); SDCardState SD_GetState(void); SD_Error SD_PowerON(void); SD_Error SD_PowerOFF(void); SD_Error SD_InitializeCards(void); SD_Error SD_GetCardInfo(SD_CardInfo *cardinfo); SD_Error SD_GetCardStatus(SD_CardStatus *cardstatus); SD_Error SD_EnableWideBusOperation(uint32_t WideMode); SD_Error SD_SelectDeselect(uint32_t addr); SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize); SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks); SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize); SD_Error SD_WriteMultiBlocks(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize, uint32_t NumberOfBlocks); SDTransferState SD_GetTransferState(void); SD_Error SD_StopTransfer(void); SD_Error SD_Erase(uint32_t startaddr, uint32_t endaddr); SD_Error SD_SendStatus(uint32_t *pcardstatus); SD_Error SD_SendSDStatus(uint32_t *psdstatus); SD_Error SD_ProcessIRQSrc(void); SD_Error SD_WaitReadOperation(void); SD_Error SD_WaitWriteOperation(void); #ifdef __cplusplus } #endif#endif /* __STM32_EVAL_SDIO_SD_H */ /*** @}*//*** @}*//*** @}*//*** @}*/ /*** @}*/ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ /********************************************************************************* @file stm32_eval_sdio_sd.c* @author MCD Application Team* @version V4.5.0* @date 07-March-2011* @brief This file provides a set of functions needed to manage the SDIO SD * Card memory mounted on STM32xx-EVAL board (refer to stm32_eval.h* to know about the boards supporting this memory). * * * @verbatim** ===================================================================* How to use this driver* ===================================================================* It implements a high level communication layer for read and write * from/to this memory. The needed STM32 hardware resources (SDIO and * GPIO) are defined in stm32xx_eval.h file, and the initialization is * performed in SD_LowLevel_Init() function declared in stm32xx_eval.c * file.* You can easily tailor this driver to any other development board, * by just adapting the defines for hardware resources and * SD_LowLevel_Init() function.* * A - SD Card Initialization and configuration* ============================================ * - To initialize the SD Card, use the SD_Init() function. It * Initializes the SD Card and put it into StandBy State (Ready * for data transfer). This function provide the following operations:* * 1 - Apply the SD Card initialization process at 400KHz and check* the SD Card type (Standard Capacity or High Capacity). You * can change or adapt this frequency by adjusting the * "SDIO_INIT_CLK_DIV" define inside the stm32xx_eval.h file. * The SD Card frequency (SDIO_CK) is computed as follows:* * +---------------------------------------------+ * | SDIO_CK = SDIOCLK / (SDIO_INIT_CLK_DIV + 2) |* +---------------------------------------------+ * * In initialization mode and according to the SD Card standard, * make sure that the SDIO_CK frequency don't exceed 400KHz. * * 2 - Get the SD CID and CSD data. All these information are* managed by the SDCardInfo structure. This structure provide* also ready computed SD Card capacity and Block size. ** 3 - Configure the SD Card Data transfer frequency. By Default,* the card transfer frequency is set to 24MHz. You can change* or adapt this frequency by adjusting the "SDIO_TRANSFER_CLK_DIV" * define inside the stm32xx_eval.h file.* The SD Card frequency (SDIO_CK) is computed as follows:* * +---------------------------------------------+ * | SDIO_CK = SDIOCLK / (SDIO_INIT_CLK_DIV + 2) |* +---------------------------------------------+ * * In transfer mode and according to the SD Card standard, * make sure that the SDIO_CK frequency don't exceed 25MHz* and 50MHz in High-speed mode switch.* To be able to use a frequency higher than 24MHz, you should* use the SDIO peripheral in bypass mode. Refer to the * corresponding reference manual for more details.* * 4 - Select the corresponding SD Card according to the address* read with the step 2.* * 5 - Configure the SD Card in wide bus mode: 4-bits data. ** B - SD Card Read operation* ========================== * - You can read SD card by using two function: SD_ReadBlock() and* SD_ReadMultiBlocks() functions. These functions support only* 512-byte block length.* - The SD_ReadBlock() function read only one block (512-byte). This* function can transfer the data using DMA controller or using * polling mode. To select between DMA or polling mode refer to * "SD_DMA_MODE" or "SD_POLLING_MODE" inside the stm32_eval_sdio_sd.h* file and uncomment the corresponding line. By default the SD DMA* mode is selected * - The SD_ReadMultiBlocks() function read only mutli blocks (multiple * of 512-byte). * - Any read operation should be followed by two functions to check* if the DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data.* * - The DMA transfer is finished by the SDIO Data End interrupt. User* has to call the SD_ProcessIRQ() function inside the SDIO_IRQHandler().* Don't forget to enable the SDIO_IRQn interrupt using the NVIC controller. * * C - SD Card Write operation* =========================== * - You can write SD card by using two function: SD_WriteBlock() and* SD_WriteMultiBlocks() functions. These functions support only* 512-byte block length. * - The SD_WriteBlock() function write only one block (512-byte). This* function can transfer the data using DMA controller or using * polling mode. To select between DMA or polling mode refer to * "SD_DMA_MODE" or "SD_POLLING_MODE" inside the stm32_eval_sdio_sd.h* file and uncomment the corresponding line. By default the SD DMA* mode is selected * - The SD_WriteMultiBlocks() function write only mutli blocks (multiple * of 512-byte). * - Any write operation should be followed by two functions to check* if the DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * * - The DMA transfer is finished by the SDIO Data End interrupt. User* has to call the SD_ProcessIRQ() function inside the SDIO_IRQHandler().* Don't forget to enable the SDIO_IRQn interrupt using the NVIC controller. * * D - SD card status* ================== * - At any time, you can check the SD Card status and get the SD card* state by using the SD_GetStatus() function. This function checks* first if the SD card is still connected and then get the internal* SD Card transfer state. * - You can also get the SD card SD Status register by using the * SD_SendSDStatus() function. * * E - Programming Model* ===================== * Status = SD_Init(); // Initialization Step as described in section A* * // SDIO Interrupt ENABLE* NVIC_InitStructure.NVIC_IRQChannel = SDIO_IRQn;* NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;* NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;* NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;* NVIC_Init(&NVIC_InitStructure);* * // Write operation as described in Section C* Status = SD_WriteBlock(buffer, address, 512);* Status = SD_WaitWriteOperation();* while(SD_GetStatus() != SD_TRANSFER_OK); * * Status = SD_WriteMultiBlocks(buffer, address, 512, NUMBEROFBLOCKS);* Status = SD_WaitWriteOperation();* while(SD_GetStatus() != SD_TRANSFER_OK); * * // Read operation as described in Section B* Status = SD_ReadBlock(buffer, address, 512);* Status = SD_WaitReadOperation();* while(SD_GetStatus() != SD_TRANSFER_OK);* * Status = SD_ReadMultiBlocks(buffer, address, 512, NUMBEROFBLOCKS);* Status = SD_WaitReadOperation();* while(SD_GetStatus() != SD_TRANSFER_OK); * * * STM32 SDIO Pin assignment* ========================= * +-----------------------------------------------------------+* | Pin assignment |* +-----------------------------+---------------+-------------+* | STM32 SDIO Pins | SD | Pin |* +-----------------------------+---------------+-------------+* | SDIO D2 | D2 | 1 |* | SDIO D3 | D3 | 2 |* | SDIO CMD | CMD | 3 |* | | VCC | 4 (3.3 V)|* | SDIO CLK | CLK | 5 |* | | GND | 6 (0 V) |* | SDIO D0 | D0 | 7 |* | SDIO D1 | D1 | 8 | * +-----------------------------+---------------+-------------+ * * @endverbatim * ******************************************************************************* @attention** THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.** <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "sdio_sd.h"/** @addtogroup Utilities* @{*//** @addtogroup STM32_EVAL* @{*/ /** @addtogroup Common* @{*//** @addtogroup STM32_EVAL_SDIO_SD* @brief This file provides all the SD Card driver firmware functions.* @{*/ /** @defgroup STM32_EVAL_SDIO_SD_Private_Types* @{*/ /*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Private_Defines* @{*/ /** * @brief SDIO Static flags, TimeOut, FIFO Address */ #define NULL 0 #define SDIO_STATIC_FLAGS ((uint32_t)0x000005FF) #define SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)/** * @brief Mask for errors Card Status R1 (OCR Register) */ #define SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000) #define SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000) #define SD_OCR_BLOCK_LEN_ERR ((uint32_t)0x20000000) #define SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000) #define SD_OCR_BAD_ERASE_PARAM ((uint32_t)0x08000000) #define SD_OCR_WRITE_PROT_VIOLATION ((uint32_t)0x04000000) #define SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000) #define SD_OCR_COM_CRC_FAILED ((uint32_t)0x00800000) #define SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000) #define SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000) #define SD_OCR_CC_ERROR ((uint32_t)0x00100000) #define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000) #define SD_OCR_STREAM_READ_UNDERRUN ((uint32_t)0x00040000) #define SD_OCR_STREAM_WRITE_OVERRUN ((uint32_t)0x00020000) #define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000) #define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000) #define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000) #define SD_OCR_ERASE_RESET ((uint32_t)0x00002000) #define SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008) #define SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)/** * @brief Masks for R6 Response */ #define SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000) #define SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000) #define SD_R6_COM_CRC_FAILED ((uint32_t)0x00008000)#define SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000) #define SD_HIGH_CAPACITY ((uint32_t)0x40000000) #define SD_STD_CAPACITY ((uint32_t)0x00000000) #define SD_CHECK_PATTERN ((uint32_t)0x000001AA)#define SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF) #define SD_ALLZERO ((uint32_t)0x00000000)#define SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000) #define SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000) #define SD_CARD_LOCKED ((uint32_t)0x02000000)#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF) #define SD_0TO7BITS ((uint32_t)0x000000FF) #define SD_8TO15BITS ((uint32_t)0x0000FF00) #define SD_16TO23BITS ((uint32_t)0x00FF0000) #define SD_24TO31BITS ((uint32_t)0xFF000000) #define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)#define SD_HALFFIFO ((uint32_t)0x00000008) #define SD_HALFFIFOBYTES ((uint32_t)0x00000020)/** * @brief Command Class Supported */ #define SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080) #define SD_CCCC_WRITE_PROT ((uint32_t)0x00000040) #define SD_CCCC_ERASE ((uint32_t)0x00000020)/** * @brief Following commands are SD Card Specific commands.* SDIO_APP_CMD should be sent before sending these commands. */ #define SDIO_SEND_IF_COND ((uint32_t)0x00000008)/*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Private_Macros* @{*/ /*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Private_Variables* @{*/ static uint32_t CardType = SDIO_STD_CAPACITY_SD_CARD_V1_1; static uint32_t CSD_Tab[4], CID_Tab[4], RCA = 0; static uint8_t SDSTATUS_Tab[16]; __IO uint32_t StopCondition = 0; __IO SD_Error TransferError = SD_OK; __IO uint32_t TransferEnd = 0; SD_CardInfo SDCardInfo;SDIO_InitTypeDef SDIO_InitStructure; SDIO_CmdInitTypeDef SDIO_CmdInitStructure; SDIO_DataInitTypeDef SDIO_DataInitStructure; /*** @} */ /** @defgroup STM32_EVAL_SDIO_SD_Private_Function_Prototypes* @{*/ static SD_Error CmdError(void); static SD_Error CmdResp1Error(uint8_t cmd); static SD_Error CmdResp7Error(void); static SD_Error CmdResp3Error(void); static SD_Error CmdResp2Error(void); static SD_Error CmdResp6Error(uint8_t cmd, uint16_t *prca); static SD_Error SDEnWideBus(FunctionalState NewState); static SD_Error IsCardProgramming(uint8_t *pstatus); static SD_Error FindSCR(uint16_t rca, uint32_t *pscr); uint8_t convert_from_bytes_to_power_of_two(uint16_t NumberOfBytes);/*** @}*/ /** @defgroup STM32_EVAL_SDIO_SD_Private_Functions* @{*/ static void NVIC_Configuration(void) {NVIC_InitTypeDef NVIC_InitStructure;// SDIO Interrupt ENABLENVIC_InitStructure.NVIC_IRQChannel = SDIO_IRQn;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;NVIC_Init(&NVIC_InitStructure); }/*** @brief DeInitializes the SDIO interface.* @param None* @retval None*/ void SD_LowLevel_DeInit(void) {GPIO_InitTypeDef GPIO_InitStructure;/*!< Disable SDIO Clock */SDIO_ClockCmd(DISABLE);/*!< Set Power State to OFF */SDIO_SetPowerState(SDIO_PowerState_OFF);/*!< DeInitializes the SDIO peripheral */SDIO_DeInit();/*!< Disable the SDIO AHB Clock */RCC_AHBPeriphClockCmd(RCC_AHBPeriph_SDIO, DISABLE);/*!< Configure PC.08, PC.09, PC.10, PC.11, PC.12 pin: D0, D1, D2, D3, CLK pin */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;GPIO_Init(GPIOC, &GPIO_InitStructure);/*!< Configure PD.02 CMD line */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;GPIO_Init(GPIOD, &GPIO_InitStructure); }/*** @brief Initializes the SD Card and put it into StandBy State (Ready for * data transfer).* @param None* @retval None*/ void SD_LowLevel_Init(void) {GPIO_InitTypeDef GPIO_InitStructure;/*!< GPIOC and GPIOD Periph clock enable */RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);/*!< Configure PC.08, PC.09, PC.10, PC.11, PC.12 pin: D0, D1, D2, D3, CLK pin */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_Init(GPIOC, &GPIO_InitStructure);/*!< Configure PD.02 CMD line */GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;GPIO_Init(GPIOD, &GPIO_InitStructure);/*!< Enable the SDIO AHB Clock */RCC_AHBPeriphClockCmd(RCC_AHBPeriph_SDIO, ENABLE);/*!< Enable the DMA2 Clock */RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA2, ENABLE); }/*** @brief Configures the DMA2 Channel4 for SDIO Tx request.* @param BufferSRC: pointer to the source buffer* @param BufferSize: buffer size* @retval None*/ void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize) {DMA_InitTypeDef DMA_InitStructure;DMA_ClearFlag(DMA2_FLAG_TC4 | DMA2_FLAG_TE4 | DMA2_FLAG_HT4 | DMA2_FLAG_GL4);/*!< DMA2 Channel4 disable */DMA_Cmd(DMA2_Channel4, DISABLE);/*!< DMA2 Channel4 Config */DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)SDIO_FIFO_ADDRESS;DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)BufferSRC;DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;DMA_InitStructure.DMA_BufferSize = BufferSize / 4;DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;DMA_InitStructure.DMA_Priority = DMA_Priority_High;DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;DMA_Init(DMA2_Channel4, &DMA_InitStructure);/*!< DMA2 Channel4 enable */DMA_Cmd(DMA2_Channel4, ENABLE); }/*** @brief Configures the DMA2 Channel4 for SDIO Rx request.* @param BufferDST: pointer to the destination buffer* @param BufferSize: buffer size* @retval None*/ void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize) {DMA_InitTypeDef DMA_InitStructure;DMA_ClearFlag(DMA2_FLAG_TC4 | DMA2_FLAG_TE4 | DMA2_FLAG_HT4 | DMA2_FLAG_GL4);/*!< DMA2 Channel4 disable */DMA_Cmd(DMA2_Channel4, DISABLE);/*!< DMA2 Channel4 Config */DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)SDIO_FIFO_ADDRESS;DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)BufferDST;DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;DMA_InitStructure.DMA_BufferSize = BufferSize / 4;DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;DMA_InitStructure.DMA_Priority = DMA_Priority_High;DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;DMA_Init(DMA2_Channel4, &DMA_InitStructure);/*!< DMA2 Channel4 enable */DMA_Cmd(DMA2_Channel4, ENABLE); }/*** @brief Returns the DMA End Of Transfer Status.* @param None* @retval DMA SDIO Channel Status.*/ uint32_t SD_DMAEndOfTransferStatus(void) {return (uint32_t)DMA_GetFlagStatus(DMA2_FLAG_TC4); }/*** @brief DeInitializes the SDIO interface.* @param None* @retval None*/ void SD_DeInit(void) { SD_LowLevel_DeInit(); }/*** @brief Initializes the SD Card and put it into StandBy State (Ready for data * transfer).* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_Init(void) {SD_Error errorstatus = SD_OK;NVIC_Configuration();/* SDIO Peripheral Low Level Init */SD_LowLevel_Init();SDIO_DeInit();errorstatus = SD_PowerON();if (errorstatus != SD_OK){/*!< CMD Response TimeOut (wait for CMDSENT flag) */return(errorstatus);}errorstatus = SD_InitializeCards();if (errorstatus != SD_OK){/*!< CMD Response TimeOut (wait for CMDSENT flag) */return(errorstatus);}/*!< Configure the SDIO peripheral *//*!< SDIOCLK = HCLK, SDIO_CK = HCLK/(2 + SDIO_TRANSFER_CLK_DIV) *//*!< on STM32F2xx devices, SDIOCLK is fixed to 48MHz */ SDIO_InitStructure.SDIO_ClockDiv = SDIO_TRANSFER_CLK_DIV; SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_1b;SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;SDIO_Init(&SDIO_InitStructure);if (errorstatus == SD_OK){/*----------------- Read CSD/CID MSD registers ------------------*/errorstatus = SD_GetCardInfo(&SDCardInfo);}if (errorstatus == SD_OK){/*----------------- Select Card --------------------------------*/errorstatus = SD_SelectDeselect((uint32_t) (SDCardInfo.RCA << 16));}if (errorstatus == SD_OK){errorstatus = SD_EnableWideBusOperation(SDIO_BusWide_4b);} return(errorstatus); }/*** @brief Gets the cuurent sd card data transfer status.* @param None* @retval SDTransferState: Data Transfer state.* This value can be: * - SD_TRANSFER_OK: No data transfer is acting* - SD_TRANSFER_BUSY: Data transfer is acting*/ SDTransferState SD_GetStatus(void) {SDCardState cardstate = SD_CARD_TRANSFER;cardstate = SD_GetState();if (cardstate == SD_CARD_TRANSFER){return(SD_TRANSFER_OK);}else if(cardstate == SD_CARD_ERROR){return (SD_TRANSFER_ERROR);}else{return(SD_TRANSFER_BUSY);} }/*** @brief Returns the current card's state.* @param None* @retval SDCardState: SD Card Error or SD Card Current State.*/ SDCardState SD_GetState(void) {uint32_t resp1 = 0;if (SD_SendStatus(&resp1) != SD_OK){return SD_CARD_ERROR;}else{return (SDCardState)((resp1 >> 9) & 0x0F);} }/*** @brief Enquires cards about their operating voltage and configures * clock controls.* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_PowerON(void) {SD_Error errorstatus = SD_OK;uint32_t response = 0, count = 0, validvoltage = 0;uint32_t SDType = SD_STD_CAPACITY;/*!< Power ON Sequence -----------------------------------------------------*//*!< Configure the SDIO peripheral *//*!< SDIOCLK = HCLK, SDIO_CK = HCLK/(2 + SDIO_INIT_CLK_DIV) *//*!< on STM32F2xx devices, SDIOCLK is fixed to 48MHz *//*!< SDIO_CK for initialization should not exceed 400 KHz */ SDIO_InitStructure.SDIO_ClockDiv = SDIO_INIT_CLK_DIV;SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_1b;SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;SDIO_Init(&SDIO_InitStructure);/*!< Set Power State to ON */SDIO_SetPowerState(SDIO_PowerState_ON);/*!< Enable SDIO Clock */SDIO_ClockCmd(ENABLE);/*!< CMD0: GO_IDLE_STATE ---------------------------------------------------*//*!< No CMD response required */SDIO_CmdInitStructure.SDIO_Argument = 0x0;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_GO_IDLE_STATE;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_No;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdError();if (errorstatus != SD_OK){/*!< CMD Response TimeOut (wait for CMDSENT flag) */return(errorstatus);}/*!< CMD8: SEND_IF_COND ----------------------------------------------------*//*!< Send CMD8 to verify SD card interface operating condition *//*!< Argument: - [31:12]: Reserved (shall be set to '0')- [11:8]: Supply Voltage (VHS) 0x1 (Range: 2.7-3.6 V)- [7:0]: Check Pattern (recommended 0xAA) *//*!< CMD Response: R7 */SDIO_CmdInitStructure.SDIO_Argument = SD_CHECK_PATTERN;SDIO_CmdInitStructure.SDIO_CmdIndex = SDIO_SEND_IF_COND;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp7Error();if (errorstatus == SD_OK){CardType = SDIO_STD_CAPACITY_SD_CARD_V2_0; /*!< SD Card 2.0 */SDType = SD_HIGH_CAPACITY;}else{/*!< CMD55 */SDIO_CmdInitStructure.SDIO_Argument = 0x00;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);}/*!< CMD55 */SDIO_CmdInitStructure.SDIO_Argument = 0x00;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);/*!< If errorstatus is Command TimeOut, it is a MMC card *//*!< If errorstatus is SD_OK it is a SD card: SD card 2.0 (voltage range mismatch)or SD card 1.x */if (errorstatus == SD_OK){/*!< SD CARD *//*!< Send ACMD41 SD_APP_OP_COND with Argument 0x80100000 */while ((!validvoltage) && (count < SD_MAX_VOLT_TRIAL)){/*!< SEND CMD55 APP_CMD with RCA as 0 */SDIO_CmdInitStructure.SDIO_Argument = 0x00;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}SDIO_CmdInitStructure.SDIO_Argument = SD_VOLTAGE_WINDOW_SD | SDType;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_APP_OP_COND;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp3Error();if (errorstatus != SD_OK){return(errorstatus);}response = SDIO_GetResponse(SDIO_RESP1);validvoltage = (((response >> 31) == 1) ? 1 : 0);count++;}if (count >= SD_MAX_VOLT_TRIAL){errorstatus = SD_INVALID_VOLTRANGE;return(errorstatus);}if (response &= SD_HIGH_CAPACITY){CardType = SDIO_HIGH_CAPACITY_SD_CARD;}}/*!< else MMC Card */return(errorstatus); }/*** @brief Turns the SDIO output signals off.* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_PowerOFF(void) {SD_Error errorstatus = SD_OK;/*!< Set Power State to OFF */SDIO_SetPowerState(SDIO_PowerState_OFF);return(errorstatus); }/*** @brief Intialises all cards or single card as the case may be Card(s) come * into standby state.* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_InitializeCards(void) {SD_Error errorstatus = SD_OK;uint16_t rca = 0x01;if (SDIO_GetPowerState() == SDIO_PowerState_OFF){errorstatus = SD_REQUEST_NOT_APPLICABLE;return(errorstatus);}if (SDIO_SECURE_DIGITAL_IO_CARD != CardType){/*!< Send CMD2 ALL_SEND_CID */SDIO_CmdInitStructure.SDIO_Argument = 0x0;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_ALL_SEND_CID;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Long;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp2Error();if (SD_OK != errorstatus){return(errorstatus);}CID_Tab[0] = SDIO_GetResponse(SDIO_RESP1);CID_Tab[1] = SDIO_GetResponse(SDIO_RESP2);CID_Tab[2] = SDIO_GetResponse(SDIO_RESP3);CID_Tab[3] = SDIO_GetResponse(SDIO_RESP4);}if ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == CardType) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == CardType) || (SDIO_SECURE_DIGITAL_IO_COMBO_CARD == CardType)|| (SDIO_HIGH_CAPACITY_SD_CARD == CardType)){/*!< Send CMD3 SET_REL_ADDR with argument 0 *//*!< SD Card publishes its RCA. */SDIO_CmdInitStructure.SDIO_Argument = 0x00;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_REL_ADDR;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp6Error(SD_CMD_SET_REL_ADDR, &rca);if (SD_OK != errorstatus){return(errorstatus);}}if (SDIO_SECURE_DIGITAL_IO_CARD != CardType){RCA = rca;/*!< Send CMD9 SEND_CSD with argument as card's RCA */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)(rca << 16);SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SEND_CSD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Long;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp2Error();if (SD_OK != errorstatus){return(errorstatus);}CSD_Tab[0] = SDIO_GetResponse(SDIO_RESP1);CSD_Tab[1] = SDIO_GetResponse(SDIO_RESP2);CSD_Tab[2] = SDIO_GetResponse(SDIO_RESP3);CSD_Tab[3] = SDIO_GetResponse(SDIO_RESP4);}errorstatus = SD_OK; /*!< All cards get intialized */return(errorstatus); }/*** @brief Returns information about specific card.* @param cardinfo: pointer to a SD_CardInfo structure that contains all SD card * information.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_GetCardInfo(SD_CardInfo *cardinfo) {SD_Error errorstatus = SD_OK;uint8_t tmp = 0;cardinfo->CardType = (uint8_t)CardType;cardinfo->RCA = (uint16_t)RCA;/*!< Byte 0 */tmp = (uint8_t)((CSD_Tab[0] & 0xFF000000) >> 24);cardinfo->SD_csd.CSDStruct = (tmp & 0xC0) >> 6;cardinfo->SD_csd.SysSpecVersion = (tmp & 0x3C) >> 2;cardinfo->SD_csd.Reserved1 = tmp & 0x03;/*!< Byte 1 */tmp = (uint8_t)((CSD_Tab[0] & 0x00FF0000) >> 16);cardinfo->SD_csd.TAAC = tmp;/*!< Byte 2 */tmp = (uint8_t)((CSD_Tab[0] & 0x0000FF00) >> 8);cardinfo->SD_csd.NSAC = tmp;/*!< Byte 3 */tmp = (uint8_t)(CSD_Tab[0] & 0x000000FF);cardinfo->SD_csd.MaxBusClkFrec = tmp;/*!< Byte 4 */tmp = (uint8_t)((CSD_Tab[1] & 0xFF000000) >> 24);cardinfo->SD_csd.CardComdClasses = tmp << 4;/*!< Byte 5 */tmp = (uint8_t)((CSD_Tab[1] & 0x00FF0000) >> 16);cardinfo->SD_csd.CardComdClasses |= (tmp & 0xF0) >> 4;cardinfo->SD_csd.RdBlockLen = tmp & 0x0F;/*!< Byte 6 */tmp = (uint8_t)((CSD_Tab[1] & 0x0000FF00) >> 8);cardinfo->SD_csd.PartBlockRead = (tmp & 0x80) >> 7;cardinfo->SD_csd.WrBlockMisalign = (tmp & 0x40) >> 6;cardinfo->SD_csd.RdBlockMisalign = (tmp & 0x20) >> 5;cardinfo->SD_csd.DSRImpl = (tmp & 0x10) >> 4;cardinfo->SD_csd.Reserved2 = 0; /*!< Reserved */if ((CardType == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (CardType == SDIO_STD_CAPACITY_SD_CARD_V2_0)){cardinfo->SD_csd.DeviceSize = (tmp & 0x03) << 10;/*!< Byte 7 */tmp = (uint8_t)(CSD_Tab[1] & 0x000000FF);cardinfo->SD_csd.DeviceSize |= (tmp) << 2;/*!< Byte 8 */tmp = (uint8_t)((CSD_Tab[2] & 0xFF000000) >> 24);cardinfo->SD_csd.DeviceSize |= (tmp & 0xC0) >> 6;cardinfo->SD_csd.MaxRdCurrentVDDMin = (tmp & 0x38) >> 3;cardinfo->SD_csd.MaxRdCurrentVDDMax = (tmp & 0x07);/*!< Byte 9 */tmp = (uint8_t)((CSD_Tab[2] & 0x00FF0000) >> 16);cardinfo->SD_csd.MaxWrCurrentVDDMin = (tmp & 0xE0) >> 5;cardinfo->SD_csd.MaxWrCurrentVDDMax = (tmp & 0x1C) >> 2;cardinfo->SD_csd.DeviceSizeMul = (tmp & 0x03) << 1;/*!< Byte 10 */tmp = (uint8_t)((CSD_Tab[2] & 0x0000FF00) >> 8);cardinfo->SD_csd.DeviceSizeMul |= (tmp & 0x80) >> 7;cardinfo->CardCapacity = (cardinfo->SD_csd.DeviceSize + 1) ;cardinfo->CardCapacity *= (1 << (cardinfo->SD_csd.DeviceSizeMul + 2));cardinfo->CardBlockSize = 1 << (cardinfo->SD_csd.RdBlockLen);cardinfo->CardCapacity *= cardinfo->CardBlockSize;}else if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){/*!< Byte 7 */tmp = (uint8_t)(CSD_Tab[1] & 0x000000FF);cardinfo->SD_csd.DeviceSize = (tmp & 0x3F) << 16;/*!< Byte 8 */tmp = (uint8_t)((CSD_Tab[2] & 0xFF000000) >> 24);cardinfo->SD_csd.DeviceSize |= (tmp << 8);/*!< Byte 9 */tmp = (uint8_t)((CSD_Tab[2] & 0x00FF0000) >> 16);cardinfo->SD_csd.DeviceSize |= (tmp);/*!< Byte 10 */tmp = (uint8_t)((CSD_Tab[2] & 0x0000FF00) >> 8);cardinfo->CardCapacity = (cardinfo->SD_csd.DeviceSize + 1) * 512 * 1024;cardinfo->CardBlockSize = 512; }cardinfo->SD_csd.EraseGrSize = (tmp & 0x40) >> 6;cardinfo->SD_csd.EraseGrMul = (tmp & 0x3F) << 1;/*!< Byte 11 */tmp = (uint8_t)(CSD_Tab[2] & 0x000000FF);cardinfo->SD_csd.EraseGrMul |= (tmp & 0x80) >> 7;cardinfo->SD_csd.WrProtectGrSize = (tmp & 0x7F);/*!< Byte 12 */tmp = (uint8_t)((CSD_Tab[3] & 0xFF000000) >> 24);cardinfo->SD_csd.WrProtectGrEnable = (tmp & 0x80) >> 7;cardinfo->SD_csd.ManDeflECC = (tmp & 0x60) >> 5;cardinfo->SD_csd.WrSpeedFact = (tmp & 0x1C) >> 2;cardinfo->SD_csd.MaxWrBlockLen = (tmp & 0x03) << 2;/*!< Byte 13 */tmp = (uint8_t)((CSD_Tab[3] & 0x00FF0000) >> 16);cardinfo->SD_csd.MaxWrBlockLen |= (tmp & 0xC0) >> 6;cardinfo->SD_csd.WriteBlockPaPartial = (tmp & 0x20) >> 5;cardinfo->SD_csd.Reserved3 = 0;cardinfo->SD_csd.ContentProtectAppli = (tmp & 0x01);/*!< Byte 14 */tmp = (uint8_t)((CSD_Tab[3] & 0x0000FF00) >> 8);cardinfo->SD_csd.FileFormatGrouop = (tmp & 0x80) >> 7;cardinfo->SD_csd.CopyFlag = (tmp & 0x40) >> 6;cardinfo->SD_csd.PermWrProtect = (tmp & 0x20) >> 5;cardinfo->SD_csd.TempWrProtect = (tmp & 0x10) >> 4;cardinfo->SD_csd.FileFormat = (tmp & 0x0C) >> 2;cardinfo->SD_csd.ECC = (tmp & 0x03);/*!< Byte 15 */tmp = (uint8_t)(CSD_Tab[3] & 0x000000FF);cardinfo->SD_csd.CSD_CRC = (tmp & 0xFE) >> 1;cardinfo->SD_csd.Reserved4 = 1;/*!< Byte 0 */tmp = (uint8_t)((CID_Tab[0] & 0xFF000000) >> 24);cardinfo->SD_cid.ManufacturerID = tmp;/*!< Byte 1 */tmp = (uint8_t)((CID_Tab[0] & 0x00FF0000) >> 16);cardinfo->SD_cid.OEM_AppliID = tmp << 8;/*!< Byte 2 */tmp = (uint8_t)((CID_Tab[0] & 0x000000FF00) >> 8);cardinfo->SD_cid.OEM_AppliID |= tmp;/*!< Byte 3 */tmp = (uint8_t)(CID_Tab[0] & 0x000000FF);cardinfo->SD_cid.ProdName1 = tmp << 24;/*!< Byte 4 */tmp = (uint8_t)((CID_Tab[1] & 0xFF000000) >> 24);cardinfo->SD_cid.ProdName1 |= tmp << 16;/*!< Byte 5 */tmp = (uint8_t)((CID_Tab[1] & 0x00FF0000) >> 16);cardinfo->SD_cid.ProdName1 |= tmp << 8;/*!< Byte 6 */tmp = (uint8_t)((CID_Tab[1] & 0x0000FF00) >> 8);cardinfo->SD_cid.ProdName1 |= tmp;/*!< Byte 7 */tmp = (uint8_t)(CID_Tab[1] & 0x000000FF);cardinfo->SD_cid.ProdName2 = tmp;/*!< Byte 8 */tmp = (uint8_t)((CID_Tab[2] & 0xFF000000) >> 24);cardinfo->SD_cid.ProdRev = tmp;/*!< Byte 9 */tmp = (uint8_t)((CID_Tab[2] & 0x00FF0000) >> 16);cardinfo->SD_cid.ProdSN = tmp << 24;/*!< Byte 10 */tmp = (uint8_t)((CID_Tab[2] & 0x0000FF00) >> 8);cardinfo->SD_cid.ProdSN |= tmp << 16;/*!< Byte 11 */tmp = (uint8_t)(CID_Tab[2] & 0x000000FF);cardinfo->SD_cid.ProdSN |= tmp << 8;/*!< Byte 12 */tmp = (uint8_t)((CID_Tab[3] & 0xFF000000) >> 24);cardinfo->SD_cid.ProdSN |= tmp;/*!< Byte 13 */tmp = (uint8_t)((CID_Tab[3] & 0x00FF0000) >> 16);cardinfo->SD_cid.Reserved1 |= (tmp & 0xF0) >> 4;cardinfo->SD_cid.ManufactDate = (tmp & 0x0F) << 8;/*!< Byte 14 */tmp = (uint8_t)((CID_Tab[3] & 0x0000FF00) >> 8);cardinfo->SD_cid.ManufactDate |= tmp;/*!< Byte 15 */tmp = (uint8_t)(CID_Tab[3] & 0x000000FF);cardinfo->SD_cid.CID_CRC = (tmp & 0xFE) >> 1;cardinfo->SD_cid.Reserved2 = 1;return(errorstatus); }/*** @brief Enables wide bus opeartion for the requeseted card if supported by * card.* @param WideMode: Specifies the SD card wide bus mode. * This parameter can be one of the following values:* @arg SDIO_BusWide_8b: 8-bit data transfer (Only for MMC)* @arg SDIO_BusWide_4b: 4-bit data transfer* @arg SDIO_BusWide_1b: 1-bit data transfer* @retval SD_Error: SD Card Error code.*/ SD_Error SD_GetCardStatus(SD_CardStatus *cardstatus) {SD_Error errorstatus = SD_OK;uint8_t tmp = 0;errorstatus = SD_SendSDStatus((uint32_t *)SDSTATUS_Tab);if (errorstatus != SD_OK){return(errorstatus);}/*!< Byte 0 */tmp = (uint8_t)((SDSTATUS_Tab[0] & 0xC0) >> 6);cardstatus->DAT_BUS_WIDTH = tmp;/*!< Byte 0 */tmp = (uint8_t)((SDSTATUS_Tab[0] & 0x20) >> 5);cardstatus->SECURED_MODE = tmp;/*!< Byte 2 */tmp = (uint8_t)((SDSTATUS_Tab[2] & 0xFF));cardstatus->SD_CARD_TYPE = tmp << 8;/*!< Byte 3 */tmp = (uint8_t)((SDSTATUS_Tab[3] & 0xFF));cardstatus->SD_CARD_TYPE |= tmp;/*!< Byte 4 */tmp = (uint8_t)(SDSTATUS_Tab[4] & 0xFF);cardstatus->SIZE_OF_PROTECTED_AREA = tmp << 24;/*!< Byte 5 */tmp = (uint8_t)(SDSTATUS_Tab[5] & 0xFF);cardstatus->SIZE_OF_PROTECTED_AREA |= tmp << 16;/*!< Byte 6 */tmp = (uint8_t)(SDSTATUS_Tab[6] & 0xFF);cardstatus->SIZE_OF_PROTECTED_AREA |= tmp << 8;/*!< Byte 7 */tmp = (uint8_t)(SDSTATUS_Tab[7] & 0xFF);cardstatus->SIZE_OF_PROTECTED_AREA |= tmp;/*!< Byte 8 */tmp = (uint8_t)((SDSTATUS_Tab[8] & 0xFF));cardstatus->SPEED_CLASS = tmp;/*!< Byte 9 */tmp = (uint8_t)((SDSTATUS_Tab[9] & 0xFF));cardstatus->PERFORMANCE_MOVE = tmp;/*!< Byte 10 */tmp = (uint8_t)((SDSTATUS_Tab[10] & 0xF0) >> 4);cardstatus->AU_SIZE = tmp;/*!< Byte 11 */tmp = (uint8_t)(SDSTATUS_Tab[11] & 0xFF);cardstatus->ERASE_SIZE = tmp << 8;/*!< Byte 12 */tmp = (uint8_t)(SDSTATUS_Tab[12] & 0xFF);cardstatus->ERASE_SIZE |= tmp;/*!< Byte 13 */tmp = (uint8_t)((SDSTATUS_Tab[13] & 0xFC) >> 2);cardstatus->ERASE_TIMEOUT = tmp;/*!< Byte 13 */tmp = (uint8_t)((SDSTATUS_Tab[13] & 0x3));cardstatus->ERASE_OFFSET = tmp;return(errorstatus); }/*** @brief Enables wide bus opeartion for the requeseted card if supported by * card.* @param WideMode: Specifies the SD card wide bus mode. * This parameter can be one of the following values:* @arg SDIO_BusWide_8b: 8-bit data transfer (Only for MMC)* @arg SDIO_BusWide_4b: 4-bit data transfer* @arg SDIO_BusWide_1b: 1-bit data transfer* @retval SD_Error: SD Card Error code.*/ SD_Error SD_EnableWideBusOperation(uint32_t WideMode) {SD_Error errorstatus = SD_OK;/*!< MMC Card doesn't support this feature */if (SDIO_MULTIMEDIA_CARD == CardType){errorstatus = SD_UNSUPPORTED_FEATURE;return(errorstatus);}else if ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == CardType) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == CardType) || (SDIO_HIGH_CAPACITY_SD_CARD == CardType)){if (SDIO_BusWide_8b == WideMode){errorstatus = SD_UNSUPPORTED_FEATURE;return(errorstatus);}else if (SDIO_BusWide_4b == WideMode){errorstatus = SDEnWideBus(ENABLE);if (SD_OK == errorstatus){/*!< Configure the SDIO peripheral */SDIO_InitStructure.SDIO_ClockDiv = SDIO_TRANSFER_CLK_DIV; SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_4b;SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;SDIO_Init(&SDIO_InitStructure);}}else{errorstatus = SDEnWideBus(DISABLE);if (SD_OK == errorstatus){/*!< Configure the SDIO peripheral */SDIO_InitStructure.SDIO_ClockDiv = SDIO_TRANSFER_CLK_DIV; SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_1b;SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;SDIO_Init(&SDIO_InitStructure);}}}return(errorstatus); }/*** @brief Selects od Deselects the corresponding card.* @param addr: Address of the Card to be selected.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_SelectDeselect(uint32_t addr) {SD_Error errorstatus = SD_OK;/*!< Send CMD7 SDIO_SEL_DESEL_CARD */SDIO_CmdInitStructure.SDIO_Argument = addr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SEL_DESEL_CARD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SEL_DESEL_CARD);return(errorstatus); }/*** @brief Allows to read one block from a specified address in a card. The Data* transfer can be managed by DMA mode or Polling mode. * @note This operation should be followed by two functions to check if the * DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * @param readbuff: pointer to the buffer that will contain the received data* @param ReadAddr: Address from where data are to be read. * @param BlockSize: the SD card Data block size. The Block size should be 512.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize) {SD_Error errorstatus = SD_OK; #if defined (SD_POLLING_MODE) uint32_t count = 0, *tempbuff = (uint32_t *)readbuff; #endifTransferError = SD_OK;TransferEnd = 0;StopCondition = 0;SDIO->DCTRL = 0x0;if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){BlockSize = 512;ReadAddr /= 512;}/*******************add,沒有這一段容易卡死在DMA檢測中*************************************//* Set Block Size for Card,cmd16,* 若是sdsc卡,可以用來設(shè)置塊大小,* 若是sdhc卡,塊大小為512字節(jié),不受cmd16影響 */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short; //r1SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (SD_OK != errorstatus){return(errorstatus);}/*********************************************************************************/SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = BlockSize;SDIO_DataInitStructure.SDIO_DataBlockSize = (uint32_t) 9 << 4;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToSDIO;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);/*!< Send CMD17 READ_SINGLE_BLOCK */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)ReadAddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_READ_SINGLE_BLOCK;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_READ_SINGLE_BLOCK);if (errorstatus != SD_OK){return(errorstatus);}#if defined (SD_POLLING_MODE) /*!< In case of single block transfer, no need of stop transfer at all.*//*!< Polling mode */while (!(SDIO->STA &(SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR))){if (SDIO_GetFlagStatus(SDIO_FLAG_RXFIFOHF) != RESET){for (count = 0; count < 8; count++){*(tempbuff + count) = SDIO_ReadData();}tempbuff += 8;}}if (SDIO_GetFlagStatus(SDIO_FLAG_DTIMEOUT) != RESET){SDIO_ClearFlag(SDIO_FLAG_DTIMEOUT);errorstatus = SD_DATA_TIMEOUT;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_DCRCFAIL) != RESET){SDIO_ClearFlag(SDIO_FLAG_DCRCFAIL);errorstatus = SD_DATA_CRC_FAIL;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_RXOVERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_RXOVERR);errorstatus = SD_RX_OVERRUN;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_STBITERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_STBITERR);errorstatus = SD_START_BIT_ERR;return(errorstatus);}while (SDIO_GetFlagStatus(SDIO_FLAG_RXDAVL) != RESET){*tempbuff = SDIO_ReadData();tempbuff++;}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);#elif defined (SD_DMA_MODE)SDIO_ITConfig(SDIO_IT_DATAEND, ENABLE);SDIO_DMACmd(ENABLE);SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, BlockSize); #endifreturn(errorstatus); }/*** @brief Allows to read blocks from a specified address in a card. The Data* transfer can be managed by DMA mode or Polling mode. * @note This operation should be followed by two functions to check if the * DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * @param readbuff: pointer to the buffer that will contain the received data.* @param ReadAddr: Address from where data are to be read.* @param BlockSize: the SD card Data block size. The Block size should be 512.* @param NumberOfBlocks: number of blocks to be read.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks) {SD_Error errorstatus = SD_OK;TransferError = SD_OK;TransferEnd = 0;StopCondition = 1;SDIO->DCTRL = 0x0;if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){BlockSize = 512;ReadAddr /= 512;}/*!< Set Block Size for Card */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (SD_OK != errorstatus){return(errorstatus);}SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = NumberOfBlocks * BlockSize;SDIO_DataInitStructure.SDIO_DataBlockSize = (uint32_t) 9 << 4;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToSDIO;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);/*!< Send CMD18 READ_MULT_BLOCK with argument data address */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)ReadAddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_READ_MULT_BLOCK;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_READ_MULT_BLOCK);if (errorstatus != SD_OK){return(errorstatus);}SDIO_ITConfig(SDIO_IT_DATAEND, ENABLE);SDIO_DMACmd(ENABLE);SD_LowLevel_DMA_RxConfig((uint32_t *)readbuff, (NumberOfBlocks * BlockSize));return(errorstatus); }/*** @brief This function waits until the SDIO DMA data transfer is finished. * This function should be called after SDIO_ReadMultiBlocks() function* to insure that all data sent by the card are already transferred by * the DMA controller. * @param None.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_WaitReadOperation(void) {SD_Error errorstatus = SD_OK;while ((SD_DMAEndOfTransferStatus() == RESET) && (TransferEnd == 0) && (TransferError == SD_OK)){}if (TransferError != SD_OK){return(TransferError);}return(errorstatus); }/*** @brief Allows to write one block starting from a specified address in a card.* The Data transfer can be managed by DMA mode or Polling mode.* @note This operation should be followed by two functions to check if the * DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * @param writebuff: pointer to the buffer that contain the data to be transferred.* @param WriteAddr: Address from where data are to be read. * @param BlockSize: the SD card Data block size. The Block size should be 512.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize) {SD_Error errorstatus = SD_OK;#if defined (SD_POLLING_MODE)uint32_t bytestransferred = 0, count = 0, restwords = 0;uint32_t *tempbuff = (uint32_t *)writebuff; #endifTransferError = SD_OK;TransferEnd = 0;StopCondition = 0;SDIO->DCTRL = 0x0;if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){BlockSize = 512;WriteAddr /= 512;}/*-------------- add , 沒有這一段容易卡死在DMA檢測中 -------------------*//* Set Block Size for Card,cmd16,* 若是sdsc卡,可以用來設(shè)置塊大小,* 若是sdhc卡,塊大小為512字節(jié),不受cmd16影響 */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short; SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (SD_OK != errorstatus){return(errorstatus);}/*********************************************************************************//*!< Send CMD24 WRITE_SINGLE_BLOCK */SDIO_CmdInitStructure.SDIO_Argument = WriteAddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_WRITE_SINGLE_BLOCK;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_WRITE_SINGLE_BLOCK);if (errorstatus != SD_OK){return(errorstatus);}SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = BlockSize;SDIO_DataInitStructure.SDIO_DataBlockSize = (uint32_t) 9 << 4;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToCard;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);/*!< In case of single data block transfer no need of stop command at all */ #if defined (SD_POLLING_MODE) while (!(SDIO->STA & (SDIO_FLAG_DBCKEND | SDIO_FLAG_TXUNDERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_STBITERR))){if (SDIO_GetFlagStatus(SDIO_FLAG_TXFIFOHE) != RESET){if ((512 - bytestransferred) < 32){restwords = ((512 - bytestransferred) % 4 == 0) ? ((512 - bytestransferred) / 4) : (( 512 - bytestransferred) / 4 + 1);for (count = 0; count < restwords; count++, tempbuff++, bytestransferred += 4){SDIO_WriteData(*tempbuff);}}else{for (count = 0; count < 8; count++){SDIO_WriteData(*(tempbuff + count));}tempbuff += 8;bytestransferred += 32;}}}if (SDIO_GetFlagStatus(SDIO_FLAG_DTIMEOUT) != RESET){SDIO_ClearFlag(SDIO_FLAG_DTIMEOUT);errorstatus = SD_DATA_TIMEOUT;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_DCRCFAIL) != RESET){SDIO_ClearFlag(SDIO_FLAG_DCRCFAIL);errorstatus = SD_DATA_CRC_FAIL;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_TXUNDERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_TXUNDERR);errorstatus = SD_TX_UNDERRUN;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_STBITERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_STBITERR);errorstatus = SD_START_BIT_ERR;return(errorstatus);} #elif defined (SD_DMA_MODE)SDIO_ITConfig(SDIO_IT_DATAEND, ENABLE);SD_LowLevel_DMA_TxConfig((uint32_t *)writebuff, BlockSize);SDIO_DMACmd(ENABLE); #endifreturn(errorstatus); }/*** @brief Allows to write blocks starting from a specified address in a card.* The Data transfer can be managed by DMA mode only. * @note This operation should be followed by two functions to check if the * DMA Controller and SD Card status.* - SD_ReadWaitOperation(): this function insure that the DMA* controller has finished all data transfer.* - SD_GetStatus(): to check that the SD Card has finished the * data transfer and it is ready for data. * @param WriteAddr: Address from where data are to be read.* @param writebuff: pointer to the buffer that contain the data to be transferred.* @param BlockSize: the SD card Data block size. The Block size should be 512.* @param NumberOfBlocks: number of blocks to be written.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_WriteMultiBlocks(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize, uint32_t NumberOfBlocks) {SD_Error errorstatus = SD_OK;__IO uint32_t count = 0;TransferError = SD_OK;TransferEnd = 0;StopCondition = 1;SDIO->DCTRL = 0x0;if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){BlockSize = 512;WriteAddr /= 512;}/*******************add,沒有這一段容易卡死在DMA檢測中*************************************//*!< Set Block Size for Card,cmd16,若是sdsc卡,可以用來設(shè)置塊大小,若是sdhc卡,塊大小為512字節(jié),不受cmd16影響 */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) BlockSize;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short; //r1SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (SD_OK != errorstatus){return(errorstatus);}/*********************************************************************************//*!< To improve performance */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) (RCA << 16);SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}/*!< To improve performance */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)NumberOfBlocks;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCK_COUNT;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCK_COUNT);if (errorstatus != SD_OK){return(errorstatus);}/*!< Send CMD25 WRITE_MULT_BLOCK with argument data address */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)WriteAddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_WRITE_MULT_BLOCK;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_WRITE_MULT_BLOCK);if (SD_OK != errorstatus){return(errorstatus);}SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = NumberOfBlocks * BlockSize;SDIO_DataInitStructure.SDIO_DataBlockSize = (uint32_t) 9 << 4;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToCard;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);SDIO_ITConfig(SDIO_IT_DATAEND, ENABLE);SDIO_DMACmd(ENABLE); SD_LowLevel_DMA_TxConfig((uint32_t *)writebuff, (NumberOfBlocks * BlockSize));return(errorstatus); }/*** @brief This function waits until the SDIO DMA data transfer is finished. * This function should be called after SDIO_WriteBlock() and* SDIO_WriteMultiBlocks() function to insure that all data sent by the * card are already transferred by the DMA controller. * @param None.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_WaitWriteOperation(void) {SD_Error errorstatus = SD_OK;while ((SD_DMAEndOfTransferStatus() == RESET) && (TransferEnd == 0) && (TransferError == SD_OK)){}if (TransferError != SD_OK){return(TransferError);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);return(errorstatus); }/*** @brief Gets the cuurent data transfer state.* @param None* @retval SDTransferState: Data Transfer state.* This value can be: * - SD_TRANSFER_OK: No data transfer is acting* - SD_TRANSFER_BUSY: Data transfer is acting*/ SDTransferState SD_GetTransferState(void) {if (SDIO->STA & (SDIO_FLAG_TXACT | SDIO_FLAG_RXACT)){return(SD_TRANSFER_BUSY);}else{return(SD_TRANSFER_OK);} }/*** @brief Aborts an ongoing data transfer.* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_StopTransfer(void) {SD_Error errorstatus = SD_OK;/*!< Send CMD12 STOP_TRANSMISSION */SDIO->ARG = 0x0;SDIO->CMD = 0x44C;errorstatus = CmdResp1Error(SD_CMD_STOP_TRANSMISSION);return(errorstatus); }/*** @brief Allows to erase memory area specified for the given card.* @param startaddr: the start address.* @param endaddr: the end address.* @retval SD_Error: SD Card Error code.*/ SD_Error SD_Erase(uint32_t startaddr, uint32_t endaddr) {SD_Error errorstatus = SD_OK;uint32_t delay = 0;__IO uint32_t maxdelay = 0;uint8_t cardstate = 0;/*!< Check if the card coomnd class supports erase command */if (((CSD_Tab[1] >> 20) & SD_CCCC_ERASE) == 0){errorstatus = SD_REQUEST_NOT_APPLICABLE;return(errorstatus);}maxdelay = 120000 / ((SDIO->CLKCR & 0xFF) + 2);if (SDIO_GetResponse(SDIO_RESP1) & SD_CARD_LOCKED){errorstatus = SD_LOCK_UNLOCK_FAILED;return(errorstatus);}if (CardType == SDIO_HIGH_CAPACITY_SD_CARD){startaddr /= 512;endaddr /= 512;}/*!< According to sd-card spec 1.0 ERASE_GROUP_START (CMD32) and erase_group_end(CMD33) */if ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == CardType) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == CardType) || (SDIO_HIGH_CAPACITY_SD_CARD == CardType)){/*!< Send CMD32 SD_ERASE_GRP_START with argument as addr */SDIO_CmdInitStructure.SDIO_Argument = startaddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_ERASE_GRP_START;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SD_ERASE_GRP_START);if (errorstatus != SD_OK){return(errorstatus);}/*!< Send CMD33 SD_ERASE_GRP_END with argument as addr */SDIO_CmdInitStructure.SDIO_Argument = endaddr;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_ERASE_GRP_END;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SD_ERASE_GRP_END);if (errorstatus != SD_OK){return(errorstatus);}}/*!< Send CMD38 ERASE */SDIO_CmdInitStructure.SDIO_Argument = 0;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_ERASE;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_ERASE);if (errorstatus != SD_OK){return(errorstatus);}for (delay = 0; delay < maxdelay; delay++){}/*!< Wait till the card is in programming state */errorstatus = IsCardProgramming(&cardstate);while ((errorstatus == SD_OK) && ((SD_CARD_PROGRAMMING == cardstate) || (SD_CARD_RECEIVING == cardstate))){errorstatus = IsCardProgramming(&cardstate);}return(errorstatus); }/*** @brief Returns the current card's status.* @param pcardstatus: pointer to the buffer that will contain the SD card * status (Card Status register).* @retval SD_Error: SD Card Error code.*/ SD_Error SD_SendStatus(uint32_t *pcardstatus) {SD_Error errorstatus = SD_OK;SDIO->ARG = (uint32_t) RCA << 16;SDIO->CMD = 0x44D;errorstatus = CmdResp1Error(SD_CMD_SEND_STATUS);if (errorstatus != SD_OK){return(errorstatus);}*pcardstatus = SDIO->RESP1;return(errorstatus); }/*** @brief Returns the current SD card's status.* @param psdstatus: pointer to the buffer that will contain the SD card status * (SD Status register).* @retval SD_Error: SD Card Error code.*/ SD_Error SD_SendSDStatus(uint32_t *psdstatus) {SD_Error errorstatus = SD_OK;uint32_t count = 0;if (SDIO_GetResponse(SDIO_RESP1) & SD_CARD_LOCKED){errorstatus = SD_LOCK_UNLOCK_FAILED;return(errorstatus);}/*!< Set block size for card if it is not equal to current block size for card. */SDIO_CmdInitStructure.SDIO_Argument = 64;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (errorstatus != SD_OK){return(errorstatus);}/*!< CMD55 */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = 64;SDIO_DataInitStructure.SDIO_DataBlockSize = SDIO_DataBlockSize_64b;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToSDIO;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);/*!< Send ACMD13 SD_APP_STAUS with argument as card's RCA.*/SDIO_CmdInitStructure.SDIO_Argument = 0;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_APP_STAUS;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SD_APP_STAUS);if (errorstatus != SD_OK){return(errorstatus);}while (!(SDIO->STA &(SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR))){if (SDIO_GetFlagStatus(SDIO_FLAG_RXFIFOHF) != RESET){for (count = 0; count < 8; count++){*(psdstatus + count) = SDIO_ReadData();}psdstatus += 8;}}if (SDIO_GetFlagStatus(SDIO_FLAG_DTIMEOUT) != RESET){SDIO_ClearFlag(SDIO_FLAG_DTIMEOUT);errorstatus = SD_DATA_TIMEOUT;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_DCRCFAIL) != RESET){SDIO_ClearFlag(SDIO_FLAG_DCRCFAIL);errorstatus = SD_DATA_CRC_FAIL;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_RXOVERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_RXOVERR);errorstatus = SD_RX_OVERRUN;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_STBITERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_STBITERR);errorstatus = SD_START_BIT_ERR;return(errorstatus);}while (SDIO_GetFlagStatus(SDIO_FLAG_RXDAVL) != RESET){*psdstatus = SDIO_ReadData();psdstatus++;}/*!< Clear all the static status flags*/SDIO_ClearFlag(SDIO_STATIC_FLAGS);return(errorstatus); }/*** @brief Allows to process all the interrupts that are high.* @param None* @retval SD_Error: SD Card Error code.*/ SD_Error SD_ProcessIRQSrc(void) {if (StopCondition == 1){SDIO->ARG = 0x0;SDIO->CMD = 0x44C;TransferError = CmdResp1Error(SD_CMD_STOP_TRANSMISSION);}else{TransferError = SD_OK;}SDIO_ClearITPendingBit(SDIO_IT_DATAEND);SDIO_ITConfig(SDIO_IT_DATAEND, DISABLE);TransferEnd = 1;return(TransferError); }/*** @brief Checks for error conditions for CMD0.* @param None* @retval SD_Error: SD Card Error code.*/ static SD_Error CmdError(void) {SD_Error errorstatus = SD_OK;uint32_t timeout;timeout = SDIO_CMD0TIMEOUT; /*!< 10000 */while ((timeout > 0) && (SDIO_GetFlagStatus(SDIO_FLAG_CMDSENT) == RESET)){timeout--;}if (timeout == 0){errorstatus = SD_CMD_RSP_TIMEOUT;return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);return(errorstatus); }/*** @brief Checks for error conditions for R7 response.* @param None* @retval SD_Error: SD Card Error code.*/ static SD_Error CmdResp7Error(void) {SD_Error errorstatus = SD_OK;uint32_t status;uint32_t timeout = SDIO_CMD0TIMEOUT;status = SDIO->STA;while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT)) && (timeout > 0)){timeout--;status = SDIO->STA;}if ((timeout == 0) || (status & SDIO_FLAG_CTIMEOUT)){/*!< Card is not V2.0 complient or card does not support the set voltage range */errorstatus = SD_CMD_RSP_TIMEOUT;SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT);return(errorstatus);}if (status & SDIO_FLAG_CMDREND){/*!< Card is SD V2.0 compliant */errorstatus = SD_OK;SDIO_ClearFlag(SDIO_FLAG_CMDREND);return(errorstatus);}return(errorstatus); }/*** @brief Checks for error conditions for R1 response.* @param cmd: The sent command index.* @retval SD_Error: SD Card Error code.*/ static SD_Error CmdResp1Error(uint8_t cmd) {while (!(SDIO->STA & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))){}SDIO->ICR = SDIO_STATIC_FLAGS;return (SD_Error)(SDIO->RESP1 & SD_OCR_ERRORBITS); }/*** @brief Checks for error conditions for R3 (OCR) response.* @param None* @retval SD_Error: SD Card Error code.*/ static SD_Error CmdResp3Error(void) {SD_Error errorstatus = SD_OK;uint32_t status;status = SDIO->STA;while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))){status = SDIO->STA;}if (status & SDIO_FLAG_CTIMEOUT){errorstatus = SD_CMD_RSP_TIMEOUT;SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT);return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);return(errorstatus); }/*** @brief Checks for error conditions for R2 (CID or CSD) response.* @param None* @retval SD_Error: SD Card Error code.*/ static SD_Error CmdResp2Error(void) {SD_Error errorstatus = SD_OK;uint32_t status;status = SDIO->STA;while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CTIMEOUT | SDIO_FLAG_CMDREND))){status = SDIO->STA;}if (status & SDIO_FLAG_CTIMEOUT){errorstatus = SD_CMD_RSP_TIMEOUT;SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT);return(errorstatus);}else if (status & SDIO_FLAG_CCRCFAIL){errorstatus = SD_CMD_CRC_FAIL;SDIO_ClearFlag(SDIO_FLAG_CCRCFAIL);return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);return(errorstatus); }/*** @brief Checks for error conditions for R6 (RCA) response.* @param cmd: The sent command index.* @param prca: pointer to the variable that will contain the SD card relative * address RCA. * @retval SD_Error: SD Card Error code.*/ static SD_Error CmdResp6Error(uint8_t cmd, uint16_t *prca) {SD_Error errorstatus = SD_OK;uint32_t status;uint32_t response_r1;status = SDIO->STA;while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CTIMEOUT | SDIO_FLAG_CMDREND))){status = SDIO->STA;}if (status & SDIO_FLAG_CTIMEOUT){errorstatus = SD_CMD_RSP_TIMEOUT;SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT);return(errorstatus);}else if (status & SDIO_FLAG_CCRCFAIL){errorstatus = SD_CMD_CRC_FAIL;SDIO_ClearFlag(SDIO_FLAG_CCRCFAIL);return(errorstatus);}/*!< Check response received is of desired command */if (SDIO_GetCommandResponse() != cmd){errorstatus = SD_ILLEGAL_CMD;return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);/*!< We have received response, retrieve it. */response_r1 = SDIO_GetResponse(SDIO_RESP1);if (SD_ALLZERO == (response_r1 & (SD_R6_GENERAL_UNKNOWN_ERROR | SD_R6_ILLEGAL_CMD | SD_R6_COM_CRC_FAILED))){*prca = (uint16_t) (response_r1 >> 16);return(errorstatus);}if (response_r1 & SD_R6_GENERAL_UNKNOWN_ERROR){return(SD_GENERAL_UNKNOWN_ERROR);}if (response_r1 & SD_R6_ILLEGAL_CMD){return(SD_ILLEGAL_CMD);}if (response_r1 & SD_R6_COM_CRC_FAILED){return(SD_COM_CRC_FAILED);}return(errorstatus); }/*** @brief Enables or disables the SDIO wide bus mode.* @param NewState: new state of the SDIO wide bus mode.* This parameter can be: ENABLE or DISABLE.* @retval SD_Error: SD Card Error code.*/ static SD_Error SDEnWideBus(FunctionalState NewState) {SD_Error errorstatus = SD_OK;uint32_t scr[2] = {0, 0};if (SDIO_GetResponse(SDIO_RESP1) & SD_CARD_LOCKED){errorstatus = SD_LOCK_UNLOCK_FAILED;return(errorstatus);}/*!< Get SCR Register */errorstatus = FindSCR(RCA, scr);if (errorstatus != SD_OK){return(errorstatus);}/*!< If wide bus operation to be enabled */if (NewState == ENABLE){/*!< If requested card supports wide bus operation */if ((scr[1] & SD_WIDE_BUS_SUPPORT) != SD_ALLZERO){/*!< Send CMD55 APP_CMD with argument as card's RCA.*/SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}/*!< Send ACMD6 APP_CMD with argument as 2 for wide bus mode */SDIO_CmdInitStructure.SDIO_Argument = 0x2;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_SD_SET_BUSWIDTH;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_SD_SET_BUSWIDTH);if (errorstatus != SD_OK){return(errorstatus);}return(errorstatus);}else{errorstatus = SD_REQUEST_NOT_APPLICABLE;return(errorstatus);}} /*!< If wide bus operation to be disabled */else{/*!< If requested card supports 1 bit mode operation */if ((scr[1] & SD_SINGLE_BUS_SUPPORT) != SD_ALLZERO){/*!< Send CMD55 APP_CMD with argument as card's RCA.*/SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}/*!< Send ACMD6 APP_CMD with argument as 2 for wide bus mode */SDIO_CmdInitStructure.SDIO_Argument = 0x00;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_SD_SET_BUSWIDTH;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_SD_SET_BUSWIDTH);if (errorstatus != SD_OK){return(errorstatus);}return(errorstatus);}else{errorstatus = SD_REQUEST_NOT_APPLICABLE;return(errorstatus);}} }/*** @brief Checks if the SD card is in programming state.* @param pstatus: pointer to the variable that will contain the SD card state.* @retval SD_Error: SD Card Error code.*/ static SD_Error IsCardProgramming(uint8_t *pstatus) {SD_Error errorstatus = SD_OK;__IO uint32_t respR1 = 0, status = 0;SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SEND_STATUS;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);status = SDIO->STA;while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))){status = SDIO->STA;}if (status & SDIO_FLAG_CTIMEOUT){errorstatus = SD_CMD_RSP_TIMEOUT;SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT);return(errorstatus);}else if (status & SDIO_FLAG_CCRCFAIL){errorstatus = SD_CMD_CRC_FAIL;SDIO_ClearFlag(SDIO_FLAG_CCRCFAIL);return(errorstatus);}status = (uint32_t)SDIO_GetCommandResponse();/*!< Check response received is of desired command */if (status != SD_CMD_SEND_STATUS){errorstatus = SD_ILLEGAL_CMD;return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);/*!< We have received response, retrieve it for analysis */respR1 = SDIO_GetResponse(SDIO_RESP1);/*!< Find out card status */*pstatus = (uint8_t) ((respR1 >> 9) & 0x0000000F);if ((respR1 & SD_OCR_ERRORBITS) == SD_ALLZERO){return(errorstatus);}if (respR1 & SD_OCR_ADDR_OUT_OF_RANGE){return(SD_ADDR_OUT_OF_RANGE);}if (respR1 & SD_OCR_ADDR_MISALIGNED){return(SD_ADDR_MISALIGNED);}if (respR1 & SD_OCR_BLOCK_LEN_ERR){return(SD_BLOCK_LEN_ERR);}if (respR1 & SD_OCR_ERASE_SEQ_ERR){return(SD_ERASE_SEQ_ERR);}if (respR1 & SD_OCR_BAD_ERASE_PARAM){return(SD_BAD_ERASE_PARAM);}if (respR1 & SD_OCR_WRITE_PROT_VIOLATION){return(SD_WRITE_PROT_VIOLATION);}if (respR1 & SD_OCR_LOCK_UNLOCK_FAILED){return(SD_LOCK_UNLOCK_FAILED);}if (respR1 & SD_OCR_COM_CRC_FAILED){return(SD_COM_CRC_FAILED);}if (respR1 & SD_OCR_ILLEGAL_CMD){return(SD_ILLEGAL_CMD);}if (respR1 & SD_OCR_CARD_ECC_FAILED){return(SD_CARD_ECC_FAILED);}if (respR1 & SD_OCR_CC_ERROR){return(SD_CC_ERROR);}if (respR1 & SD_OCR_GENERAL_UNKNOWN_ERROR){return(SD_GENERAL_UNKNOWN_ERROR);}if (respR1 & SD_OCR_STREAM_READ_UNDERRUN){return(SD_STREAM_READ_UNDERRUN);}if (respR1 & SD_OCR_STREAM_WRITE_OVERRUN){return(SD_STREAM_WRITE_OVERRUN);}if (respR1 & SD_OCR_CID_CSD_OVERWRIETE){return(SD_CID_CSD_OVERWRITE);}if (respR1 & SD_OCR_WP_ERASE_SKIP){return(SD_WP_ERASE_SKIP);}if (respR1 & SD_OCR_CARD_ECC_DISABLED){return(SD_CARD_ECC_DISABLED);}if (respR1 & SD_OCR_ERASE_RESET){return(SD_ERASE_RESET);}if (respR1 & SD_OCR_AKE_SEQ_ERROR){return(SD_AKE_SEQ_ERROR);}return(errorstatus); }/*** @brief Find the SD card SCR register value.* @param rca: selected card address.* @param pscr: pointer to the buffer that will contain the SCR value.* @retval SD_Error: SD Card Error code.*/ static SD_Error FindSCR(uint16_t rca, uint32_t *pscr) {uint32_t index = 0;SD_Error errorstatus = SD_OK;uint32_t tempscr[2] = {0, 0};/*!< Set Block Size To 8 Bytes *//*!< Send CMD55 APP_CMD with argument as card's RCA */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t)8;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SET_BLOCKLEN;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SET_BLOCKLEN);if (errorstatus != SD_OK){return(errorstatus);}/*!< Send CMD55 APP_CMD with argument as card's RCA */SDIO_CmdInitStructure.SDIO_Argument = (uint32_t) RCA << 16;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_APP_CMD;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_APP_CMD);if (errorstatus != SD_OK){return(errorstatus);}SDIO_DataInitStructure.SDIO_DataTimeOut = SD_DATATIMEOUT;SDIO_DataInitStructure.SDIO_DataLength = 8;SDIO_DataInitStructure.SDIO_DataBlockSize = SDIO_DataBlockSize_8b;SDIO_DataInitStructure.SDIO_TransferDir = SDIO_TransferDir_ToSDIO;SDIO_DataInitStructure.SDIO_TransferMode = SDIO_TransferMode_Block;SDIO_DataInitStructure.SDIO_DPSM = SDIO_DPSM_Enable;SDIO_DataConfig(&SDIO_DataInitStructure);/*!< Send ACMD51 SD_APP_SEND_SCR with argument as 0 */SDIO_CmdInitStructure.SDIO_Argument = 0x0;SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_SD_APP_SEND_SCR;SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_Short;SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;SDIO_SendCommand(&SDIO_CmdInitStructure);errorstatus = CmdResp1Error(SD_CMD_SD_APP_SEND_SCR);if (errorstatus != SD_OK){return(errorstatus);}while (!(SDIO->STA & (SDIO_FLAG_RXOVERR | SDIO_FLAG_DCRCFAIL | SDIO_FLAG_DTIMEOUT | SDIO_FLAG_DBCKEND | SDIO_FLAG_STBITERR))){if (SDIO_GetFlagStatus(SDIO_FLAG_RXDAVL) != RESET){*(tempscr + index) = SDIO_ReadData();index++;if (index > 1) break; }}if (SDIO_GetFlagStatus(SDIO_FLAG_DTIMEOUT) != RESET){SDIO_ClearFlag(SDIO_FLAG_DTIMEOUT);errorstatus = SD_DATA_TIMEOUT;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_DCRCFAIL) != RESET){SDIO_ClearFlag(SDIO_FLAG_DCRCFAIL);errorstatus = SD_DATA_CRC_FAIL;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_RXOVERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_RXOVERR);errorstatus = SD_RX_OVERRUN;return(errorstatus);}else if (SDIO_GetFlagStatus(SDIO_FLAG_STBITERR) != RESET){SDIO_ClearFlag(SDIO_FLAG_STBITERR);errorstatus = SD_START_BIT_ERR;return(errorstatus);}/*!< Clear all the static flags */SDIO_ClearFlag(SDIO_STATIC_FLAGS);*(pscr + 1) = ((tempscr[0] & SD_0TO7BITS) << 24) | ((tempscr[0] & SD_8TO15BITS) << 8) | ((tempscr[0] & SD_16TO23BITS) >> 8) | ((tempscr[0] & SD_24TO31BITS) >> 24);*(pscr) = ((tempscr[1] & SD_0TO7BITS) << 24) | ((tempscr[1] & SD_8TO15BITS) << 8) | ((tempscr[1] & SD_16TO23BITS) >> 8) | ((tempscr[1] & SD_24TO31BITS) >> 24);return(errorstatus); }/*** @brief Converts the number of bytes in power of two and returns the power.* @param NumberOfBytes: number of bytes.* @retval None*/ uint8_t convert_from_bytes_to_power_of_two(uint16_t NumberOfBytes) {uint8_t count = 0;while (NumberOfBytes != 1){NumberOfBytes >>= 1;count++;}return(count); }void SDIO_IRQHandler(void) {SD_ProcessIRQSrc(); }/*** @}*//*** @}*//*** @}*//*** @}*//*** @}*/ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

?

總結(jié)

以上是生活随笔為你收集整理的STM32之SDIO例程的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

精品无码成人片一区二区98 | 露脸叫床粗话东北少妇 | 丁香啪啪综合成人亚洲 | 一本久道久久综合婷婷五月 | 亚洲精品久久久久久一区二区 | 欧美丰满老熟妇xxxxx性 | 国产性生大片免费观看性 | 日韩成人一区二区三区在线观看 | 高潮毛片无遮挡高清免费视频 | 亚洲成熟女人毛毛耸耸多 | 狠狠色噜噜狠狠狠7777奇米 | 欧美阿v高清资源不卡在线播放 | 国产免费久久精品国产传媒 | 对白脏话肉麻粗话av | 少妇高潮一区二区三区99 | 粗大的内捧猛烈进出视频 | 亚洲国产精品久久久久久 | 久久亚洲精品中文字幕无男同 | 中文字幕乱码人妻无码久久 | 精品久久久无码人妻字幂 | 亚洲熟妇色xxxxx欧美老妇 | 日本熟妇大屁股人妻 | 高清国产亚洲精品自在久久 | 欧洲极品少妇 | 精品水蜜桃久久久久久久 | 性生交大片免费看女人按摩摩 | 亚洲精品中文字幕乱码 | 国产精品无码mv在线观看 | 精品熟女少妇av免费观看 | 欧美日韩一区二区免费视频 | 亚洲精品久久久久久一区二区 | 青春草在线视频免费观看 | 99久久精品午夜一区二区 | 亚洲a无码综合a国产av中文 | 97夜夜澡人人双人人人喊 | 夜夜夜高潮夜夜爽夜夜爰爰 | 亚洲欧美精品伊人久久 | 无码人中文字幕 | 扒开双腿疯狂进出爽爽爽视频 | 久久国语露脸国产精品电影 | 国产精品无码一区二区三区不卡 | 女人被男人躁得好爽免费视频 | 亚洲中文字幕在线无码一区二区 | 久久综合香蕉国产蜜臀av | 99久久亚洲精品无码毛片 | 久久精品99久久香蕉国产色戒 | 国产成人精品无码播放 | 狠狠色丁香久久婷婷综合五月 | 精品乱子伦一区二区三区 | 人妻中文无码久热丝袜 | www成人国产高清内射 | 沈阳熟女露脸对白视频 | 日韩精品无码免费一区二区三区 | 帮老师解开蕾丝奶罩吸乳网站 | 一本久道久久综合狠狠爱 | 亚洲成色在线综合网站 | 中文久久乱码一区二区 | 亚洲成a人片在线观看日本 | 国产色视频一区二区三区 | 在线成人www免费观看视频 | 两性色午夜免费视频 | 少妇性l交大片欧洲热妇乱xxx | 中文字幕人成乱码熟女app | 欧洲欧美人成视频在线 | 狠狠躁日日躁夜夜躁2020 | 国产乱人偷精品人妻a片 | 在线播放免费人成毛片乱码 | 精品久久久久久亚洲精品 | 欧美日韩精品 | 亚洲中文字幕乱码av波多ji | 免费无码肉片在线观看 | 亚洲性无码av中文字幕 | 日韩人妻无码中文字幕视频 | 婷婷六月久久综合丁香 | 国产情侣作爱视频免费观看 | 欧洲vodafone精品性 | 国产精品自产拍在线观看 | 亚洲精品国产a久久久久久 | 麻豆精品国产精华精华液好用吗 | 黑人粗大猛烈进出高潮视频 | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 亚洲人成人无码网www国产 | 性欧美牲交xxxxx视频 | 久精品国产欧美亚洲色aⅴ大片 | 无人区乱码一区二区三区 | a在线观看免费网站大全 | 亚洲精品久久久久中文第一幕 | 丁香啪啪综合成人亚洲 | 国产精品亚洲а∨无码播放麻豆 | 中文字幕无线码 | 在线播放免费人成毛片乱码 | 亚无码乱人伦一区二区 | 色综合久久久无码中文字幕 | 国产尤物精品视频 | a片免费视频在线观看 | 国产区女主播在线观看 | 无码帝国www无码专区色综合 | 久久精品国产精品国产精品污 | 在线视频网站www色 | 国产做国产爱免费视频 | 天干天干啦夜天干天2017 | 久久精品人妻少妇一区二区三区 | 成人三级无码视频在线观看 | 国产综合久久久久鬼色 | 国产肉丝袜在线观看 | 久久精品女人的天堂av | 亚洲精品成人福利网站 | 日韩人妻少妇一区二区三区 | 亚洲成av人影院在线观看 | 久久国产自偷自偷免费一区调 | 欧美日韩综合一区二区三区 | 无码人妻av免费一区二区三区 | 欧美变态另类xxxx | 久久精品国产一区二区三区肥胖 | 成在人线av无码免费 | 精品久久久久久人妻无码中文字幕 | 国产精品多人p群无码 | 亚洲国产精品无码一区二区三区 | 天堂久久天堂av色综合 | 久9re热视频这里只有精品 | 白嫩日本少妇做爰 | 少妇一晚三次一区二区三区 | 免费国产成人高清在线观看网站 | 99久久久无码国产aaa精品 | 波多野结衣乳巨码无在线观看 | 人人爽人人澡人人高潮 | 精品久久久久久人妻无码中文字幕 | 亚洲色大成网站www国产 | 国产精品va在线观看无码 | 中文字幕无码免费久久99 | 蜜桃视频韩日免费播放 | 欧美人与动性行为视频 | 欧美人与物videos另类 | 女人高潮内射99精品 | 无码午夜成人1000部免费视频 | 水蜜桃色314在线观看 | 亚洲中文字幕乱码av波多ji | 无码人妻av免费一区二区三区 | 熟妇激情内射com | 日本一区二区三区免费播放 | 乱码午夜-极国产极内射 | 男女作爱免费网站 | 国产午夜手机精彩视频 | 精品人妻av区 | 成在人线av无码免费 | 两性色午夜视频免费播放 | 超碰97人人做人人爱少妇 | 色五月五月丁香亚洲综合网 | 福利一区二区三区视频在线观看 | 麻豆精品国产精华精华液好用吗 | 野外少妇愉情中文字幕 | 亚洲一区二区观看播放 | 99久久久无码国产aaa精品 | 全球成人中文在线 | 一本精品99久久精品77 | 国产午夜亚洲精品不卡 | 野狼第一精品社区 | 最新版天堂资源中文官网 | 无码人妻黑人中文字幕 | 欧美35页视频在线观看 | 国产色视频一区二区三区 | 亲嘴扒胸摸屁股激烈网站 | 青春草在线视频免费观看 | 无码吃奶揉捏奶头高潮视频 | 国产美女精品一区二区三区 | 国产精品无码永久免费888 | 男女超爽视频免费播放 | 欧美 日韩 亚洲 在线 | 精品国产av色一区二区深夜久久 | 中文字幕人妻无码一夲道 | 久久精品人人做人人综合试看 | 荫蒂添的好舒服视频囗交 | 成 人影片 免费观看 | 日本xxxx色视频在线观看免费 | 成人无码精品1区2区3区免费看 | 国产人成高清在线视频99最全资源 | 麻豆md0077饥渴少妇 | 蜜臀aⅴ国产精品久久久国产老师 | av人摸人人人澡人人超碰下载 | 久激情内射婷内射蜜桃人妖 | 国产综合在线观看 | 久久久久国色av免费观看性色 | 国内精品九九久久久精品 | 国产亚洲精品久久久久久久 | 国产精品香蕉在线观看 | 欧美第一黄网免费网站 | 亚欧洲精品在线视频免费观看 | 久久97精品久久久久久久不卡 | 日韩视频 中文字幕 视频一区 | 国产精品第一区揄拍无码 | 成 人 免费观看网站 | 97人妻精品一区二区三区 | 狠狠cao日日穞夜夜穞av | 激情人妻另类人妻伦 | 国产一区二区三区精品视频 | 国产熟妇另类久久久久 | 午夜福利不卡在线视频 | 久久久中文字幕日本无吗 | 欧洲精品码一区二区三区免费看 | 精品无码成人片一区二区98 | 亚洲伊人久久精品影院 | 久久久久成人精品免费播放动漫 | 日本爽爽爽爽爽爽在线观看免 | 无码国模国产在线观看 | 久久久久亚洲精品中文字幕 | 国产亚洲精品久久久闺蜜 | 国产成人精品一区二区在线小狼 | 中国女人内谢69xxxx | 亚洲男人av天堂午夜在 | 中文字幕日韩精品一区二区三区 | 国产农村乱对白刺激视频 | 中文字幕无码视频专区 | 午夜福利一区二区三区在线观看 | 亚洲高清偷拍一区二区三区 | 国产偷国产偷精品高清尤物 | 天堂无码人妻精品一区二区三区 | 最新国产乱人伦偷精品免费网站 | 一本色道婷婷久久欧美 | 亚洲精品综合一区二区三区在线 | 欧美日韩一区二区免费视频 | 国产成人精品三级麻豆 | 亚洲日本va午夜在线电影 | 国产亲子乱弄免费视频 | 国产成人无码av在线影院 | 亚洲国产精华液网站w | 色一情一乱一伦 | 国产精品久久久一区二区三区 | 377p欧洲日本亚洲大胆 | 国产精品久久久久久久影院 | 国产av一区二区精品久久凹凸 | 玩弄少妇高潮ⅹxxxyw | 欧美日韩一区二区综合 | 欧美精品无码一区二区三区 | 日韩精品久久久肉伦网站 | 亚洲理论电影在线观看 | 亚洲精品国产a久久久久久 | 欧美 日韩 人妻 高清 中文 | av无码电影一区二区三区 | 俺去俺来也www色官网 | 亚洲狠狠婷婷综合久久 | 国产真实乱对白精彩久久 | 亚洲热妇无码av在线播放 | 久久久无码中文字幕久... | 波多野结衣高清一区二区三区 | 97久久国产亚洲精品超碰热 | 亚洲性无码av中文字幕 | 久久精品国产一区二区三区肥胖 | 波多野结衣一区二区三区av免费 | 欧美 日韩 亚洲 在线 | 欧洲精品码一区二区三区免费看 | 国产激情精品一区二区三区 | 国产人妻久久精品二区三区老狼 | 人人妻人人澡人人爽人人精品浪潮 | 免费无码一区二区三区蜜桃大 | 久久人人爽人人爽人人片av高清 | 久久99精品久久久久婷婷 | 亚洲综合无码一区二区三区 | 性色av无码免费一区二区三区 | 国产欧美亚洲精品a | 色婷婷香蕉在线一区二区 | 无码av中文字幕免费放 | 亚洲自偷精品视频自拍 | 熟妇人妻无乱码中文字幕 | 亚洲精品综合五月久久小说 | 国精产品一区二区三区 | 色妞www精品免费视频 | 性色欲情网站iwww九文堂 | 精品厕所偷拍各类美女tp嘘嘘 | 天天爽夜夜爽夜夜爽 | 日本护士毛茸茸高潮 | 又色又爽又黄的美女裸体网站 | 九月婷婷人人澡人人添人人爽 | 亚洲一区二区三区香蕉 | 欧美 丝袜 自拍 制服 另类 | 人妻少妇精品无码专区二区 | 亚洲无人区一区二区三区 | 国产热a欧美热a在线视频 | 久久99精品国产麻豆蜜芽 | 国产另类ts人妖一区二区 | 97久久精品无码一区二区 | 国产猛烈高潮尖叫视频免费 | 一本一道久久综合久久 | 久久精品99久久香蕉国产色戒 | 日韩视频 中文字幕 视频一区 | 亚洲成av人影院在线观看 | 乱码午夜-极国产极内射 | 在线播放免费人成毛片乱码 | 97精品国产97久久久久久免费 | 麻豆蜜桃av蜜臀av色欲av | 香蕉久久久久久av成人 | 久久人人爽人人爽人人片ⅴ | 亚洲aⅴ无码成人网站国产app | аⅴ资源天堂资源库在线 | 精品国产国产综合精品 | 日本护士毛茸茸高潮 | 少妇久久久久久人妻无码 | 欧美一区二区三区 | 亚洲一区二区观看播放 | 久久婷婷五月综合色国产香蕉 | 骚片av蜜桃精品一区 | 中文字幕无线码 | 国产精品成人av在线观看 | 国产精品内射视频免费 | 国产精品福利视频导航 | 亚洲另类伦春色综合小说 | 精品一二三区久久aaa片 | 精品一区二区三区无码免费视频 | 亚洲经典千人经典日产 | 久久久中文字幕日本无吗 | 夜夜夜高潮夜夜爽夜夜爰爰 | 乱人伦人妻中文字幕无码久久网 | 亚洲国产成人av在线观看 | 亚洲 a v无 码免 费 成 人 a v | 一二三四在线观看免费视频 | 国产av一区二区精品久久凹凸 | 99视频精品全部免费免费观看 | 国产精品无码一区二区桃花视频 | 亚洲综合无码久久精品综合 | 久久久久亚洲精品中文字幕 | 中文字幕无线码免费人妻 | 欧美三级a做爰在线观看 | 日韩欧美群交p片內射中文 | 国语自产偷拍精品视频偷 | 久久人人97超碰a片精品 | 国产精品无码一区二区桃花视频 | 人妻天天爽夜夜爽一区二区 | 荫蒂被男人添的好舒服爽免费视频 | 中文字幕乱码人妻无码久久 | 国产农村妇女高潮大叫 | 亚洲熟妇色xxxxx亚洲 | 婷婷色婷婷开心五月四房播播 | 天堂亚洲2017在线观看 | 在线天堂新版最新版在线8 | 精品人妻人人做人人爽 | 国产人妻精品一区二区三区不卡 | 超碰97人人射妻 | 四虎永久在线精品免费网址 | 亚洲日韩乱码中文无码蜜桃臀网站 | 国产热a欧美热a在线视频 | 日韩av激情在线观看 | 国产女主播喷水视频在线观看 | 88国产精品欧美一区二区三区 | www国产精品内射老师 | 奇米影视7777久久精品人人爽 | 精品午夜福利在线观看 | аⅴ资源天堂资源库在线 | 日本欧美一区二区三区乱码 | 丰满人妻翻云覆雨呻吟视频 | 午夜精品一区二区三区的区别 | 日本精品人妻无码77777 天堂一区人妻无码 | 在线观看国产一区二区三区 | 国产精品成人av在线观看 | 久久zyz资源站无码中文动漫 | 最新版天堂资源中文官网 | 人人妻人人澡人人爽人人精品浪潮 | 999久久久国产精品消防器材 | 精品无码一区二区三区的天堂 | 欧美日韩视频无码一区二区三 | 丰满人妻一区二区三区免费视频 | 色婷婷久久一区二区三区麻豆 | 国产欧美亚洲精品a | 亚洲の无码国产の无码步美 | 国产成人无码区免费内射一片色欲 | 在线播放免费人成毛片乱码 | 蜜臀av无码人妻精品 | 久久99精品国产.久久久久 | 丁香啪啪综合成人亚洲 | 久久久久成人片免费观看蜜芽 | 一个人看的视频www在线 | 最近中文2019字幕第二页 | 狂野欧美激情性xxxx | 又湿又紧又大又爽a视频国产 | 精品少妇爆乳无码av无码专区 | 夜夜躁日日躁狠狠久久av | 日本一卡2卡3卡4卡无卡免费网站 国产一区二区三区影院 | 美女毛片一区二区三区四区 | 国产精品人人爽人人做我的可爱 | 男女超爽视频免费播放 | 国产超碰人人爽人人做人人添 | 亚洲成a人片在线观看日本 | 精品一区二区不卡无码av | 好男人www社区 | 天堂а√在线中文在线 | 波多野结衣高清一区二区三区 | 色爱情人网站 | 久久亚洲精品中文字幕无男同 | 国产精品久久久久久亚洲毛片 | 亚洲日韩av一区二区三区中文 | 精品亚洲成av人在线观看 | 夜精品a片一区二区三区无码白浆 | 国产精品久免费的黄网站 | 国产特级毛片aaaaaa高潮流水 | 国精产品一品二品国精品69xx | 青春草在线视频免费观看 | 成人欧美一区二区三区黑人免费 | 精品国产av色一区二区深夜久久 | 日本熟妇乱子伦xxxx | 亚洲成av人在线观看网址 | 亚洲 另类 在线 欧美 制服 | 99久久精品午夜一区二区 | 在线精品亚洲一区二区 | 久久久久久a亚洲欧洲av冫 | 人人妻人人澡人人爽人人精品浪潮 | 日本精品久久久久中文字幕 | 人妻少妇精品视频专区 | 亚洲 a v无 码免 费 成 人 a v | 久久精品成人欧美大片 | 中文字幕人妻无码一夲道 | 精品无码一区二区三区的天堂 | 亚洲色偷偷男人的天堂 | 亚洲无人区午夜福利码高清完整版 | аⅴ资源天堂资源库在线 | 激情综合激情五月俺也去 | 在线a亚洲视频播放在线观看 | 国产成人精品久久亚洲高清不卡 | 亚洲综合另类小说色区 | 欧美老人巨大xxxx做受 | 国产精品亚洲一区二区三区喷水 | 一本加勒比波多野结衣 | 精品久久久无码人妻字幂 | 亚洲午夜久久久影院 | 欧美xxxx黑人又粗又长 | 青草视频在线播放 | 亚洲国产av美女网站 | 久久综合九色综合欧美狠狠 | 国产激情无码一区二区app | 少妇被黑人到高潮喷出白浆 | 亚洲色欲色欲天天天www | 成人免费无码大片a毛片 | 亚洲日韩中文字幕在线播放 | 日本又色又爽又黄的a片18禁 | 亚洲aⅴ无码成人网站国产app | av无码电影一区二区三区 | 捆绑白丝粉色jk震动捧喷白浆 | 日本丰满熟妇videos | 又色又爽又黄的美女裸体网站 | 给我免费的视频在线观看 | 夜精品a片一区二区三区无码白浆 | 午夜福利电影 | 性欧美videos高清精品 | 精品乱子伦一区二区三区 | 亚洲爆乳精品无码一区二区三区 | 欧美黑人性暴力猛交喷水 | 特级做a爰片毛片免费69 | 欧美国产亚洲日韩在线二区 | 亚洲人亚洲人成电影网站色 | 在线 国产 欧美 亚洲 天堂 | 高清无码午夜福利视频 | 色欲久久久天天天综合网精品 | 国产在线aaa片一区二区99 | 久久综合久久自在自线精品自 | 日韩精品乱码av一区二区 | 97久久国产亚洲精品超碰热 | 日本精品少妇一区二区三区 | 粉嫩少妇内射浓精videos | 日韩欧美群交p片內射中文 | 国产办公室秘书无码精品99 | 人人妻人人澡人人爽欧美一区九九 | 中文字幕乱妇无码av在线 | 欧美丰满熟妇xxxx | 67194成是人免费无码 | 天天拍夜夜添久久精品大 | 国产特级毛片aaaaaa高潮流水 | 久久国产36精品色熟妇 | 亚洲娇小与黑人巨大交 | 免费无码av一区二区 | 精品水蜜桃久久久久久久 | 最近免费中文字幕中文高清百度 | 国产极品美女高潮无套在线观看 | 中文亚洲成a人片在线观看 | 日本又色又爽又黄的a片18禁 | 国内精品久久毛片一区二区 | 久久这里只有精品视频9 | 人妻熟女一区 | 人人超人人超碰超国产 | 亚洲 激情 小说 另类 欧美 | 99精品无人区乱码1区2区3区 | 黑人巨大精品欧美黑寡妇 | 欧美真人作爱免费视频 | 久久久无码中文字幕久... | 久青草影院在线观看国产 | 嫩b人妻精品一区二区三区 | 99精品无人区乱码1区2区3区 | 亚洲乱码日产精品bd | 久久99精品久久久久久动态图 | 天堂在线观看www | 性生交片免费无码看人 | 在线观看国产午夜福利片 | 国产亲子乱弄免费视频 | 欧美日韩人成综合在线播放 | 少妇久久久久久人妻无码 | 性色av无码免费一区二区三区 | 日韩精品无码一区二区中文字幕 | 三上悠亚人妻中文字幕在线 | 综合网日日天干夜夜久久 | 欧美黑人乱大交 | 国产偷抇久久精品a片69 | 国产亚洲精品久久久久久久久动漫 | 激情亚洲一区国产精品 | 午夜精品久久久久久久 | 国产熟妇另类久久久久 | 国产免费久久久久久无码 | 少妇愉情理伦片bd | 国产亚洲tv在线观看 | 免费人成网站视频在线观看 | 人人妻人人澡人人爽人人精品浪潮 | 色一情一乱一伦一视频免费看 | 亚洲精品国偷拍自产在线观看蜜桃 | 成人精品视频一区二区三区尤物 | 亚洲中文字幕无码中文字在线 | 2020最新国产自产精品 | 无码帝国www无码专区色综合 | 欧美三级不卡在线观看 | 国产精品手机免费 | 久久久久se色偷偷亚洲精品av | 精品一区二区三区无码免费视频 | 无码成人精品区在线观看 | 亚洲精品一区二区三区在线观看 | 天下第一社区视频www日本 | 在线欧美精品一区二区三区 | 狂野欧美性猛交免费视频 | 久久久久久国产精品无码下载 | 日韩人妻无码中文字幕视频 | 日韩精品久久久肉伦网站 | 国产在线无码精品电影网 | 久久午夜无码鲁丝片秋霞 | 性欧美大战久久久久久久 | 日本大香伊一区二区三区 | 亚洲精品综合五月久久小说 | 午夜无码区在线观看 | 久久精品人人做人人综合试看 | 久久久久久av无码免费看大片 | 成人欧美一区二区三区黑人 | 久久国内精品自在自线 | 午夜性刺激在线视频免费 | 国产精品亚洲五月天高清 | 蜜桃av蜜臀av色欲av麻 999久久久国产精品消防器材 | 中文精品无码中文字幕无码专区 | 一本大道久久东京热无码av | 久久久精品456亚洲影院 | 亚洲精品鲁一鲁一区二区三区 | 欧美zoozzooz性欧美 | 美女黄网站人色视频免费国产 | 人妻体内射精一区二区三四 | 初尝人妻少妇中文字幕 | 亚洲精品国产第一综合99久久 | 鲁一鲁av2019在线 | 曰韩少妇内射免费播放 | 小泽玛莉亚一区二区视频在线 | 欧美阿v高清资源不卡在线播放 | 小sao货水好多真紧h无码视频 | 99精品无人区乱码1区2区3区 | 帮老师解开蕾丝奶罩吸乳网站 | 色综合久久中文娱乐网 | 内射巨臀欧美在线视频 | 亚洲精品一区二区三区婷婷月 | 亚洲热妇无码av在线播放 | 色情久久久av熟女人妻网站 | 国产色视频一区二区三区 | 亚洲精品鲁一鲁一区二区三区 | 精品无码成人片一区二区98 | 久久精品国产大片免费观看 | 丰满人妻一区二区三区免费视频 | 亚洲人交乣女bbw | 国产午夜无码视频在线观看 | 成人动漫在线观看 | 久久午夜夜伦鲁鲁片无码免费 | 久久精品中文闷骚内射 | 国产sm调教视频在线观看 | 成年美女黄网站色大免费视频 | 亚洲理论电影在线观看 | 国产亚洲精品久久久久久 | 国产真人无遮挡作爱免费视频 | 日韩欧美中文字幕公布 | 国产真人无遮挡作爱免费视频 | 宝宝好涨水快流出来免费视频 | 亚洲乱亚洲乱妇50p | 亚洲乱亚洲乱妇50p | 老熟女乱子伦 | 亚洲日本一区二区三区在线 | 欧美亚洲国产一区二区三区 | 性欧美videos高清精品 | 少妇高潮一区二区三区99 | 欧美野外疯狂做受xxxx高潮 | 中文精品无码中文字幕无码专区 | 国产色精品久久人妻 | 国内精品久久久久久中文字幕 | 国产两女互慰高潮视频在线观看 | 丰腴饱满的极品熟妇 | 国产人妻精品一区二区三区 | 少妇被黑人到高潮喷出白浆 | 欧美大屁股xxxxhd黑色 | 激情国产av做激情国产爱 | 人人妻人人澡人人爽欧美精品 | 亚洲人成网站免费播放 | 国内少妇偷人精品视频 | 少妇愉情理伦片bd | 久久婷婷五月综合色国产香蕉 | 久青草影院在线观看国产 | 少妇性l交大片 | 四虎国产精品一区二区 | 色综合久久中文娱乐网 | 久久精品国产99久久6动漫 | 日本熟妇人妻xxxxx人hd | 亚洲欧美精品伊人久久 | 国产色视频一区二区三区 | 亚洲国产精品久久久久久 | 国产乱子伦视频在线播放 | 99精品久久毛片a片 | 亚洲中文无码av永久不收费 | 国产精品免费大片 | 蜜桃视频插满18在线观看 | 成 人 网 站国产免费观看 | 粗大的内捧猛烈进出视频 | 天天躁夜夜躁狠狠是什么心态 | 国产精品久久久久久亚洲毛片 | 十八禁视频网站在线观看 | 欧洲欧美人成视频在线 | 久久97精品久久久久久久不卡 | 玩弄少妇高潮ⅹxxxyw | 免费国产黄网站在线观看 | 日韩视频 中文字幕 视频一区 | 色综合久久88色综合天天 | 夜夜躁日日躁狠狠久久av | 久久久久免费看成人影片 | 国产真实伦对白全集 | 免费无码一区二区三区蜜桃大 | 久久精品国产精品国产精品污 | 亚洲熟妇色xxxxx欧美老妇 | 久久久久久久久蜜桃 | 啦啦啦www在线观看免费视频 | 精品国产乱码久久久久乱码 | 亚洲国产精品美女久久久久 | 亚洲精品久久久久久一区二区 | 丝袜美腿亚洲一区二区 | 国产精品久久国产精品99 | 日本乱人伦片中文三区 | 鲁一鲁av2019在线 | 99久久人妻精品免费一区 | 日日鲁鲁鲁夜夜爽爽狠狠 | 国产av剧情md精品麻豆 | 欧美人与物videos另类 | 国产无av码在线观看 | 人妻尝试又大又粗久久 | 成人女人看片免费视频放人 | 人人妻人人澡人人爽人人精品 | 国产精品亚洲五月天高清 | 国产莉萝无码av在线播放 | 亚洲精品一区二区三区在线 | 成 人 网 站国产免费观看 | 野外少妇愉情中文字幕 | 熟妇人妻中文av无码 | 成人av无码一区二区三区 | 牲欲强的熟妇农村老妇女 | 曰本女人与公拘交酡免费视频 | 少妇性l交大片欧洲热妇乱xxx | 久久人人97超碰a片精品 | 中文字幕人妻无码一夲道 | 亚洲人成网站在线播放942 | 日日夜夜撸啊撸 | 青青久在线视频免费观看 | 亚洲人交乣女bbw | 国产成人综合美国十次 | 性欧美疯狂xxxxbbbb | 无码国产激情在线观看 | 亚洲大尺度无码无码专区 | 色婷婷综合激情综在线播放 | 波多野结衣高清一区二区三区 | 亚洲 日韩 欧美 成人 在线观看 | 欧美成人家庭影院 | 男女作爱免费网站 | 大屁股大乳丰满人妻 | 国产高清不卡无码视频 | 久久久久久九九精品久 | av人摸人人人澡人人超碰下载 | 国产无遮挡又黄又爽又色 | 久久人妻内射无码一区三区 | 亚洲国产精华液网站w | 1000部啪啪未满十八勿入下载 | 蜜桃视频插满18在线观看 | 大地资源网第二页免费观看 | 欧美黑人乱大交 | 亚洲春色在线视频 | 欧洲极品少妇 | 日韩精品一区二区av在线 | 精品熟女少妇av免费观看 | 老头边吃奶边弄进去呻吟 | 99麻豆久久久国产精品免费 | 欧美人妻一区二区三区 | 国产精品亚洲lv粉色 | 色综合久久久久综合一本到桃花网 | 亚洲国产精品无码一区二区三区 | 亚洲国产欧美在线成人 | 成 人 网 站国产免费观看 | 久久综合色之久久综合 | 55夜色66夜色国产精品视频 | 国内精品一区二区三区不卡 | 美女扒开屁股让男人桶 | 精品无码一区二区三区爱欲 | 日韩 欧美 动漫 国产 制服 | 亚洲中文无码av永久不收费 | 强辱丰满人妻hd中文字幕 | www国产精品内射老师 | 色诱久久久久综合网ywww | а√天堂www在线天堂小说 | 波多野结衣乳巨码无在线观看 | 中文字幕中文有码在线 | 日日噜噜噜噜夜夜爽亚洲精品 | а天堂中文在线官网 | 成人精品视频一区二区 | 无码av免费一区二区三区试看 | 亚洲精品成人福利网站 | 日本高清一区免费中文视频 | 久久综合激激的五月天 | 免费无码av一区二区 | 玩弄中年熟妇正在播放 | 国产av无码专区亚洲a∨毛片 | 青春草在线视频免费观看 | 无码人妻出轨黑人中文字幕 | 精品久久久久久亚洲精品 | 2019午夜福利不卡片在线 | 99久久人妻精品免费一区 | 人人妻人人澡人人爽欧美一区九九 | 国产亚洲精品久久久久久久 | 亚洲色大成网站www | 无码福利日韩神码福利片 | 欧洲极品少妇 | 久久久久久九九精品久 | 亚洲日韩精品欧美一区二区 | 国产小呦泬泬99精品 | 蜜臀av在线播放 久久综合激激的五月天 | 亚洲欧洲日本综合aⅴ在线 | 5858s亚洲色大成网站www | 女人被爽到呻吟gif动态图视看 | 狠狠亚洲超碰狼人久久 | 玩弄人妻少妇500系列视频 | 欧美激情内射喷水高潮 | 久久国语露脸国产精品电影 | 日日麻批免费40分钟无码 | www一区二区www免费 | 99riav国产精品视频 | 亚洲中文字幕成人无码 | 青青草原综合久久大伊人精品 | 亚洲精品成a人在线观看 | 国产凸凹视频一区二区 | 曰本女人与公拘交酡免费视频 | 水蜜桃色314在线观看 | 免费无码一区二区三区蜜桃大 | 久久久婷婷五月亚洲97号色 | 久热国产vs视频在线观看 | 亚洲国产欧美日韩精品一区二区三区 | 一本久久a久久精品亚洲 | 国产绳艺sm调教室论坛 | 黑人大群体交免费视频 | 性欧美牲交xxxxx视频 | 老头边吃奶边弄进去呻吟 | 人妻有码中文字幕在线 | 国产av一区二区三区最新精品 | 无码av中文字幕免费放 | 色婷婷欧美在线播放内射 | 久激情内射婷内射蜜桃人妖 | 蜜桃无码一区二区三区 | 永久免费观看美女裸体的网站 | 久久精品99久久香蕉国产色戒 | 久久无码专区国产精品s | 亚洲狠狠婷婷综合久久 | 国产精品久久久久久亚洲影视内衣 | 特黄特色大片免费播放器图片 | 领导边摸边吃奶边做爽在线观看 | 真人与拘做受免费视频一 | 久久无码中文字幕免费影院蜜桃 | 婷婷色婷婷开心五月四房播播 | 漂亮人妻洗澡被公强 日日躁 | 亚洲国产欧美日韩精品一区二区三区 | 一本久久a久久精品vr综合 | 国产精品高潮呻吟av久久4虎 | 国产精品人人妻人人爽 | 国产在线aaa片一区二区99 | 亚洲综合久久一区二区 | 久久国产精品偷任你爽任你 | 麻豆国产丝袜白领秘书在线观看 | 国产黑色丝袜在线播放 | 久久国产自偷自偷免费一区调 | 55夜色66夜色国产精品视频 | 成人无码精品一区二区三区 | 天天躁日日躁狠狠躁免费麻豆 | 噜噜噜亚洲色成人网站 | 丰满人妻翻云覆雨呻吟视频 | 精品一区二区三区无码免费视频 | 亚洲毛片av日韩av无码 | а天堂中文在线官网 | 精品人妻中文字幕有码在线 | 欧洲欧美人成视频在线 | 国产农村乱对白刺激视频 | 亚洲精品午夜无码电影网 | 99久久婷婷国产综合精品青草免费 | 国产精品国产三级国产专播 | 日日碰狠狠躁久久躁蜜桃 | 色一情一乱一伦一视频免费看 | 亚洲乱码中文字幕在线 | 亚洲欧洲中文日韩av乱码 | 日韩精品成人一区二区三区 | 免费观看的无遮挡av | 久久精品成人欧美大片 | 国产网红无码精品视频 | 2020最新国产自产精品 | 日本大乳高潮视频在线观看 | 中文字幕人妻丝袜二区 | 国产精品国产自线拍免费软件 | 久久精品99久久香蕉国产色戒 | 欧美成人高清在线播放 | а天堂中文在线官网 | 2019nv天堂香蕉在线观看 | 少妇性荡欲午夜性开放视频剧场 | 美女毛片一区二区三区四区 | 久久久久久av无码免费看大片 | 无码成人精品区在线观看 | 国产亚洲精品久久久ai换 | 欧美日本精品一区二区三区 | 国产办公室秘书无码精品99 | 国产亚洲精品久久久久久国模美 | 一本久久a久久精品vr综合 | 国产精品毛片一区二区 | 国产精品欧美成人 | 国产莉萝无码av在线播放 | 欧美精品无码一区二区三区 | 亚洲日韩av一区二区三区四区 | 精品成在人线av无码免费看 | 日韩在线不卡免费视频一区 | 亚洲爆乳无码专区 | 麻豆成人精品国产免费 | 国产一精品一av一免费 | 久久久亚洲欧洲日产国码αv | 国内少妇偷人精品视频 | 十八禁真人啪啪免费网站 | 人人爽人人澡人人人妻 | 国产一区二区三区日韩精品 | 欧美兽交xxxx×视频 | 国产超碰人人爽人人做人人添 | 日韩 欧美 动漫 国产 制服 | 亚洲精品久久久久中文第一幕 | 精品国产福利一区二区 | 欧美日韩久久久精品a片 | 波多野结衣乳巨码无在线观看 | 欧美日韩色另类综合 | 扒开双腿吃奶呻吟做受视频 | 久久精品国产亚洲精品 | 国产肉丝袜在线观看 | 在线 国产 欧美 亚洲 天堂 | 377p欧洲日本亚洲大胆 | 成熟女人特级毛片www免费 | 久久午夜无码鲁丝片午夜精品 | 国产在热线精品视频 | 最新版天堂资源中文官网 | 久久人妻内射无码一区三区 | 国产成人综合在线女婷五月99播放 | 国产真人无遮挡作爱免费视频 | 久久综合香蕉国产蜜臀av | 成熟妇人a片免费看网站 | 少妇人妻av毛片在线看 | 日本一区二区三区免费高清 | 免费播放一区二区三区 | 亚洲理论电影在线观看 | 久久人妻内射无码一区三区 | 久久无码中文字幕免费影院蜜桃 | 国产无套内射久久久国产 | 亚洲中文字幕无码一久久区 | 99精品无人区乱码1区2区3区 | 免费看少妇作爱视频 | 精品国产国产综合精品 | 亚洲精品久久久久avwww潮水 | 久久精品中文字幕大胸 | 国产精品久久久午夜夜伦鲁鲁 | 亚洲国产精品无码一区二区三区 | 97人妻精品一区二区三区 | 色一情一乱一伦 | 四虎永久在线精品免费网址 | 午夜丰满少妇性开放视频 | 国产人妻大战黑人第1集 | 欧美 日韩 亚洲 在线 | 乱码午夜-极国产极内射 | 国产人妻大战黑人第1集 | 亚洲国产午夜精品理论片 | 亚洲经典千人经典日产 | 思思久久99热只有频精品66 | a在线亚洲男人的天堂 | 午夜理论片yy44880影院 | 乱人伦人妻中文字幕无码 | av小次郎收藏 | 久久97精品久久久久久久不卡 | 成人毛片一区二区 | www一区二区www免费 | 又粗又大又硬又长又爽 | 天堂а√在线地址中文在线 | 给我免费的视频在线观看 | 青青久在线视频免费观看 | 国产精品无码永久免费888 | 国产做国产爱免费视频 | 国产极品美女高潮无套在线观看 | 亚洲中文无码av永久不收费 | 亚洲人成影院在线观看 | 99精品国产综合久久久久五月天 | 丰满少妇弄高潮了www | 国产黄在线观看免费观看不卡 | 国产精品二区一区二区aⅴ污介绍 | 国产特级毛片aaaaaa高潮流水 | 无码福利日韩神码福利片 | 免费人成网站视频在线观看 | 无码帝国www无码专区色综合 | 欧美熟妇另类久久久久久多毛 | 极品尤物被啪到呻吟喷水 | 无码免费一区二区三区 | 久久精品国产一区二区三区肥胖 | 国产超级va在线观看视频 | 国产人妖乱国产精品人妖 | 国产精品久久久久无码av色戒 | 97人妻精品一区二区三区 | 亚洲精品综合一区二区三区在线 | 又粗又大又硬又长又爽 | 丝袜足控一区二区三区 | 日欧一片内射va在线影院 | 亚洲熟妇色xxxxx欧美老妇y | 国精产品一品二品国精品69xx | 99久久精品国产一区二区蜜芽 | 无码乱肉视频免费大全合集 | 亚洲aⅴ无码成人网站国产app | 国色天香社区在线视频 | 国产9 9在线 | 中文 | 国语自产偷拍精品视频偷 | 成人欧美一区二区三区 | 国产精品久免费的黄网站 | 国产无套粉嫩白浆在线 | 精品国偷自产在线视频 | 国产欧美熟妇另类久久久 | 日日噜噜噜噜夜夜爽亚洲精品 | 成人三级无码视频在线观看 | 亚洲无人区午夜福利码高清完整版 | 午夜福利不卡在线视频 | 天天躁夜夜躁狠狠是什么心态 | 亚洲精品成人福利网站 | 国产深夜福利视频在线 | 黑人大群体交免费视频 | 国产乡下妇女做爰 | 激情人妻另类人妻伦 | 中文字幕无码av激情不卡 | 国产成人无码午夜视频在线观看 | 俺去俺来也www色官网 | 国内精品久久久久久中文字幕 | 色综合久久久无码网中文 | 国产情侣作爱视频免费观看 | 精品国产福利一区二区 | 久久精品人人做人人综合试看 | 无码午夜成人1000部免费视频 | 亚洲中文字幕无码一久久区 | 久久国产劲爆∧v内射 | 未满成年国产在线观看 | 人妻尝试又大又粗久久 | 成人片黄网站色大片免费观看 | 国产婷婷色一区二区三区在线 | 国产综合色产在线精品 | 国产xxx69麻豆国语对白 | 色综合久久久无码网中文 | 国产明星裸体无码xxxx视频 | 久9re热视频这里只有精品 | 成在人线av无码免费 | 亚洲小说图区综合在线 | 乱码午夜-极国产极内射 | 国产后入清纯学生妹 | 成人无码视频在线观看网站 | 人妻尝试又大又粗久久 | 夜精品a片一区二区三区无码白浆 | 久激情内射婷内射蜜桃人妖 | 日韩视频 中文字幕 视频一区 | 精品亚洲韩国一区二区三区 | 欧美 丝袜 自拍 制服 另类 | 一本色道久久综合亚洲精品不卡 | 曰韩无码二三区中文字幕 | 精品乱码久久久久久久 | 成人免费无码大片a毛片 | 77777熟女视频在线观看 а天堂中文在线官网 | 久久精品99久久香蕉国产色戒 | 高清无码午夜福利视频 | 黄网在线观看免费网站 | 九月婷婷人人澡人人添人人爽 | 亚洲人成无码网www | 久久久久久久人妻无码中文字幕爆 | 女人被男人躁得好爽免费视频 | 久久精品国产亚洲精品 | 无码吃奶揉捏奶头高潮视频 | 妺妺窝人体色www在线小说 | 东京无码熟妇人妻av在线网址 | 亚洲国产精品一区二区第一页 | 国产成人一区二区三区在线观看 | 强伦人妻一区二区三区视频18 | 免费中文字幕日韩欧美 | 亚洲一区二区三区国产精华液 | 图片区 小说区 区 亚洲五月 | 国产又粗又硬又大爽黄老大爷视 | 暴力强奷在线播放无码 | 国产乱人无码伦av在线a | 国产熟妇另类久久久久 | 少女韩国电视剧在线观看完整 | 欧美黑人乱大交 | 色老头在线一区二区三区 | 麻豆果冻传媒2021精品传媒一区下载 | 国产一区二区三区四区五区加勒比 | 亚洲 另类 在线 欧美 制服 | 精品亚洲成av人在线观看 | 亚洲中文字幕在线无码一区二区 | 狂野欧美性猛xxxx乱大交 | 国产xxx69麻豆国语对白 | 国产午夜福利亚洲第一 | 亚洲国产成人a精品不卡在线 | 亚洲日本va中文字幕 | 日本一区二区更新不卡 | 国产成人精品必看 | 精品久久综合1区2区3区激情 | 久久久久免费精品国产 | 无码人妻丰满熟妇区五十路百度 | 极品尤物被啪到呻吟喷水 | 呦交小u女精品视频 | 日韩 欧美 动漫 国产 制服 | 色一情一乱一伦一区二区三欧美 | 国产香蕉尹人综合在线观看 | 成人无码精品1区2区3区免费看 | 免费播放一区二区三区 | 久久97精品久久久久久久不卡 | 秋霞成人午夜鲁丝一区二区三区 | 欧美人与禽zoz0性伦交 | 亚洲国产av精品一区二区蜜芽 | 最近的中文字幕在线看视频 | 亚洲欧美综合区丁香五月小说 | 午夜性刺激在线视频免费 | 久久精品视频在线看15 | 99久久精品日本一区二区免费 | 久久国产劲爆∧v内射 | 青草青草久热国产精品 | 国产一区二区三区日韩精品 | 综合人妻久久一区二区精品 | 国产精品鲁鲁鲁 | 中文字幕乱码亚洲无线三区 | 国产人妻精品午夜福利免费 | 婷婷五月综合激情中文字幕 | 国产绳艺sm调教室论坛 | 国产超碰人人爽人人做人人添 | 中文字幕无码免费久久99 | 精品厕所偷拍各类美女tp嘘嘘 | 亚洲一区二区三区无码久久 | 成熟人妻av无码专区 | 色综合久久久无码中文字幕 | 久久久久久亚洲精品a片成人 | 免费国产黄网站在线观看 | 一个人看的www免费视频在线观看 | 久久久久99精品国产片 | 精品少妇爆乳无码av无码专区 | 欧洲精品码一区二区三区免费看 | 色 综合 欧美 亚洲 国产 | 精品国产成人一区二区三区 | 亚洲精品无码国产 | 国产精品嫩草久久久久 | 日韩视频 中文字幕 视频一区 | 特级做a爰片毛片免费69 | 日产精品高潮呻吟av久久 | 国产精品久久福利网站 | 性色av无码免费一区二区三区 | 99视频精品全部免费免费观看 | 无码av最新清无码专区吞精 | 波多野结衣高清一区二区三区 | 欧美黑人性暴力猛交喷水 | 无码av岛国片在线播放 | 国产午夜无码精品免费看 | 天下第一社区视频www日本 | 国产亚洲欧美在线专区 | 2019午夜福利不卡片在线 | 成人无码视频免费播放 | 色婷婷香蕉在线一区二区 | 99视频精品全部免费免费观看 | 中文字幕无码免费久久9一区9 | 亚洲色欲色欲天天天www | 中文字幕av日韩精品一区二区 | 装睡被陌生人摸出水好爽 | 国产午夜精品一区二区三区嫩草 | 国产精品va在线观看无码 | 成人免费视频一区二区 | 中文字幕无码免费久久9一区9 | 国产片av国语在线观看 | 久久久久亚洲精品男人的天堂 | 女人和拘做爰正片视频 | 精品国产麻豆免费人成网站 | 久久国产精品精品国产色婷婷 | 久久亚洲精品中文字幕无男同 | 国内揄拍国内精品少妇国语 | 国内老熟妇对白xxxxhd | 乌克兰少妇性做爰 | 日本乱人伦片中文三区 | 国产黑色丝袜在线播放 | 蜜桃av抽搐高潮一区二区 | 性生交大片免费看女人按摩摩 | 人妻互换免费中文字幕 | 国产亚洲精品久久久久久久 | 99久久婷婷国产综合精品青草免费 | 未满成年国产在线观看 | 久久精品丝袜高跟鞋 | 欧美自拍另类欧美综合图片区 | 国产精品福利视频导航 | 丝袜 中出 制服 人妻 美腿 | 一区二区三区乱码在线 | 欧洲 | 亚洲日本在线电影 | 亚洲 a v无 码免 费 成 人 a v | 国产无套粉嫩白浆在线 | 在线观看欧美一区二区三区 | 国产欧美熟妇另类久久久 | 国产麻豆精品一区二区三区v视界 | 又紧又大又爽精品一区二区 | 乱人伦人妻中文字幕无码久久网 | 免费看男女做好爽好硬视频 | 免费国产黄网站在线观看 | 人妻无码αv中文字幕久久琪琪布 | 久久久av男人的天堂 | 狠狠亚洲超碰狼人久久 | 欧美35页视频在线观看 | 精品一区二区三区波多野结衣 | 男女超爽视频免费播放 | 久久久久久国产精品无码下载 | 亚洲中文字幕无码中文字在线 | 国产无遮挡又黄又爽又色 | 国产成人一区二区三区在线观看 | 成 人 免费观看网站 | 天堂在线观看www | 九九热爱视频精品 | 麻豆国产人妻欲求不满 | 亚洲综合伊人久久大杳蕉 | 伊人久久大香线焦av综合影院 | 国产精品无码成人午夜电影 | 国产99久久精品一区二区 | 日韩av无码一区二区三区不卡 | 白嫩日本少妇做爰 | 国产女主播喷水视频在线观看 | 亚洲高清偷拍一区二区三区 | 久久这里只有精品视频9 | 亚洲日韩av一区二区三区中文 | 国产特级毛片aaaaaa高潮流水 | av人摸人人人澡人人超碰下载 | 日产精品99久久久久久 | 欧美丰满少妇xxxx性 | 亚洲精品午夜国产va久久成人 | 99久久无码一区人妻 | 久久 国产 尿 小便 嘘嘘 | 鲁一鲁av2019在线 | 极品嫩模高潮叫床 | 一个人看的www免费视频在线观看 | 国产精品无码一区二区三区不卡 | 一个人看的www免费视频在线观看 | 久久久中文字幕日本无吗 | 鲁一鲁av2019在线 | 粉嫩少妇内射浓精videos | 国精产品一品二品国精品69xx | 网友自拍区视频精品 | 国产偷自视频区视频 | 99精品久久毛片a片 | 亚洲精品一区二区三区在线 | aa片在线观看视频在线播放 | 少妇愉情理伦片bd | www国产亚洲精品久久网站 | 欧美猛少妇色xxxxx | 性色av无码免费一区二区三区 | 日日噜噜噜噜夜夜爽亚洲精品 | 国产精品久久久一区二区三区 | 色一情一乱一伦 | 亚洲精品午夜国产va久久成人 | 亚无码乱人伦一区二区 | 欧美大屁股xxxxhd黑色 | 日韩欧美群交p片內射中文 | а√资源新版在线天堂 | 国产电影无码午夜在线播放 | 国产乱人无码伦av在线a | 久久国产精品精品国产色婷婷 | 丰满岳乱妇在线观看中字无码 | 精品一区二区不卡无码av | 欧美喷潮久久久xxxxx | 亚洲熟妇色xxxxx亚洲 | 国产精品对白交换视频 | 丰满妇女强制高潮18xxxx | 欧洲欧美人成视频在线 | yw尤物av无码国产在线观看 | 又大又紧又粉嫩18p少妇 | 国产精品无码mv在线观看 | 久久综合狠狠综合久久综合88 | 人妻少妇精品无码专区动漫 | 久久99精品久久久久久动态图 | 国内精品一区二区三区不卡 | 欧美性猛交内射兽交老熟妇 | 国产av无码专区亚洲a∨毛片 | 亚洲码国产精品高潮在线 | 久久精品国产精品国产精品污 | 国精品人妻无码一区二区三区蜜柚 | 色一情一乱一伦一视频免费看 | 天堂亚洲2017在线观看 | 精品久久久久久人妻无码中文字幕 | 国产激情无码一区二区 | 亚洲中文无码av永久不收费 | 亚洲人成网站免费播放 | 少妇邻居内射在线 | 图片区 小说区 区 亚洲五月 | 国产又粗又硬又大爽黄老大爷视 | 亚洲精品一区三区三区在线观看 | 欧美日韩视频无码一区二区三 | 天天做天天爱天天爽综合网 | 日本xxxx色视频在线观看免费 | 伊人久久大香线蕉av一区二区 | 性做久久久久久久久 | 麻豆国产人妻欲求不满谁演的 | 日韩精品无码免费一区二区三区 | 国产亚洲日韩欧美另类第八页 | 免费播放一区二区三区 | 十八禁视频网站在线观看 | yw尤物av无码国产在线观看 | 一本精品99久久精品77 | 久热国产vs视频在线观看 | 久久久精品欧美一区二区免费 | 色综合久久中文娱乐网 | 亚洲国产成人a精品不卡在线 | 日韩在线不卡免费视频一区 | 5858s亚洲色大成网站www | 亚洲一区二区三区四区 | 日韩欧美中文字幕公布 | 在线播放无码字幕亚洲 | 欧洲精品码一区二区三区免费看 | 丁香花在线影院观看在线播放 | 国产精品亚洲一区二区三区喷水 | 国产成人无码专区 | 亚洲日韩乱码中文无码蜜桃臀网站 | 强开小婷嫩苞又嫩又紧视频 | 国产成人精品一区二区在线小狼 | 免费男性肉肉影院 | 男女作爱免费网站 | 精品亚洲韩国一区二区三区 | 精品亚洲成av人在线观看 | 色综合天天综合狠狠爱 | 一本大道久久东京热无码av | 婷婷丁香五月天综合东京热 | 水蜜桃av无码 | 欧美喷潮久久久xxxxx | 日本一区二区三区免费高清 | 欧美肥老太牲交大战 | 成人无码精品1区2区3区免费看 | 国产九九九九九九九a片 | 男人和女人高潮免费网站 | 日本一卡二卡不卡视频查询 | 欧美一区二区三区视频在线观看 | 一本久久a久久精品vr综合 | 久久人人97超碰a片精品 | 亚洲区欧美区综合区自拍区 | 人人妻人人澡人人爽人人精品浪潮 | 色综合久久久无码网中文 | 无码帝国www无码专区色综合 | 99麻豆久久久国产精品免费 | 99精品国产综合久久久久五月天 | 无码播放一区二区三区 | 丝袜足控一区二区三区 | 中文字幕无码人妻少妇免费 | 丰满岳乱妇在线观看中字无码 | 色婷婷综合中文久久一本 | 亚洲精品国产第一综合99久久 | 国产人妻人伦精品1国产丝袜 | 国产精品va在线观看无码 | 女人色极品影院 | 国産精品久久久久久久 | 日日麻批免费40分钟无码 | 又色又爽又黄的美女裸体网站 | 亚洲国产精品无码久久久久高潮 | 伦伦影院午夜理论片 | 大肉大捧一进一出好爽视频 | 亚洲色成人中文字幕网站 | 成人欧美一区二区三区黑人免费 | 久久精品国产99精品亚洲 | 欧美阿v高清资源不卡在线播放 | 99久久久无码国产精品免费 | 国产两女互慰高潮视频在线观看 | 天堂无码人妻精品一区二区三区 | 国内精品一区二区三区不卡 | 国产人妻精品一区二区三区不卡 | 国产精品久久久一区二区三区 | 欧美刺激性大交 | 亚洲精品国偷拍自产在线观看蜜桃 | 亚洲色www成人永久网址 | 日韩人妻系列无码专区 | aⅴ亚洲 日韩 色 图网站 播放 | 无遮无挡爽爽免费视频 | 人妻少妇精品无码专区动漫 | 午夜精品久久久久久久 | 欧美性生交活xxxxxdddd | 国语自产偷拍精品视频偷 | 日本大香伊一区二区三区 | 午夜时刻免费入口 | 国产凸凹视频一区二区 | 性色av无码免费一区二区三区 | 在线成人www免费观看视频 | 成人aaa片一区国产精品 | 蜜桃视频插满18在线观看 | 亚洲 欧美 激情 小说 另类 | 乱中年女人伦av三区 | 国产精品高潮呻吟av久久 | 一本加勒比波多野结衣 | 亚洲国产精品久久人人爱 | 大地资源中文第3页 | 最新国产乱人伦偷精品免费网站 | 牛和人交xxxx欧美 | 欧美 日韩 亚洲 在线 | 欧美精品无码一区二区三区 | 国产av无码专区亚洲a∨毛片 | 丰满人妻翻云覆雨呻吟视频 | 97久久超碰中文字幕 | 亚洲国产精品久久人人爱 | 成人无码视频在线观看网站 | 精品久久久久香蕉网 | 国产午夜无码视频在线观看 | 天海翼激烈高潮到腰振不止 | 亚洲精品久久久久中文第一幕 | 中文字幕乱码人妻二区三区 | 少妇愉情理伦片bd | 久久久婷婷五月亚洲97号色 | 亚洲の无码国产の无码影院 | 性欧美大战久久久久久久 | 久久人人爽人人爽人人片ⅴ | 婷婷综合久久中文字幕蜜桃三电影 | 一个人看的www免费视频在线观看 | 亚洲区小说区激情区图片区 | 欧美三级不卡在线观看 | 亚洲精品成人av在线 | 波多野结衣乳巨码无在线观看 | 亚洲中文无码av永久不收费 | 色综合久久网 | 国产精品欧美成人 | 久久精品人妻少妇一区二区三区 | 午夜福利一区二区三区在线观看 | 亚洲精品一区二区三区在线 | 国产极品视觉盛宴 | 国产成人精品三级麻豆 | 亚洲自偷自拍另类第1页 | 捆绑白丝粉色jk震动捧喷白浆 | 无码人妻精品一区二区三区下载 | 亚洲精品国偷拍自产在线麻豆 | 丰满人妻精品国产99aⅴ | 欧美人妻一区二区三区 | 久久99热只有频精品8 | 久久久久免费精品国产 | 色综合久久中文娱乐网 | 亚洲精品午夜国产va久久成人 | 综合人妻久久一区二区精品 | 狠狠噜狠狠狠狠丁香五月 | 久久久久久国产精品无码下载 | 鲁一鲁av2019在线 | 最新国产乱人伦偷精品免费网站 | 成人欧美一区二区三区黑人免费 | 少妇高潮一区二区三区99 | 亚洲无人区午夜福利码高清完整版 | 日韩av无码一区二区三区 | 亚洲精品久久久久久久久久久 | 日韩人妻少妇一区二区三区 | 2020最新国产自产精品 | 少妇被粗大的猛进出69影院 | 亚洲 欧美 激情 小说 另类 | 国产午夜无码视频在线观看 | 亚洲日本va午夜在线电影 | 亚洲熟妇色xxxxx欧美老妇 | 国产精品久久久久影院嫩草 | 久久精品中文字幕一区 | 窝窝午夜理论片影院 | 日日碰狠狠躁久久躁蜜桃 | 女人被男人躁得好爽免费视频 | 国产亚洲精品久久久久久 | 国产麻豆精品一区二区三区v视界 | 日日天干夜夜狠狠爱 | 国产精品无码mv在线观看 | 3d动漫精品啪啪一区二区中 | 亚洲熟妇自偷自拍另类 | 国产熟妇另类久久久久 | 国产精品无套呻吟在线 | 精品国产精品久久一区免费式 | 国产艳妇av在线观看果冻传媒 | 亚洲 激情 小说 另类 欧美 | 日本va欧美va欧美va精品 | 国产精品18久久久久久麻辣 | 无码国产激情在线观看 | 中文字幕av日韩精品一区二区 | 欧美自拍另类欧美综合图片区 | 精品人妻人人做人人爽 | 国产午夜无码精品免费看 | 国产成人无码午夜视频在线观看 | 国产精品va在线播放 | 成人免费视频视频在线观看 免费 | 欧美老妇交乱视频在线观看 | 日韩欧美群交p片內射中文 | 中文字幕亚洲情99在线 | 久激情内射婷内射蜜桃人妖 | 国产精品永久免费视频 | 中文字幕乱码人妻无码久久 | 中文字幕+乱码+中文字幕一区 | 蜜桃无码一区二区三区 | 秋霞成人午夜鲁丝一区二区三区 | 成年美女黄网站色大免费全看 | 亚洲日本va中文字幕 | 亚洲国产成人a精品不卡在线 | 亚洲最大成人网站 | 日韩精品成人一区二区三区 | 亚洲人成影院在线无码按摩店 | 人人妻人人澡人人爽欧美精品 | 久久精品国产精品国产精品污 | 天天综合网天天综合色 | 成人免费视频视频在线观看 免费 | 熟女少妇在线视频播放 | 久久综合九色综合欧美狠狠 | 学生妹亚洲一区二区 | 日本熟妇人妻xxxxx人hd | 亚洲综合无码一区二区三区 | 成熟人妻av无码专区 | 国产又爽又猛又粗的视频a片 | www国产亚洲精品久久网站 | 老司机亚洲精品影院无码 | 无码人妻av免费一区二区三区 | 国产av一区二区三区最新精品 | 亚洲国产av美女网站 | 亚洲欧洲日本综合aⅴ在线 | 亚洲一区av无码专区在线观看 | 久久99精品国产.久久久久 | 亚洲一区二区三区含羞草 | 国产精品久久久一区二区三区 | 人妻少妇精品无码专区动漫 | 人人澡人人妻人人爽人人蜜桃 | 丰满少妇熟乱xxxxx视频 | 久久精品视频在线看15 | 色一情一乱一伦一视频免费看 | 日日摸日日碰夜夜爽av | 图片小说视频一区二区 | 在线a亚洲视频播放在线观看 | 国产特级毛片aaaaaaa高清 | 日本一卡2卡3卡四卡精品网站 | 国产色xx群视频射精 | 麻豆果冻传媒2021精品传媒一区下载 | 午夜理论片yy44880影院 | 国产精品高潮呻吟av久久 | 国产亚洲精品久久久久久久 | 国产亚洲人成a在线v网站 | 日韩精品无码一区二区中文字幕 | 免费人成在线观看网站 | 精品无人国产偷自产在线 | 亚洲春色在线视频 | 亚洲精品国产a久久久久久 | 久久久久99精品国产片 | 国产精品亚洲综合色区韩国 | 人妻有码中文字幕在线 | 综合激情五月综合激情五月激情1 | 亚洲熟妇色xxxxx欧美老妇y | 亚洲中文字幕在线无码一区二区 | 国产亚av手机在线观看 | 人妻aⅴ无码一区二区三区 | 精品夜夜澡人妻无码av蜜桃 | 台湾无码一区二区 | 综合人妻久久一区二区精品 | 国产一精品一av一免费 | 亚洲国产日韩a在线播放 | 亚洲成a人片在线观看无码 | 亚洲成av人片天堂网无码】 | 日韩精品无码一区二区中文字幕 | 天堂无码人妻精品一区二区三区 | 久精品国产欧美亚洲色aⅴ大片 | 特黄特色大片免费播放器图片 | 色噜噜亚洲男人的天堂 | 男女超爽视频免费播放 | 成人性做爰aaa片免费看 | 强奷人妻日本中文字幕 | 国产精品va在线观看无码 | 国产av一区二区精品久久凹凸 | 色妞www精品免费视频 | 国产精品久免费的黄网站 | 东京热无码av男人的天堂 | 国产精品高潮呻吟av久久4虎 | 国产97在线 | 亚洲 | 国产精品久免费的黄网站 | 亚洲精品一区三区三区在线观看 | 国产精品久免费的黄网站 | 巨爆乳无码视频在线观看 | 亚洲精品一区二区三区在线 | 久久zyz资源站无码中文动漫 | 捆绑白丝粉色jk震动捧喷白浆 | 日本一区二区更新不卡 | 伊人久久大香线蕉午夜 | 精品亚洲韩国一区二区三区 | 大地资源网第二页免费观看 | 正在播放老肥熟妇露脸 | 中文字幕无码av激情不卡 | 97人妻精品一区二区三区 | 精品厕所偷拍各类美女tp嘘嘘 | 一本久道久久综合婷婷五月 | 国产欧美精品一区二区三区 | 蜜臀av无码人妻精品 | 日本一区二区三区免费高清 | 国产亚洲精品久久久久久久 | 亚洲综合另类小说色区 | 国产精品福利视频导航 | 午夜精品久久久久久久 | 99久久人妻精品免费二区 | 国产情侣作爱视频免费观看 | 精品久久综合1区2区3区激情 | 波多野结衣 黑人 | 精品久久久无码中文字幕 | 亚洲中文字幕va福利 | 天天拍夜夜添久久精品大 | 国产精品永久免费视频 | 久久亚洲精品成人无码 | 亚洲乱亚洲乱妇50p | 97夜夜澡人人爽人人喊中国片 | 国产亚洲精品久久久久久 | 国产卡一卡二卡三 | 奇米影视7777久久精品人人爽 | 久久精品中文字幕大胸 | 国产成人无码区免费内射一片色欲 | 国色天香社区在线视频 | 女高中生第一次破苞av | 国产免费无码一区二区视频 | 99久久精品午夜一区二区 | 少妇无码一区二区二三区 | 精品午夜福利在线观看 | 欧美性生交活xxxxxdddd | 呦交小u女精品视频 | 国产精品沙发午睡系列 | 亚洲国产综合无码一区 | 97久久精品无码一区二区 | 欧美 日韩 人妻 高清 中文 | 女人和拘做爰正片视频 | 乱码av麻豆丝袜熟女系列 | 国产人妖乱国产精品人妖 | 综合网日日天干夜夜久久 | 亚洲中文字幕在线无码一区二区 | 国产精品免费大片 | 欧美人与禽猛交狂配 | aa片在线观看视频在线播放 | 国产人妻人伦精品1国产丝袜 | 国产无遮挡又黄又爽免费视频 | 国产精品igao视频网 | 国产成人精品优优av | 国产av剧情md精品麻豆 | 色欲久久久天天天综合网精品 | 亚洲国产高清在线观看视频 | 亚洲精品久久久久久久久久久 | 国产无遮挡又黄又爽免费视频 | 久久五月精品中文字幕 | 无码毛片视频一区二区本码 | 国产成人精品视频ⅴa片软件竹菊 | 亚洲区欧美区综合区自拍区 | 2020久久香蕉国产线看观看 | 亚洲乱码国产乱码精品精 | 国産精品久久久久久久 | 亚洲s色大片在线观看 | 亚洲国产精品美女久久久久 | 黑森林福利视频导航 | 无码国产色欲xxxxx视频 | 欧美zoozzooz性欧美 | 丝袜人妻一区二区三区 | 强开小婷嫩苞又嫩又紧视频 | 久久精品国产大片免费观看 | 性做久久久久久久久 | 亚洲一区二区三区 | 亚洲精品中文字幕久久久久 | 国产农村乱对白刺激视频 | 日韩精品无码免费一区二区三区 | 久久精品女人天堂av免费观看 | 男女下面进入的视频免费午夜 | 丰满护士巨好爽好大乳 | 美女毛片一区二区三区四区 | 色婷婷综合激情综在线播放 | 麻豆人妻少妇精品无码专区 | 中文无码成人免费视频在线观看 | 欧美 丝袜 自拍 制服 另类 | 永久免费精品精品永久-夜色 | 丁香啪啪综合成人亚洲 | 初尝人妻少妇中文字幕 | 久久久精品人妻久久影视 | 人妻夜夜爽天天爽三区 | 国产精品怡红院永久免费 | 四虎永久在线精品免费网址 | 野狼第一精品社区 | 国产一区二区三区四区五区加勒比 | 久久国产精品偷任你爽任你 | 51国偷自产一区二区三区 | 国产亚洲精品久久久ai换 | 国产乱人无码伦av在线a | 国产精品18久久久久久麻辣 | 妺妺窝人体色www婷婷 | 国产亚洲人成a在线v网站 | 久久人人爽人人爽人人片ⅴ | 欧美精品国产综合久久 | 欧美黑人巨大xxxxx | 在线亚洲高清揄拍自拍一品区 | 动漫av网站免费观看 | www国产亚洲精品久久网站 | 亚洲中文字幕无码中文字在线 | 国产三级精品三级男人的天堂 | 国产午夜福利亚洲第一 | 久久人妻内射无码一区三区 | 精品人人妻人人澡人人爽人人 | 久久婷婷五月综合色国产香蕉 | www成人国产高清内射 | 丁香啪啪综合成人亚洲 | 人妻少妇精品久久 | 亚洲国产精品久久人人爱 | 国产精品无码一区二区三区不卡 | 中文字幕无码av波多野吉衣 | 国产办公室秘书无码精品99 | 午夜性刺激在线视频免费 | 无码播放一区二区三区 | 强开小婷嫩苞又嫩又紧视频 | 国产av一区二区三区最新精品 | 麻豆蜜桃av蜜臀av色欲av | 综合网日日天干夜夜久久 | 18无码粉嫩小泬无套在线观看 | 2020久久香蕉国产线看观看 | 丰满少妇弄高潮了www | 中文字幕日韩精品一区二区三区 | 男女爱爱好爽视频免费看 | 国产97在线 | 亚洲 | 久久精品国产一区二区三区肥胖 | 无码人妻丰满熟妇区毛片18 | 99久久无码一区人妻 | 任你躁国产自任一区二区三区 | 漂亮人妻洗澡被公强 日日躁 | 国产xxx69麻豆国语对白 | 国产亚洲精品久久久闺蜜 | 人妻少妇被猛烈进入中文字幕 | 未满成年国产在线观看 | 久久久久久久久888 | 成人无码视频免费播放 | 日产精品高潮呻吟av久久 | 亚洲一区二区观看播放 | 曰本女人与公拘交酡免费视频 | 亚洲午夜福利在线观看 | 99久久精品午夜一区二区 | 精品一二三区久久aaa片 | 人人爽人人澡人人高潮 | 蜜臀av无码人妻精品 | 亚洲中文无码av永久不收费 | 强奷人妻日本中文字幕 | 久久午夜无码鲁丝片 | 人妻少妇被猛烈进入中文字幕 | 久久久中文字幕日本无吗 | 日韩在线不卡免费视频一区 | 亚洲一区二区三区播放 | 亚洲精品欧美二区三区中文字幕 | 人妻熟女一区 | 欧美成人免费全部网站 | 免费网站看v片在线18禁无码 | 国产两女互慰高潮视频在线观看 | 熟女俱乐部五十路六十路av | 国产无遮挡又黄又爽又色 | 亚洲爆乳无码专区 | 国产乱人伦app精品久久 国产在线无码精品电影网 国产国产精品人在线视 | 亚洲第一无码av无码专区 | 又粗又大又硬又长又爽 | av无码不卡在线观看免费 | 成人aaa片一区国产精品 | 粉嫩少妇内射浓精videos | 黑人巨大精品欧美一区二区 | 亚洲成熟女人毛毛耸耸多 | 国产av一区二区三区最新精品 | 色 综合 欧美 亚洲 国产 | 久久精品国产大片免费观看 | 精品国产aⅴ无码一区二区 | 欧美日韩一区二区综合 | 亲嘴扒胸摸屁股激烈网站 | 国产偷抇久久精品a片69 | 天堂一区人妻无码 | 日韩欧美群交p片內射中文 | 一本无码人妻在中文字幕免费 | 久久99精品久久久久久 | 成人精品一区二区三区中文字幕 |