a121_rs/
lib.rs

1#![cfg_attr(feature = "nightly-logger", feature(c_variadic))]
2#![cfg_attr(not(any(test, feature = "std")), no_std)]
3
4//! The `a121-rs` library offers Rust bindings for interfacing with the Acconeer A121 radar sensor,
5//! designed for embedded systems. Unlike traditional networking or sensor libraries, `a121-rs` focuses
6//! on providing low-level access to the sensor's capabilities while abstracting the complexities
7//! into a more Rust-centric API. This library is tailored for real-time applications where direct
8//! control over sensor data acquisition and processing is crucial.
9//!
10//! `a121-rs` is structured to offer both high-level abstractions for easy integration into applications
11//! and low-level access for fine-tuned control.
12//!
13//! # Sensor Modes and Configuration
14//! The core functionality of `a121-rs` is exposed through its sensor mode configurations, allowing
15//! users to switch between distance measurement and presence detection(_soon_). The configuration API,
16//! found in the module [`config`](config/index.html), enables detailed customization of the
17//! radar's parameters, such as sweep frequency, power levels, and processing options.
18//!
19//! # Data Acquisition and Processing
20//! At the heart of `a121-rs` is the data acquisition and processing layer. This layer, accessible
21//! through the [`radar`](radar/index.html) module, provides the mechanisms to initiate sensor
22//! sweeps, retrieve raw data, and apply post-processing for noise reduction and signal
23//! enhancement.
24//!
25//! # Hardware Abstraction Layer (HAL)
26//! `a121-rs` employs an embedded-hal compatible layer, found in the [`hal`](hal/index.html) module,
27//! to abstract over the specific hardware interfaces used to communicate with the A121 sensor.
28//! This design allows `a121-rs` to be hardware agnostic, supporting a wide range of embedded platforms
29//! by leveraging the embedded-hal ecosystem.
30//! There is still work to be done to make the HAL more flexible and configurable, but the current
31//! implementation is a good starting point for most use cases.
32//!
33//! # Examples and Use Cases
34//! The library comes with a set of examples, located in the `examples` directory, demonstrating
35//! common use cases and configurations for the A121 sensor. These examples cover basic setups for
36//! different hardware platforms and provide a starting point for integrating the A121 sensor into
37//! your projects.
38//!
39
40extern crate alloc;
41
42/// Configuration for the radar sensor
43pub mod config;
44#[cfg(any(feature = "distance", feature = "presence"))]
45/// Detector modules for the radar sensor
46pub mod detector;
47/// Hardware Abstraction Layer equivalent to the C API
48pub mod hal;
49#[cfg(feature = "libm")]
50/// Math functions definitions from the libm crate
51pub mod libm;
52/// Number definitions for the radar sensor
53pub mod num;
54/// Processing modules for the radar sensor
55pub mod processing;
56/// Main radar module, interfacing with the radar sensor
57pub mod radar;
58/// Sensor module for the radar sensor
59mod sensor;