neoradio2/lib.rs
1//! Safe Rust bindings for the Intrepid Control Systems neoRAD-IO2 device family.
2//!
3//! ```no_run
4//! use neoradio2::{Device, CalType};
5//! for info in Device::find()? {
6//! let dev = Device::open(&info)?;
7//! dev.chain_identify()?;
8//! dev.app_start(0, 0xFF)?;
9//! dev.request_sensor_data(0, 0xFF, CalType::Enabled)?;
10//! println!("{}", dev.read_sensor_float(0, 0)?);
11//! }
12//! # Ok::<(), neoradio2::Error>(())
13//! ```
14#![warn(missing_docs)]
15
16mod calibration;
17mod device;
18mod error;
19// `ffi` is bindgen-generated (`build.rs` / `cargo build --features bindgen`); it's
20// not hand-maintained, so lints that would otherwise call for real code fixes
21// (e.g. `useless_transmute` on bindgen's bitfield-accessor boilerplate) are
22// silenced here rather than edited into generated output.
23#[doc(hidden)]
24#[allow(clippy::useless_transmute)]
25#[rustfmt::skip]
26pub mod ffi;
27mod settings;
28mod types;
29
30pub use device::{Device, DeviceInfo};
31pub(crate) use error::check;
32pub use error::{Error, Result};
33pub use types::{
34 is_blocking, set_blocking, CalType, CommandStatus, DeviceType, LedMode, StatusType,
35};
36
37/// Raw `repr(C)` structs used by the settings/calibration/statistics calls.
38pub mod raw {
39 pub use crate::ffi::{
40 neoRADIO2AOUT_header, neoRADIO2_PerfStatistics, neoRADIO2_settings,
41 neoRADIO2frame_calHeader,
42 };
43}