Mode1 Optical Validation

Dependencies:   max32630fthr

Revision:
66:d4989829a23d
Parent:
65:84513856f64e
--- a/main.cpp	Wed Jun 01 01:46:28 2022 +0000
+++ b/main.cpp	Wed Jun 01 18:42:12 2022 +0000
@@ -93,11 +93,11 @@
   //#define RAW_HZ 200   // Raw data rate
   //#define RAW_HZ 2004   // Raw data rate 200 Hz, ave 4
 //#define SPO2_CAL_RPT 1
-//#define MAXM86146_OPT_VALIDATION_GRN1 1 // Optical validatation
+#define MAXM86146_OPT_VALIDATION_GRN1 1 // Optical validatation
 //#define MAXM86146_OPT_VALIDATION_GRN2 1 // Optical validatation
 //#define MAXM86146_OPT_VALIDATION_RED 1 // Optical validatation
 //#define MAXM86146_OPT_VALIDATION_IR 1 // Optical validatation
-#define MAXM86146_OPT_VALIDATION_XTALK 1 // Optical validatation
+//#define MAXM86146_OPT_VALIDATION_XTALK 1 // Optical validatation
 
 // Comment out both of the below for Normal Algorithm Samples Format
 //#define EXTENDED_ALGO 1  // define this if you want the extended algo samples report format 
@@ -1129,7 +1129,7 @@
  
 #if defined(MAXM86146_OPT_VALIDATION_XTALK)
     // Set Green1 current
-    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x23; cmd[3] = 0x52;
+    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x23; cmd[3] = 0xff;
     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);
@@ -1145,7 +1145,7 @@
     pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
 
     // Set Green2 current 
-    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x25; cmd[3] = 0x52;
+    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x25; cmd[3] = 0xff;
     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);
@@ -1161,7 +1161,7 @@
     pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
 
     // Set Red current
-    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x27; cmd[3] = 0x29;
+    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x27; cmd[3] = 0xff;
     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);
@@ -1169,7 +1169,7 @@
     pc.printf("wr afe reg Status: %x\n\r", rsp[0]);
 
     // Set IR current
-    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x28; cmd[3] = 0x29;
+    cmd[0] = 0x40; cmd[1] = 0x00; cmd[2] = 0x28; cmd[3] = 0xff;
     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);