mid_littlefs_flash.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*********************************************************
  2. //file :hd_dev_gpio.h
  3. //author :libo
  4. //date :2020/05/10
  5. //version :V1.0
  6. //brief :GSP HAL²ãGPIO½Ó¿ÚHÎļþ
  7. *********************************************************/
  8. #ifndef MID_LITTLEFS_FLASH_H
  9. #define MID_LITTLEFS_FLASH_H
  10. /* Includes----------------------------------------------------------------------------------*/
  11. #include "lfs.h"
  12. /* Public macro------------------------------------------------------------------------------*/
  13. #define LFS_PAGE_SIZE 256
  14. #define LFS_SECT_SIZE (LFS_PAGE_SIZE*2)
  15. #define LFS_BLOCK_SIZE (LFS_PAGE_SIZE*16)
  16. #define LFS_BLOCK_CNT (1024)
  17. #define LFS_CACH_SIZE (LFS_SECT_SIZE)
  18. /* Public define-----------------------------------------------------------------------------*/
  19. /* Public typedef----------------------------------------------------------------------------*/
  20. /* public function---------------------------------------------------------------------------*/
  21. extern lfs_t lfs_flash; ;
  22. void mid_lfs_flash_init(void);
  23. int mid_lfs_flash_bootcnt(void);
  24. int mid_lfs_flash_boot_step(void);
  25. int mid_lfs_flash_get_free(void);
  26. int lfs_file_open_static(lfs_t *lfs, lfs_file_t *file, const char *path, int flags) ;
  27. #endif /*********MID_LITTLEFS_FLASH_H****************/
  28. /******************************the end of file************************************************/