MBED firmware for MAXREFDES117 Heart Rate / SpO2 sensor. Tested on KL25Z, K64F, and MAX32600MBED#

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MAX30102.h Source File

MAX30102.h

00001 /** \file max30102.h ******************************************************
00002 *
00003 * Project: MAXREFDES117#
00004 * Filename: max30102.h
00005 * Description: This module is an embedded controller driver header file for MAX30102
00006 *
00007 *
00008 * --------------------------------------------------------------------
00009 *
00010 * This code follows the following naming conventions:
00011 *
00012 * char              ch_pmod_value
00013 * char (array)      s_pmod_s_string[16]
00014 * float             f_pmod_value
00015 * int32_t           n_pmod_value
00016 * int32_t (array)   an_pmod_value[16]
00017 * int16_t           w_pmod_value
00018 * int16_t (array)   aw_pmod_value[16]
00019 * uint16_t          uw_pmod_value
00020 * uint16_t (array)  auw_pmod_value[16]
00021 * uint8_t           uch_pmod_value
00022 * uint8_t (array)   auch_pmod_buffer[16]
00023 * uint32_t          un_pmod_value
00024 * int32_t *         pn_pmod_value
00025 *
00026 * ------------------------------------------------------------------------- */
00027 /*******************************************************************************
00028 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
00029 *
00030 * Permission is hereby granted, free of charge, to any person obtaining a
00031 * copy of this software and associated documentation files (the "Software"),
00032 * to deal in the Software without restriction, including without limitation
00033 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00034 * and/or sell copies of the Software, and to permit persons to whom the
00035 * Software is furnished to do so, subject to the following conditions:
00036 *
00037 * The above copyright notice and this permission notice shall be included
00038 * in all copies or substantial portions of the Software.
00039 *
00040 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00041 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00042 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00043 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00044 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00045 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00046 * OTHER DEALINGS IN THE SOFTWARE.
00047 *
00048 * Except as contained in this notice, the name of Maxim Integrated
00049 * Products, Inc. shall not be used except as stated in the Maxim Integrated
00050 * Products, Inc. Branding Policy.
00051 *
00052 * The mere transfer of this software does not imply any licenses
00053 * of trade secrets, proprietary technology, copyrights, patents,
00054 * trademarks, maskwork rights, or any other form of intellectual
00055 * property whatsoever. Maxim Integrated Products, Inc. retains all
00056 * ownership rights.
00057 *******************************************************************************
00058 */
00059 #ifndef MAX30102_H_
00060 #define MAX30102_H_
00061 
00062 #include "mbed.h"
00063 
00064 #define I2C_WRITE_ADDR 0xAE
00065 #define I2C_READ_ADDR 0xAF
00066 
00067 //register addresses
00068 #define REG_INTR_STATUS_1 0x00
00069 #define REG_INTR_STATUS_2 0x01
00070 #define REG_INTR_ENABLE_1 0x02
00071 #define REG_INTR_ENABLE_2 0x03
00072 #define REG_FIFO_WR_PTR 0x04
00073 #define REG_OVF_COUNTER 0x05
00074 #define REG_FIFO_RD_PTR 0x06
00075 #define REG_FIFO_DATA 0x07
00076 #define REG_FIFO_CONFIG 0x08
00077 #define REG_MODE_CONFIG 0x09
00078 #define REG_SPO2_CONFIG 0x0A
00079 #define REG_LED1_PA 0x0C
00080 #define REG_LED2_PA 0x0D
00081 #define REG_PILOT_PA 0x10
00082 #define REG_MULTI_LED_CTRL1 0x11
00083 #define REG_MULTI_LED_CTRL2 0x12
00084 #define REG_TEMP_INTR 0x1F
00085 #define REG_TEMP_FRAC 0x20
00086 #define REG_TEMP_CONFIG 0x21
00087 #define REG_PROX_INT_THRESH 0x30
00088 #define REG_REV_ID 0xFE
00089 #define REG_PART_ID 0xFF
00090 
00091 bool maxim_max30102_init();
00092 bool maxim_max30102_read_fifo(uint32_t *pun_red_led, uint32_t *pun_ir_led);
00093 bool maxim_max30102_write_reg(uint8_t uch_addr, uint8_t uch_data);
00094 bool maxim_max30102_read_reg(uint8_t uch_addr, uint8_t *puch_data);
00095 bool maxim_max30102_reset(void);
00096 
00097 #endif /* MAX30102_H_ */