drivers_peripherals/lib.rs
1//! Shared base for peripheral device nodes.
2//!
3//! A class adapter (UART, I2C, SPI, ...) implements [`PeripheralHandle`] over the
4//! embedded-hal or embedded-io handle it owns, then wraps it in
5//! [`PeripheralDevice`] and mounts it under `/devices/<class>/<name>` with
6//! [`mount_peripheral`]. Applications use the ordinary `File` API (open, read,
7//! write, poll, close) and receive no new public API from this crate.
8//!
9//! The base defines no control commands. Each class defines its own commands
10//! with `file_system::define_command!` using a distinct kind byte (for example
11//! `b'u'` for UART, `b'i'` for I2C, `b's'` for SPI and `b'a'` for ADC). Command
12//! input and output structs must be versioned, `#[repr(C)]`, and live in the
13//! class module.
14#![no_std]
15
16extern crate alloc;
17
18#[cfg(feature = "adc")]
19pub mod adc;
20mod device;
21#[cfg(feature = "gpio")]
22pub mod gpio;
23#[cfg(feature = "human-interface")]
24pub mod human_interface;
25#[cfg(feature = "i2c")]
26pub mod i2c;
27#[cfg(feature = "vfs")]
28mod mount;
29#[cfg(feature = "power")]
30pub mod power;
31#[cfg(feature = "pwm")]
32pub mod pwm;
33#[cfg(feature = "real-time-clock")]
34pub mod real_time_clock;
35#[cfg(feature = "spi")]
36pub mod spi;
37#[cfg(feature = "uart")]
38pub mod uart;
39
40pub use device::*;
41#[cfg(feature = "vfs")]
42pub use mount::*;