Changes done in ECG and BT
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_20sept_2017_4th_oct_2017 by
PPG/MAX30102.h@3:9a06c2bed650, 2017-02-10 (annotated)
- Committer:
- nikitateggi
- Date:
- Fri Feb 10 10:39:13 2017 +0000
- Revision:
- 3:9a06c2bed650
Peak detect to 400 samples
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nikitateggi | 3:9a06c2bed650 | 1 | /** \file max30102.h ****************************************************** |
nikitateggi | 3:9a06c2bed650 | 2 | * |
nikitateggi | 3:9a06c2bed650 | 3 | * Project: MAXREFDES117# |
nikitateggi | 3:9a06c2bed650 | 4 | * Filename: max30102.h |
nikitateggi | 3:9a06c2bed650 | 5 | * Description: This module is an embedded controller driver header file for MAX30102 |
nikitateggi | 3:9a06c2bed650 | 6 | * |
nikitateggi | 3:9a06c2bed650 | 7 | * |
nikitateggi | 3:9a06c2bed650 | 8 | * -------------------------------------------------------------------- |
nikitateggi | 3:9a06c2bed650 | 9 | * |
nikitateggi | 3:9a06c2bed650 | 10 | * This code follows the following naming conventions: |
nikitateggi | 3:9a06c2bed650 | 11 | * |
nikitateggi | 3:9a06c2bed650 | 12 | * char ch_pmod_value |
nikitateggi | 3:9a06c2bed650 | 13 | * char (array) s_pmod_s_string[16] |
nikitateggi | 3:9a06c2bed650 | 14 | * float f_pmod_value |
nikitateggi | 3:9a06c2bed650 | 15 | * int32_t n_pmod_value |
nikitateggi | 3:9a06c2bed650 | 16 | * int32_t (array) an_pmod_value[16] |
nikitateggi | 3:9a06c2bed650 | 17 | * int16_t w_pmod_value |
nikitateggi | 3:9a06c2bed650 | 18 | * int16_t (array) aw_pmod_value[16] |
nikitateggi | 3:9a06c2bed650 | 19 | * uint16_t uw_pmod_value |
nikitateggi | 3:9a06c2bed650 | 20 | * uint16_t (array) auw_pmod_value[16] |
nikitateggi | 3:9a06c2bed650 | 21 | * uint8_t uch_pmod_value |
nikitateggi | 3:9a06c2bed650 | 22 | * uint8_t (array) auch_pmod_buffer[16] |
nikitateggi | 3:9a06c2bed650 | 23 | * uint32_t un_pmod_value |
nikitateggi | 3:9a06c2bed650 | 24 | * int32_t * pn_pmod_value |
nikitateggi | 3:9a06c2bed650 | 25 | * |
nikitateggi | 3:9a06c2bed650 | 26 | * ------------------------------------------------------------------------- */ |
nikitateggi | 3:9a06c2bed650 | 27 | /******************************************************************************* |
nikitateggi | 3:9a06c2bed650 | 28 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
nikitateggi | 3:9a06c2bed650 | 29 | * |
nikitateggi | 3:9a06c2bed650 | 30 | * Permission is hereby granted, free of charge, to any person obtaining a |
nikitateggi | 3:9a06c2bed650 | 31 | * copy of this software and associated documentation files (the "Software"), |
nikitateggi | 3:9a06c2bed650 | 32 | * to deal in the Software without restriction, including without limitation |
nikitateggi | 3:9a06c2bed650 | 33 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
nikitateggi | 3:9a06c2bed650 | 34 | * and/or sell copies of the Software, and to permit persons to whom the |
nikitateggi | 3:9a06c2bed650 | 35 | * Software is furnished to do so, subject to the following conditions: |
nikitateggi | 3:9a06c2bed650 | 36 | * |
nikitateggi | 3:9a06c2bed650 | 37 | * The above copyright notice and this permission notice shall be included |
nikitateggi | 3:9a06c2bed650 | 38 | * in all copies or substantial portions of the Software. |
nikitateggi | 3:9a06c2bed650 | 39 | * |
nikitateggi | 3:9a06c2bed650 | 40 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
nikitateggi | 3:9a06c2bed650 | 41 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
nikitateggi | 3:9a06c2bed650 | 42 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
nikitateggi | 3:9a06c2bed650 | 43 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
nikitateggi | 3:9a06c2bed650 | 44 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
nikitateggi | 3:9a06c2bed650 | 45 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
nikitateggi | 3:9a06c2bed650 | 46 | * OTHER DEALINGS IN THE SOFTWARE. |
nikitateggi | 3:9a06c2bed650 | 47 | * |
nikitateggi | 3:9a06c2bed650 | 48 | * Except as contained in this notice, the name of Maxim Integrated |
nikitateggi | 3:9a06c2bed650 | 49 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
nikitateggi | 3:9a06c2bed650 | 50 | * Products, Inc. Branding Policy. |
nikitateggi | 3:9a06c2bed650 | 51 | * |
nikitateggi | 3:9a06c2bed650 | 52 | * The mere transfer of this software does not imply any licenses |
nikitateggi | 3:9a06c2bed650 | 53 | * of trade secrets, proprietary technology, copyrights, patents, |
nikitateggi | 3:9a06c2bed650 | 54 | * trademarks, maskwork rights, or any other form of intellectual |
nikitateggi | 3:9a06c2bed650 | 55 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
nikitateggi | 3:9a06c2bed650 | 56 | * ownership rights. |
nikitateggi | 3:9a06c2bed650 | 57 | ******************************************************************************* |
nikitateggi | 3:9a06c2bed650 | 58 | */ |
nikitateggi | 3:9a06c2bed650 | 59 | #ifndef MAX30102_H_ |
nikitateggi | 3:9a06c2bed650 | 60 | #define MAX30102_H_ |
nikitateggi | 3:9a06c2bed650 | 61 | |
nikitateggi | 3:9a06c2bed650 | 62 | #include "mbed.h" |
nikitateggi | 3:9a06c2bed650 | 63 | |
nikitateggi | 3:9a06c2bed650 | 64 | #define I2C_WRITE_ADDR 0xAE |
nikitateggi | 3:9a06c2bed650 | 65 | #define I2C_READ_ADDR 0xAF |
nikitateggi | 3:9a06c2bed650 | 66 | |
nikitateggi | 3:9a06c2bed650 | 67 | //register addresses |
nikitateggi | 3:9a06c2bed650 | 68 | #define REG_INTR_STATUS_1 0x00 |
nikitateggi | 3:9a06c2bed650 | 69 | #define REG_INTR_STATUS_2 0x01 |
nikitateggi | 3:9a06c2bed650 | 70 | #define REG_INTR_ENABLE_1 0x02 |
nikitateggi | 3:9a06c2bed650 | 71 | #define REG_INTR_ENABLE_2 0x03 |
nikitateggi | 3:9a06c2bed650 | 72 | #define REG_FIFO_WR_PTR 0x04 |
nikitateggi | 3:9a06c2bed650 | 73 | #define REG_OVF_COUNTER 0x05 |
nikitateggi | 3:9a06c2bed650 | 74 | #define REG_FIFO_RD_PTR 0x06 |
nikitateggi | 3:9a06c2bed650 | 75 | #define REG_FIFO_DATA 0x07 |
nikitateggi | 3:9a06c2bed650 | 76 | #define REG_FIFO_CONFIG 0x08 |
nikitateggi | 3:9a06c2bed650 | 77 | #define REG_MODE_CONFIG 0x09 |
nikitateggi | 3:9a06c2bed650 | 78 | #define REG_SPO2_CONFIG 0x0A |
nikitateggi | 3:9a06c2bed650 | 79 | #define REG_LED1_PA 0x0C |
nikitateggi | 3:9a06c2bed650 | 80 | #define REG_LED2_PA 0x0D |
nikitateggi | 3:9a06c2bed650 | 81 | #define REG_PILOT_PA 0x10 |
nikitateggi | 3:9a06c2bed650 | 82 | #define REG_MULTI_LED_CTRL1 0x11 |
nikitateggi | 3:9a06c2bed650 | 83 | #define REG_MULTI_LED_CTRL2 0x12 |
nikitateggi | 3:9a06c2bed650 | 84 | #define REG_TEMP_INTR 0x1F |
nikitateggi | 3:9a06c2bed650 | 85 | #define REG_TEMP_FRAC 0x20 |
nikitateggi | 3:9a06c2bed650 | 86 | #define REG_TEMP_CONFIG 0x21 |
nikitateggi | 3:9a06c2bed650 | 87 | #define REG_PROX_INT_THRESH 0x30 |
nikitateggi | 3:9a06c2bed650 | 88 | #define REG_REV_ID 0xFE |
nikitateggi | 3:9a06c2bed650 | 89 | #define REG_PART_ID 0xFF |
nikitateggi | 3:9a06c2bed650 | 90 | |
nikitateggi | 3:9a06c2bed650 | 91 | bool maxim_max30102_init(); |
nikitateggi | 3:9a06c2bed650 | 92 | bool maxim_max30102_read_fifo(uint32_t *pun_red_led); //(uint32_t *pun_red_led, uint32_t *pun_ir_led); |
nikitateggi | 3:9a06c2bed650 | 93 | bool maxim_max30102_write_reg(uint8_t uch_addr, uint8_t uch_data); |
nikitateggi | 3:9a06c2bed650 | 94 | bool maxim_max30102_read_reg(uint8_t uch_addr, uint8_t *puch_data); |
nikitateggi | 3:9a06c2bed650 | 95 | bool maxim_max30102_reset(void); |
nikitateggi | 3:9a06c2bed650 | 96 | |
nikitateggi | 3:9a06c2bed650 | 97 | #endif /* MAX30102_H_ */ |