quec_boot_pff.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /** @file
  2. quec_boot_pff.h
  3. @brief
  4. This file is used to define boot uart api for different Quectel Project.
  5. */
  6. /*================================================================
  7. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  8. Quectel Wireless Solution Proprietary and Confidential.
  9. =================================================================*/
  10. /*=================================================================
  11. EDIT HISTORY FOR MODULE
  12. This section contains comments describing changes made to the module.
  13. Notice that changes are listed in reverse chronological order.
  14. WHEN WHO WHAT, WHERE, WHY
  15. ------------ ------- -------------------------------------------------------------------------------
  16. 24/01/2021 Neo Init version
  17. =================================================================*/
  18. #ifndef QUEC_BOOT_PFF_H
  19. #define QUEC_BOOT_PFF_H
  20. #include "quec_proj_config.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /*===========================================================================
  25. * Macro Definition
  26. ===========================================================================*/
  27. /*===========================================================================
  28. * Enum
  29. ===========================================================================*/
  30. typedef enum
  31. {
  32. QUEC_BOOT_FS_NONE = -1,
  33. QUEC_BOOT_SFFS_EXT = 0,
  34. QUEC_BOOT_SFFS_SPI4EXTNOR = 1,
  35. QUEC_BOOT_FAT_SDMMC = 2,
  36. QUEC_BOOT_FAT_EXNAND_FLASH,
  37. QUEC_BOOT_FAT_EXTNOR_FLASH
  38. }quec_boot_fs_type_e;
  39. typedef enum
  40. {
  41. QL_BOOT_FAT_OPEN_READ_ONLY = 0, /* Open in read-only mode */
  42. QL_BOOT_FAT_OPEN_CREATE = 1, /* Open in create mode */
  43. /* if the file already exists, it will be overwritten*/
  44. }ql_boot_fat_open_mode_e;
  45. /* the partition number of mount */
  46. typedef enum
  47. {
  48. QL_BOOT_FAT_MOUNT_PARTITION_1 = 0, /* partition 1 */
  49. QL_BOOT_FAT_MOUNT_PARTITION_2 = 1, /* partition 2 */
  50. QL_BOOT_FAT_MOUNT_PARTITION_MAX = 2,
  51. }ql_boot_fat_mount_pt_e;
  52. /*===========================================================================
  53. * Functions declaration
  54. ===========================================================================*/
  55. void quec_get_real_path(const char* path,char** realpath);
  56. int ql_boot_fat_mount(ql_boot_fat_mount_pt_e pt);
  57. int ql_boot_fat_open(ql_boot_fat_mount_pt_e pt,const char* path, ql_boot_fat_open_mode_e mode);
  58. int ql_boot_fat_read(ql_boot_fat_mount_pt_e pt,void* buff, unsigned int size);
  59. int ql_boot_fat_file_size(ql_boot_fat_mount_pt_e pt);
  60. int ql_boot_fat_lseek(ql_boot_fat_mount_pt_e pt,unsigned int ofs);
  61. long ql_boot_fat_tell(ql_boot_fat_mount_pt_e pt);
  62. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_FAT_RW
  63. int ql_boot_fat_mount_ex(ql_boot_fat_mount_pt_e pt);
  64. int ql_boot_fat_open_ex(ql_boot_fat_mount_pt_e pt,const char* path, ql_boot_fat_open_mode_e mode);
  65. int ql_boot_fat_read_ex(ql_boot_fat_mount_pt_e pt,void* buff, unsigned int size);
  66. int ql_boot_fat_close_ex(ql_boot_fat_mount_pt_e pt);
  67. int ql_boot_fat_file_size_ex(ql_boot_fat_mount_pt_e pt);
  68. int ql_boot_fat_write_ex(ql_boot_fat_mount_pt_e pt,const void* buff, unsigned int size);
  69. int ql_boot_fat_lseek_ex(ql_boot_fat_mount_pt_e pt,unsigned int ofs);
  70. int ql_boot_fat_is_mount_ex(ql_boot_fat_mount_pt_e pt);
  71. #endif
  72. #ifdef __cplusplus
  73. } /*"C" */
  74. #endif
  75. #endif /* QUEC_BOOT_PFF_H */