nvitem.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef NVITEM_H
  2. #define NVITEM_H
  3. #include "sci_types.h"
  4. /******************************************************************************
  5. * Parameter Attribute
  6. ******************************************************************************/
  7. /*
  8. #define INPUT
  9. #define OUTPUT
  10. #define INOUT
  11. */
  12. /******************************************************************************
  13. * Interface Prototype
  14. ******************************************************************************/
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif /* __cplusplus */
  18. #ifdef CONFIG_SOC_8850
  19. #ifndef NV_GPS_PARAM
  20. #define NV_GPS_PARAM 0x193
  21. #define NVID_CPTSX_NV 0x1b2
  22. #define NVID_APTSX_NV 0x1b4
  23. #if defined(GPS_SUPPORT) && defined(GPS_CHIP_VER_GREENEYE2)
  24. #define DIAG_GPS_F 58
  25. #else
  26. #define DIAG_GPS_F 35
  27. #endif
  28. #endif
  29. #endif
  30. /******************************************************************************
  31. * Return values of NVITEM_XXX()
  32. ******************************************************************************/
  33. typedef enum _NVITEM_ERROR
  34. {
  35. NVERR_NONE = 0, /* Success */
  36. NVERR_SYSTEM, /* System error, e.g. hardware failure */
  37. NVERR_INVALID_PARAM,
  38. NVERR_NO_ENOUGH_RESOURCE,
  39. NVERR_NOT_EXIST,
  40. NVERR_ACCESS_DENY,
  41. NVERR_INCOMPATIBLE,
  42. NVERR_NOT_OPENED
  43. } NVITEM_ERROR_E;
  44. /**
  45. NVITEM_Read
  46. Description:
  47. Read an item from the medium.
  48. Paramters:
  49. ItemID - Identifier of the NV item to be read.
  50. cchSize - Size in bytes to be read.
  51. pBuf - Pointer to the buffer to hold the data read.
  52. Return values:
  53. NVERR_NONE - The item is read successfully.
  54. NVERR_NOT_EXIST - The nvitem does not exist.
  55. NVERR_INVALID_PARAM - Parameters are invalid, e.g. buf_ptr is NULL, count
  56. is larger than the size of this NV item or the specified
  57. Identifier does not exist.
  58. **/
  59. //NVITEM_ERROR_E NVITEM_Read(INPUT uint16 ItemID, INPUT uint16 cchSize, OUTPUT void *pBuf);
  60. NVITEM_ERROR_E EFS_NvitemRead(uint16 identifier, uint16 count, uint8 *buf_ptr);
  61. /**
  62. NVITEM_Write
  63. Description:
  64. Write an item to the medium. If the item does not exist, it will be created.
  65. Parameters:
  66. ItemID - Identifier of the item to be written.
  67. cchSize - Size in byte of this item.
  68. pBuf - Pointer to the buffer holding the data of the item.
  69. Return values:
  70. NVERR_NONE - The item is written successfully.
  71. NVERR_NO_ENOUGH_RESOURCE - There is no enough resource to complete this
  72. operation, e.g. no enough space on the medium.
  73. NVERR_INVALID_PARAM - Parameters are invalid, e.g. buf_ptr is NULL or
  74. Identifier is invalid.
  75. **/
  76. //NVITEM_ERROR_E NVITEM_Write(INPUT uint16 ItemID, INPUT uint16 cchSize, INPUT const void *pBuf);
  77. NVITEM_ERROR_E EFS_NvitemWrite(uint16 identifier, uint16 count, const uint8 *buf_ptr, uint8 basync);
  78. #ifdef __cplusplus
  79. }
  80. #endif /* __cplusplus */
  81. #endif /* NVITEM_H */