Mode1 Optical Validation

Dependencies:   max32630fthr

Revision:
16:ff1122f0624a
Parent:
15:26dda33c2ef4
Child:
17:0d6e99a0fd8d
--- a/main.cpp	Thu May 13 18:41:22 2021 +0000
+++ b/main.cpp	Wed May 26 01:09:05 2021 +0000
@@ -35,6 +35,12 @@
 #include "platform/mbed_thread.h"
 #include "mbed.h"
 /******************************************************************************
+* https://os.mbed.com/users/phonemacro/code/MAX32664C_Example_Host_Code
+* Tera Term output is set to 115200 baud rate.
+* ver: 210525
+******************************************************************************/
+
+/******************************************************************************
 * Warning, if using the either
 *   MAX32630FTHR+MAXM86161_ADPTER_REVB+MAXM86146EVSYS sensor brd or
 *   MAX32630FTHR+MAXM86161_ADPTER_REVB+MAXM86161EVSYS sensor brd,
@@ -42,10 +48,6 @@
 * connected to a regulated power supply if you are testing accuracy.
 *******************************************************************************
 */
-/******************************************************************************
-* Tera Term output is set to 115200 baud rate.
-* ver: 210325
-******************************************************************************/
 
 /*****************************************************************************/
 // define one and only one of the following three platforms
@@ -258,7 +260,7 @@
 #else
             pc.printf("%d,%d,", hr, hr_conf);
             pc.printf("%d,%d,", spo2, spo2_conf);
-            pc.printf("%d,", spo2_lo);
+            pc.printf("%d,%d,%d,", spo2_lo, spo2_mo, spo2_lopi);
             pc.printf("%d,%d,", spo2_unrel, scd);
 #endif
 #else // normal algo size
@@ -368,6 +370,14 @@
     mfio = 1; mfio = 0; wait_us(300);
     pc.printf("Ver: %d %d %d %d\n\r", rsp[0], rsp[1], rsp[2], rsp[3]);
 
+// set Perfusion Index threshold from .05 to .025 (3x.13.19+)
+    cmd[0] = 0x50; cmd[1] = 0x07; cmd[2] = 0x1D; cmd[3] = 25;
+    sh_i2c.write(SH_ADDR, cmd, 4);
+    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
+    sh_i2c.read(SH_ADDR, rsp, 1);
+    mfio = 1; mfio = 0; wait_us(300);
+    pc.printf("pi set to 0x19 : %x \n\r", rsp[0]);
+
 // 1.3 sensor and algo data
     cmd[0] = 0x10; cmd[1] = 0x00;
 #ifdef ALGO_ONLY