SDIO
所属分类:单片机开发
开发工具:C/C++
文件大小:54KB
下载次数:52
上传日期:2014-06-30 10:44:43
上 传 者:
lmw
说明: 基于STM32F4的SD卡的驱动配置与开发
(Based on drive configuration and development STM32F4 SD card)
文件列表:
SDIO\uSDCard\main.c (11008, 2011-10-03)
SDIO\uSDCard\MDK-ARM\JLinkLog.txt (262131, 2012-05-15)
SDIO\uSDCard\MDK-ARM\JLinkSettings.ini (573, 2012-05-14)
SDIO\uSDCard\MDK-ARM\Project.uvopt (25619, 2012-05-15)
SDIO\uSDCard\MDK-ARM\Project.uvproj (23601, 2012-05-15)
SDIO\uSDCard\stm324xg_eval_sdio_sd.c (88941, 2011-10-03)
SDIO\uSDCard\stm324xg_eval_sdio_sd.h (18310, 2011-10-03)
SDIO\uSDCard\stm32f4xx_conf.h (3622, 2011-10-03)
SDIO\uSDCard\stm32f4xx_it.c (5223, 2011-10-03)
SDIO\uSDCard\stm32f4xx_it.h (2016, 2011-10-03)
SDIO\uSDCard\system_stm32f4xx.c (21728, 2011-10-03)
SDIO\uSDCard\MDK-ARM (0, 2013-04-08)
SDIO\uSDCard (0, 2013-04-08)
SDIO (0, 2013-04-08)
This example provides a basic example of how to use the SDIO firmware library and
an associate driver to perform read/write operations on the SD Card memory (SD Card
V1.0, V1.1, V2.0 and SDHC (High Capacity) protocol)that could be mounted on the
STM324xG_EVAL board.
The example provides different SD Card transfer states and operations and here
below a description of each step:
- First the SDIO peripheral and SD Card are initialized using the SD_Init()
function:
- Configure the SDIO according to the desired SDIO_CK clock frequency.
- Reset the SD Card
- Identify the SD Card
- Initializes the SD Card
- Get the SD Card Info
- Select the SD Card
- Enable the Wide Bus mode (4-bit data)
- SD Card Erase Operation
- Starts an Erase operation: Erase the corresponding blocks using
the SD_Erase() function
- Read the Erased blocks using the SD_ReadMultiBlocks() function
- Test if the corresponding Blocks are well erased: check if the
EraseStatus variable is equal to PASSED. If the erase operation is
passed LED1 is turned ON.
- SD Card Single Block Operation
- Starts a Write operation: Write a single Block using the SD_WriteBlock()
function
- Read a single Block using the SD_ReadBlock() function
- Compare the written Block and the read one: check if the TransferStatus1
variable is equal to PASSED. If the Single Block Read/write operation
is passed LED2 is turned ON.
- SD Card Multiple Block Operation
- Starts a Multiple Write operation: Write a multi Blocks using the
SD_WriteMultiBlocks() function.
- Read a multiple Blocks using the SD_ReadMultiBlocks() function
- Compare the written Blocks and the read one: check if the TransferStatus2
variable is equal to PASSED. If the Multiple Blocks Read/Write operation
is passed LED3 is turned ON.
All data transfers are made by DMA.
At each operation, the SD Card presence and status is checked using the SD_GetStatus()
function and a global variable "Status" storing the results of the last operation.
SD Card Operations and Written/Read data correctness is signaled by LED
lightening and though as follow:
- If the Erase operation is PASSED then LED1 ON else the LED4 is ON and LED1 is OFF
- If the Single Block Write/Read operation is PASSED then LED2 ON else the LED4 is ON and LED2 is OFF
- If the Multi Blocks Write/Read operation is PASSED then LED3 ON else the LED4 is ON and LED3 is OFF
- Any SD Card operation including the SD Initialization error is signaled by
LED4 ON.
近期下载者:
相关文件:
收藏者: