资源简介
stm32 stm32f103 stm32f10x 的sd卡读写实验例子,sdio模式(非spi),整个工程打包,带串口usart1(115200,8bit,无校验) 调试,把sd卡的数据读出来打印到securityCRT或者超级终端,可用winhex配合调试。是一个sd卡的驱动,由st官方的程序改编。适用于学习

代码片段和文件信息
/******************** (C) COPYRIGHT 2009 奋斗嵌入式开发工作室 ********************
* File Name : main.c
* Author : Sun68
* Version : V1.0
* Date : 11/11/2009
* Description : 演示将一段字符串写入AT45DB161D的1页中,然后读出并通过USART1传送出去。
字符串:SPI AT45DB161D Example: This is SPI DEMO 终端上出现这一行字,说明AT45DDB161的读写正常
定义:
USART1
TXD1----- PA9-US1-TX
RXD1----- PA10-US1-RX 速率:115200n81
SPI2
NSS---PB12-SPI2-NSS
MISO--PB14-SPI2-MISO
MOSI--PB15-SPI2-MOSI
SCK---PB13-SPI2-SCK
*********************************************************************/
/* Includes ------------------------------------------------------------------*/
#include “stm32f10x.h“
#include “platform_config.h“
#include “stm32f10x_usart.h“
#include “misc.h“
extern void SPI_Flash_Init(void);
extern u8 SPI_Flash_ReadByte(void);
extern u8 SPI_Flash_SendByte(u8 byte);
extern void FlashPageEarse(u16 page);
extern void FlashPageRead(u16 pageu8 *Data);
extern void FlashPageWrite(u16 pageu8 *Data);
extern void FlashWaitBusy(void);
extern void AT45_RomTo_buf(unsigned char bufferunsigned int page);
extern u8 AT45_buf_ToRam(unsigned char bufferunsigned int start_addressunsigned int length);
extern u8 AT45_RamTo_buf(unsigned char bufferunsigned int start_addressunsigned int length);
extern void AT45_buf_ToRom(unsigned char bufferunsigned int page);
extern void AT45_page_earse(unsigned int page);
extern unsigned char AT45_buffer[];
/** @addtogroup StdPeriph_Examples
* @{
*/
/** @addtogroup USART_Interrupt
* @{
*/
/* Private typedef -----------------------------------------------------------*/
typedef enum { FAILED = 0 PASSED = !FAILED} TestStatus;
/* Private define ------------------------------------------------------------*/
#define TxBufferSize1 (countof(TxBuffer1) - 1)
#define RxBufferSize1 (countof(TxBuffer1) - 1)
/* Private macro -------------------------------------------------------------*/
#define countof(a) (sizeof(a) / sizeof(*(a)))
/* Private variables ---------------------------------------------------------*/
USART_InitTypeDef USART_InitStructure;
uint8_t TxBuffer1[] = “SPI AT45DB161D Example: This is SPI DEMO 终端上出现这一行字,说明AT45DDB161的读写正常“;
uint8_t RxBuffer1[RxBufferSize1]rec_f;
__IO uint8_t TxCounter1 = 0x00;
__IO uint8_t RxCounter1 = 0x00;
uint8_t NbrOfDataToTransfer1 = TxBufferSize1;
uint8_t NbrOfDataToRead1 = RxBufferSize1;
__IO TestStatus TransferStatus1 = FAILED;
/* Private function prototypes -----------------------------------------------*/
void RCC_Configuration(void);
void GPIO_Configuration(void);
void NVIC_Configuration(void);
void Delay(__IO uint32_t nCount);
void USART_OUT(USART_TypeDef* USARTx uint8_t *Datauint16_t Len);
TestStatus Buffercmp(uint8_t* pBuffer1 uint8_t* pBuffer2 uint16_t BufferLength);
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef US
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4951 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\misc.h
文件 19585 2009-08-31 15:06 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_adc.h
文件 7373 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_bkp.h
文件 14289 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_can.h
文件 3213 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_conf.h
文件 1980 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_crc.h
文件 10271 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_dac.h
文件 2980 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_dbgmcu.h
文件 18790 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_dma.h
文件 5833 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_exti.h
文件 14446 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_flash.h
文件 17276 2009-09-01 10:57 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_fsmc.h
文件 15221 2009-09-04 15:44 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_gpio.h
文件 16923 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_i2c.h
文件 3677 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_iwdg.h
文件 4201 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_pwr.h
文件 16258 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_rcc.h
文件 3659 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_rtc.h
文件 18598 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_sdio.h
文件 14896 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_spi.h
文件 48768 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_tim.h
文件 14483 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_usart.h
文件 2785 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\inc\stm32f10x_wwdg.h
文件 6874 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\misc.c
文件 46634 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_adc.c
文件 8248 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_bkp.c
文件 30960 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_can.c
文件 3340 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_crc.c
文件 13723 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_dac.c
文件 4310 2009-04-06 10:30 13 SD卡读写-SDIO接口\FWlib\SRC\stm32f10x_dbgmcu.c
............此处省略107个文件信息
- 上一篇:计算机组成原理东南大学
- 下一篇:调用系统相机拍照并压缩保存视频录制并播放功能
相关资源
- 基于stm32f103ve的程序——跑马灯实验
- 基于STM32RCT6的步进电机驱动程序
- stm32f407上的两个can发送和接收例程
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- SD卡,TF卡修复工具 能够恢复SD卡的真
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- STM32基于rt_thread操作系统的SDHC卡文件
- 51模拟SPI读写SD卡(包括Fat和Fat32文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- [免费]基于stm32f103ze 的OLED驱动代码
- 51单片机读取温度数据存储到SD卡中并
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- STM32F103 CC2500完整驱动(模拟SPI)
- AD7606采集程序
- stm32 用SPI 方式读写 SDHC
- stm32通过DMA方式采集ADC数据
- 意法半导体STM全系列微控制器STM32ST
评论
共有 条评论