ql_api_common.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. /**
  2. @file
  3. ql_api_common.h
  4. @brief
  5. quectel common definition.
  6. */
  7. /*================================================================
  8. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  9. Quectel Wireless Solution Proprietary and Confidential.
  10. =================================================================*/
  11. /*=================================================================
  12. EDIT HISTORY FOR MODULE
  13. This section contains comments describing changes made to the module.
  14. Notice that changes are listed in reverse chronological order.
  15. WHEN WHO WHAT, WHERE, WHY
  16. ------------ ------- -------------------------------------------------------------------------------
  17. =================================================================*/
  18. #ifndef QL_API_COMMON_H
  19. #define QL_API_COMMON_H
  20. #include "quec_proj_config.h"
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /*========================================================================
  25. * Macro Definition
  26. *========================================================================*/
  27. #define TRUE 1
  28. #define FALSE 0
  29. /*========================================================================
  30. * Enumeration Definition
  31. *========================================================================*/
  32. typedef enum
  33. {
  34. QL_COMPONENT_NONE = 0,
  35. QL_COMPONENT_OSI = 0x8100,
  36. QL_COMPONENT_BSP = 0x8200,
  37. QL_COMPONENT_BSP_GPIO = 0x8201,
  38. QL_COMPONENT_BSP_PWM = 0x8202,
  39. QL_COMPONENT_BSP_SPI = 0x8203,
  40. QL_COMPONENT_BSP_I2C = 0x8204,
  41. //QL_COMPONENT_BSP_KEY = 0x8205,
  42. QL_COMPONENT_BSP_UART = 0x8206,
  43. QL_COMPONENT_BSP_USB = 0x8207,
  44. QL_COMPONENT_BSP_CMUX = 0x8208,
  45. QL_COMPONENT_BSP_LCD = 0x8209,
  46. QL_COMPONENT_BSP_CAMERA = 0x820A,
  47. QL_COMPONENT_BSP_BT = 0x820B,
  48. QL_COMPONENT_BSP_GNSS = 0x820C,
  49. QL_COMPONENT_BSP_WIFISCAN = 0x820D,
  50. QL_COMPONENT_BSP_ADC = 0x820E,
  51. QL_COMPONENT_BSP_LED = 0x820F,
  52. QL_COMPONENT_BSP_DECODER = 0x8210,
  53. QL_COMPONENT_BSP_KEYPAD = 0x8211,
  54. QL_COMPONENT_BSP_RTC = 0x8212,
  55. QL_COMPONENT_BSP_LVGL = 0x8213,
  56. QL_COMPONENT_BSP_CHARGE = 0x8214,
  57. QL_COMPONENT_BSP_VIRT_AT = 0x8215,
  58. QL_COMPONENT_BSP_TP = 0x8216, //touch penal
  59. //QL_COMPONENT_BSP_OTHER = 0x82FF,
  60. QL_COMPONENT_STORAGE = 0x8300,
  61. QL_COMPONENT_STORAGE_FLASH = 0x8301,
  62. QL_COMPONENT_STORAGE_SDEMMC = 0x8302,
  63. QL_COMPONENT_STORAGE_FILE = 0x8303,
  64. QL_COMPONENT_STORAGE_EXTFLASH = 0x8304, //for nor flash
  65. QL_COMPONENT_STORAGE_EXT_NANDFLASH = 0x8305, //for nand flash
  66. QL_COMPONENT_STORAGE_ZIP = 0x8306,
  67. QL_COMPONENT_STORAGE_FATFS = 0x8307, //for fatfs
  68. QL_COMPONENT_STORAGE_EMBED_NOR_FLASH = 0x8308, //for embed flash
  69. QL_COMPONENT_AUDIO = 0x8400,
  70. QL_COMPONENT_AUDIO_CODEC = 0x8401,
  71. QL_COMPONENT_AUDIO_REC_PLAY = 0x8402,
  72. QL_COMPONENT_AUDIO_TTS = 0x8403,
  73. QL_COMPONENT_AUDIO_DTMF = 0x8404,
  74. QL_COMPONENT_AUDIO_SETTING = 0x8405,
  75. QL_COMPONENT_AUDIO_HEADSET = 0x8406,
  76. QL_COMPONENT_LWIP = 0x8500,
  77. QL_COMPONENT_LWIP_SOCKET = 0x8501, // tcp/udp/ping/dns
  78. QL_COMPONENT_LWIP_HTTP = 0x8502,
  79. QL_COMPONENT_LWIP_MQTT = 0x8503,
  80. QL_COMPONENT_LWIP_FTP = 0x8504,
  81. QL_COMPONENT_LWIP_SSL = 0x8505,
  82. QL_COMPONENT_LWIP_MMS = 0x8506,
  83. QL_COMPONENT_LWIP_LBS = 0x8507, // queclocator
  84. QL_COMPONENT_LWIP_QUECTHING = 0x8508,
  85. QL_COMPONENT_LWIP_QNTP = 0x8509,
  86. QL_COMPONENT_LWIP_SMTP = 0x8510,
  87. QL_COMPONNET_LWIP_GPRS_DATA_TRANSFER = 0x8511,
  88. QL_COMPONNET_LWIP_MQTT_UNIOT = 0x8512,
  89. QL_COMPONNET_LWIP_NTRIP_RTK = 0x8513,
  90. QL_COMPONENT_LWIP_WIFI = 0x8514,
  91. QL_COMPONENT_NETWORK = 0x8600,
  92. QL_COMPONENT_NETWORK_MANAGE = 0x8601,
  93. QL_COMPONENT_NETWORK_PPP = 0x8602,
  94. QL_COMPONENT_NETWORK_USBNET = 0x8603,
  95. QL_COMPONENT_ETHERNET = 0x8605,
  96. QL_COMPONENT_SIM = 0x8700,
  97. QL_COMPONENT_VSIM_ADAPT = 0x8701,
  98. QL_COMPONENT_PM = 0x8800,
  99. QL_COMPONENT_PM_SLEEP = 0x8801,
  100. QL_COMPONENT_SMS = 0x8900,
  101. QL_COMPONENT_VOICE_CALL = 0x8A00, // cs call (csfb)
  102. QL_COMPONENT_IMS = 0x8B00, // volte, ps sms
  103. QL_COMPONENT_FOTA = 0x8C00,
  104. QL_COMPONENT_STATE_INFO = 0x8D00, // basic info and state for quectel product itself
  105. QL_COMPONENT_LOG = 0x8E00,
  106. QL_COMPONENT_AT = 0x8F00,
  107. QL_COMPONENT_STK = 0x9000,
  108. //
  109. //next is reserved for app to add component
  110. //
  111. QL_COMPONENT_APP_START = 0x9F00,// app component start
  112. QL_COMPONENT_MAX = 0x9FFF,//component end
  113. }ql_component_e;
  114. /*
  115. * errcode definition
  116. *
  117. * 4 bytes, little endian, signed type, as below:
  118. *
  119. * ----------------------------------------------------------------------------------------------------
  120. * | 4 | 3 | 2 | 1 |
  121. * ----------------------------------------------------------------------------------------------------
  122. * | High byte of component ID | low byte of component ID | High byte of errcode | low byte of errcode|
  123. * ----------------------------------------------------------------------------------------------------
  124. *
  125. * component ID defined at enum type <ql_errcode_component_e>.
  126. * detail errcode defined by each component.
  127. *
  128. */
  129. //common detail errcode, 2 bytes
  130. typedef enum
  131. {
  132. QL_NO_ERROR = 0,
  133. QL_SUCCESS = 0,
  134. QL_GENERAL_ERROR = 0xFFFF,
  135. } ql_errcode_e;
  136. /*========================================================================
  137. * Type Definition
  138. *========================================================================*/
  139. #ifndef BOOLEAN
  140. typedef unsigned char BOOLEAN;
  141. #endif
  142. #ifndef int8
  143. typedef signed char int8;
  144. #endif
  145. #ifndef uint8
  146. typedef unsigned char uint8;
  147. #endif
  148. #ifndef UINT8
  149. typedef unsigned char UINT8;
  150. #endif
  151. #ifndef int16
  152. typedef signed short int16;
  153. #endif
  154. #ifndef uint16
  155. typedef unsigned short uint16;
  156. #endif
  157. #ifndef int32
  158. typedef signed int int32;
  159. #endif
  160. #ifndef uint
  161. typedef unsigned int uint;
  162. #endif
  163. #ifndef UINT
  164. typedef unsigned int UINT;
  165. #endif
  166. #ifndef uint32
  167. typedef unsigned int uint32;
  168. #endif
  169. #ifndef PVOID
  170. typedef void *PVOID;
  171. #endif
  172. #ifndef TCHAR
  173. typedef char TCHAR;
  174. #endif
  175. #ifndef int64
  176. typedef long long int64;
  177. #endif
  178. #ifndef uint64
  179. typedef unsigned long long uint64;
  180. #endif
  181. #ifndef UINT32
  182. typedef unsigned int UINT32;
  183. #endif
  184. /*========================================================================
  185. * Variable Definition
  186. *========================================================================*/
  187. /*========================================================================
  188. * function Definition
  189. *========================================================================*/
  190. typedef void (*ql_callback)(void *ctx);
  191. #ifdef __cplusplus
  192. } /*"C" */
  193. #endif
  194. #endif /* QL_API_COMMON_H */