![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Changes added for the DISCO-L476VG
Diff: MAX30102/MAX30102.h
- Revision:
- 0:346a7fa07998
- Child:
- 3:7c0fb55eb3ff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MAX30102/MAX30102.h Wed Apr 20 21:46:06 2016 +0000 @@ -0,0 +1,103 @@ +/** \file max30102.h ****************************************************** +* +* Project: MAXREFDES117# +* Filename: max30102.h +* Description: This module is an embedded controller driver header file for MAX30102 +* +* Revision History: +*\n 1-18-2016 Rev 01.00 GL Initial release. +*\n +* +* -------------------------------------------------------------------- +* +* This code follows the following naming conventions: +* +*\n char ch_pmod_value +*\n char (array) s_pmod_s_string[16] +*\n float f_pmod_value +*\n int32_t n_pmod_value +*\n int32_t (array) an_pmod_value[16] +*\n int16_t w_pmod_value +*\n int16_t (array) aw_pmod_value[16] +*\n uint16_t uw_pmod_value +*\n uint16_t (array) auw_pmod_value[16] +*\n uint8_t uch_pmod_value +*\n uint8_t (array) auch_pmod_buffer[16] +*\n uint32_t un_pmod_value +*\n int32_t * pn_pmod_value +* +* ------------------------------------------------------------------------- */ +/******************************************************************************* +* Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +******************************************************************************* +*/ +#ifndef MAX30102_H_ +#define MAX30102_H_ + +#include "mbed.h" + +#define I2C_WRITE_ADDR 0xAE +#define I2C_READ_ADDR 0xAF + +//register addresses +#define REG_INTR_STATUS_1 0x00 +#define REG_INTR_STATUS_2 0x01 +#define REG_INTR_ENABLE_1 0x02 +#define REG_INTR_ENABLE_2 0x03 +#define REG_FIFO_WR_PTR 0x04 +#define REG_OVF_COUNTER 0x05 +#define REG_FIFO_RD_PTR 0x06 +#define REG_FIFO_DATA 0x07 +#define REG_FIFO_CONFIG 0x08 +#define REG_MODE_CONFIG 0x09 +#define REG_SPO2_CONFIG 0x0A +#define REG_LED1_PA 0x0C +#define REG_LED2_PA 0x0D +#define REG_PILOT_PA 0x10 +#define REG_MULTI_LED_CTRL1 0x11 +#define REG_MULTI_LED_CTRL2 0x12 +#define REG_TEMP_INTR 0x1F +#define REG_TEMP_FRAC 0x20 +#define REG_TEMP_CONFIG 0x21 +#define REG_PROX_INT_THRESH 0x30 +#define REG_REV_ID 0xFE +#define REG_PART_ID 0xFF + +#define true 1 +#define false 0 + +bool maxim_max30102_init(); +bool maxim_max30102_read_fifo(uint32_t *un_red_led, uint32_t *un_ir_led); +bool maxim_max30102_write_reg(uint8_t uch_addr, uint8_t uch_data); +bool maxim_max30102_read_reg(uint8_t uch_addr, uint8_t *uch_data); +bool maxim_max30102_reset(void); + +#endif /* MAX30102_H_ */ \ No newline at end of file