1 /*
2  * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __BT_USER_CONFIG_H__
8 #define __BT_USER_CONFIG_H__
9 #include "sdkconfig.h"
10 
11 #define UC_TRACE_LEVEL_NONE                 0          /* No trace messages to be generated    */
12 #define UC_TRACE_LEVEL_ERROR                1          /* Error condition trace messages       */
13 #define UC_TRACE_LEVEL_WARNING              2          /* Warning condition trace messages     */
14 #define UC_TRACE_LEVEL_API                  3          /* API traces                           */
15 #define UC_TRACE_LEVEL_EVENT                4          /* Debug messages for events            */
16 #define UC_TRACE_LEVEL_DEBUG                5          /* Full debug messages                  */
17 #define UC_TRACE_LEVEL_VERBOSE              6          /* Verbose debug messages               */
18 
19 //DYNAMIC ENV ALLOCATOR
20 #ifdef CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY
21 #define UC_BT_BLE_DYNAMIC_ENV_MEMORY            CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY
22 #else
23 #define UC_BT_BLE_DYNAMIC_ENV_MEMORY            FALSE
24 #endif
25 
26 #ifdef CONFIG_BT_STACK_NO_LOG
27 #define UC_BT_STACK_NO_LOG               CONFIG_BT_STACK_NO_LOG
28 #else
29 #define UC_BT_STACK_NO_LOG               FALSE
30 #endif
31 
32 /**********************************************************
33  * Thread/Task reference
34  **********************************************************/
35 #ifdef CONFIG_BT_BLUEDROID_PINNED_TO_CORE
36 #define UC_TASK_PINNED_TO_CORE              (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY)
37 #else
38 #define UC_TASK_PINNED_TO_CORE              (0)
39 #endif
40 
41 #ifdef CONFIG_BT_BTC_TASK_STACK_SIZE
42 #define UC_BTC_TASK_STACK_SIZE              CONFIG_BT_BTC_TASK_STACK_SIZE
43 #else
44 #define UC_BTC_TASK_STACK_SIZE              4096
45 #endif
46 
47 /**********************************************************
48  * Alarm reference
49  **********************************************************/
50 #ifdef CONFIG_BT_ALARM_MAX_NUM
51 #define UC_ALARM_MAX_NUM                    CONFIG_BT_ALARM_MAX_NUM
52 #else
53 #define UC_ALARM_MAX_NUM                    50
54 #endif
55 
56 /**********************************************************
57  * Trace reference
58  **********************************************************/
59 
60 #ifdef CONFIG_LOG_DEFAULT_LEVEL
61 #define UC_LOG_DEFAULT_LEVEL                CONFIG_LOG_DEFAULT_LEVEL
62 #else
63 #define UC_LOG_DEFAULT_LEVEL                3
64 #endif
65 
66 #ifdef CONFIG_BOOTLOADER_LOG_LEVEL
67 #define UC_BOOTLOADER_LOG_LEVEL             CONFIG_BOOTLOADER_LOG_LEVEL
68 #else
69 #define UC_BOOTLOADER_LOG_LEVEL             3
70 #endif
71 
72 #ifdef CONFIG_BT_LOG_BTC_TRACE_LEVEL
73 #define UC_BT_LOG_BTC_TRACE_LEVEL           CONFIG_BT_LOG_BTC_TRACE_LEVEL
74 #else
75 #define UC_BT_LOG_BTC_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
76 #endif
77 
78 #ifdef CONFIG_BT_LOG_OSI_TRACE_LEVEL
79 #define UC_BT_LOG_OSI_TRACE_LEVEL           CONFIG_BT_LOG_OSI_TRACE_LEVEL
80 #else
81 #define UC_BT_LOG_OSI_TRACE_LEVEL           UC_TRACE_LEVEL_WARNING
82 #endif
83 
84 #ifdef CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
85 #define UC_BT_LOG_BLUFI_TRACE_LEVEL         CONFIG_BT_LOG_BLUFI_TRACE_LEVEL
86 #else
87 #define UC_BT_LOG_BLUFI_TRACE_LEVEL         UC_TRACE_LEVEL_WARNING
88 #endif
89 
90 //BLUFI
91 #if  defined(CONFIG_BT_BLE_BLUFI_ENABLE) || defined(CONFIG_BT_NIMBLE_BLUFI_ENABLE)
92 #define UC_BT_BLUFI_ENABLE                  TRUE
93 #else
94 #define UC_BT_BLUFI_ENABLE                  FALSE
95 #endif
96 
97 //MEMORY
98 #ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
99 #define UC_BT_BLUEDROID_MEM_DEBUG TRUE
100 #else
101 #define UC_BT_BLUEDROID_MEM_DEBUG FALSE
102 #endif
103 
104 #ifdef CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
105 #define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST    CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
106 #else
107 #define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST    FALSE
108 #endif
109 
110 #ifdef CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
111 #define UC_BT_ABORT_WHEN_ALLOCATION_FAILS       CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
112 #else
113 #define UC_BT_ABORT_WHEN_ALLOCATION_FAILS       FALSE
114 #endif
115 
116 //HCI LOG
117 #ifdef CONFIG_BT_HCI_LOG_DEBUG_EN
118 #define UC_BT_HCI_LOG_DEBUG_EN  TRUE
119 #else
120 #define UC_BT_HCI_LOG_DEBUG_EN  FALSE
121 #endif
122 
123 #ifdef CONFIG_BT_HCI_LOG_DATA_BUFFER_SIZE
124 #define UC_BT_HCI_LOG_DATA_BUFFER_SIZE  CONFIG_BT_HCI_LOG_DATA_BUFFER_SIZE
125 #else
126 #define UC_BT_HCI_LOG_DATA_BUFFER_SIZE  (5)
127 #endif
128 
129 #ifdef CONFIG_BT_HCI_LOG_ADV_BUFFER_SIZE
130 #define UC_BT_HCI_LOG_ADV_BUFFER_SIZE CONFIG_BT_HCI_LOG_ADV_BUFFER_SIZE
131 #else
132 #define UC_BT_HCI_LOG_ADV_BUFFER_SIZE  (5)
133 #endif
134 
135 #endif /* __BT_USER_CONFIG_H__ */
136