1# SPDX-License-Identifier: Apache-2.0
2
3if(CONFIG_BT_CTLR_ADVANCED_FEATURES)
4  message(WARNING "\nCONFIG_BT_CTLR_ADVANCED_FEATURES=y, Advanced Features' "
5                  "default value change could change Zephyr Bluetooth "
6                  "Controller's functional behavior.")
7endif()
8
9zephyr_library()
10
11zephyr_library_sources(
12  util/mem.c
13  util/memq.c
14  util/mayfly.c
15  util/dbuf.c
16  util/util.c
17  ticker/ticker.c
18  ll_sw/ll_feat.c
19  ll_sw/ll_tx_pwr.c
20  ll_sw/ll_addr.c
21  ll_sw/ull.c
22  ll_sw/lll_common.c
23  hci/hci_driver.c
24  hci/hci.c
25  )
26
27if(CONFIG_BT_BROADCASTER)
28  zephyr_library_sources(
29    ll_sw/ull_adv.c
30    )
31  zephyr_library_sources_ifdef(
32    CONFIG_BT_CTLR_ADV_EXT
33    ll_sw/ull_adv_aux.c
34    )
35  zephyr_library_sources_ifdef(
36    CONFIG_BT_CTLR_ADV_PERIODIC
37    ll_sw/ull_adv_sync.c
38    )
39  zephyr_library_sources_ifdef(
40    CONFIG_BT_CTLR_ADV_ISO
41    ll_sw/ull_adv_iso.c
42    )
43endif()
44
45if(CONFIG_BT_OBSERVER)
46  zephyr_library_sources(
47    ll_sw/ull_scan.c
48    )
49  zephyr_library_sources_ifdef(
50    CONFIG_BT_CTLR_ADV_EXT
51    ll_sw/ull_scan_aux.c
52    )
53  zephyr_library_sources_ifdef(
54    CONFIG_BT_CTLR_SYNC_PERIODIC
55    ll_sw/ull_sync.c
56    )
57  zephyr_library_sources_ifdef(
58    CONFIG_BT_CTLR_SYNC_ISO
59    ll_sw/ull_sync_iso.c
60    )
61endif()
62
63if(CONFIG_BT_CONN)
64  zephyr_library_sources(
65    ll_sw/ull_conn.c
66    )
67  zephyr_library_sources_ifdef(
68    CONFIG_BT_CTLR_LE_ENC
69    ll_sw/ull_llcp_enc.c
70    )
71  zephyr_library_sources_ifdef(
72    CONFIG_BT_CTLR_PHY
73    ll_sw/ull_llcp_phy.c
74    )
75  if (CONFIG_BT_CTLR_PERIPHERAL_ISO OR
76      CONFIG_BT_CTLR_CENTRAL_ISO)
77    zephyr_library_sources(
78      ll_sw/ull_llcp_cc.c
79      )
80  endif()
81  zephyr_library_sources(
82    ll_sw/ull_tx_queue.c
83    ll_sw/ull_llcp.c
84    ll_sw/ull_llcp_common.c
85    ll_sw/ull_llcp_local.c
86    ll_sw/ull_llcp_pdu.c
87    ll_sw/ull_llcp_conn_upd.c
88    ll_sw/ull_llcp_chmu.c
89    ll_sw/ull_llcp_remote.c
90    )
91  zephyr_library_sources_ifdef(
92    CONFIG_BT_PERIPHERAL
93    ll_sw/ull_peripheral.c
94    )
95  zephyr_library_sources_ifdef(
96    CONFIG_BT_CTLR_PERIPHERAL_ISO
97    ll_sw/ull_peripheral_iso.c
98    )
99  zephyr_library_sources_ifdef(
100    CONFIG_BT_CENTRAL
101    ll_sw/ull_central.c
102    )
103  zephyr_library_sources_ifdef(
104    CONFIG_BT_CTLR_CENTRAL_ISO
105    ll_sw/ull_central_iso.c
106    )
107endif()
108
109zephyr_library_sources_ifdef(
110  CONFIG_BT_CTLR_SCHED_ADVANCED
111  ll_sw/ull_sched.c
112  )
113
114zephyr_library_sources_ifdef(
115  CONFIG_BT_CTLR_DF
116  ll_sw/ull_df.c
117  )
118
119zephyr_library_sources_ifdef(
120  CONFIG_BT_CTLR_CONN_ISO
121  ll_sw/ull_conn_iso.c
122  )
123
124zephyr_library_sources_ifdef(
125  CONFIG_BT_CTLR_ISO
126  ll_sw/ull_iso.c
127  ll_sw/isoal.c
128  )
129
130if(CONFIG_BT_CONN OR
131   (CONFIG_BT_BROADCASTER AND
132    CONFIG_BT_CTLR_ADV_EXT) OR
133   CONFIG_BT_CTLR_ADV_PERIODIC OR
134   CONFIG_BT_CTLR_SYNC_PERIODIC)
135  zephyr_library_sources(
136    ll_sw/ull_chan.c
137    ll_sw/lll_chan.c
138    )
139endif()
140
141if(CONFIG_BT_CTLR_FILTER_ACCEPT_LIST OR
142   CONFIG_BT_CTLR_SYNC_PERIODIC_ADV_LIST)
143  zephyr_library_sources(
144    ll_sw/ull_filter.c
145    )
146endif()
147
148zephyr_library_sources_ifdef(
149  CONFIG_BT_HCI_MESH_EXT
150  ll_sw/ll_mesh.c
151  )
152
153zephyr_library_sources_ifdef(
154  CONFIG_BT_CTLR_SETTINGS
155  ll_sw/ll_settings.c
156  )
157
158zephyr_library_sources_ifdef(
159  CONFIG_BT_CTLR_CRYPTO
160  crypto/crypto.c
161  )
162
163zephyr_library_sources_ifdef(
164  CONFIG_SOC_FLASH_NRF_RADIO_SYNC_TICKER
165  flash/soc_flash_nrf_ticker.c
166  )
167
168add_subdirectory_ifdef(
169  CONFIG_BT_CTLR_COEX_DRIVERS
170  coex
171  )
172
173if(CONFIG_SOC_COMPATIBLE_NRF)
174  include(ll_sw/nrf.cmake)
175elseif(CONFIG_SOC_OPENISA_RV32M1_RISCV32)
176  include(ll_sw/openisa.cmake)
177endif()
178
179zephyr_library_include_directories(
180  .
181  include
182  )
183
184zephyr_library_include_directories_ifdef(
185  CONFIG_BT_CTLR_CRYPTO
186  ../crypto
187)
188
189zephyr_library_include_directories_ifdef(
190  CONFIG_SOC_FLASH_NRF_RADIO_SYNC_TICKER
191  ${ZEPHYR_BASE}/drivers/flash
192)
193
194zephyr_library_compile_options_ifdef(
195  CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED
196  ${OPTIMIZE_FOR_SPEED_FLAG}
197  )
198
199zephyr_library_link_libraries(subsys__bluetooth)
200