veridian_kernel/drivers/bluetooth/
mod.rs1#![allow(dead_code)]
7
8pub mod device_node;
9pub mod hci;
10
11pub mod l2cap;
13pub mod profiles;
14pub mod rfcomm;
15
16pub use hci::{BluetoothController, ControllerState};
17use spin::Mutex;
18
19use crate::sync::once_lock::OnceLock;
20
21static BT_CONTROLLER: OnceLock<Mutex<BluetoothController>> = OnceLock::new();
23
24pub fn init() {
26 let controller = BluetoothController::new();
27 let _ = BT_CONTROLLER.set(Mutex::new(controller));
28 crate::println!("[BT] Bluetooth subsystem initialized");
29}
30
31pub fn get_controller() -> &'static Mutex<BluetoothController> {
33 BT_CONTROLLER
34 .get()
35 .expect("Bluetooth controller not initialized")
36}