资源简介
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个文件信息
- 上一篇:计算机组成原理东南大学
- 下一篇:调用系统相机拍照并压缩保存视频录制并播放功能
相关资源
- stm32F103C8T6+LCD1602.rar
- stm32F4电机BLDC控制
- STM32-PLC原代码,有原理图
- STM32按键控制L298N驱动两直流电机正反
- stm32程序,AD7705,tsl2506步进电机,d
- STM32F103系列采用模拟IIC方式驱动了B
- STM32F1通过模拟IIC接口与BME280通信,获
- stm32 + dht11温度报警器
- STM32 USB复合设备 双游戏摇杆代码和
- STM32F103_ADC代码——直接移植即可用
- HC-SR04 STM32程序
- STM32F051 SPI DMA操作智能插座
- rtthread stm32f1xx hal bsp 偏移地址0x4000
- stm32f407的双通道adc驱动主函数,由定
- STM32F103C8T6 2.4G nrf24l01无线模块通信代
- 基于STM32F103C8T6的双柄遥控板DMA采样工
- STM32 CUBE空闲中断+DMA双串口透传
- stm32f407增量式编码器测速程序
- STM32F107官方开发板电路包括原理图和
- uCOSII移植STM32F103C8T6范例工程
- STM32F103 串口DMA+空闲中断接收
- STM32F407VGT6 原理图(pdf)
- 基于STM32F767驱动 LTDC LCDRGB屏
- stm32f1+sim800c全部代码GPRS短信电话等
- STM32+FSMC+R61509V驱动程序 16位亲测可用
- 基于STM32、SIM900A、UCOSII的GPRS DTU
- STM32F4链表实现
- STM32F4 7针0.96寸oled驱动.rar
- STM32F030F4P6输入捕获计算频率代码工程
- STM32单片机嵌入式实战教程四章讲义
评论
共有 条评论