Expand description
Shared base for peripheral device nodes.
A class adapter (UART, I2C, SPI, …) implements PeripheralHandle over the
embedded-hal or embedded-io handle it owns, then wraps it in
PeripheralDevice and mounts it under /devices/<class>/<name> with
mount_peripheral. Applications use the ordinary File API (open, read,
write, poll, close) and receive no new public API from this crate.
The base defines no control commands. Each class defines its own commands
with file_system::define_command! using a distinct kind byte (for example
b'u' for UART, b'i' for I2C, b's' for SPI and b'a' for ADC). Command
input and output structs must be versioned, #[repr(C)], and live in the
class module.
Structs§
- Peripheral
Device - Character device exposing a
PeripheralHandlethrough the VFS polling contract.
Traits§
- Peripheral
Handle - Class-specific handle wrapped by
PeripheralDevice.
Functions§
- mount_
peripheral - Mounts
handleas a character device atpath, for example/devices/uart/uart0, with the default device permissions. The caller chooses the class directory; this helper adds no permission policy beyond the VFS mount defaults. - mount_
peripheral_ with_ permissions - Mounts
handleas a character device atpathwith explicitpermissions, for device classes whose writes are reserved to the mounting user (for example the real-time clock with [Permissions::PRIVILEGED_DEVICE]).