Hexiwear Heart rate sensor driver

Dependents:   Hexi_MAX30101 Hexiwear HexiwearFinal HexiwearFinal1

Fork of FXOS8700 by Aswin Sivakumar

Files at this revision

API Documentation at this revision

Comitter:
DimiterK
Date:
Sun Sep 04 22:37:38 2016 +0000
Parent:
3:4bfb42d6c70c
Commit message:
First revision , not yet operational

Changed in this revision

MAX30101.cpp Show annotated file Show diff for this revision Revisions of this file
MAX30101.h Show annotated file Show diff for this revision Revisions of this file
diff -r 4bfb42d6c70c -r 3be008e67345 MAX30101.cpp
--- a/MAX30101.cpp	Tue Aug 30 22:13:28 2016 +0000
+++ b/MAX30101.cpp	Sun Sep 04 22:37:38 2016 +0000
@@ -2,10 +2,11 @@
  #include "mbed.h"
 
 
-MAX30101::MAX30101(PinName sda, PinName scl ,int addr) : m_i2c(sda, scl), m_addr(addr) {
+MAX30101::MAX30101(PinName sda, PinName scl) : m_i2c(sda, scl){
    // mode (HR, SpO2, or multi-led)
    mode = modeMultiLED;
 
+    m_addr = MAX30101_I2C_ADDRESS;
    // LED currents
    LEDCurrentRed = 0;
    LEDCurrentIR = 0;
@@ -29,13 +30,13 @@
 //
 //   writeRegister( MAX30101_FIFOConfiguration , 0x06 );
 //   writeRegister( MAX30101_SPO2Configuration , 0x43 );
-//
-//   writeRegister(MAX30101_ProximityInterruptThreshold , 0x14 );
-//
-//   /** clear FIFO pointers */
-//   writeRegister(MAX30101_FIFO_WR_PTR , 0 );
-//   writeRegister(MAX30101_FIFO_RD_PTR , 0 );
-//   writeRegister(MAX30101_FIFO_OV_PTR , 0 );
+
+   writeRegister(MAX30101_ProximityInterruptThreshold , 0x14 );
+
+   /** clear FIFO pointers */
+   writeRegister(MAX30101_FIFO_WR_PTR , 0 );
+   writeRegister(MAX30101_FIFO_RD_PTR , 0 );
+   writeRegister(MAX30101_FIFO_OV_PTR , 0 );
 
 }
  
diff -r 4bfb42d6c70c -r 3be008e67345 MAX30101.h
--- a/MAX30101.h	Tue Aug 30 22:13:28 2016 +0000
+++ b/MAX30101.h	Sun Sep 04 22:37:38 2016 +0000
@@ -160,7 +160,7 @@
   * @param sdl SCL pin
   * @param addr addr of the I2C peripheral
   */
-  MAX30101(PinName sda, PinName scl,  int addr);
+  MAX30101(PinName sda, PinName scl);
  
   /**
   * MAX30101 destructor