Crates.io | max3010x |
lib.rs | max3010x |
version | |
source | src |
created_at | 2019-03-10 13:44:19.164503 |
updated_at | 2024-12-02 20:07:09.368378 |
description | Platform-agnostic Rust driver for the MAX3010x high-sensitivity pulse oximeter and heart-rate sensor for wearable health. |
homepage | https://github.com/eldruin/max3010x-rs |
repository | https://github.com/eldruin/max3010x-rs |
max_upload_size | |
id | 119881 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This is a platform agnostic Rust driver for the MAX3010x high-sensitivity
pulse oximeter and heart-rate sensor for wearable health, based on the
embedded-hal
traits.
This driver allows you to:
get_available_sample_count()
.get_overflow_sample_count()
.read_fifo()
.read_temperature()
.into_multi_led()
.set_sample_averaging()
.set_pulse_amplitude()
.set_pulse_width()
.set_sampling_rate()
.set_adc_range()
.set_led_time_slots()
.enable_fifo_rollover()
.clear_fifo()
.shutdown()
.reset()
.get_part_id()
.Read the status of all interrupts. See read_interrupt_status()
.
Set FIFO-almost-full level interrupt. See set_fifo_almost_full_level_interrupt()
.
Enable/disable the FIFO-almost-full interrupt. See enable_fifo_almost_full_interrupt()
.
Enable/disable the ambient-light-cancellation overflow interrupt. See enable_alc_overflow_interrupt()
.
Enable/disable the temperature-ready interrupt. See enable_temperature_ready_interrupt()
.
Enable/disable the new-FIFO-data-ready interrupt. See enable_new_fifo_data_ready_interrupt()
.
The MAX30102 is an integrated pulse oximetry and heart-rate monitor module. It includes internal LEDs, photodetectors, optical elements, and low-noise electronics with ambient light rejection. The MAX30102 provides a complete system solution to ease the design-in process for mobile and wearable devices.
The MAX30102 operates on a single 1.8V power supply and a separate 3.3V power supply for the internal LEDs. Communication is through a standard I2C-compatible interface. The module can be shut down through software with zero standby current, allowing the power rails to remain powered at all times.
Datasheet:
This driver should be compatible at least with the devices: MAX30102.
Please find additional examples using hardware in this repository: driver-examples
extern crate linux_embedded_hal as hal;
extern crate max3010x;
use max3010x::{Max3010x, Led, SampleAveraging};
fn main() {
let dev = hal::I2cdev::new("/dev/i2c-1").unwrap();
let mut sensor = Max3010x::new_max30102(dev);
let mut 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();
let mut data = [0; 3];
let samples_read = sensor.read_fifo(&mut data).unwrap();
// get the I2C device back
let dev = sensor.destroy();
}
This crate is guaranteed to compile on stable Rust 1.62.0 and up. It might compile with older versions but that may change in any new patch release.
For questions, issues, feature requests, and other changes, please file an issue in the github project.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.