quec_customer_cfg.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. 
  2. /*================================================================
  3. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  4. Quectel Wireless Solutions Proprietary and Confidential.
  5. =================================================================*/
  6. /*=================================================================
  7. EDIT HISTORY FOR MODULE
  8. This section contains comments describing changes made to the module.
  9. Notice that changes are listed in reverse chronological order.
  10. WHEN WHO WHAT, WHERE, WHY
  11. ------------ ------- -------------------------------------------------------------------------------
  12. =================================================================*/
  13. #ifndef QUEC_CUSTOMER_CFG_H
  14. #define QUEC_CUSTOMER_CFG_H
  15. #include "quec_common.h"
  16. #include "ql_uart.h"
  17. #include "ql_audio.h"
  18. #include "ql_pwm.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /*===========================================================================
  23. * Macro
  24. ===========================================================================*/
  25. #ifdef CONFIG_QL_PROJECT_DEF_EC800G
  26. #define UART_PIN_MAX (6) //UART2 UART3 //different uart num, so don't used in core code directly
  27. #else
  28. #define UART_PIN_MAX (6) //UART2 UART3 //different uart num, so don't used in core code directly
  29. #endif
  30. #define CAM_PIN_MAX (8) //fixed pin num
  31. #define LCD_PIN_MAX (6) //fixed pin num
  32. #define HAL_PMU_POWER_MAX_COUNT 0xFF
  33. #ifdef CONFIG_QL_PROJECT_DEF_EG700G
  34. #define QUEC_NET_STAT_PWM QL_PWM_0
  35. #else
  36. #define QUEC_NET_STAT_PWM QL_PWM_10
  37. #endif
  38. /* GNSS SYS CFG */
  39. #define GPS_SYS 0x61
  40. #define BDS_SYS 0x64
  41. #define GPS_BDS_SYS 0x65
  42. #define GPS_GLONASS_SYS 0x63
  43. #define GPS_GALILEO_SYS 0x71
  44. #define GPS_GLONASS_GALILEO_SYS 0x73
  45. #define GPS_BDS_GALILEO_SYS 0x75
  46. #define INVALID_SYS 0x0
  47. /*===========================================================================
  48. * Struct
  49. ===========================================================================*/
  50. typedef enum
  51. {
  52. POWER_INIT_NONE = -1,
  53. POWER_INIT_PHASE1 = 0, //unisoc init phase
  54. POWER_INIT_PHASE2, //quec init phase
  55. POWER_INIT_PHASE3, //individual function init phase
  56. }ql_power_init_phase_e;
  57. typedef enum
  58. {
  59. DSIM_SINGLE,
  60. DSIM_DSSS,
  61. DSIM_DSDS,
  62. }ql_dsim_feature_e;
  63. typedef enum
  64. {
  65. SDCARD_EMMC_USE_SDMMC1,
  66. SDCARD_EMMC_USE_SDMMC2,
  67. }ql_sdmmc_feature_e;
  68. typedef enum
  69. {
  70. HD_GNSS_800G = 800,
  71. HD_GNSS_200G = 200,
  72. }ql_hd_gnss_moudle_e;//适配华大GNSS的模块型号
  73. typedef struct
  74. {
  75. uint8_t adc_num;
  76. uint8_t sdmmc_enabled;//标准版本硬件是否支持sdmmc功能,open版本没用到此参数
  77. uint8_t ex_uart_num;
  78. uint8_t pin_num; //=QUEC_PIN_CFG_MAX
  79. AudInputType_e hp_input_type;
  80. uint32_t factory_size;
  81. }ql_model_diff_ctx_s;
  82. typedef struct
  83. {
  84. bool enable;
  85. uint reserve;
  86. }usbsusp_mg_t;
  87. typedef struct
  88. {
  89. char *serialstr; //Custom string descriptor
  90. }usbdesc_mg_t;
  91. typedef struct
  92. {
  93. unsigned int ap_addr;
  94. unsigned int ap_size;
  95. unsigned int appimg_addr;
  96. unsigned int appimg_size;
  97. unsigned int fs_addr;
  98. unsigned int fs_size;
  99. unsigned int fs_modem_addr;
  100. unsigned int fs_modem_size;
  101. }ql_model_partinfo_ctx_s;
  102. typedef struct
  103. {
  104. bool volte_enabled;
  105. uint8_t sim_count;
  106. ql_dsim_feature_e dsim_feature;
  107. uint32_t app_ram_offset;
  108. uint32_t app_total_ram_size;
  109. uint8_t ap_ifc_dma_count; //ap can use ifc dma channel number
  110. usbsusp_mg_t usbsusp;
  111. usbdesc_mg_t usbdesc; //Custom usb descriptor
  112. bool gnss_enabled;
  113. bool charge_enable; //启动充电管理标志。为true时,启动充电管理,为false,关闭充电管理。默认为true。open charge management sign. When it is true, the charging management is started, and when it is false, the charging management is turned off. Defaults to true.
  114. ql_sdmmc_feature_e sdmmc_channel; //sdmmc channel selection to sdcard/emmc 0--sdmmc1 1--sdmmc2
  115. uint8_t vibr_domain_flg; // be used for close VIBR domain when LCD enter sleep.
  116. bool audio_cvs_enabled;
  117. uint8 uart_prio; //uart口回调函数的优先级
  118. uint8 usb_prio; //usb口回调函数的优先级
  119. } ql_model_feature_ctx_s;
  120. typedef struct
  121. {
  122. ql_uart_port_number_e port;
  123. uint8_t tx_pin;
  124. uint8_t tx_func;
  125. uint8_t rx_pin;
  126. uint8_t rx_func;
  127. } ql_uart_func_s;
  128. typedef struct
  129. {
  130. uint8_t port_num;
  131. uint8_t pin_num;
  132. uint8_t pin_func;
  133. } ql_cp_dev_cfg_s;
  134. typedef struct
  135. {
  136. uint8_t pin;
  137. uint8_t func;
  138. } ql_cam_func_s;
  139. typedef ql_cam_func_s ql_lcd_func_s;
  140. /**
  141. * Power domain set
  142. */
  143. typedef struct
  144. {
  145. uint32_t id; //configurable power domain
  146. bool enabled; //work mode
  147. bool lp_enabled; //sleep mode
  148. uint32_t mv; //power domain value(units:mV)
  149. int8_t init_phase; //power domain initialization stage
  150. } ql_power_domain_s;
  151. typedef struct
  152. {
  153. volatile uint32_t *pin_register;
  154. bool enabled; //whether enable pin deep sleep mode when enter deep sleep mode
  155. }ql_pin_deep_sleep_ctx_s;
  156. typedef struct
  157. {
  158. uint8_t rf_band;
  159. uint8_t board_id0;
  160. uint8_t board_id1;
  161. unsigned int board_id0_fun_pad;
  162. unsigned int board_id1_fun_pad;
  163. } ql_xtl_diff_ctx_s;
  164. /*===========================================================================
  165. * Extern
  166. ===========================================================================*/
  167. extern volatile ql_model_diff_ctx_s ql_model_diff_ctx;
  168. extern const ql_model_partinfo_ctx_s ql_model_partinfo_ctx;
  169. extern volatile ql_model_feature_ctx_s ql_model_feature_ctx;
  170. extern const ql_uart_func_s ql_uart_pin_func[];
  171. extern const ql_cam_func_s ql_cam_pin_func[];
  172. extern const ql_lcd_func_s ql_lcd_pin_func[];
  173. extern const ql_power_domain_s ql_power_domain_table[];
  174. extern const unsigned char ql_power_domain_table_len;
  175. extern const ql_pin_deep_sleep_ctx_s ql_pin_deepsleep_mode_table[];
  176. extern const unsigned char ql_pin_deepsleep_table_len;
  177. extern const ql_xtl_diff_ctx_s ql_xtl_diff_ctx;
  178. extern const ql_cp_dev_cfg_s ql_cp_dev_cfg[];
  179. extern const unsigned char ql_cp_dev_cfg_len;
  180. #ifdef __cplusplus
  181. } /*"C" */
  182. #endif
  183. #endif /* QUEC_CUSTOMER_CFG_H */