ql_api_fs_nor_flash.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /** @file
  2. ql_api_fs_nor_flash.h
  3. @brief
  4. quectel fs nor flash info interface definition.
  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/5/2021 Neo Init version
  17. =================================================================*/
  18. #ifndef QL_API_FS_NOR_FLASH_H
  19. #define QL_API_FS_NOR_FLASH_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #include "ql_api_common.h"
  24. /*===========================================================================
  25. * Macro Definition
  26. ===========================================================================*/
  27. #define QL_NOR_FLASH_ERRCODE_BASE (QL_COMPONENT_STORAGE_EXTFLASH<<16)
  28. /*========================================================================
  29. * Enumeration Definition
  30. *========================================================================*/
  31. typedef enum
  32. {
  33. QL_NOR_FLASH_SUCCESS = QL_SUCCESS,
  34. QL_NOR_FLASH_INVALID_PARAM_ERR = 1|QL_NOR_FLASH_ERRCODE_BASE,
  35. QL_NOR_FLASH_MOUNT_ERR,
  36. QL_NOR_FLASH_MKFS_ERR,
  37. QL_NOR_FLASH_NOT_MOUNT,
  38. } ql_errcode_nor_flash_e;
  39. typedef struct
  40. {
  41. uint32_t mid; //Manufacturer ID
  42. uint32_t blknum; //block count
  43. uint32_t blksize; //block size
  44. } ql_nor_hw_info_t;
  45. /*===========================================================================
  46. * Functions declaration
  47. ===========================================================================*/
  48. /*****************************************************************
  49. * Function: ql_nor_flash_mkfs
  50. *
  51. * Description: format nor flash in FM_FAT32
  52. *
  53. * Parameters:
  54. * opt [in] FM_FAT32(0x02)
  55. *
  56. * Return:
  57. * QL_NOR_FLASH_SUCCESS success
  58. * other error code
  59. *
  60. *****************************************************************/
  61. ql_errcode_nor_flash_e ql_nor_flash_mkfs(uint8_t opt);
  62. /*****************************************************************
  63. * Function: ql_nor_flash_umount
  64. *
  65. * Description: Uninitialize the nor flash driver, umount nor flash
  66. *
  67. * Parameters:
  68. * NULL
  69. *
  70. * Return:
  71. * QL_NOR_FLASH_SUCCESS success
  72. * other error code
  73. *
  74. *****************************************************************/
  75. ql_errcode_nor_flash_e ql_nor_flash_umount(void);
  76. /*****************************************************************
  77. * Function: ql_sdmmc_mount
  78. *
  79. * Description: Initialize the nor flash driver,and mount nor flash
  80. *
  81. * Parameters:
  82. * NULL
  83. *
  84. * Return:
  85. * QL_NOR_FLASH_SUCCESS success
  86. * other error code
  87. *
  88. *****************************************************************/
  89. ql_errcode_nor_flash_e ql_nor_flash_mount(void);
  90. /*****************************************************************
  91. * Function: ql_nor_get_hw_info
  92. *
  93. * Description: get information about nor
  94. *
  95. * Parameters:
  96. * info [out] Pointer to info data to read
  97. *
  98. * Return:
  99. * QL_NOR_FLASH_SUCCESS success
  100. * other error code
  101. *
  102. *****************************************************************/
  103. ql_errcode_nor_flash_e ql_nor_get_hw_info(ql_nor_hw_info_t *info);
  104. #ifdef __cplusplus
  105. } /*"C" */
  106. #endif
  107. #endif /* QL_API_FS_NOR_FLASH_H */