edgefirst_tflite_sys/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 Au-Zone Technologies. All Rights Reserved.
3
4//! Low-level FFI bindings for the TensorFlow Lite C API.
5//!
6//! This crate provides raw, unsafe bindings generated by `bindgen` with
7//! `--dynamic-loading`. Symbols are resolved at runtime via `libloading`.
8//!
9//! **Most users should depend on `edgefirst-tflite` instead**, which
10//! provides a safe, ergonomic API on top of these bindings.
11//!
12//! # Library Discovery
13//!
14//! Use [`discovery::discover`] to automatically find and load the `TFLite`
15//! shared library, or [`discovery::load`] to load from a specific path.
16//!
17//! # `VxDelegate` Extensions
18//!
19//! The [`vx_ffi`] module provides function pointer structs for the
20//! `VxDelegate` DMA-BUF and `CameraAdaptor` APIs, loaded at runtime from
21//! the delegate shared library.
22
23// Suppress all clippy/rustc/rustdoc warnings for bindgen-generated code.
24#[allow(
25 clippy::all,
26 clippy::pedantic,
27 clippy::nursery,
28 non_upper_case_globals,
29 non_camel_case_types,
30 non_snake_case,
31 missing_debug_implementations,
32 unreachable_pub,
33 dead_code,
34 rustdoc::bare_urls,
35 rustdoc::broken_intra_doc_links
36)]
37mod ffi {
38 include!("ffi.rs");
39}
40
41pub use ffi::*;
42
43/// Sentinel value for an unset `TfLiteBufferHandle` (`kTfLiteNullBufferHandle = -1`).
44#[allow(non_upper_case_globals)]
45pub const kTfLiteNullBufferHandle: TfLiteBufferHandle = -1;
46
47pub mod discovery;
48pub mod vx_ffi;