Mode1 Optical Validation

Dependencies:   max32630fthr

Revision:
17:0d6e99a0fd8d
Parent:
16:ff1122f0624a
Child:
18:f4c95b1c0efc
--- a/main.cpp	Wed May 26 01:09:05 2021 +0000
+++ b/main.cpp	Thu Jun 10 23:25:26 2021 +0000
@@ -55,7 +55,8 @@
 //#define MAXREFDES103_CFG
 //#define MAX86161_CFG 1
 /*****************************************************************************/
-
+#include "max32630fthr.h"
+MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); // Enable J1-pin2, 3.3V and set GPIO to 3.3v
 //#define RAW  // define this if you only AFE+accel data, no algo
 #define ALGO_ONLY 1  // define this if you only want algo data, comment out if you want raw sensor+algo data
 //#define EXTENDED_ALGO 1  // define this if you want the extended algo format
@@ -370,13 +371,41 @@
     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;
+#if 0
+// algo sz
+    cmd[0] = 0x11; cmd[1] = 0x06; cmd[2] = 0x01;
+    sh_i2c.write(SH_ADDR, cmd, 3);
+    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
+    sh_i2c.read(SH_ADDR, rsp, 2);
+    mfio = 1; mfio = 0; wait_us(300);
+    pc.printf("algo size: %d %d \n\r", rsp[0], rsp[1]);
+
+// algo sz
+    cmd[0] = 0x11; cmd[1] = 0x06; cmd[2] = 0x02;
+    sh_i2c.write(SH_ADDR, cmd, 3);
+    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
+    sh_i2c.read(SH_ADDR, rsp, 2);
+    mfio = 1; mfio = 0; wait_us(300);
+    pc.printf("algo size: %d %d \n\r", rsp[0], rsp[1]);
+
+// algo sz
+    cmd[0] = 0x11; cmd[1] = 0x06; cmd[2] = 0x03;
+    sh_i2c.write(SH_ADDR, cmd, 3);
+    mfio = 1; thread_sleep_for(2); mfio = 0; wait_us(300);
+    sh_i2c.read(SH_ADDR, rsp, 2);
+    mfio = 1; mfio = 0; wait_us(300);
+    pc.printf("algo size: %d %d \n\r", rsp[0], rsp[1]);
+#endif
+
+#if 0
+// set Perfusion Index threshold to .05 (3x.13.19+)
+    cmd[0] = 0x50; cmd[1] = 0x07; cmd[2] = 0x1D; cmd[3] = 50;
     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]);
+#endif
 
 // 1.3 sensor and algo data
     cmd[0] = 0x10; cmd[1] = 0x00;