โ ๏ธ Warning: Early Development StageThis library is currently under active development and has not been thoroughly tested. Use in production systems at your own risk. APIs may change without notice.
Hayasen is an Embedded Rust library designed to simplify sensor integration in embedded systems. It provides unified, type-safe interfaces for various sensors with a focus on ease of use and reliability.
- MPU9250 - 9-axis motion tracking device (accelerometer, gyroscope, temperature) - Work in Progress
Click here to check the current progress of the library
Add hayasen to your Cargo.toml:
[dependencies]
hayasen = { version = "*", features = ["mpu9250"] } # For MPU9250 supportuse hayasen::prelude::*;
use hayasen::mpu9250_hayasen;
fn main() -> Result<(), Error<YourI2cError>> {
// Setup I2C (platform-specific)
let i2c = setup_i2c();
// Initialize sensor with default configuration
let mut sensor = mpu9250_hayasen::create_default(i2c, 0x68)?;
// Read all sensor data (temp, accel, gyro)
let (temperature, acceleration, angular_velocity) =
mpu9250_hayasen::read_all(&mut sensor)?;
println!("Temperature: {:.2}ยฐC", temperature);
println!("Acceleration: [{:.3}, {:.3}, {:.3}] g",
acceleration[0], acceleration[1], acceleration[2]);
println!("Angular Velocity: [{:.3}, {:.3}, {:.3}] dps",
angular_velocity[0], angular_velocity[1], angular_velocity[2]);
Ok(())
}mpu9250- Enables MPU9250 motion sensor support (enabled by default)- More sensors coming soon!
- API Documentation - Complete API reference
- Examples - Practical usage examples (Coming Soon)
- Contributing Guidelines - How to contribute to the project
hayasen/
โโโ src/
โ โโโ lib.rs # Main library entry point
โ โโโ error.rs # Unified error types
โ โโโ functions.rs # Function registry system
โ โโโ mpu9250.rs # MPU9250 sensor implementation
โโโ examples/ # Usage examples
โโโ tests/ # Integration tests
This project is dual-licensed under either:
- Apache License, Version 2.0 Apache-2.0
- MIT license MIT
- Inspired by various embedded Rust driver libraries
- Thanks to the Rust embedded working group for excellent tools and guidance
- Community contributors and testers
Found a bug or have a feature request? Please open an issue on GitHub.
-
Complete MPU9250 implementation and testing
- Magnetometer support (AK8963)
- Self-test functionality
- Motion detection interrupts
- FIFO buffer support
- Comprehensive unit tests
- Integration tests with hardware
-
Add comprehensive test suite
- Unit tests for all public APIs
- Integration tests with mock I2C
- Hardware-in-the-loop testing
- Continuous integration setup
- Code coverage reporting
-
Create more usage examples
- Basic sensor reading example
- Interrupt-driven motion detection
- Data logging application
- Multi-sensor fusion example
- RTOS integration examples
-
Add MAX30102 heart rate sensor support
- Heart rate monitoring
- Oxygen saturation (SpO2) measurement
- FIFO data reading
- Interrupt configuration
- Temperature reading
-
Add CI/CD pipeline
- GitHub Actions for testing
- Automated documentation deployment
- Release automation
- Crate publishing automation
- Cross-compilation testing
-
Support for more sensor types
- BME280 (Temperature, Humidity, Pressure)
- BMP180/BMP280 (Pressure)
- HMC5883L (Magnetometer)
- ADXL345 (Accelerometer)
- TMP36/TMP102 (Temperature)
-
Advanced features
- Sensor fusion algorithms
- Power management utilities
- Async/await support
- No-alloc mode for tiny systems
- WebAssembly support for simulation
-
Ecosystem integration
- Embassy framework support
- RTIC framework integration
- defmt logging support
- Probe-rs debugging support
- Platform-agnostic drivers
timeline
title Hayasen Development Timeline
section v0.2.x
MPU9250 Completion : Magnetometer<br>Interrupts<br>FIFO
Testing Suite : Unit Tests<br>Integration Tests
section v0.3.x
Examples : Basic Examples<br>Advanced Use Cases
CI/CD : GitHub Actions<br>Auto Documentation
section v0.4.x
MAX30102 Support : Heart Rate<br>SpO2 Monitoring
section v0.5.x
Additional Sensors : BME280<br>HMC5883L
section v1.0.0
Stable API : Production Ready<br>Full Documentation