/********************************************************* //file :hd_dev_gpio.h //author :libo //date :2020/05/10 //version :V1.0 //brief :GSP HAL层GPIO接口H文件 *********************************************************/ #ifndef FUNC_SPI_W25QXX_H #define FUNC_SPI_W25QXX_H /* Includes----------------------------------------------------------------------------------*/ #include /* Public macro------------------------------------------------------------------------------*/ //对于W25Q128 //前25M字节给fatfs用,25M字节后,用于存放字库,字库占用6.01M. 剩余部分,给客户自己用 #define SPI_FLASH_SECTOR_SIZE 512 #define SPI_FLASH_SECTOR_COUNT 1024*16*2 //W25Q256,前25M字节给FATFS占用 #define SPI_FLASH_BLOCK_SIZE 8 //每个BLOCK有8个扇区 //128Mb == 16M byte == 1024*1024*16 == 1024*4*256*16 == 0x400*0x4*0x100*0x10 == 0x1000 BLOCK //sector size 256*16 == 4k == 4096 //256*120*24 = 491520 = 0x78000 ==480k /* Public define-----------------------------------------------------------------------------*/ /* Public typedef----------------------------------------------------------------------------*/ typedef uint8_t BYTE; /* public function---------------------------------------------------------------------------*/ void func_w25q_init(void); void func_w25q_test(void); void func_w25q_erase_ship(void); uint16_t func_w25q_stat(void); uint8_t func_w25q_bootcnt(void); //void func_w25q_spi_flash(void); int func_w25q_hal_main(void); uint8_t func_w25q_disk_ioctl ( BYTE pdrv, /* Physical drive nmuber (0..) */ BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ); #endif /*********FUNC_SPI_W25QXX_H****************/ /******************************the end of file************************************************/