Skip to content

Vaishnav-Sabari-Girish/Hayasen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

104 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Sublime's custom image

Hayasen

Crates.io License Minimum Supported Rust Version

Hayasen is now on the awesome-embedded-rust repository. Find it here awesome-embedded-rust

⚠️ Warning: Early Development Stage

This 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.

πŸš€ Currently Supported Sensors

  • MPU9250 - 9-axis Inertial Measurement Unit (accelerometer, gyroscope, temperature, magnetometer) - Work in Progress
  • MPU6050 - 6-axis Inertial Measurement Unit (accelerometer, gyroscope, temperature)
  • MAX30102 - Pulse Oximeter, Heart Rate Monitor, Temperature Sensor

Progress

Click here to check the current progress of the library

Progress

πŸ“¦ Installation

Add hayasen to your Cargo.toml:

[dependencies]
hayasen = { version = "*", features = ["mpu9250"] }   # For MPU9250 support

🎯 Quick Start

use 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(())
}

πŸ”§ Features

  • mpu9250 - Enables MPU9250 Inertial Measurement Unit support (enabled by default)
  • mpu6050 - Enables MPU6050 Inertial Measurement Unit support
  • More sensors coming soon!

πŸ“š Documentation

πŸ—οΈ Project Structure

hayasen/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs          # Main library entry point
β”‚   β”œβ”€β”€ error.rs        # Unified error types
β”‚   β”œβ”€β”€ functions.rs    # Function registry system
β”‚   β”œβ”€β”€ mpu9250.rs      # MPU9250 sensor implementation
β”‚   └── mpu6050.rs      # MPU6050 sensor implementation
β”œβ”€β”€ examples/           # Usage examples
└── tests/              # Integration tests

πŸ“ License

This project is dual-licensed under either:

πŸ™ Acknowledgments

  • Inspired by various embedded Rust driver libraries
  • Thanks to the Rust embedded working group for excellent tools and guidance
  • Community contributors and testers

πŸ› Issue Reporting

Found a bug or have a feature request? Please open an issue on GitHub.

TODO

  • Add MPU9250 SPI Support
  • Add MPU6050 SPI Support
  • Add support for BME280 (I2C and SPI)
  • Add support for HC-SR04 Ultrasonic Sensor
  • Add support for MQ135 Gas sensor

πŸ“Š Project Activity

Stargazers over time

Stargazers over time

Stargazers

stargazers badge

Contributors

Forkers

forkers badge

About

An Embedded Rust crate with support for multiple sensors

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors