1 /*******************************************************************************
2  * @file  rsi_bt_common_config.h
3  * @brief : This file contains user configurable details to configure the device
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
7  *******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  ******************************************************************************/
30 
31 #ifndef RSI_BT_COMMON_CONFIG_H
32 #define RSI_BT_COMMON_CONFIG_H
33 /** @addtogroup BT_BLE_CONSTANTS
34  *  @{
35  */
36 
37 #ifndef BD_ADDR_ARRAY_LEN
38 #define BD_ADDR_ARRAY_LEN 18 ///< length of the Bluetooth device address array
39 #endif
40 #ifndef RSI_LINKKEY_REPLY_SIZE
41 #define RSI_LINKKEY_REPLY_SIZE 16 ///< size of the link key reply
42 #endif
43 // WLAN + BT Classic coex mode
44 #ifndef RSI_OPERMODE_WLAN_BT_CLASSIC
45 #define RSI_OPERMODE_WLAN_BT_CLASSIC 5 ///< operation mode for WLAN and Bluetooth Classic
46 #endif
47 #ifndef RSI_BT_BLE_DUAL_MODE
48 #define RSI_BT_BLE_DUAL_MODE 9 ///< operation mode for Bluetooth and BLE dual mode
49 #endif
50 
51 #ifndef BT_GLOBAL_BUFF_LEN
52 #define BT_GLOBAL_BUFF_LEN 10000 ///< size of the global buffer for Bluetooth operations
53 #endif
54 /*=======================================================================*/
55 // Discovery command parameters
56 /*=======================================================================*/
57 
58 // Discovery mode
59 // Start the discoverable mode
60 #ifndef START_DISCOVERY
61 #define START_DISCOVERY 0x01 ///< command to start device discovery
62 #endif
63 
64 // Start the limited discoverable mode
65 #ifndef START_LIMITED_DISCOVERY
66 #define START_LIMITED_DISCOVERY 0x02 ///< command to start limited discovery mode
67 #endif
68 
69 // Stop the discoverable mode
70 #ifndef STOP_DISCOVERY
71 #define STOP_DISCOVERY 0x00 ///< command to stop discovery mode
72 #endif
73 /*=======================================================================*/
74 // Connectability command parameters
75 /*=======================================================================*/
76 
77 // Connectable mode
78 // Start the connectable mode
79 #ifndef CONNECTABLE
80 #define CONNECTABLE 0x01 ///< state indicating the device is connectable
81 #endif
82 
83 // Stop the connectable mode
84 #ifndef NON_CONNECTABLE
85 #define NON_CONNECTABLE 0x00 ///< state indicating the device is non-connectable
86 #endif
87 
88 /*=======================================================================*/
89 //  SSP Confirmation command parameters
90 /*=======================================================================*/
91 // Confimation type
92 // Accept confirmation
93 #ifndef ACCEPT
94 #define ACCEPT 0x01 ///< SSP confirmation command parameter indicating acceptance
95 #endif
96 
97 // Reject confirmation
98 #ifndef REJECT
99 #define REJECT 0x00 ///< SSP confirmation command parameter indicating rejection
100 #endif
101 /*=======================================================================*/
102 //  BT classic profile enable BITS
103 /*=======================================================================*/
104 #ifndef RSI_SPP_PROFILE_BIT
105 #define RSI_SPP_PROFILE_BIT BIT(0) ///< bitmask to enable the SPP profile in Bluetooth Classic (BIT(0))
106 #endif
107 
108 #ifndef RSI_A2DP_PROFILE_BIT
109 #define RSI_A2DP_PROFILE_BIT BIT(1) ///< bitmask to enable the A2DP profile in Bluetooth Classic (BIT(1))
110 #endif
111 
112 #ifndef RSI_AVRCP_PROFILE_BIT
113 #define RSI_AVRCP_PROFILE_BIT BIT(2) ///< bitmask to enable the AVRCP profile in Bluetooth Classic (BIT(2))
114 #endif
115 
116 #ifndef RSI_HFP_PROFILE_BIT
117 #define RSI_HFP_PROFILE_BIT BIT(3) ///< bitmask to enable the HFP profile in Bluetooth Classic (BIT(3))
118 #endif
119 
120 #ifndef RSI_PBAP_PROFILE_BIT
121 #define RSI_PBAP_PROFILE_BIT \
122   BIT(4) #define RSI_PBAP_PROFILE_BIT BIT(4) ///< bitmask to enable the PBAP profile in Bluetooth Classic (BIT(4))
123 #endif
124 /*=======================================================================*/
125 //  A2DP Profile Related
126 /*=======================================================================*/
127 
128 #ifndef A2DP_BURST_MODE
129 #define A2DP_BURST_MODE 1 ///< A2DP profile setting for burst mode ,  0 - Disable, 1 - Enable
130 #endif
131 
132 #ifndef A2DP_BURST_SIZE
133 #define A2DP_BURST_SIZE 1 ///<  Number of PCM/MP3 packets buffered
134 #endif
135 
136 #ifndef PCM_AUDIO
137 #define PCM_AUDIO 1 ///< Audio mode using PCM (Pulse Code Modulation)
138 #endif
139 #ifndef SBC_AUDIO
140 #define SBC_AUDIO 2 ///< Audio mode using SBC (Subband Coding)
141 #endif
142 #ifndef MP3_AUDIO
143 #define MP3_AUDIO 3 ///< Audio mode using MP3 (MPEG-1 Audio Layer 3)
144 #endif
145 
146 #ifndef RSI_AUDIO_DATA_TYPE
147 #define RSI_AUDIO_DATA_TYPE \
148   SBC_AUDIO ///< Defines the audio data type for the A2DP profile as SBC (Subband Coding) (Value = SBC_AUDIO)
149 #endif
150 #ifndef PCM_INPUT_BUFFER_SIZE
151 #define PCM_INPUT_BUFFER_SIZE (30 * 512) ///< Size of the PCM input buffer in bytes
152 #endif
153 
154 #ifndef MP3_INPUT_BUFFER_SIZE
155 #define MP3_INPUT_BUFFER_SIZE (10 * 512) ///< Size of the MP3 input buffer in bytes
156 #endif
157 
158 #ifndef BIN_FILE
159 #define BIN_FILE 1 ///< File type indicating binary format
160 #endif
161 #ifndef BT_ARRAY
162 #define BT_ARRAY 2 ///< Array type for Bluetooth data
163 #endif
164 #ifndef SD_BIN_FILE
165 #define SD_BIN_FILE 3 ///< File type indicating a binary format for SD
166 #endif
167 
168 #ifndef RSI_AUDIO_DATA_SRC
169 #define RSI_AUDIO_DATA_SRC BIN_FILE ///< Defines the audio data source as a binary file (Value = BIN_FILE)
170 #endif
171 
172 #ifndef PRE_ENC_BUF_LEN
173 #define PRE_ENC_BUF_LEN 8 ///< Length of the pre-encoded buffer (Value = 8)
174 #endif
175 
176 //avdtp related defines
177 #ifndef ACCEPTOR_ROLE
178 #define ACCEPTOR_ROLE 1 ///< AVDTP role indicating the acceptor (Value = 1)
179 #endif
180 #ifndef INITIATOR_ROLE
181 #define INITIATOR_ROLE 2 ///< AVDTP role indicating the initiator (Value = 2)
182 #endif
183 #ifndef ANY_ROLE
184 #define ANY_ROLE 3 ///< AVDTP role indicating any role
185 #endif
186 
187 #ifndef RSI_BT_MAX_PAYLOAD_SIZE
188 #define RSI_BT_MAX_PAYLOAD_SIZE \
189   1040 ///< BT MTU size changes //310 /* Max supported is 200, but 190 gives optimum Tx throughput */
190 #endif
191 
192 #ifndef BT_BDR_MODE
193 #define BT_BDR_MODE 0 ///< 1 - HP chain
194 #endif
195 
196 #ifndef USE_REM_MTU_SIZE_ONLY
197 #define USE_REM_MTU_SIZE_ONLY 1 ///< Flag to use only the remote MTU size
198 #endif
199 
200 #ifndef TA_BASED_ENCODER
201 #define TA_BASED_ENCODER 0 ///< Encoder type based on TA
202 #endif
203 /** @} */
204 
205 /*=======================================================================*/
206 // Added default macros which was expected to be defined in the ble_config.h
207 /*=======================================================================*/
208 #ifndef RSI_BLE_SET_RAND_ADDR
209 #define RSI_BLE_SET_RAND_ADDR "00:23:A7:12:34:56"
210 #endif
211 
212 #ifndef RSI_BLE_MAX_NBR_PERIPHERALS
213 #define RSI_BLE_MAX_NBR_PERIPHERALS 3
214 #endif
215 
216 #ifndef RSI_BLE_MAX_NBR_CENTRALS
217 #define RSI_BLE_MAX_NBR_CENTRALS 1
218 #endif
219 
220 #endif //RSI_BT_COMMON_CONFIG_H
221