Vincent Neo / Mbed 2 deprecated CS3237_Project

Dependencies:   mbed

Committer:
tenvinc
Date:
Mon Sep 30 12:51:34 2019 +0000
Revision:
0:864a1ca8699e
initial commit;

Who changed what in which revision?

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