All Projects → hepingood → max30102

hepingood / max30102

Licence: MIT license
max30102 full function driver

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to max30102

pcf8574
pcf8574 full function driver
Stars: ✭ 106 (+20.45%)
Mutual labels:  mcu, iic, full-function
sgp30
sgp30 full function driver
Stars: ✭ 24 (-72.73%)
Mutual labels:  mcu, iic
ina219
ina219 full function driver
Stars: ✭ 27 (-69.32%)
Mutual labels:  mcu, iic
max30205
max30205 full function driver
Stars: ✭ 18 (-79.55%)
Mutual labels:  mcu, iic
bmp388
bmp388 full function driver
Stars: ✭ 14 (-84.09%)
Mutual labels:  mcu, iic
pcf8591
pcf8591 full function driver
Stars: ✭ 32 (-63.64%)
Mutual labels:  mcu, iic
w25qxx
w25qxx full function driver
Stars: ✭ 440 (+400%)
Mutual labels:  mcu, full-function
at24cxx
at24cxx full function driver
Stars: ✭ 28 (-68.18%)
Mutual labels:  mcu, iic
bmp180
bmp180 full function driver
Stars: ✭ 57 (-35.23%)
Mutual labels:  mcu, iic
sht31
sht31 full function driver
Stars: ✭ 28 (-68.18%)
Mutual labels:  mcu, iic
mcp9600
mcp9600 full function driver
Stars: ✭ 22 (-75%)
Mutual labels:  mcu, iic
fm24clxx
fm24clxx full function driver
Stars: ✭ 0 (-100%)
Mutual labels:  mcu, iic
amg8833
amg8833 full function driver
Stars: ✭ 78 (-11.36%)
Mutual labels:  mcu, full-function
mcp4725
mcp4725 full function driver
Stars: ✭ 15 (-82.95%)
Mutual labels:  mcu, iic
max30102-tutorial-raspberrypi
This repository is unofficial porting of Arduino sample code of MAXRESDEF117#(max30102) HR/SpO2 sensor
Stars: ✭ 44 (-50%)
Mutual labels:  spo2, max30102
uvis25
uvis25 full function driver
Stars: ✭ 13 (-85.23%)
Mutual labels:  mcu, iic
mlx90614
mlx90614 full function driver
Stars: ✭ 17 (-80.68%)
Mutual labels:  mcu, iic
adxl345
ADXL345 full function driver for general MCU and Linux.
Stars: ✭ 170 (+93.18%)
Mutual labels:  mcu, iic
optical-pulse-reader
iOS application that uses camera to detect heart rate.
Stars: ✭ 45 (-48.86%)
Mutual labels:  heart-rate
ez-rtos
A micro real-time operating system supporting task switching, delay function, memory allocator and critical section. It is writen on ARM Cortex-M3 assemble language, it runs successfully on STM32F103 MCU.
Stars: ✭ 57 (-35.23%)
Mutual labels:  mcu

English | 简体中文 | 繁體中文 | 日本語 | Deutsch | 한국어

LibDriver MAX30102

MISRA API License

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.It can be used in wearable devices, fitness assistant devices, smartphones, tablets and so on.

LibDriver MAX30102 is the full function driver of MAX30102 launched by LibDriver. It provides fifo reading, id reading and other functions. LibDriver is MISRA compliant.

Table of Contents

Instruction

/src includes LibDriver MAX30102 source files.

/interface includes LibDriver MAX30102 IIC platform independent template.

/test includes LibDriver MAX30102 driver test code and this code can test the chip necessary function simply.

/example includes LibDriver MAX30102 sample code.

/doc includes LibDriver MAX30102 offline document.

/datasheet includes MAX30102 datasheet.

/project includes the common Linux and MCU development board sample code. All projects use the shell script to debug the driver and the detail instruction can be found in each project's README.md.

Install

Reference /interface IIC platform independent template and finish your platform IIC driver.

Add /src, /interface and /example to your project.

Usage

example fifo

#include "driver_max30102_fifo.h"

static uint8_t gs_flag;
static uint32_t gs_raw_red[32];
static uint32_t gs_raw_ir[32];
uint8_t res;
uint32_t timeout;
uint32_t times;
uint8_t (*g_gpio_irq)(void) = NULL;

...
    
void max30102_receive_callback(uint8_t type)
{
    switch (type)
    {
        case MAX30102_INTERRUPT_STATUS_FIFO_FULL :
        {
            uint8_t res;
            uint8_t len;
            
            /* read data */
            len = 32;
            res = max30102_fifo_read((uint32_t *)gs_raw_red, (uint32_t *)gs_raw_ir, (uint8_t *)&len);
            if (res != 0)
            {
                max30102_interface_debug_print("max30102: read failed.\n");
            }
            max30102_interface_debug_print("max30102: irq fifo full with %d.\n", len);
            gs_flag = 1;
            
            break;
        }
        case MAX30102_INTERRUPT_STATUS_PPG_RDY :
        {
            max30102_interface_debug_print("max30102: irq ppg rdy.\n");
            
            break;
        }
        case MAX30102_INTERRUPT_STATUS_ALC_OVF :
        {
            max30102_interface_debug_print("max30102: irq alc ovf.\n");
            
            break;
        }
        case MAX30102_INTERRUPT_STATUS_PWR_RDY :
        {
            max30102_interface_debug_print("max30102: irq pwr rdy.\n");
            
            break;
        }
        case MAX30102_INTERRUPT_STATUS_DIE_TEMP_RDY :
        {
            max30102_interface_debug_print("max30102: irq die temp rdy.\n");
            
            break;
        }
        default :
        {
            max30102_interface_debug_print("max30102: unknown code.\n");
            
            break;
        }
    }
}

...
    
/* set gpio */
g_gpio_irq = max30102_fifo_irq_handler;
res = gpio_interrupt_init();
if (res != 0)
{
    g_gpio_irq = NULL;

    return 1;
}

/* fifo init */
res = max30102_fifo_init(max30102_receive_callback);
if (res != 0)
{
    (void)gpio_interrupt_deinit();
    g_gpio_irq = NULL;

    return 1;
}

/* read data */
times = 3;
gs_flag = 0;
timeout = 5000;
while (timeout != 0)
{
    if (gs_flag != 0)
    {
        /* clear config */
        gs_flag = 0;
        timeout = 5000;
        times--;
        if (times == 0)
        {
            break;
        }
    }
    max30102_interface_delay_ms(1);
    timeout--;
}

/* check timeout */
if (timeout == 0)
{
    max30102_interface_debug_print("max30102: read timeout failed.\n");
    (void)max30102_fifo_deinit();
    (void)gpio_interrupt_deinit();
    g_gpio_irq = NULL;

    return 1;
}

(void)max30102_fifo_deinit();
(void)gpio_interrupt_deinit();
g_gpio_irq = NULL;

return 0;

Document

Online documents: https://www.libdriver.com/docs/max30102/index.html.

Offline documents: /doc/html/index.html.

Contributing

Please refer to CONTRIBUTING.md.

License

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

Contact Us

Please sent an e-mail to [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].