1 /*
2  * Copyright (c) 2022 Antmicro <www.antmicro.com>
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <sl_bt_ll_zephyr.h>
8 
9 K_SEM_DEFINE(slz_ll_sem, 0, 1);
10 
11 static atomic_t sli_btctrl_events;
12 
sli_pending_btctrl_events(void)13 bool sli_pending_btctrl_events(void)
14 {
15 	return false;
16 }
17 
BTLE_LL_EventRaise(uint32_t events)18 void BTLE_LL_EventRaise(uint32_t events)
19 {
20 	atomic_or(&sli_btctrl_events, events);
21 	k_sem_give(&slz_ll_sem);
22 }
23 
slz_ll_thread_func(void)24 void slz_ll_thread_func(void)
25 {
26 	while (true) {
27 		k_sem_take(&slz_ll_sem, K_FOREVER);
28 		uint32_t events = atomic_clear(&sli_btctrl_events);
29 		BTLE_LL_Process(events);
30 	}
31 }
32 
sl_bt_controller_init()33 void sl_bt_controller_init()
34 {
35 	/* No extra initialization procedure required */
36 }
37