gps_diag.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /******************************************************************************
  2. ** File Name: gps_diag.h *
  3. ** Author: Liangwen.Zhen *
  4. ** DATE: 11/29/2007 *
  5. ** Copyright: 2007 Spreadtrum, Incoporated. All Rights Reserved. *
  6. ** Description: This file defines the basic operation interfaces of GPS *
  7. ** Diag communication *
  8. ** *
  9. ******************************************************************************
  10. ******************************************************************************
  11. ** Edit History *
  12. ** ------------------------------------------------------------------------- *
  13. ** DATE NAME DESCRIPTION *
  14. ** 11/29/2007 Liangwen.Zhen Create. *
  15. ******************************************************************************/
  16. /**---------------------------------------------------------------------------*
  17. ** Dependencies *
  18. **---------------------------------------------------------------------------*/
  19. /**---------------------------------------------------------------------------*
  20. ** Debugging Flag *
  21. **---------------------------------------------------------------------------*/
  22. #include "os_api.h"
  23. #include "gps_drv.h"
  24. /**---------------------------------------------------------------------------*
  25. ** Compiler Flag *
  26. **---------------------------------------------------------------------------*/
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**---------------------------------------------------------------------------*
  31. ** Macro Definition *
  32. **---------------------------------------------------------------------------*/
  33. #define GPS_DIAG_PARAM_CNT_MAX 256
  34. /*----------------------------------------------------------------------------*
  35. ** Data Structures *
  36. **---------------------------------------------------------------------------*/
  37. #if defined(GPS_SUPPORT) && defined(GPS_CHIP_VER_GREENEYE2)
  38. typedef enum
  39. {
  40. GPS_DIAG_HOT_START = 0x00,
  41. GPS_DIAG_WARM_START,
  42. GPS_DIAG_COLD_START,
  43. GPS_DIAG_STOP,
  44. GPS_DIAG_DEBUGLOG_ENABLE,
  45. GPS_DIAG_NMEALOG_OUTPUT,
  46. GPS_DIAG_DEBUGLOG_OUTPUT,
  47. GPS_DIAG_NMEALOG_ENABLE,
  48. GPS_DIAG_RESERVER1,
  49. GPS_DIAG_RESERVER2,
  50. GPS_DIAG_TXCO,
  51. GPS_DIAG_RF_GPS,
  52. GPS_DIAG_RF_GLO,
  53. GPS_DIAG_RF_BD,
  54. GPS_DIAG_FAC_START = 20,
  55. GPS_DIAG_NEW_TCXO = 21,
  56. GPS_DIAG_ORBIT_SWITCH = 23,
  57. GPS_DIAG_SUBTYPE_GET_SIGNALMODE = 24,
  58. GPS_DIAG_SUBTYPE_SET_SIGNALMODE = 25,
  59. GPS_DIAG_CMD_MAX
  60. } GPS_DIAG_MODE_E;
  61. typedef enum
  62. {
  63. GPS_DIAG_RESPONSE_FAIL = 0x0,
  64. GPS_DIAG_RESPONSE_SUCCESS,
  65. GPS_DIAG_RESPONSE_MAX
  66. } GPS_DIAG_RESPONSE_MODE_E;
  67. typedef struct
  68. {
  69. uint8 cmd;
  70. } GPS_DIAG_RESPONSE_T, *GPS_DIAG_RESPONSE_PTR;
  71. #else
  72. typedef enum
  73. {
  74. GPS_DIAG_CMD_OPEN = 0x00, // Æô¶¯GPSÄ£¿é
  75. GPS_DIAG_CMD_SEND, // Send to GPS HW Module for test
  76. GPS_DIAG_CMD_RECEIVE, // Receive from GPS HW Module for test
  77. GPS_DIAG_CMD_CLOSE, // ¹Ø±ÕGPSÄ£¿é
  78. GPS_DIAG_CMD_WRITE_NV, // Write parameter to NV
  79. GPS_DIAG_CMD_READ_NV, // Read some parameter from NV
  80. GPS_DIAG_CMD_GET_GPS_INFO, // Get GPS information
  81. GPS_DIAG_CMD_MAX
  82. } GPS_DIAG_CMD_E;
  83. typedef enum
  84. {
  85. GPS_DIAG_MODE_WR_NV = 0x00, // Write/read nvitem
  86. GPS_DIAG_MODE_WR_DATA, // Write/read data to/from GPS chip
  87. GPS_DIAG_MODE_GET_INFO, // Get information about GPS Module
  88. GPS_DIAG_MODE_MAX
  89. } GPS_DIAG_MODE_E;
  90. typedef struct
  91. {
  92. GPS_DIAG_MODE_E cmd;
  93. uint32 param_num;
  94. uint8 param_val_list[GPS_DIAG_PARAM_CNT_MAX];
  95. } GPS_DIAG_MSG_T, *GPS_DIAG_MSG_PTR;
  96. #endif
  97. /**---------------------------------------------------------------------------*
  98. ** PUBLIC Function Prototypes *
  99. **---------------------------------------------------------------------------*/
  100. /*****************************************************************************/
  101. // Description: This function is register diag command routine
  102. // Author: Liangwen.Zhen
  103. // Note:
  104. /*****************************************************************************/
  105. PUBLIC void GPS_DIAG_RegDiagCmdRoutine(void);
  106. GPS_ERR_E GPS_StartBy_Diag();
  107. extern bool diagOutputPacket(const void *data, unsigned size);
  108. /**---------------------------------------------------------------------------*
  109. ** Compiler Flag *
  110. **---------------------------------------------------------------------------*/
  111. #ifdef __cplusplus
  112. }
  113. #endif // End of gsp_diag.h