MAXREFDES117# Code Documentation  V01.00
Heart Rate / SpO2 Monitor
 All Files Functions Variables Macros Pages
MAX30102.h
Go to the documentation of this file.
1 
27 /*******************************************************************************
28 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
29 *
30 * Permission is hereby granted, free of charge, to any person obtaining a
31 * copy of this software and associated documentation files (the "Software"),
32 * to deal in the Software without restriction, including without limitation
33 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
34 * and/or sell copies of the Software, and to permit persons to whom the
35 * Software is furnished to do so, subject to the following conditions:
36 *
37 * The above copyright notice and this permission notice shall be included
38 * in all copies or substantial portions of the Software.
39 *
40 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
41 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
44 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
45 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46 * OTHER DEALINGS IN THE SOFTWARE.
47 *
48 * Except as contained in this notice, the name of Maxim Integrated
49 * Products, Inc. shall not be used except as stated in the Maxim Integrated
50 * Products, Inc. Branding Policy.
51 *
52 * The mere transfer of this software does not imply any licenses
53 * of trade secrets, proprietary technology, copyrights, patents,
54 * trademarks, maskwork rights, or any other form of intellectual
55 * property whatsoever. Maxim Integrated Products, Inc. retains all
56 * ownership rights.
57 *******************************************************************************
58 */
59 #ifndef MAX30102_H_
60 #define MAX30102_H_
61 
62 #include "mbed.h"
63 
64 #define I2C_WRITE_ADDR 0xAE
65 #define I2C_READ_ADDR 0xAF
66 
67 //register addresses
68 #define REG_INTR_STATUS_1 0x00
69 #define REG_INTR_STATUS_2 0x01
70 #define REG_INTR_ENABLE_1 0x02
71 #define REG_INTR_ENABLE_2 0x03
72 #define REG_FIFO_WR_PTR 0x04
73 #define REG_OVF_COUNTER 0x05
74 #define REG_FIFO_RD_PTR 0x06
75 #define REG_FIFO_DATA 0x07
76 #define REG_FIFO_CONFIG 0x08
77 #define REG_MODE_CONFIG 0x09
78 #define REG_SPO2_CONFIG 0x0A
79 #define REG_LED1_PA 0x0C
80 #define REG_LED2_PA 0x0D
81 #define REG_PILOT_PA 0x10
82 #define REG_MULTI_LED_CTRL1 0x11
83 #define REG_MULTI_LED_CTRL2 0x12
84 #define REG_TEMP_INTR 0x1F
85 #define REG_TEMP_FRAC 0x20
86 #define REG_TEMP_CONFIG 0x21
87 #define REG_PROX_INT_THRESH 0x30
88 #define REG_REV_ID 0xFE
89 #define REG_PART_ID 0xFF
90 
91 bool maxim_max30102_init();
92 bool maxim_max30102_read_fifo(uint32_t *pun_red_led, uint32_t *pun_ir_led);
93 bool maxim_max30102_write_reg(uint8_t uch_addr, uint8_t uch_data);
94 bool maxim_max30102_read_reg(uint8_t uch_addr, uint8_t *puch_data);
95 bool maxim_max30102_reset(void);
96 
97 #endif /* MAX30102_H_ */