gps_interface.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /******************************************************************************
  2. ** File Name: gps_interface.h *
  3. ** Author: *
  4. ** DATE: *
  5. ** Copyright: 2007 Spreadtrum, Incoporated. All Rights Reserved. *
  6. ** Description: This file defines the basic operation interfaces of GPS *
  7. ** *
  8. ******************************************************************************
  9. ******************************************************************************
  10. ** Edit History *
  11. ** ------------------------------------------------------------------------- *
  12. ** DATE NAME DESCRIPTION *
  13. ** 07/26/2007 Liangwen.Zhen/David.Jia Create. *
  14. ******************************************************************************/
  15. #ifndef _GPS_INTERFACE_H_
  16. #define _GPS_INTERFACE_H_
  17. /**---------------------------------------------------------------------------*
  18. ** Dependencies *
  19. **---------------------------------------------------------------------------*/
  20. /**---------------------------------------------------------------------------*
  21. ** Debugging Flag *
  22. **---------------------------------------------------------------------------*/
  23. #include "os_api.h"
  24. /**---------------------------------------------------------------------------*
  25. ** Compiler Flag *
  26. **---------------------------------------------------------------------------*/
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**---------------------------------------------------------------------------*
  31. ** Enum Definition *
  32. **---------------------------------------------------------------------------*/
  33. #define SERIAL_READ_BUFFER_MAX (2048)
  34. #define SERIAL_WRITE_BUFFER_MAX (2048)
  35. #define GNSS_LOG_BUFFER_MAX SERIAL_READ_BUFFER_MAX
  36. typedef struct msg_head_tag
  37. {
  38. uint32_t seq_num; // Message sequence number, used for flow control
  39. uint16_t len; // The totoal size of the packet "sizeof(MSG_HEAD_T)
  40. // + packet size"
  41. uint8_t type; // Main command type
  42. uint8_t subtype; // Sub command type
  43. } MSG_HEAD_T;
  44. typedef enum
  45. {
  46. GPS_COLD_MODE, //冷启动
  47. GPS_HOT_MODE, //热启动
  48. GPS_WARM_MODE, //温启动
  49. GPS_TRACE_MODE,
  50. GPS_FACTORY_MODE,
  51. GPS_TCXO_MODE,
  52. GPS_TSX_MODE,
  53. GPS_CW_MODE,
  54. GPS_RF_MODE,
  55. GPS_NEW_TCXO_MODE,
  56. GPS_MAX_MODE
  57. } GPS_RESET_MODE_E;
  58. typedef enum
  59. {
  60. GPS_RF_GPS,
  61. GPS_RF_GLO,
  62. GPS_RF_BDS,
  63. GPS_RF_MAX_MODE
  64. } GPS_RF_TEST_MODE_E;
  65. typedef struct
  66. {
  67. MSG_HEAD_T msg_head;
  68. uint8 nmealog[GNSS_LOG_BUFFER_MAX]; //NMEA格式数据
  69. } GPS_NMEALOG_OUTPUT_T;
  70. typedef struct
  71. {
  72. SIGNAL_VARS
  73. GPS_NMEALOG_OUTPUT_T nmealog;
  74. } GPS_DIAG_OUTPUT_NMEALOG_T;
  75. #pragma pack(1)
  76. typedef struct
  77. {
  78. uint8 num_svs;
  79. uint8 snr[256];
  80. } GPS_OUTPUT_SVINFO_T;
  81. #pragma pack()
  82. typedef struct
  83. {
  84. MSG_HEAD_T msg_head;
  85. GPS_OUTPUT_SVINFO_T svinfo;
  86. } GPS_DIAG_OUTPUT_SVINFO_T;
  87. typedef struct
  88. {
  89. SIGNAL_VARS
  90. uint8 isStarted;
  91. } GPS_RECOVERY_REQ_T;
  92. typedef struct
  93. {
  94. SIGNAL_VARS
  95. } GPS_GET_AGPSDATA_T,
  96. GPS_FIX_SUCCESS_T,
  97. GPS_GET_EPHDATA_T,
  98. GPS_WATCHDOG_T,
  99. GPS_CREATE_DUMP_T,
  100. GPS_ENTER_SLEEP_T,
  101. GPS_REPORT_AGPSDATA_T,
  102. GPS_AGPSDATA_INIT_T,
  103. GPS_SPREADORBIT_INIT_T,
  104. GPS_SMD_TIMER_EXPIRED_T,
  105. GPS_NMEA_RPT_TIMER_EXPIRED_T;
  106. typedef enum
  107. {
  108. GPS_GET_AGPSDATA_REQ = 0xA0, //冷启动
  109. GPS_FIX_SUCCESS_REQ, //热启动
  110. GPS_GET_EPHDATA_REQ, //温启动
  111. GPS_WATCHDOG_REQ,
  112. GPS_CREATE_DUMP_REQ,
  113. GPS_ENTER_SLEEP_REQ,
  114. GPS_REPORT_AGPSDATA_REQ,
  115. GPS_AGPSDATA_INIT_REQ,
  116. GPS_SPREADORBIT_INIT_REQ,
  117. GPS_SMD_TIMER_EXPIRED,
  118. GPS_NMEA_RPT_TIMER_EXPIRED,
  119. GPS_RECOVERY_REQ,
  120. GPS_MAX_REQ
  121. } GPS_INTERFACE_REQ_E;
  122. PUBLIC BLOCK_ID GPS_GetInterfaceThreadId();
  123. PUBLIC uint8 *GPS_GetAgpsNVInfo(void);
  124. PUBLIC uint32 GPS_WriteAgpsNVInfo(uint8 *nv_info_ptr);
  125. PUBLIC int GPS_Get_Uartport();
  126. PUBLIC int gps_get_assert_mode();
  127. #ifdef GPS_AGPS_SUPPORT_QX
  128. PUBLIC BLOCK_ID AGPS_GetInterfaceThreadId(void);
  129. #endif
  130. const char *GPS_GetVersionInfo(void);
  131. void GPS_SetNMEALogToPC(bool isOn);
  132. /**---------------------------------------------------------------------------*
  133. ** Compiler Flag *
  134. **---------------------------------------------------------------------------*/
  135. #ifdef __cplusplus
  136. }
  137. #endif // End of gsp_interface.h
  138. #endif // end _GPS_INTERFACE_H_