STM32单片机用FSMC接口控制SRAM
本文博客链接:http://blog.youkuaiyun.com/jdh99,作者:jdh,转载请注明.
环境:
主机:WIN7
开发环境:MDK4.72
MCU:STM32F103ZE
说明:
sram型号:IS62WV51216BLL
连接方式:FSMC
大小:1M字节.512K * 16
源代码:
inf_sram.h
/********************************************************************** sram接口层头文件* (c)copyright 2013,jdh* All Right Reserved*文件名:inf_sram.h*程序员:jdh*修改日期:2013/10/10* 2013/10/11**********************************************************************//********************************************************************** 说明*sram型号:IS62WV51216BLL*连接方式:FSMC*大小:1M字节.512K * 16**********************************************************************/#ifndef _INF_SRAM_H_#define _INF_SRAM_H_/********************************************************************** 头文件**********************************************************************/#include "stm32f10x.h"#include "stm32f10x_fsmc.h"/********************************************************************** 宏定义**********************************************************************//********************************************************************** SRAM2的BANK1起始地址**********************************************************************/#define Bank1_SRAM2_ADDR ((uint32_t)0x64000000)/********************************************************************** 函数**********************************************************************//********************************************************************** 初始化sram**********************************************************************/void inf_init_sram(void);/********************************************************************** 写入数据包*输入:pBuffer:数据指针* WriteAddr:写入数据地址* NumHalfwordToWrite:数据长度*返回:无**********************************************************************/void FSMC_SRAM_WriteBuffer(uint16_t* pBuffer,uint32_t WriteAddr,uint32_t NumHalfwordToWrite);/********************************************************************** 读