在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