Skip to main content

bela_sys/
lib.rs

1//! Raw FFI bindings to the Bela core API (`libbela`) for [Bela Gem].
2//!
3//! This crate exposes the C surface of the Bela core API (`Bela.h`):
4//! `BelaContext`, `BelaInitSettings`, the `Bela_*` lifecycle and
5//! auxiliary-task functions, and `rt_printf`. Bindings are generated
6//! from vendored headers (see `vendor/bela/COMMIT` for the pinned
7//! upstream commit) with `cargo xtask bindgen`; see the crate README
8//! for how to regenerate them. Higher-level C++ libraries (Scope,
9//! Trill, Fft, Gui, Midi) are out of scope.
10//!
11//! The `setup` / `render` / `cleanup` callbacks are not bound: they are
12//! either provided to `Bela_initAudio` via [`BelaInitSettings`] or
13//! defined as `#[unsafe(no_mangle)]` symbols by the linking crate.
14//!
15//! Target platform is Bela Gem on `PocketBeagle` 2
16//! (`aarch64-unknown-linux-gnu`). For a safe API, use the `bela`
17//! crate instead.
18//!
19//! [Bela Gem]: https://bela.io
20#![no_std]
21
22#[allow(
23    missing_docs,
24    nonstandard_style,
25    unsafe_op_in_unsafe_fn,
26    unused,
27    clippy::all,
28    clippy::pedantic,
29    clippy::nursery,
30    clippy::restriction,
31    rustdoc::all,
32    reason = "generated by bindgen; regenerate with `cargo xtask bindgen`"
33)]
34mod bindings;
35
36pub use bindings::*;