quec_common.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /** @file
  2. quec_common.h
  3. @brief
  4. This file is used to define version information for different Quectel Project.
  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. =================================================================*/
  17. #ifndef QUEC_COMMON_H
  18. #define QUEC_COMMON_H
  19. /*> include header files here*/
  20. #include <stdio.h>
  21. #include "osi_api.h"
  22. #include "quec_proj_config.h"
  23. #include "quec_log.h"
  24. #include "ql_api_common.h"
  25. #include "quec_cust_patch.h"
  26. #include "quec_cust_feature.h"
  27. #include "quec_customer_cfg.h"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /*========================================================================
  32. * Macro Definition
  33. *========================================================================*/
  34. #define TRUE 1
  35. #define FALSE 0
  36. #ifndef false
  37. #define false 0
  38. #endif
  39. #ifndef true
  40. #define true 1
  41. #endif
  42. #define kNoErr 0 //! No error occurred.
  43. #define kGeneralErr -1 //! General error.
  44. #define kInProgressErr 1 //! Operation in progress.
  45. /*========================================================================
  46. * Enumeration Definition
  47. *========================================================================*/
  48. typedef enum
  49. {
  50. QUEC_DISABLE = 0,
  51. QUEC_ENABLE = 1,
  52. } quec_enable_e;
  53. typedef enum
  54. {
  55. //error code is minus, less than QUEC_GENERAL_ERROR
  56. QUEC_GENERAL_ERROR = kGeneralErr,
  57. //sucess code is not minus, bigger than QUEC_GENERAL_ERROR
  58. QUEC_NO_ERROR = kNoErr,
  59. QUEC_SUCCESS = QUEC_NO_ERROR,
  60. } quec_errcode_e;
  61. /*========================================================================
  62. * Type Definition
  63. *========================================================================*/
  64. typedef int QuecOSStatus;
  65. /*========================================================================
  66. * Utilities Definition
  67. *========================================================================*/
  68. /* Get Array Size */
  69. #ifndef QUEC_ARR_SIZE
  70. #define QUEC_ARR_SIZE(a) ( sizeof(a) / sizeof(a[0]) )
  71. #endif
  72. /* Bit Mask Operation */
  73. #define QUEC_BIT_MASK(bit) (1 << (bit))
  74. #define QUEC_BIT_CLR(x,bit) ((x) &= ~ BIT_MASK (bit))
  75. #define QUEC_BIT_SET(x,bit) ((x) |= BIT_MASK (bit))
  76. #define QUEC_CHECK_BIT_SET(x,bit) ((x) & BIT_MASK (bit))
  77. #ifdef __cplusplus
  78. } /*"C" */
  79. #endif
  80. #endif /* QUEC_COMMON_H */