{"id":16064708,"url":"https://github.com/eldruin/max3010x-rs","last_synced_at":"2025-03-17T16:32:36.682Z","repository":{"id":52120922,"uuid":"171729939","full_name":"eldruin/max3010x-rs","owner":"eldruin","description":"Platform agnostic Rust driver for the MAX3010x high-sensitivity pulse oximeter and heart-rate sensor for wearable health","archived":false,"fork":false,"pushed_at":"2021-07-06T21:31:18.000Z","size":107,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-16T05:28:59.335Z","etag":null,"topics":["embedded","embedded-hal","embedded-hal-driver","health","heart-rate","no-std","oximeter","rust","sensor","spi","spo2","wearable"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldruin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T18:47:53.000Z","updated_at":"2024-07-21T17:52:26.000Z","dependencies_parsed_at":"2022-08-30T16:02:09.949Z","dependency_job_id":null,"html_url":"https://github.com/eldruin/max3010x-rs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax3010x-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax3010x-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax3010x-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fmax3010x-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/max3010x-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871888,"owners_count":20361379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","embedded-hal","embedded-hal-driver","health","heart-rate","no-std","oximeter","rust","sensor","spi","spo2","wearable"],"created_at":"2024-10-09T05:09:12.090Z","updated_at":"2025-03-17T16:32:36.674Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust MAX3010x High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health Driver\n\n[![crates.io](https://img.shields.io/crates/v/max3010x.svg)](https://crates.io/crates/max3010x)\n[![Docs](https://docs.rs/max3010x/badge.svg)](https://docs.rs/max3010x)\n![Minimum Supported Rust Version](https://img.shields.io/badge/rustc-1.62+-blue.svg)\n[![Build Status](https://github.com/eldruin/max3010x-rs/workflows/Build/badge.svg)](https://github.com/eldruin/max3010x-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/max3010x-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/max3010x-rs?branch=master)\n\nThis is a platform agnostic Rust driver for the MAX3010x high-sensitivity\npulse oximeter and heart-rate sensor for wearable health, based on the\n[`embedded-hal`](https://github.com/rust-embedded/embedded-hal) traits.\n\nThis driver allows you to:\n- Get the number of samples available on the FIFO. See `get_available_sample_count()`.\n- Get the number of samples lost from the FIFO. See `get_overflow_sample_count()`.\n- Read samples from the FIFO. See `read_fifo()`.\n- Perform a temperature measurement. See `read_temperature()`.\n- Change into heart-rate, oximeter or multi-LED modes. See `into_multi_led()`.\n- Set the sample averaging. See `set_sample_averaging()`.\n- Set the LED pulse amplitude. See `set_pulse_amplitude()`.\n- Set the LED pulse width. See `set_pulse_width()`.\n- Set the sampling rate. See `set_sampling_rate()`.\n- Set the ADC range. See `set_adc_range()`.\n- Set the LED time slots in multi-LED mode. `set_led_time_slots()`.\n- Enable/disable the FIFO rollover. See `enable_fifo_rollover()`.\n- Clear the FIFO. See `clear_fifo()`.\n- Wake-up and shutdown the device. See `shutdown()`.\n- Perform a software reset. See `reset()`.\n- Get the device part and revision id. See `get_part_id()`.\n- Interrupts:\n  - Read the status of all interrupts. See `read_interrupt_status()`.\n  - Set FIFO-almost-full level interrupt. See `set_fifo_almost_full_level_interrupt()`.\n  - Enable/disable the FIFO-almost-full interrupt. See `enable_fifo_almost_full_interrupt()`.\n  - Enable/disable the ambient-light-cancellation overflow interrupt. See `enable_alc_overflow_interrupt()`.\n  - Enable/disable the temperature-ready interrupt. See `enable_temperature_ready_interrupt()`.\n  - Enable/disable the new-FIFO-data-ready interrupt. See `enable_new_fifo_data_ready_interrupt()`.\n\n\n## The device\nThe MAX30102 is an integrated pulse oximetry and heart-rate monitor module.\nIt includes internal LEDs, photodetectors, optical elements, and low-noise\nelectronics with ambient light rejection. The MAX30102 provides a complete\nsystem solution to ease the design-in process for mobile and\nwearable devices.\n\nThe MAX30102 operates on a single 1.8V power supply and a separate 3.3V\npower supply for the internal LEDs. Communication is through a standard\nI2C-compatible interface. The module can be shut down through software\nwith zero standby current, allowing the power rails to remain\npowered at all times.\n\nDatasheet:\n- [MAX30102](https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf)\n\nThis driver should be compatible at least with the devices: MAX30102.\n\n### Usage\n\nPlease find additional examples using hardware in this repository: [driver-examples]\n\n[driver-examples]: https://github.com/eldruin/driver-examples\n\n```rust\nextern crate linux_embedded_hal as hal;\nextern crate max3010x;\nuse max3010x::{Max3010x, Led, SampleAveraging};\n\nfn main() {\n  let dev = hal::I2cdev::new(\"/dev/i2c-1\").unwrap();\n\n  let mut sensor = Max3010x::new_max30102(dev);\n  let mut sensor = sensor.into_heart_rate().unwrap();\n  sensor.set_sample_averaging(SampleAveraging::Sa4).unwrap();\n  sensor.set_pulse_amplitude(Led::All, 15).unwrap();\n  sensor.enable_fifo_rollover().unwrap();\n\n  let mut data = [0; 3];\n  let samples_read = sensor.read_fifo(\u0026mut data).unwrap();\n\n  // get the I2C device back\n  let dev = sensor.destroy();\n}\n```\n\n## Status\n\n- [x] Compatibility with MAX30102\n- [ ] Compatibility with MAX30101\n- [ ] Compatibility with MAX30105\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.62.0 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/eldruin/max3010x-rs/issues).\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fmax3010x-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fmax3010x-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fmax3010x-rs/lists"}