基于stm32的fat32文件系统.docVIP

  • 25
  • 0
  • 约3.75万字
  • 约 36页
  • 2017-07-14 发布于天津
  • 举报
基于stm32的fat32文件系统.doc

Main.c /********************************************************************* * * * STM32- 3.2寸TFT液晶屏字符和汉字显示程序 * * * ***********************************************************************/ #include stm32f10x_lib.h #include LCD_driver.h #include fat.h #include MMC.h struct FAT32_Init_Arg Init_Arg_SD; //初始化参数结构体实体 struct FAT32_Init_Arg *pArg; struct FileInfoStruct FileInfo; //文件信息结构体实体 uchar file_buf[150]; //文件数据缓冲区,读取到的文件数据放在其中 uchar Dev_No=0; //设备号,SDCARD的SD卡设备号的宏定义,根据设备号,znFAT会将底层存储设备驱动连接到相应的存储设备驱动 //动态的切换设备号,就可以实现在各种存储设备之间进行切换,这也是znFAT实现多设备的重要手段。比如,我 //可以将SD卡上的文件拷贝到CF卡或U盘上,这就是多设备的最典型应用 #define COLOR(r,g,b) (((((((uint)r)3)6)|(((uint)g)2))5)|(((uint)b)3)) //r红色分量 0~31 g绿色分量 0~63 b蓝色分量 0~31 #include LCD.c /******************************** 变量定义 ---------------------------------------------------------*/ GPIO_InitTypeDef GPIO_InitStructure; ErrorStatus HSEStartUpStatus; unsigned char csd_data[16]; unsigned char cid_data[16]; unsigned char by; unsigned int c_size, c_size_mult, read_bl_len; unsigned long drive_size; unsigned long size_mb; /*********************************声明函数 -----------------------------------------------*/ void RCC_Configuration(void); void NVIC_Configuration(void); void Delay(vu32 nCount); /******************************************************************************* 主函数 *******************************************************************************/ int main(void) { uchar item; RCC_Configuration(); //系统时钟配置函数 NVIC_Configuration(); //NVIC配置函数 //启动GPIO模块时钟 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); //把调试设置普通IO口 GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE); GPIO_In

文档评论(0)

1亿VIP精品文档

相关文档