Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Platform agnostic Rust driver for the MAX3010x high-sensitivity pulse oximeter and heart-rate sensor for wearable health

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

eldruin/max3010x-rs

Repository files navigation

crates.ioDocsMinimum Supported Rust VersionBuild StatusCoverage Status

This is a platform agnostic Rust driver for the MAX3010x high-sensitivitypulse oximeter and heart-rate sensor for wearable health, based on theembedded-hal traits.

This driver allows you to:

  • Get the number of samples available on the FIFO. Seeget_available_sample_count().
  • Get the number of samples lost from the FIFO. Seeget_overflow_sample_count().
  • Read samples from the FIFO. Seeread_fifo().
  • Perform a temperature measurement. Seeread_temperature().
  • Change into heart-rate, oximeter or multi-LED modes. Seeinto_multi_led().
  • Set the sample averaging. Seeset_sample_averaging().
  • Set the LED pulse amplitude. Seeset_pulse_amplitude().
  • Set the LED pulse width. Seeset_pulse_width().
  • Set the sampling rate. Seeset_sampling_rate().
  • Set the ADC range. Seeset_adc_range().
  • Set the LED time slots in multi-LED mode.set_led_time_slots().
  • Enable/disable the FIFO rollover. Seeenable_fifo_rollover().
  • Clear the FIFO. Seeclear_fifo().
  • Wake-up and shutdown the device. Seeshutdown().
  • Perform a software reset. Seereset().
  • Get the device part and revision id. Seeget_part_id().
  • Interrupts:
    • Read the status of all interrupts. Seeread_interrupt_status().
    • Set FIFO-almost-full level interrupt. Seeset_fifo_almost_full_level_interrupt().
    • Enable/disable the FIFO-almost-full interrupt. Seeenable_fifo_almost_full_interrupt().
    • Enable/disable the ambient-light-cancellation overflow interrupt. Seeenable_alc_overflow_interrupt().
    • Enable/disable the temperature-ready interrupt. Seeenable_temperature_ready_interrupt().
    • Enable/disable the new-FIFO-data-ready interrupt. Seeenable_new_fifo_data_ready_interrupt().

The device

The MAX30102 is an integrated pulse oximetry and heart-rate monitor module.It includes internal LEDs, photodetectors, optical elements, and low-noiseelectronics with ambient light rejection. The MAX30102 provides a completesystem solution to ease the design-in process for mobile andwearable devices.

The MAX30102 operates on a single 1.8V power supply and a separate 3.3Vpower supply for the internal LEDs. Communication is through a standardI2C-compatible interface. The module can be shut down through softwarewith zero standby current, allowing the power rails to remainpowered at all times.

Datasheet:

This driver should be compatible at least with the devices: MAX30102.

Usage

Please find additional examples using hardware in this repository:driver-examples

externcrate linux_embedded_halas hal;externcrate max3010x;use max3010x::{Max3010x,Led,SampleAveraging};fnmain(){let dev = hal::I2cdev::new("/dev/i2c-1").unwrap();letmut sensor =Max3010x::new_max30102(dev);letmut sensor = sensor.into_heart_rate().unwrap();  sensor.set_sample_averaging(SampleAveraging::Sa4).unwrap();  sensor.set_pulse_amplitude(Led::All,15).unwrap();  sensor.enable_fifo_rollover().unwrap();letmut data =[0;3];let samples_read = sensor.read_fifo(&mut data).unwrap();// get the I2C device backlet dev = sensor.destroy();}

Status

  • Compatibility with MAX30102
  • Compatibility with MAX30101
  • Compatibility with MAX30105

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.62.0 and up. Itmightcompile with older versions but that may change in any new patch release.

Support

For questions, issues, feature requests, and other changes, please file anissue in the github project.

License

Licensed under either of

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you, as defined in the Apache-2.0 license, shallbe dual licensed as above, without any additional terms or conditions.

About

Platform agnostic Rust driver for the MAX3010x high-sensitivity pulse oximeter and heart-rate sensor for wearable health

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp