Bluetooth Heart Rate Monitor using Maxim MAX32630FTHR & MAXREFDES117

Fork of mbed-os-example-ble-HeartRate by mbed-os-examples

Committer:
Brakkion
Date:
Mon Dec 11 16:22:50 2017 +0000
Revision:
49:5be03f287022
Parent:
47:8ae30057edc0
Created using MAX32630FTHR & MAXREFDES117

Who changed what in which revision?

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