ql_led.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*================================================================
  2. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  3. Quectel Wireless Solutions Proprietary and Confidential.
  4. =================================================================*/
  5. /*=================================================================
  6. EDIT HISTORY FOR MODULE
  7. This section contains comments describing changes made to the module.
  8. Notice that changes are listed in reverse chronological order.
  9. WHEN WHO WHAT, WHERE, WHY
  10. ------------ ------- -------------------------------------------------------------------------------
  11. =================================================================*/
  12. #ifndef QL_LED_H
  13. #define QL_LED_H
  14. #include "ql_api_common.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /*===========================================================================
  19. * Macro Definition
  20. ===========================================================================*/
  21. #define QL_LED_ERRCODE_BASE (QL_COMPONENT_BSP_LED<<16)
  22. /*===========================================================================
  23. * Enum
  24. ===========================================================================*/
  25. /**
  26. * LED errcode
  27. */
  28. typedef enum
  29. {
  30. QL_LED_SUCCESS = QL_SUCCESS,
  31. QL_LED_EXECUTE_ERR = 1|QL_LED_ERRCODE_BASE,
  32. QL_LED_INVALID_PARAM_ERR,
  33. QL_LED_CB_NULL_ERR
  34. }ql_errcode_led;
  35. /*===========================================================================
  36. * Struct
  37. ===========================================================================*/
  38. /*===========================================================================
  39. * Typedef
  40. ===========================================================================*/
  41. typedef void (*ql_ledcfg_callback)(unsigned int ind_type, uint32_t net_status, uint32_t net_type);
  42. /*===========================================================================
  43. * Functions declaration
  44. ===========================================================================*/
  45. /**
  46. * @brief user's led config callback register
  47. * @param ledcfg_cb : set callback by user
  48. * @return
  49. * QL_LED_CB_NULL_ERR
  50. * QL_LED_SUCCESS
  51. */
  52. ql_errcode_led ql_ledcfg_callback_register(ql_ledcfg_callback ledcfg_cb);
  53. /*****************************************************************
  54. * Function: ql_led_set_sim
  55. *
  56. * Description: Bind the network light to the SIM card
  57. *
  58. * Parameters:
  59. * nSim [in] SIM index, range 0 to 1
  60. *
  61. * Return:
  62. * 0 success
  63. * other error code
  64. *
  65. *****************************************************************/
  66. ql_errcode_led ql_led_set_sim(uint8 nSim);
  67. /*****************************************************************
  68. * Function: ql_led_get_sim
  69. *
  70. * Description: get the SIM card that bound to the network light
  71. *
  72. * Parameters:
  73. * nSim [out] SIM index, range 0 to 1
  74. *
  75. * Return:
  76. * 0 success
  77. * other error code
  78. *
  79. *****************************************************************/
  80. ql_errcode_led ql_led_get_sim(uint8 *nSim);
  81. #ifdef __cplusplus
  82. } /*"C" */
  83. #endif
  84. #endif /* QL_LED_H */