How vaishnav-sabari-girish/hayasen works
Project type and purpose
• This is an Embedded-Rust library crate (hayasen) whose sole purpose is to provide unified, type-safe drivers for IMU sensors (currently MPU6050 and MPU9250).
• It is _not_ a full-stack app but a reusable library that sits between an embedded application and the hardware sensors via an I²C bus.
File structure
• src/
• lib.rs – crate entry point and prelude exports
• error.rs – unified error types and conversion logic
• functions.rs – registrar for runtime-configurable functions (hooking into operations)
• mpu6050.rs & mpu9250.rs – sensor-specific implementations, default configs, read routines
• examples/ – sample applications showing how client code calls into the crate
• docs/ – mdBook sources and theme assets for published documentation
• Cargo.toml & Cargo.lock – dependency list (e.g. embedded-hal, heapless, nb)
• Other top-level files (README, LICENSES) provide meta information.
README for additional insights
• Confirms supported sensors, usage pattern (client sets up an I²C peripheral, invokes create_default, then calls read_all).
• Roadmap shows planned extensions (new sensor modules, async support, no-alloc mode).
Diagramming recommendations
• dependency (Client → Library)
• data flow (Library → I²C bus → Sensors → Library → Client)
• build/doc generation (Cargo → mdBook → Docs)
– Blue for external interfaces (embedded-hal)
– Gray for hardware
– Yellow for documentation workflow