quec_boot_vfs.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _QUEC_BOOT_VFS_H_
  13. #define _QUEC_BOOT_VFS_H_
  14. #include "osi_compiler.h"
  15. #include <stdint.h>
  16. #include <stdbool.h>
  17. #include <stdio.h>
  18. #include <stddef.h>
  19. #include "quec_boot_pff.h"
  20. #include "quec_proj_config.h"
  21. #define QUEC_BOOT_VFS_ECHO 0
  22. #define QUEC_SD_FD (4200)
  23. #define _FCREAT 0x0200 /* open with file create */
  24. typedef enum {
  25. QUEC_BOOT_VFS_INIT = 0,
  26. QUEC_BOOT_VFS_OPEN = 1,
  27. QUEC_BOOT_VFS_CLOSE = 2,
  28. } quec_boot_vfs_status_e;
  29. OSI_EXTERN_C_BEGIN
  30. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RDONLY
  31. int quec_bootVfsOpen(const char *path,int flags);
  32. int quec_bootVfsRead(int fd, void *data, size_t size);
  33. bool quec_bootVfsClose(int fd);
  34. int quec_bootVfsFileSize(int fd,int *size);
  35. bool quec_bootVfsCheckPath(const char *path);
  36. #endif
  37. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  38. int quec_bootVfsOpen_ex(const char *path,int flags);
  39. int quec_bootVfsRead_ex(int fd, void *data, size_t size);
  40. bool quec_bootVfsClose_ex(int fd);
  41. int quec_bootVfsFileSize_ex(int fd,int *size);
  42. int quec_bootVfsWrite_ex(int fd, const void *data, size_t size);
  43. int quec_bootVfsSfileWrite_ex(const char *path, const void *data, size_t size);
  44. int quec_bootVfsOpen_ex(const char *path,int flags);
  45. int quec_bootVfsRead_ex(int fd, void *data, size_t size);
  46. bool quec_bootVfsClose_ex(int fd);
  47. #endif
  48. OSI_EXTERN_C_END
  49. #endif