flash spi 野火_Flash基础入门之野火STM32 Flash&sd卡模拟U盘

在USB库文件mass_mal.c中添加对flash和sd读写的函数,USB库调用这些函数从而实现模拟U盘的功能

1 //mass_mal.c

2 /* Includes ------------------------------------------------------------------*/

3 #include "..\User\sdcard\bsp_sdio_sdcard.h"

4 #include "..\User\spi_flash\fatfs_flash_spi.h"

5 #include "mass_mal.h"

6 #include 7 /* Private typedef -----------------------------------------------------------*/

8 /* Private define ------------------------------------------------------------*/

9 /* Private macro -------------------------------------------------------------*/

10 /* Private variables ---------------------------------------------------------*/

11 uint32_t Mass_Memory_Size[2];

12 uint32_t Mass_Block_Size[2];

13 uint32_t Mass_Block_Count[2];

14 __IO uint32_t Status = 0;

15 //#define  sFLASH_ID              0xEF3015     //W25X16

16 //#define  sFLASH_ID              0xEF4015     //W25Q16

17 #define  sFLASH_ID              0XEF4017    //W25Q64

18 extern SD_CardInfo SDCardInfo;      //ÓÃÓÚ´æ´¢¿¨µÄÐÅÏ¢

1 /*******************************************************************************

2 * Function Name  : MAL_Init

3 * Description    : Initializes the Media on the STM32

4 * Input          : None

5 * Output         : None

6 * Return         : None

7 *******************************************************************************/

8 uint16_t

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值