Kartik Sastry / Mbed 2 deprecated 4180Final

Dependencies:   4DGL-uLCD-SE LSM9DS1_Library-KVS MBed_Adafruit-GPS-Library PinDetect X_NUCLEO_53L0A1 mbed-rtos mbed

Committer:
ksastry3
Date:
Thu Dec 14 07:21:52 2017 +0000
Revision:
1:abc522e41d63
Final Version 12/14/2017 by Kartik V. Sastry

Who changed what in which revision?

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