• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef _TARGET_CONFIG_H_
16 #define _TARGET_CONFIG_H_
17 #include "plf.h"
18 // General paramter configuration
19 #define FPGA                            0
20 #define PXP                             0
21 //end
22 
23 // tws ble adv or scan open/close
24 #ifdef CFG_BLE_STACK
25 #define TWS_BLE_CONNECT                 0
26 #else
27 #define TWS_BLE_CONNECT                 1
28 #endif
29 //end
30 
31 // macro for test case, user don't change it
32 #define SCO_LOOPBACK_TEST               0
33 #define MAX_THROUGHPUT_TEST             0
34 #define SCO_CVSD_PLC_TEST               0
35 #define TWS_SLAVE_CONNECT_MASTER        0
36 #define TWS_MSS_AUTO_TEST               0
37 #define TWS_SENDING_DATA_TEST           0
38 //end
39 /* TEST_MODE_ROLE_SEND
40     ble=off    1 : link connect initiator                              role is MASTER ,without roleswitch
41                0 : page/inquiry scan and waiting                       role is SLAVE  ,without roleswitch
42     ble=on     1 : adv initiator  ,page/inquiry scan and waiting       role is SLAVE  ,without roleswitch
43                0 : ble scan       ,link connect initiator              role is MASTER ,without roleswitch
44 */
45 #define TEST_MODE_ROLE_SEND             0
46 #ifdef CFG_AON
47 #define AON_SUPPORT                     1
48 #else
49 #define AON_SUPPORT                     0
50 #endif
51 
52 /*
53  * set sleep level for BT/BLE
54  * 0: sys_sleep_level = PM_LEVEL_ACTIVE           bt_lp_level = BT_LP_LEVEL_ACTIVE
55  * 1: sys_sleep_level = PM_LEVEL_LIGHT_SLEEP      bt_lp_level = BT_LP_LEVEL_CLOCK_GATE2
56  * 2: sys_sleep_level = PM_LEVEL_DEEP_SLEEP       bt_lp_level = BT_LP_LEVEL_POWER_OFF3
57  * 3: sys_sleep_level = PM_LEVEL_HIBERNATE        bt_lp_level = BT_LP_LEVEL_HIBERNATE
58 */
59 #define APP_SLEEP_LEVEL                 0
60 
61 // General BT paramter configuration
62 #ifdef CFG_BT_STACK
63 #if (AON_SUPPORT)
64 #define APP_SUPPORT_DEEPSLEEP
65 #define AON_APP_STATIC_LEN              512
66 #endif
67 
68 #if defined(CFG_TWS_ROLE_MASTER)
69     #undef TEST_MODE_ROLE_SEND
70     #if TWS_BLE_CONNECT == 0
71     #define TEST_MODE_ROLE_SEND             1//master
72     #else
73     #define TEST_MODE_ROLE_SEND             0//master
74     #endif
75     #define APP_SUPPORT_TWS                 1
76     #define APP_SUPPORT_MULTIPLE_PHONE      0//if APP_SUPPORT_MULTIPLE_PHONE == 1 ,APP_SUPPORT_TWS = 0 .if APP_SUPPORT_TWS == 1,APP_SUPPORT_MULTIPLE_PHONE = 0
77     #define APP_SUPPORT_LINK_ONE_ONLY       0
78 #elif defined(CFG_TWS_ROLE_SLAVE)
79     #undef TEST_MODE_ROLE_SEND
80     #if TWS_BLE_CONNECT == 0
81     #define TEST_MODE_ROLE_SEND             0//slave
82     #else
83     #define TEST_MODE_ROLE_SEND             1//slave
84     #endif
85     #define APP_SUPPORT_TWS                 1
86     #define APP_SUPPORT_MULTIPLE_PHONE      0//if APP_SUPPORT_MULTIPLE_PHONE == 1 ,APP_SUPPORT_TWS = 0 .if APP_SUPPORT_TWS == 1,APP_SUPPORT_MULTIPLE_PHONE = 0
87     #define APP_SUPPORT_LINK_ONE_ONLY       0
88 #else
89     #undef TEST_MODE_ROLE_SEND
90     #undef TWS_BLE_CONNECT
91     #define TEST_MODE_ROLE_SEND             0//slave
92     #if PLF_CS_VENDOR_ADV
93     #define TWS_BLE_CONNECT                 1//CS VENDOR CONNECTION is support
94     #else
95     #define TWS_BLE_CONNECT                 0//no tws ble
96     #endif
97     #define APP_SUPPORT_TWS                 0
98     #define APP_SUPPORT_MULTIPLE_PHONE      1//if APP_SUPPORT_MULTIPLE_PHONE == 1 ,APP_SUPPORT_TWS = 0 .if APP_SUPPORT_TWS == 1,APP_SUPPORT_MULTIPLE_PHONE = 0
99     #if defined(CFG_LINK_ONE)
100     #define APP_SUPPORT_LINK_ONE_ONLY       1//Used for test or Only one connected application scenario is required
101     #else
102     #define APP_SUPPORT_LINK_ONE_ONLY       0
103     #endif
104 #endif
105 
106 #if APP_SUPPORT_TWS == 1
107 #define APP_SUPPORT_AES                 0
108 #define APP_SUPPORT_TWS_LOCAL_VOL_SYNC  0
109 #else
110 #define APP_SUPPORT_AES                 1
111 #define APP_SUPPORT_TWS_LOCAL_VOL_SYNC  0
112 #endif
113 
114 //BT profile configuration
115 #define APP_SUPPORT_A2DP_SBC            1
116 #ifdef A2DP_AAC_ENABLE
117 #define APP_SUPPORT_A2DP_AAC            1
118 #else
119 #define APP_SUPPORT_A2DP_AAC            0
120 #endif
121 #ifdef CFG_A2DP_SOURCE_SUPPORT
122 #define APP_SUPPORT_A2DP_SOURCE         1
123 #undef APP_SUPPORT_MULTIPLE_PHONE
124 #define APP_SUPPORT_MULTIPLE_PHONE      0
125 #else
126 #define APP_SUPPORT_A2DP_SOURCE         0
127 #endif
128 #define APP_SUPPORT_A2DP_CP             0
129 #if APP_SUPPORT_A2DP_SBC == 1 || APP_SUPPORT_A2DP_AAC == 1 || APP_SUPPORT_A2DP_SOURCE == 1
130 #define APP_SUPPORT_AVRCP               1
131 #else
132 #define APP_SUPPORT_AVRCP               0
133 #endif
134 #define APP_SUPPORT_HFP                 1
135 #define APP_SUPPORT_HSP                 0
136 #define APP_SUPPORT_HID                 0
137 #if APP_SUPPORT_HFP==1
138 #define APP_SUPPORT_NUMBER_VOICE        1
139 #define APP_SUPPORT_BTBATTERY           1
140 #define APP_SUPPORT_NREC_OFF            0
141 #define HFP_1_6_ENABLE
142 #else
143 #define APP_SUPPORT_NUMBER_VOICE        0
144 #define APP_SUPPORT_BTBATTERY           0
145 #define APP_SUPPORT_NREC_OFF            0
146 #endif
147 #if APP_SUPPORT_AVRCP == 1
148 #define APP_SUPPORT_IPHONE_VOLUME_SYNC  1
149 #else
150 #define APP_SUPPORT_IPHONE_VOLUME_SYNC  0
151 #endif
152 #if SCO_CVSD_PLC_TEST == 1 || MAX_THROUGHPUT_TEST == 1
153 #define APP_SUPPORT_SPP                 1
154 #else
155 #define APP_SUPPORT_SPP                 0
156 #endif
157 
158 #else
159 #define APP_SUPPORT_TWS                 0
160 #define APP_SUPPORT_MULTIPLE_PHONE      0
161 #define APP_SUPPORT_A2DP_SBC            0
162 #define APP_SUPPORT_A2DP_AAC            0
163 #define APP_SUPPORT_A2DP_SOURCE         0
164 #define APP_SUPPORT_A2DP_CP             0
165 #define APP_SUPPORT_AVRCP               0
166 #define APP_SUPPORT_HFP                 0
167 #define APP_SUPPORT_HSP                 0
168 #define APP_SUPPORT_HID                 0
169 #define APP_SUPPORT_BLE                 0
170 #define APP_SUPPORT_SPP                 0
171 #endif
172 
173 #if PLF_HFG_SUPPORT
174 #undef APP_SUPPORT_HFP
175 #undef APP_SUPPORT_NUMBER_VOICE
176 #undef APP_SUPPORT_BTBATTERY
177 #undef APP_SUPPORT_NREC_OFF
178 #undef TWS_BLE_CONNECT
179 #define APP_SUPPORT_HFP                 1
180 #define APP_SUPPORT_NUMBER_VOICE        0
181 #define APP_SUPPORT_BTBATTERY           0
182 #define APP_SUPPORT_NREC_OFF            0
183 #define TWS_BLE_CONNECT                 1
184 
185 #define APP_SUPPORT_HFG                 1
186 #else
187 #define APP_SUPPORT_HFG                 0
188 #endif
189 
190 #ifdef CFG_BT_OTA_BOX
191 #define APP_SUPPORT_OTA_BOX             1
192 #undef TEST_MODE_ROLE_SEND
193 #undef APP_SUPPORT_AES
194 #define TEST_MODE_ROLE_SEND             1
195 #define APP_SUPPORT_AES                 0
196 #else
197 #define APP_SUPPORT_OTA_BOX             0
198 #endif
199 
200 #if (PLF_BLE_STACK && PLF_BTDM == 0) || APP_SUPPORT_OTA_BOX
201 #undef APP_SUPPORT_TWS
202 #define APP_SUPPORT_TWS                 0
203 #undef APP_SUPPORT_MULTIPLE_PHONE
204 #define APP_SUPPORT_MULTIPLE_PHONE      0
205 #undef APP_SUPPORT_A2DP_SBC
206 #define APP_SUPPORT_A2DP_SBC            0
207 #undef APP_SUPPORT_A2DP_AAC
208 #define APP_SUPPORT_A2DP_AAC            0
209 #undef APP_SUPPORT_A2DP_SOURCE
210 #define APP_SUPPORT_A2DP_SOURCE         0
211 #undef APP_SUPPORT_A2DP_CP
212 #define APP_SUPPORT_A2DP_CP             0
213 #undef APP_SUPPORT_AVRCP
214 #define APP_SUPPORT_AVRCP               0
215 #undef APP_SUPPORT_HFP
216 #define APP_SUPPORT_HFP                 0
217 #undef APP_SUPPORT_HSP
218 #define APP_SUPPORT_HSP                 0
219 #undef APP_SUPPORT_HID
220 #define APP_SUPPORT_HID                 0
221 #undef APP_SUPPORT_BLE
222 #define APP_SUPPORT_BLE                 0
223 #undef APP_SUPPORT_SPP
224 #define APP_SUPPORT_SPP                 0
225 #undef APP_SUPPORT_AES
226 #define APP_SUPPORT_AES                 0
227 #endif
228 //end
229 
230 #define APP_VOLUME_MAX_IN_LEVEL         0xa//0xf
231 #define APP_VOLUME_MAX_OUT_LEVEL        0x3f
232 
233 ///patch en
234 /*
235  *NOTE :
236  *CSBT_PATCH_ASIC_U02_ENABLE = 1, asic rom patch for U02 enabled
237  *CSBT_PATCH_FPGA_U02_ENABLE = 1, fpga rom patch for U02 enabled
238  *CSBT_PATCH_ASIC_U02_ENABLE and CSBT_PATCH_FPGA_U02_ENABLE
239  *CAN NOT be 1 at same time
240  *but CAN both be 0.
241  */
242 
243 #define CSBT_PATCH_ASIC_U02_ENABLE      1
244 #define CSBT_PATCH_FPGA_U02_ENABLE      0
245 #if (CFG_ROM_VER == 2)
246 #define CSBT_PATCH_U02_ENABLE           (CSBT_PATCH_ASIC_U02_ENABLE || CSBT_PATCH_FPGA_U02_ENABLE)
247 #else
248 #define CSBT_PATCH_U02_ENABLE           0
249 #endif
250 
251 #define CSBT_PATCH_ASIC_U03_ENABLE      1
252 #define CSBT_PATCH_FPGA_U03_ENABLE      0
253 #if (CFG_ROM_VER == 3)
254 #define CSBT_PATCH_U03_ENABLE           (CSBT_PATCH_ASIC_U03_ENABLE || CSBT_PATCH_FPGA_U03_ENABLE)
255 #else
256 #define CSBT_PATCH_U03_ENABLE           0
257 #endif
258 
259 #define CSBT_PATCH_ENABLE               (CSBT_PATCH_U02_ENABLE || CSBT_PATCH_U03_ENABLE)
260 
261 #endif
262