• 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 _BLE_IP_CONFIG_H
16 #define _BLE_IP_CONFIG_H
17 
18 #include "ble_app_config.h"     // Audio Mode 0 configuration
19 #include "csble_dbg.h"
20 
21 /******************************************************************************************/
22 /* --------------------------   GENERAL SETUP       --------------------------------------*/
23 /******************************************************************************************/
24 
25 /// Check if compilation is performed for BLE HW 5.0 + ISO target
26 #if (defined(CFG_HW_50_ISO))
27 #define BLE_HW_50_ISO        1
28 #else
29 #define BLE_HW_50_ISO        0
30 #endif // (defined(CFG_HW_50_ISO))
31 
32 /// Flag indicating if stack is compiled in dual or single mode
33 #if defined(CFG_BT)
34     #define BLE_STD_MODE                     0
35     #if defined(CFG_BLE)
36         #define BT_DUAL_MODE                 1
37         #define BT_STD_MODE                  0
38     #else // CFG_BLE
39         #define BT_DUAL_MODE                 0
40         #define BT_STD_MODE                  1
41     #endif // CFG_BLE
42 #elif defined(CFG_BLE)
43     #define BT_DUAL_MODE                     0
44     #define BT_STD_MODE                      0
45     #define BLE_STD_MODE                     1
46 #endif // CFG_BT
47 
48 /******************************************************************************************/
49 /* -------------------------   STACK PARTITIONING      -----------------------------------*/
50 /******************************************************************************************/
51 
52 #if (BT_DUAL_MODE)
53     #define BT_EMB_PRESENT              1
54     #define BLE_EMB_PRESENT             1
55     #define HCI_PRESENT                 1
56     #define BLE_HOST_PRESENT            0
57     #define BLE_APP_PRESENT             0
58 #elif (BT_STD_MODE)
59     #define BT_EMB_PRESENT              1
60     #define BLE_EMB_PRESENT             0
61     #define HCI_PRESENT                 1
62     #define BLE_HOST_PRESENT            0
63     #define BLE_APP_PRESENT             0
64 #elif (BLE_STD_MODE)
65     #define BT_EMB_PRESENT              0
66     #define HCI_PRESENT                 1
67     #if defined(CFG_EMB)
68         #define BLE_EMB_PRESENT         1
69     #else
70         #define BLE_EMB_PRESENT         0
71     #endif //CFG_EMB
72     #if defined(CFG_HOST)
73         #define BLE_HOST_PRESENT        1
74     #else
75         #define BLE_HOST_PRESENT        0
76     #endif //CFG_HOST
77     #if defined(CFG_APP)
78         #define BLE_APP_PRESENT         1
79     #else
80         #define BLE_APP_PRESENT         0
81     #endif //CFG_APP
82 #endif // BT_DUAL_MODE / BT_STD_MODE / BLE_STD_MODE
83 
84 /// Flag indicating that Mesh is supported
85 #if defined(CFG_BLE_MESH)
86 #define BLE_MESH      1
87 #else  // !defined(CFG_BLE_MESH)
88 #define BLE_MESH      0
89 #endif // defined(CFG_BLE_MESH)
90 
91 /******************************************************************************************/
92 /* -------------------------   INTERFACES DEFINITIONS      -------------------------------*/
93 /******************************************************************************************/
94 /// Application Host Interface
95 #if defined(CFG_AHITL)
96 #define AHI_TL_SUPPORT       1
97 #else // defined(CFG_AHITL)
98 #define AHI_TL_SUPPORT       0
99 #endif // defined(CFG_AHITL)
100 
101 
102 /// Host Controller Interface Support (defines if HCI parser is present or not)
103 #if defined(CFG_HCITL)
104 #define HCI_TL_SUPPORT      1
105 #else //defined(CFG_HCITL)
106 #define HCI_TL_SUPPORT      0
107 #endif //defined(CFG_HCITL)
108 
109 
110 #if BLE_HOST_PRESENT
111 #define H4TL_SUPPORT      0
112 #else // !BLE_HOST_PRESENT
113 #define H4TL_SUPPORT      (HCI_TL_SUPPORT)
114 #endif // BLE_HOST_PRESENT
115 
116 /// Number of HCI commands the stack can handle simultaneously
117 #define HCI_NB_CMD_PKTS   (5 * HCI_TL_SUPPORT)
118 
119 /******************************************************************************************/
120 /* --------------------------   BLE COMMON DEFINITIONS      ------------------------------*/
121 /******************************************************************************************/
122 /// Kernel Heap memory sized reserved for allocate dynamically connection environment
123 #define KE_HEAP_MEM_RESERVED        (4)
124 
125 #if defined(CFG_BLE)
126 
127 /// Broadcaster
128 #if (defined(CFG_BROADCASTER) || defined(CFG_PERIPHERAL) || defined(CFG_ALLROLES))
129 #define BLE_BROADCASTER      1
130 #else
131 #define BLE_BROADCASTER      0
132 #endif // (defined(CFG_BROADCASTER) || defined(CFG_PERIPHERAL) || defined(CFG_ALLROLES))
133 
134 /// Observer
135 #if (defined(CFG_OBSERVER) || defined(CFG_CENTRAL) || defined(CFG_ALLROLES))
136 #define BLE_OBSERVER      1
137 #else
138 #define BLE_OBSERVER      0
139 #endif // (defined(CFG_OBSERVER) || defined(CFG_CENTRAL) || defined(CFG_ALLROLES))
140 
141 /// Central
142 #if (defined(CFG_CENTRAL) || defined(CFG_ALLROLES))
143 #define BLE_CENTRAL      1
144 #else
145 #define BLE_CENTRAL      0
146 #endif // (defined(CFG_CENTRAL) || defined(CFG_ALLROLES))
147 
148 /// Peripheral
149 #if (defined(CFG_PERIPHERAL) || defined(CFG_ALLROLES))
150 #define BLE_PERIPHERAL      1
151 #else
152 #define BLE_PERIPHERAL      0
153 #endif // (defined(CFG_PERIPHERAL) || defined(CFG_ALLROLES))
154 
155 #if ((BLE_BROADCASTER+BLE_OBSERVER+BLE_PERIPHERAL+BLE_CENTRAL) == 0)
156     #error "No application role defined"
157 #endif // ((BLE_BROADCASTER+BLE_OBSERVER+BLE_PERIPHERAL+BLE_CENTRAL) == 0)
158 
159 /// Maximum number of simultaneous BLE activities (scan, connection, advertising, initiating)
160 /// Keep same with fw
161 #if PLF_BT_STACK
162 #define BLE_ACTIVITY_MAX          (3)
163 #else
164 #define BLE_ACTIVITY_MAX          (12)
165 #endif
166 
167 #if (BLE_HOST_PRESENT)
168 /// Maximum number of simultaneous connections
169 /// Keep same with fw
170 #if (BLE_CENTRAL || BLE_PERIPHERAL)
171     #if PLF_BT_STACK
172     #define BLE_CONNECTION_MAX      (2)
173     #else
174     #define BLE_CONNECTION_MAX      (10)
175     #endif
176 #else
177     #define BLE_CONNECTION_MAX      (0)
178 #endif /* #if (BLE_CENTRAL || BLE_PERIPHERAL) */
179 
180 #if (BLE_CONNECTION_MAX >= BLE_ACTIVITY_MAX)
181     #error "Number of connections must be strictly less than number of activities"
182 #endif // (BLE_CONNECTION_MAX >= BLE_ACTIVITY_MAX)
183 #endif // (BLE_HOST_PRESENT)
184 
185 /// Max advertising reports before sending the info to the host
186 #define BLE_ADV_REPORTS_MAX              (1)
187 
188 #if (BLE_EMB_PRESENT)
189 /// Maximum number of ADV reports in the HCI queue to Host
190 #define BLE_MAX_NB_ADV_REP_FRAG       (4 * HCI_TL_SUPPORT)
191 #endif // (BLE_EMB_PRESENT)
192 #endif //defined(CFG_BLE)
193 
194 
195 
196 /******************************************************************************************/
197 /* --------------------------   ISOCHRONOUS CONFIGURATION        -------------------------*/
198 /******************************************************************************************/
199 
200 // check if isochronous is enabled or not
201 #if  (defined(CFG_ISO_CON) && (CFG_ISO_CON > 0) && (defined(CFG_ISO_MODE_0) || defined(CFG_CIS) || defined(CFG_BIS)))
202     #define BLE_ISO_PRESENT                (1)
203 #else // !(defined(CFG_ISO_CON) && (CFG_ISO_CON > 0))
204     #define BLE_ISO_PRESENT                (0)
205 #endif // (defined(CFG_ISO_CON) && (CFG_ISO_CON > 0))
206 
207 //  *** Definition of supported isochronous mode ***
208 
209 // Isochronous Mode 0 - Proprietary mode
210 #if  (BLE_ISO_PRESENT && defined(CFG_ISO_MODE_0))
211     #define BLE_ISO_MODE_0                (BLE_CENTRAL | BLE_PERIPHERAL)
212     #define BLE_ISO_MODE_0_PROTOCOL       (BLE_ISO_MODE_0 & BLE_HOST_PRESENT)
213     #define BLE_ISO_MODE_0_PROFILE        (BLE_ISO_MODE_0 & BLE_HOST_PRESENT)
214     #define BLE_RSA                       (BLE_ISO_MODE_0_PROFILE)
215 #else
216     #define BLE_ISO_MODE_0                (0)
217     #define BLE_ISO_MODE_0_PROTOCOL       (0)
218     #define BLE_ISO_MODE_0_PROFILE        (0)
219     #define BLE_RSA                       (0)
220 #endif // (BLE_ISO_PRESENT && defined(CFG_AUDIO))
221 
222 // Connected Isochronous Stream
223 #if  (BLE_ISO_PRESENT && defined(CFG_CIS) && BLE_HW_50_ISO)
224 #define BLE_CIS                           (BLE_CENTRAL | BLE_PERIPHERAL)
225 #else
226 #define BLE_CIS                           (0)
227 #endif // (BLE_ISO_PRESENT && defined(CFG_CIS) && BLE_HW_50_ISO)
228 
229 // Broadcast Isochronous Stream
230 #if  (BLE_ISO_PRESENT && defined(CFG_BIS) && BLE_HW_50_ISO)
231 #define BLE_BIS                           (BLE_BROADCASTER | BLE_OBSERVER)
232 #else
233 #define BLE_BIS                           (0)
234 #endif // (BLE_ISO_PRESENT && defined(CFG_BIS) && BLE_HW_50_ISO)
235 
236 // sanity check for ISO presence
237 #if !(BLE_ISO_MODE_0 | BLE_BIS | BLE_CIS)
238 #undef  BLE_ISO_PRESENT
239 #define BLE_ISO_PRESENT                   (0)
240 #endif // !(BLE_ISO_MODE_0 | BLE_BIS | BLE_CIS)
241 
242 #if (BLE_ISO_PRESENT)
243     // Ensure that maximum number of audio channels is not reached
244     #if ((BLE_HW_50_ISO == 0) && (CFG_ISO_CON > 3))
245     #error "HW supports a maximum number of 3 audio channels"
246     #endif // ((BLE_HW_50_ISO == 0) && (CFG_ISO_CON > 3))
247 
248     /// Maximum number of ISO channel / group
249     #define BLE_ISO_CHANNEL_MAX      (CFG_ISO_CON)
250     #define BLE_ISO_GROUP_MAX        (CFG_ISO_CON)
251 
252     /// Maximum number of octets that can be received/transmitted over Isochronous channels
253     #define BLE_MAX_ISO_OCTETS  (251) // number of octets
254 
255     /// Define number of ISO TX/RX buffers per isochronous channel
256     #define BLE_NB_ISO_BUFF_PER_CHAN            (4)
257 
258     /// Define number of ISO descriptors per isochronous channel
259     /// Must be equal to max(BLE_NB_ISODESC_PER_BIS_CHAN, BLE_NB_RX_ISODESC_PER_CIS_CHAN + BLE_NB_TX_ISODESC_PER_CIS_CHAN)
260     #define BLE_NB_ISODESC_PER_CHAN             (4)
261 
262     /// Number of ISO Descriptors - one descriptor required for update sub-event: 1 per stream
263     #define BLE_ISO_DESC_NB                     ((BLE_ISO_CHANNEL_MAX * (BLE_NB_ISODESC_PER_CHAN)) + BLE_ISO_GROUP_MAX)
264     /// Number of ISO buffers
265     #define BLE_ISO_BUF_NB                      (BLE_ISO_CHANNEL_MAX * BLE_NB_ISO_BUFF_PER_CHAN)
266 
267     #if (BLE_CIS)
268     /// Define number of ISO TX/RX descriptors per CIS channel
269     #define BLE_NB_RXTX_ISODESC_PER_CIS_CHAN      (2)
270     #endif // (BLE_CIS)
271 
272     #if (BLE_BIS)
273     /// Define number of ISO RX or TX descriptors per BIS channel
274     #define BLE_NB_ISODESC_PER_BIS_CHAN         (4)
275     #endif // (BLE_BIS)
276 
277     #if (BLE_CIS | BLE_BIS)
278         /// Number of hopping sequence per channel
279         #define BLE_ISO_HOP_SEQ_PER_CHAN   (2)
280         #define BLE_ISO_HOP_SEQ_SIZE       (0x20) // Depends on max number of sub-event supported
281 
282         /// Number of RX ISO buffers (add one more buffer for fake reception/transmit)
283         #define BLE_ISO_HOP_SEQ_NB         (BLE_ISO_CHANNEL_MAX * BLE_ISO_HOP_SEQ_PER_CHAN)
284     #endif // (BLE_CIS | BLE_BIS)
285 #endif // (BLE_ISO_PRESENT)
286 
287 
288 /// Check status of Isochronous Data path drivers
289 
290 /// Proprietary ISO over HCI
291 #if defined(CFG_ISOOHCI)
292     #define BLE_ISOOHCI                  (BLE_ISO_PRESENT)
293 #else
294     #define BLE_ISOOHCI                  (0)
295 #endif
296 
297 /// Internal ISO generator for validation purpose
298 #if defined(CFG_ISOGEN)
299     #define BLE_ISOGEN                   (BLE_ISO_PRESENT)
300 #else
301     #define BLE_ISOGEN                   (0)
302 #endif
303 
304 /// Platform PCM
305 #if defined(CFG_PCM)
306     #define BLE_ISO_PCM                  (BLE_ISO_PRESENT)
307 #else // !defined(CFG_PCM)
308     #define BLE_ISO_PCM                  (0)
309 #endif // defined(CFG_PCM)
310 
311 /******************************************************************************************/
312 /* --------------------------   DISPLAY SETUP        -------------------------------------*/
313 /******************************************************************************************/
314 
315 /// Display controller enable/disable
316 #if defined(CFG_DISPLAY)
317 #define DISPLAY_SUPPORT      1
318 #else
319 #define DISPLAY_SUPPORT      0
320 #endif //CFG_DISPLAY
321 
322 
323 /******************************************************************************************/
324 /* --------------------------      RTC SETUP         -------------------------------------*/
325 /******************************************************************************************/
326 
327 /// RTC enable/disable
328 #if defined(CFG_RTC)
329 #define RTC_SUPPORT      1
330 #else
331 #define RTC_SUPPORT      0
332 #endif //CFG_DISPLAY
333 
334 /******************************************************************************************/
335 /* --------------------------      PS2 SETUP         -------------------------------------*/
336 /******************************************************************************************/
337 
338 /// PS2 enable/disable
339 #if defined(CFG_PS2)
340 #define PS2_SUPPORT      1
341 #else
342 #define PS2_SUPPORT      0
343 #endif //CFG_PS2
344 
345 /******************************************************************************************/
346 /* --------------------------      TRACER SETUP      -------------------------------------*/
347 /******************************************************************************************/
348 
349 /// tracer enable/disable
350 #if defined(CFG_TRC_EN)
351     #define TRACER_PRESENT                   1
352     #include "dbg_trc_config.h"
353 #else
354     #define TRACER_PRESENT                   0
355 #endif // CFG_TRC_EN
356 
357 /******************************************************************************************/
358 /* -------------------------   DEEP SLEEP SETUP      -------------------------------------*/
359 /******************************************************************************************/
360 
361 /// Use 32K Hz Clock if set to 1 else 32,768k is used
362 #define HZ32000                                     0
363 
364 /// Time to wake-up Radio Module (in us)
365 #define SLEEP_RM_WAKEUP_DELAY                       625
366 /// Time for stabilization of the high frequency oscillator following a sleep-timer expiry (in us)
367 #define SLEEP_OSC_NORMAL_WAKEUP_DELAY               5000
368 /// Time for stabilization of the high frequency oscillator following an external wake-up request (in us)
369 #define SLEEP_OSC_EXT_WAKEUP_DELAY                  5000
370 
371 /******************************************************************************************/
372 /* --------------------------   RADIO SETUP       ----------------------------------------*/
373 /******************************************************************************************/
374 
375 /// Power control features
376 #define RF_TXPWR                            1
377 /// Class of device
378 #define RF_CLASS1                           0
379 
380 /******************************************************************************************/
381 /* -------------------------   SUPPORTED RADIO PHY    ------------------------------------*/
382 /******************************************************************************************/
383 
384 #if defined(CFG_RF_ATLAS)
385 #define BLE_PHY_1MBPS_SUPPORT                       1
386 #define BLE_PHY_2MBPS_SUPPORT                       1
387 #define BLE_PHY_CODED_SUPPORT                       1
388 #define BLE_STABLE_MOD_IDX_TX_SUPPORT               0
389 #define BLE_STABLE_MOD_IDX_RX_SUPPORT               0
390 #elif defined(CFG_RF_BTIPT)
391 #define BLE_PHY_1MBPS_SUPPORT                       1
392 #define BLE_PHY_2MBPS_SUPPORT                       1
393 #define BLE_PHY_CODED_SUPPORT                       1
394 #define BLE_STABLE_MOD_IDX_TX_SUPPORT               0
395 #define BLE_STABLE_MOD_IDX_RX_SUPPORT               0
396 #elif defined(CFG_RF_SIMU)
397 #define BLE_PHY_1MBPS_SUPPORT                       1
398 #define BLE_PHY_2MBPS_SUPPORT                       1
399 #define BLE_PHY_CODED_SUPPORT                       1
400 #define BLE_STABLE_MOD_IDX_TX_SUPPORT               0
401 #define BLE_STABLE_MOD_IDX_RX_SUPPORT               0
402 #elif defined(CFG_RF_CS)
403 #define BLE_PHY_1MBPS_SUPPORT                       1
404 #define BLE_PHY_2MBPS_SUPPORT                       1
405 #define BLE_PHY_CODED_SUPPORT                       1
406 #define BLE_STABLE_MOD_IDX_TX_SUPPORT               0
407 #define BLE_STABLE_MOD_IDX_RX_SUPPORT               0
408 #else // RIPPLE
409 #define BLE_PHY_1MBPS_SUPPORT                       1
410 #define BLE_PHY_2MBPS_SUPPORT                       0
411 #define BLE_PHY_CODED_SUPPORT                       1
412 #define BLE_STABLE_MOD_IDX_TX_SUPPORT               0
413 #define BLE_STABLE_MOD_IDX_RX_SUPPORT               0
414 #endif
415 
416 
417 /******************************************************************************************/
418 /* -------------------------   COEXISTENCE SETUP      ------------------------------------*/
419 /******************************************************************************************/
420 
421 /// WLAN Coexistence
422 #if defined(CFG_WLAN_COEX)
423     #define RW_WLAN_COEX                 1
424     #define RW_WLAN_COEX_TEST            (defined(CFG_WLAN_COEX_TEST))
425 #else
426     #define RW_WLAN_COEX                 0
427     #define RW_WLAN_COEX_TEST            0
428 #endif // defined(CFG_WLAN_COEX)
429 
430 /// MWS Coexistence
431 #if defined(CFG_MWS_COEX)
432     #define RW_MWS_COEX                 1
433     #define RW_MWS_COEX_TEST            (defined(CFG_MWS_COEX_TEST))
434 #else
435     #define RW_MWS_COEX                 0
436     #define RW_MWS_COEX_TEST            0
437 #endif // defined(CFG_MWS_COEX)
438 
439 /******************************************************************************************/
440 /* --------------------   SECURE CONNECTIONS SETUP  --------------------------------------*/
441 /******************************************************************************************/
442 //#define CFG_SEC_CON
443 #if defined(CFG_SEC_CON)
444 #define SECURE_CONNECTIONS        (1)
445 #if defined(CFG_ECC_16_BITS_ALGO)
446 #define ECC_MULT_ALGO_TYPE        (16)
447 #else // !defined(CFG_ECC_16_BITS_ALGO)
448 #define ECC_MULT_ALGO_TYPE        (32)
449 #endif // defined(CFG_ECC_16_BITS_ALGO)
450 #if defined(CFG_CRYPTO_UT)
451 #define CRYPTO_UT                 (1)
452 #else //defined(CFG_CRYPTO_UT)
453 #define CRYPTO_UT                 (0)
454 #endif //defined(CFG_CRYPTO_UT)
455 #else // !defined(CFG_SEC_CON)
456 #define SECURE_CONNECTIONS        (0)
457 #define CRYPTO_UT                 (0)
458 #endif // defined(CFG_SEC_CON)
459 
460 
461 /******************************************************************************************/
462 /* --------------------------   DEBUG SETUP       ----------------------------------------*/
463 /******************************************************************************************/
464 
465 /// Flag indicating if debug mode is activated or not
466 #if defined(CFG_DBG)
467     #define RW_DEBUG                        ((BLE_EMB_PRESENT) || (BT_EMB_PRESENT) || (BLE_HOST_PRESENT))
468 #if (BLE_EMB_PRESENT || BT_EMB_PRESENT)
469     #define RW_SWDIAG                       1
470 #else
471     #define RW_SWDIAG                       0
472 #endif
473     #define KE_PROFILING                    0
474 #else
475     #define RW_DEBUG                        0
476     #define RW_SWDIAG                       0
477     #define KE_PROFILING                    0
478 #endif /* CFG_DBG */
479 
480 /// Flag indicating if Read/Write memory commands are supported or not
481 #if defined(CFG_DBG_MEM)
482     #define RW_DEBUG_MEM               1
483 #else //CFG_DBG_MEM
484     #define RW_DEBUG_MEM               0
485 #endif //CFG_DBG_MEM
486 
487 /// Flag indicating if Flash debug commands are supported or not
488 #if defined(CFG_DBG_FLASH)
489     #define RW_DEBUG_FLASH                  1
490 #else //CFG_DBG_FLASH
491     #define RW_DEBUG_FLASH                  0
492 #endif //CFG_DBG_FLASH
493 
494 /// Flag indicating if CPU stack profiling commands are supported or not
495 #if defined(CFG_DBG_STACK_PROF)
496     #define RW_DEBUG_STACK_PROF             1
497 #else
498     #define RW_DEBUG_STACK_PROF             0
499 #endif // defined (CFG_DBG_STACK_PROF)
500 
501 /******************************************************************************************/
502 /* --------------------------      NVDS SETUP       --------------------------------------*/
503 /******************************************************************************************/
504 
505 /// Flag indicating if NVDS feature is supported or not
506 #if defined(CFG_NVDS)
507     #define NVDS_SUPPORT                    1
508 #else //CFG_NVDS
509     #define NVDS_SUPPORT                    0
510 #endif //CFG_NVDS
511 
512 /******************************************************************************************/
513 /* --------------------------      MISC SETUP       --------------------------------------*/
514 /******************************************************************************************/
515 /// Manufacturer: RivieraWaves SAS
516 #define RW_COMP_ID                           0x0060
517 
518 /// Bluetooth technologies version
519 #define RW_BT40_VERSION                      (6)
520 #define RW_BT41_VERSION                      (7)
521 #define RW_BT42_VERSION                      (8)
522 #define RW_BT50_VERSION                      (9)
523 
524 /******************************************************************************************/
525 /* -------------------------   BT / BLE / BLE HL CONFIG    -------------------------------*/
526 /******************************************************************************************/
527 
528 #if (BT_EMB_PRESENT)
529 #include "rwbt_config.h"    // bt stack configuration
530 #endif //BT_EMB_PRESENT
531 
532 #if (BLE_EMB_PRESENT)
533 #include "rwble_config.h"   // ble stack configuration
534 #endif //BLE_EMB_PRESENT
535 
536 #if (BLE_HOST_PRESENT)
537 #include "ble_hl_config.h"  // ble Host stack configuration
538 #endif //BLE_HOST_PRESENT
539 
540 #if defined(CFG_APP)
541 #include "ble_app_config.h"     // Application configuration
542 #endif // defined(CFG_APP)
543 
544 
545 
546 /******************************************************************************************/
547 /* -------------------------   KERNEL SETUP          -------------------------------------*/
548 /******************************************************************************************/
549 
550 /// Event types definition
551 enum KE_EVENT_TYPE
552 {
553     KE_EVENT_KE_MESSAGE,        //!< KE_EVENT_KE_MESSAGE
554     KE_EVENT_KE_TIMER,          //!< KE_EVENT_KE_TIMER
555 
556     #if (TRACER_PRESENT)
557     KE_EVENT_TRC,               //!< KE_EVENT_TRC
558     #endif /*(TRACER_PRESENT)*/
559 
560     #if (BLE_HOST_PRESENT)
561     #if (BLE_L2CC)
562     KE_EVENT_L2CAP_TX,
563     #endif //(BLE_L2CC)
564     #endif// (BLE_HOST_PRESENT)
565 
566     KE_EVENT_MAX,               //!< KE_EVENT_MAX
567 };
568 
569 /// Tasks types definition
570 enum KE_TASK_TYPE
571 {
572 #if (BLE_APP_PRESENT)
573     TASK_APP,
574 #endif // (BLE_APP_PRESENT)
575 
576 #if (BLE_HOST_PRESENT)
577     TASK_L2CC,    // L2CAP Controller Task
578     TASK_GATTM,   // Generic Attribute Profile Manager Task
579     TASK_GATTC,   // Generic Attribute Profile Controller Task
580     TASK_GAPM,    // Generic Access Profile Manager
581     TASK_GAPC,    // Generic Access Profile Controller
582     // allocate a certain number of profiles task
583     TASK_PRF_MAX = (TASK_GAPC + BLE_NB_PROFILES),
584 
585     #if (BLE_ISO_MODE_0_PROTOCOL)
586     TASK_AM0,     // BLE Audio Mode 0 Task
587     #endif // (BLE_ISO_MODE_0_PROTOCOL)
588 #endif // (BLE_HOST_PRESENT)
589 
590 #if (AHI_TL_SUPPORT)
591     TASK_AHI,
592 #endif // (AHI_TL_SUPPORT)
593 
594     #if (BLE_CIS || BLE_BIS)
595     TASK_GAPI,
596     #endif // (BLE_CIS || BLE_BIS)
597 
598     /// Maximum number of tasks
599     BLE_TASK_MAX,
600 
601     BLE_TASK_NONE = 0xFF,
602 };
603 
604 /// Kernel memory heaps types.
605 /*@TRACE*/
606 enum KE_MEM_HEAP
607 {
608     /// Memory allocated for environment variables
609     KE_MEM_ENV,
610     #if (BLE_HOST_PRESENT)
611     /// Memory allocated for Attribute database
612     KE_MEM_ATT_DB,
613     #endif // (BLE_HOST_PRESENT)
614     /// Memory allocated for kernel messages
615     KE_MEM_KE_MSG,
616     /// Non Retention memory block
617     KE_MEM_NON_RETENTION,
618     KE_MEM_BLOCK_MAX,
619 };
620 
621 
622 
623 #if (BT_EMB_PRESENT)
624 #define BT_HEAP_MSG_SIZE_      BT_HEAP_MSG_SIZE
625 #define BT_HEAP_ENV_SIZE_      BT_HEAP_ENV_SIZE
626 #else
627 #define BT_HEAP_MSG_SIZE_      0
628 #define BT_HEAP_ENV_SIZE_      0
629 #endif //BT_EMB_PRESENT
630 
631 #if (BLE_EMB_PRESENT)
632 #define BLE_HEAP_MSG_SIZE_     BLE_HEAP_MSG_SIZE
633 #define BLE_HEAP_ENV_SIZE_     BLE_HEAP_ENV_SIZE
634 #else
635 #define BLE_HEAP_MSG_SIZE_     0
636 #define BLE_HEAP_ENV_SIZE_     0
637 #endif //BLE_EMB_PRESENT
638 
639 #if (BLE_HOST_PRESENT)
640 
641 #define BLEHL_HEAP_MSG_SIZE_   BLEHL_HEAP_MSG_SIZE
642 #define BLEHL_HEAP_ENV_SIZE_   BLEHL_HEAP_ENV_SIZE
643 #define BLEHL_HEAP_DB_SIZE_    BLEHL_HEAP_DB_SIZE
644 #else
645 #define BLEHL_HEAP_MSG_SIZE_   0
646 #define BLEHL_HEAP_ENV_SIZE_   0
647 #define BLEHL_HEAP_DB_SIZE_    0
648 #endif //BLE_HOST_PRESENT
649 
650 #if (SECURE_CONNECTIONS && (BT_EMB_PRESENT || BLE_EMB_PRESENT))
651 #define ECC_HEAP_NON_RET_SIZE_   (328*2) // Could only have 2 ECC computations simultaneously
652 #else // (SECURE_CONNECTIONS && (BT_EMB_PRESENT || BLE_EMB_PRESENT))
653 #define ECC_HEAP_NON_RET_SIZE_   0
654 #endif // (SECURE_CONNECTIONS && (BT_EMB_PRESENT || BLE_EMB_PRESENT))
655 
656 /// Kernel Message Heap
657 #define RWIP_HEAP_MSG_SIZE         (  BT_HEAP_MSG_SIZE_      + \
658                                       BLE_HEAP_MSG_SIZE_     + \
659                                       BLEHL_HEAP_MSG_SIZE_      )
660 
661 /// Size of Environment heap
662 #define RWIP_HEAP_ENV_SIZE         ( BT_HEAP_ENV_SIZE_       + \
663                                      BLE_HEAP_ENV_SIZE_      + \
664                                      BLEHL_HEAP_ENV_SIZE_       )
665 
666 
667 /// Size of Attribute database heap
668 #define RWIP_HEAP_DB_SIZE          (  BLEHL_HEAP_DB_SIZE_  )
669 
670 /**
671  * Size of non-retention heap
672  *
673  * This heap can be used to split the RAM into 2 parts:
674  *    - an always-on part that can handle a certain number of links
675  *    - a secondary memory that could be powered-off when not used, and retained only when used
676  *
677  * With such mechanism, the previous heaps need to be reduced so that they can contain all required data
678  * in a light scenario (few connections, few profiles). Then the non-retention heap is sized in order to
679  * cover the worst case scenario (max connections, max profiles, etc ...)
680  *
681  * The current size show what is already known as not needing to be retained during deep sleep.
682  */
683 #define RWIP_HEAP_NON_RET_SIZE    ( ECC_HEAP_NON_RET_SIZE_ )
684 
685 /// Minimum sleep time to enter in deep sleep (in half slot).
686 #define RWIP_MINIMUM_SLEEP_TIME                (1)
687 
688 /******************************************************************************************/
689 /* -------------------------     CONFIGURABLE PARAMETERS     -----------------------------*/
690 /******************************************************************************************/
691 
692 /// List of parameters identifiers
693 enum PARAM_ID
694 {
695     /// Definition of the tag associated to each parameters
696     /// Local Bd Address
697     PARAM_ID_BD_ADDRESS                 = 0x01,
698     /// Device Name
699     PARAM_ID_DEVICE_NAME                = 0x02,
700     /// Radio Drift
701     PARAM_ID_LPCLK_DRIFT                = 0x07,
702     /// Radio Jitter
703     PARAM_ID_LPCLK_JITTER               = 0x08,
704     /// External wake-up time
705     PARAM_ID_EXT_WAKEUP_TIME            = 0x0D,
706     /// Oscillator wake-up time
707     PARAM_ID_OSC_WAKEUP_TIME            = 0x0E,
708     /// Radio wake-up time
709     PARAM_ID_RM_WAKEUP_TIME             = 0x0F,
710     /// UART baudrate
711     PARAM_ID_UART_BAUDRATE              = 0x10,
712     /// Enable sleep mode
713     PARAM_ID_SLEEP_ENABLE               = 0x11,
714     /// Enable External Wakeup
715     PARAM_ID_EXT_WAKEUP_ENABLE          = 0x12,
716     /// SP Private Key 192
717     PARAM_ID_SP_PRIVATE_KEY_P192        = 0x13,
718     /// SP Public Key 192
719     PARAM_ID_SP_PUBLIC_KEY_P192         = 0x14,
720 
721     /// Activity Move Configuration (enables/disables activity move for BLE connections and BT (e)SCO links)
722     PARAM_ID_ACTIVITY_MOVE_CONFIG       = 0x15,
723 
724     /// Enable/disable scanning for extended advertising PDUs
725     PARAM_ID_SCAN_EXT_ADV               = 0x16,
726 
727     /// Duration of the schedule reservation for long activities such as scan, inquiry, page, HDC advertising
728     PARAM_ID_SCHED_SCAN_DUR             = 0x17,
729 
730     /// Programming delay, margin for programming the baseband in advance of each activity (in half-slots)
731     PARAM_ID_PROG_DELAY                 = 0x18,
732 
733     /// Enable/disable channel assessment for BT and/or BLE
734     PARAM_ID_CH_ASS_EN                  = 0x19,
735 
736     /// Synchronous links configuration
737     PARAM_ID_SYNC_CONFIG                = 0x2C,
738     /// PCM Settings
739     PARAM_ID_PCM_SETTINGS               = 0x2D,
740     /// Sleep algorithm duration
741     PARAM_ID_SLEEP_ALGO_DUR             = 0x2E,
742     /// Tracer configuration
743     PARAM_ID_TRACER_CONFIG              = 0x2F,
744 
745     /// Diagport configuration
746     PARAM_ID_DIAG_BT_HW                 = 0x30,
747     PARAM_ID_DIAG_BLE_HW                = 0x31,
748     PARAM_ID_DIAG_SW                    = 0x32,
749     PARAM_ID_DIAG_DM_HW                 = 0x33,
750     PARAM_ID_DIAG_PLF                   = 0x34,
751 
752     /// IDC selection (for audio demo)
753     PARAM_ID_IDCSEL_PLF                 = 0x37,
754 
755     /// RSSI threshold tags
756     PARAM_ID_RSSI_HIGH_THR              = 0x3A,
757     PARAM_ID_RSSI_LOW_THR               = 0x3B,
758     PARAM_ID_RSSI_INTERF_THR            = 0x3C,
759 
760     /// RF BTIPT
761     PARAM_ID_RF_BTIPT_VERSION          = 0x3E,
762     PARAM_ID_RF_BTIPT_XO_SETTING       = 0x3F,
763 
764     PARAM_ID_BT_LINK_KEY_FIRST          = 0x60,
765     PARAM_ID_BT_LINK_KEY_LAST           = 0x67,
766 
767     PARAM_ID_BLE_LINK_KEY_FIRST         = 0x70,
768     PARAM_ID_BLE_LINK_KEY_LAST          = 0x7F,
769     /// SC Private Key (Low Energy)
770     PARAM_ID_LE_PRIVATE_KEY_P256        = 0x80,
771     /// SC Public Key (Low Energy)
772     PARAM_ID_LE_PUBLIC_KEY_P256         = 0x81,
773     /// SC Debug: Used Fixed Private Key from NVDS (Low Energy)
774     PARAM_ID_LE_DBG_FIXED_P256_KEY      = 0x82,
775     /// SP Private Key (classic BT)
776     PARAM_ID_SP_PRIVATE_KEY_P256        = 0x83,
777     /// SP Public Key (classic BT)
778     PARAM_ID_SP_PUBLIC_KEY_P256         = 0x84,
779 
780     /// LE Coded PHY 500 Kbps selection
781     PARAM_ID_LE_CODED_PHY_500           = 0x85,
782 
783     /// Application specific
784     PARAM_ID_APP_SPECIFIC_FIRST         = 0x90,
785     PARAM_ID_APP_SPECIFIC_LAST          = 0xAF,
786 };
787 
788 /// List of parameters lengths
789 enum PARAM_LEN
790 {
791      // Definition of length associated to each parameters
792      /// Local Bd Address
793      PARAM_LEN_BD_ADDRESS                 = 6,
794      /// Device Name
795      PARAM_LEN_DEVICE_NAME                = 248,
796      /// Low power clock drift
797      PARAM_LEN_LPCLK_DRIFT                = 2,
798      /// Low power clock jitter
799      PARAM_LEN_LPCLK_JITTER               = 1,
800      /// External wake-up time
801      PARAM_LEN_EXT_WAKEUP_TIME            = 2,
802      /// Oscillator wake-up time
803      PARAM_LEN_OSC_WAKEUP_TIME            = 2,
804      /// Radio wake-up time
805      PARAM_LEN_RM_WAKEUP_TIME             = 2,
806      /// UART baudrate
807      PARAM_LEN_UART_BAUDRATE              = 4,
808      /// Enable sleep mode
809      PARAM_LEN_SLEEP_ENABLE               = 1,
810      /// Enable External Wakeup
811      PARAM_LEN_EXT_WAKEUP_ENABLE          = 1,
812      /// SP Private Key 192
813      PARAM_LEN_SP_PRIVATE_KEY_P192        = 24,
814      /// SP Public Key 192
815      PARAM_LEN_SP_PUBLIC_KEY_P192         = 48,
816 
817      /// Activity Move Configuration
818      PARAM_LEN_ACTIVITY_MOVE_CONFIG       = 1,
819 
820      /// Enable/disable scanning for extended advertising PDUs
821      PARAM_LEN_SCAN_EXT_ADV               = 1,
822 
823      /// Duration of the schedule reservation for long activities such as scan, inquiry, page, HDC advertising
824      PARAM_LEN_SCHED_SCAN_DUR             = 2,
825 
826      /// Programming delay, margin for programming the baseband in advance of each activity (in half-slots)
827      PARAM_LEN_PROG_DELAY                 = 1,
828 
829      /// Enable/disable channel assessment for BT and/or BLE
830      PARAM_LEN_CH_ASS_EN                  = 1,
831 
832      /// Synchronous links configuration
833      PARAM_LEN_SYNC_CONFIG                = 2,
834      /// PCM Settings
835      PARAM_LEN_PCM_SETTINGS               = 8,
836      /// Tracer configuration
837      PARAM_LEN_TRACER_CONFIG              = 4,
838 
839      /// Diagport configuration
840      PARAM_LEN_DIAG_BT_HW                 = 4,
841      PARAM_LEN_DIAG_BLE_HW                = 4,
842      PARAM_LEN_DIAG_SW                    = 4,
843      PARAM_LEN_DIAG_DM_HW                 = 4,
844      PARAM_LEN_DIAG_PLF                   = 4,
845 
846      /// IDC selection (for audio demo)
847      PARAM_LEN_IDCSEL_PLF                 = 4,
848 
849      /// RSSI thresholds
850      PARAM_LEN_RSSI_THR                   = 1,
851 
852      /// RF BTIPT
853      PARAM_LEN_RF_BTIPT_VERSION          = 1,
854      PARAM_LEN_RF_BTIPT_XO_SETTING       = 1,
855 
856      /// Link keys
857      PARAM_LEN_BT_LINK_KEY                = 22,
858      PARAM_LEN_BLE_LINK_KEY               = 48,
859 
860      /// P256
861      PARAM_LEN_PRIVATE_KEY_P256           = 32,
862      PARAM_LEN_PUBLIC_KEY_P256            = 64,
863      PARAM_LEN_DBG_FIXED_P256_KEY         = 1,
864 
865      /// LE Coded PHY 500 Kbps selection
866      PARAM_LEN_LE_CODED_PHY_500           = 1,
867 };
868 
869 /******************************************************************************************/
870 /* -------------------------        BT-BLE COEX        -----------------------------------*/
871 /******************************************************************************************/
872 
873 ///To let the HW using the default values set in the registers
874 #define RW_BLE_PTI_PRIO_AUTO    15
875 
876 #if (BLE_EMB_PRESENT || BT_EMB_PRESENT)
877 /// Enable and diable definition for the PTI
878 ///Enable TX busy signal
879 #define RWIP_PTI_TXEN           1
880 ///Disable TX busy signal
881 #define RWIP_PTI_TXDIS          0
882 /// Tx busy position
883 #define RWIP_TXBSY_POS          0
884 
885 ///Enable RX busy signal
886 #define RWIP_PTI_RXEN           1
887 ///Disable RX busy signal
888 #define RWIP_PTI_RXDIS          0
889 /// Rx busy position
890 #define RWIP_RXBSY_POS          1
891 
892 ///Enable do not abort TX
893 #define RWIP_PTI_DNABORTEN      1
894 ///Disable do not abort TX
895 #define RWIP_PTI_DNABORTDIS     0
896 /// Do not abort busy position
897 #define RWIP_DNABORT_POS        2
898 
899 /// SAM disabled
900 #define RWIP_SAM_DIS            0
901 /// SAM enabled
902 #define RWIP_SAM_EN             1
903 /// SAM enable position
904 #define RWIP_SAMEN_POS          3
905 
906 /// Bit masking
907 #define RWIP_COEX_BIT_MASK      1
908 
909 /// Coex configuration index
910 enum rwip_coex_config_idx
911 {
912     #if (BT_EMB_PRESENT)
913     RWIP_COEX_MSSWITCH_IDX,
914     RWIP_COEX_SNIFFATT_IDX,
915     RWIP_COEX_PAGE_IDX,
916     RWIP_COEX_PSCAN_IDX,
917     RWIP_COEX_INQ_IDX,
918     RWIP_COEX_INQRES_IDX,
919     RWIP_COEX_SCORSVD_IDX,
920     RWIP_COEX_BCAST_IDX,
921     RWIP_COEX_CONNECT_IDX,
922     #endif //#if (BT_EMB_PRESENT)
923     #if (BLE_EMB_PRESENT)
924     RWIP_COEX_CON_IDX,
925     RWIP_COEX_CON_DATA_IDX,
926     RWIP_COEX_ADV_IDX,
927     RWIP_COEX_SCAN_IDX,
928     RWIP_COEX_INIT_IDX,
929     #endif // #if (BLE_EMB_PRESENT)
930     /// Max configuration index
931     RWIP_COEX_CFG_MAX,
932 };
933 #endif //(BLE_EMB_PRESENT || BT_EMB_PRESENT)
934 
935 /******************************************************************************************/
936 /* -------------------------     BT-BLE PRIORITIES     -----------------------------------*/
937 /******************************************************************************************/
938 #if (BLE_EMB_PRESENT || BT_EMB_PRESENT)
939 /// Priority index definition
940 enum rwip_prio_idx
941 {
942     #if (BT_EMB_PRESENT)
943     /// ACL event default priority
944     RWIP_PRIO_ACL_DFT_IDX,
945     /// ACL event priority with activity
946     RWIP_PRIO_ACL_ACT_IDX,
947     /// ACL Role Switch event default priority
948     RWIP_PRIO_ACL_RSW_IDX,
949     /// ACL sniff event default priority
950     RWIP_PRIO_ACL_SNIFF_DFT_IDX,
951     /// ACL sniff transition event default priority
952     RWIP_PRIO_ACL_SNIFF_TRANS_IDX,
953     #if MAX_NB_SYNC
954     /// SCO event default priority
955     RWIP_PRIO_SCO_DFT_IDX,
956     #endif //MAX_NB_SYNC
957     /// Broadcast ACL event default priority
958     RWIP_PRIO_BCST_DFT_IDX,
959     /// Broadcast ACL event with LMP activity priority
960     RWIP_PRIO_BCST_ACT_IDX,
961     /// CSB RX event default priority
962     RWIP_PRIO_CSB_RX_DFT_IDX,
963     /// CSB TX event default priority
964     RWIP_PRIO_CSB_TX_DFT_IDX,
965     /// Inquiry event default priority
966     RWIP_PRIO_INQ_DFT_IDX,
967     /// Inquiry Scan event default priority
968     RWIP_PRIO_ISCAN_DFT_IDX,
969     /// Page event default priority
970     RWIP_PRIO_PAGE_DFT_IDX,
971     /// Page event default priority
972     RWIP_PRIO_PAGE_1ST_PKT_IDX,
973     /// Page first packet event default priority
974     RWIP_PRIO_PCA_DFT_IDX,
975     /// Page scan event default priority
976     RWIP_PRIO_PSCAN_DFT_IDX,
977     /// Page scan event priority increment when canceled
978     RWIP_PRIO_PSCAN_1ST_PKT_IDX,
979     /// Synchronization Scan event default priority
980     RWIP_PRIO_SSCAN_DFT_IDX,
981     /// Synchronization Train event default priority
982     RWIP_PRIO_STRAIN_DFT_IDX,
983     #endif //#if (BT_EMB_PRESENT)
984     #if (BLE_EMB_PRESENT)
985     /// Default priority for scanning events
986     RWIP_PRIO_SCAN_IDX,
987     /// Default priority for auxillary scan/init (no_asap) rx events
988     RWIP_PRIO_AUX_RX_IDX,
989     /// Default priority for periodic adv rx events
990     RWIP_PRIO_PER_ADV_RX_DFT_IDX,
991     /// Default priority for initiating events
992     RWIP_PRIO_INIT_IDX,
993     /// LE connection events default priority
994     RWIP_PRIO_CONNECT_DFT_IDX,
995     /// LE connection events priority with activity
996     RWIP_PRIO_CONNECT_ACT_IDX,
997     /// Default priority for advertising events
998     RWIP_PRIO_ADV_IDX,
999     /// Default priority for advertising high duty cycle events
1000     RWIP_PRIO_ADV_HDC_IDX,
1001     /// Default priority for aux advertising events
1002     RWIP_PRIO_ADV_AUX_IDX,
1003     /// Default priority for periodic advertising events
1004     RWIP_PRIO_PER_ADV_IDX,
1005     /// Default priority for resolvable private addresses renewal event
1006     RWIP_PRIO_RPA_RENEW_IDX,
1007     #if (BLE_CIS)
1008     /// Default priority for master CIS connect events
1009     RWIP_PRIO_M_CIS_IDX,
1010     /// Default priority for slave CIS connect events
1011     RWIP_PRIO_S_CIS_IDX,
1012     #endif // (BLE_CIS)
1013     #if (BLE_BIS)
1014     /// Default priority for master BIS events
1015     RWIP_PRIO_M_BIS_IDX,
1016     /// Default priority for slave BIS events
1017     RWIP_PRIO_S_BIS_IDX,
1018     /// Priority for Scanning activity
1019     RWIP_PRIO_BIS_SCAN_IDX,
1020     #endif // (BLE_BIS)
1021     #endif // #if (BLE_EMB_PRESENT)
1022     RWIP_PRIO_IDX_MAX
1023 };
1024 /// Default priority value definition
1025 enum rwip_prio_dft
1026 {
1027     #if (BT_EMB_PRESENT)
1028     /// ACL event default priority
1029     RWIP_PRIO_ACL_DFT               = 5,
1030     /// ACL event priority with activity
1031     RWIP_PRIO_ACL_ACT               = 10,
1032     /// ACL Role Switch event default priority
1033     RWIP_PRIO_ACL_RSW               = 20,
1034     /// ACL sniff event default priority
1035     RWIP_PRIO_ACL_SNIFF_DFT         = 15,
1036     /// ACL sniff transition event default priority
1037     RWIP_PRIO_ACL_SNIFF_TRANS       = 10,
1038     #if MAX_NB_SYNC
1039     /// SCO event default priority
1040     RWIP_PRIO_SCO_DFT               = 18,
1041     #endif //MAX_NB_SYNC
1042     /// Broadcast ACL event default priority
1043     RWIP_PRIO_BCST_DFT              = 5,
1044     /// Broadcast ACL event with LMP activity priority
1045     RWIP_PRIO_BCST_ACT              = 10,
1046     /// CSB RX event default priority
1047     RWIP_PRIO_CSB_RX_DFT            = 10,
1048     /// CSB TX event default priority
1049     RWIP_PRIO_CSB_TX_DFT            = 10,
1050     /// Inquiry event default priority
1051     RWIP_PRIO_INQ_DFT               = 5,
1052     /// Inquiry Scan event default priority
1053     RWIP_PRIO_ISCAN_DFT             = 5,
1054     /// Page event default priority
1055     RWIP_PRIO_PAGE_DFT              = 8,
1056     /// Page first packet event default priority
1057     RWIP_PRIO_PAGE_1ST_PKT          = 20,
1058     /// PCA event default priority
1059     RWIP_PRIO_PCA_DFT               = 20,
1060     /// Page scan event default priority
1061     RWIP_PRIO_PSCAN_DFT             = 8,
1062     /// Page scan event priority increment when canceled
1063     RWIP_PRIO_PSCAN_1ST_PKT         = 20,
1064     /// Synchronization Scan event default priority
1065     RWIP_PRIO_SSCAN_DFT             = 10,
1066     /// Synchronization Train event default priority
1067     RWIP_PRIO_STRAIN_DFT            = 10,
1068     #endif //#if (BT_EMB_PRESENT)
1069     #if (BLE_EMB_PRESENT)
1070     /// Default priority for scanning events
1071     RWIP_PRIO_SCAN_DFT              = 5,
1072     /// Default priority for auxillary scan/init (no_asap) rx events
1073     RWIP_PRIO_AUX_RX_DFT            = 12,
1074     /// Default priority for periodic adv rx events
1075     RWIP_PRIO_PER_ADV_RX_DFT        = 16,
1076     /// Default priority for initiating events
1077     RWIP_PRIO_INIT_DFT              = 10,
1078     /// LE connection events default priority
1079     RWIP_PRIO_CONNECT_DFT           = 14,
1080     /// LE connection events priority with activity
1081     RWIP_PRIO_CONNECT_ACT           = 16,
1082     /// Default priority for advertising events
1083     RWIP_PRIO_ADV_DFT               = 5,
1084     /// Default priority for advertising high duty cycle events
1085     RWIP_PRIO_ADV_HDC_DFT           = 10,
1086     /// Default priority for aux advertising events
1087     RWIP_PRIO_ADV_AUX_DFT           = 12,
1088     /// Default priority for periodic advertising events
1089     RWIP_PRIO_PER_ADV_DFT           = 10,
1090     /// Default priority for resolvable private addresses renewal event
1091     RWIP_PRIO_RPA_RENEW_DFT         = 10,
1092     #if (BLE_CIS)
1093     /// Default priority for Master CIS Connect
1094     RWIP_PRIO_M_CIS_DFT             = 20,
1095     /// Default priority for Slave CIS Connect
1096     RWIP_PRIO_S_CIS_DFT             = 20,
1097     #endif // (BLE_CIS)
1098     #if (BLE_BIS)
1099     /// Default priority for Master BIS
1100     RWIP_PRIO_M_BIS_DFT             = 20,
1101     /// Default priority for Slave BIS
1102     RWIP_PRIO_S_BIS_DFT             = 20,
1103     /// Default priority for Scanning activity
1104     RWIP_PRIO_BIS_SCAN_DFT          = 4,
1105     #endif // (BLE_BIS)
1106     #endif // #if (BLE_EMB_PRESENT)
1107     /// Max priority
1108     RWIP_PRIO_MAX                   = 31,
1109 };
1110 /// Default increment value definition
1111 enum rwip_incr_dft
1112 {
1113     #if (BT_EMB_PRESENT)
1114     /// ACL event default increment
1115     RWIP_INCR_ACL_DFT               = 1,
1116     /// ACL event increment with activity
1117     RWIP_INCR_ACL_ACT               = 1,
1118     /// ACL Role Switch event default increment
1119     RWIP_INCR_ACL_RSW               = 1,
1120     /// ACL sniff event default increment
1121     RWIP_INCR_ACL_SNIFF_DFT         = 1,
1122     /// ACL sniff transition event default increment
1123     RWIP_INCR_ACL_SNIFF_TRANS       = 1,
1124     #if MAX_NB_SYNC
1125     /// SCO event default increment
1126     RWIP_INCR_SCO_DFT               = 1,
1127     #endif //MAX_NB_SYNC
1128     /// Broadcast ACL event default increment
1129     RWIP_INCR_BCST_DFT              = 1,
1130     /// Broadcast ACL event with LMP activity increment
1131     RWIP_INCR_BCST_ACT              = 1,
1132     /// CSB RX event default increment
1133     RWIP_INCR_CSB_RX_DFT            = 1,
1134     /// CSB TX event default increment
1135     RWIP_INCR_CSB_TX_DFT            = 1,
1136     /// Inquiry event default increment
1137     RWIP_INCR_INQ_DFT               = 1,
1138     /// Inquiry Scan event default increment
1139     RWIP_INCR_ISCAN_DFT             = 1,
1140     /// Page event default increment
1141     RWIP_INCR_PAGE_DFT              = 1,
1142     /// Page event default increment
1143     RWIP_INCR_PAGE_1ST_PKT          = 2,
1144     /// Page first packet event default increment
1145     RWIP_INCR_PCA_DFT               = 1,
1146     /// Page scan event default increment
1147     RWIP_INCR_PSCAN_DFT             = 1,
1148     /// Page scan event increment increment when canceled
1149     RWIP_INCR_PSCAN_1ST_PKT         = 1,
1150     /// Synchronization Scan event default increment
1151     RWIP_INCR_SSCAN_DFT             = 1,
1152     /// Synchronization Train event default increment
1153     RWIP_INCR_STRAIN_DFT            = 1,
1154     #endif //#if (BT_EMB_PRESENT)
1155     #if (BLE_EMB_PRESENT)
1156     /// Default increment for scanning events
1157     RWIP_INCR_SCAN_DFT              = 1,
1158     /// Default increment for auxillary scan/init (no_asap) rx events
1159     RWIP_INCR_AUX_RX_DFT            = 1,
1160     /// Default increment for periodic adv rx events
1161     RWIP_INCR_PER_ADV_RX_DFT        = 1,
1162     /// Default increment for initiating events
1163     RWIP_INCR_INIT_DFT              = 1,
1164     /// LE connection events default increment
1165     RWIP_INCR_CONNECT_DFT           = 1,
1166     /// LE connection events increment with activity
1167     RWIP_INCR_CONNECT_ACT           = 1,
1168     /// Default increment for advertising events
1169     RWIP_INCR_ADV_DFT               = 1,
1170     /// Default increment for advertising high duty cycle events
1171     RWIP_INCR_ADV_HDC_PRIO_DFT      = 1,
1172     /// Default increment for aux advertising events
1173     RWIP_INCR_ADV_AUX_DFT           = 1,
1174     /// Default increment for periodic advertising events
1175     RWIP_INCR_PER_ADV_DFT           = 1,
1176     /// Default increment for resolvable private addresses renewal event
1177     RWIP_INCR_RPA_RENEW_DFT         = 1,
1178     #if (BLE_CIS)
1179     /// Default priority for Master CIS Connect
1180     RWIP_INCR_M_CIS_DFT             = 1,
1181     /// Default priority for Slave CIS Connect
1182     RWIP_INCR_S_CIS_DFT             = 1,
1183     #endif // (BLE_CIS)
1184     #if (BLE_BIS)
1185     /// Default priority for Master BIS
1186     RWIP_INCR_M_BIS_DFT             = 1,
1187     /// Default priority for Slave BIS
1188     RWIP_INCR_S_BIS_DFT             = 1,
1189     /// Default priority increment for Scanning procedure
1190     RWIP_INCR_BIS_SCAN_DFT          = 1,
1191     #endif // (BLE_BIS)
1192     #endif // #if (BLE_EMB_PRESENT)
1193 };
1194 #endif //#if (BLE_EMB_PRESENT || BT_EMB_PRESENT)
1195 
1196 #endif // _BLE_IP_CONFIG_H
1197