Mode1 Optical Validation

Dependencies:   max32630fthr

Revision:
24:064478ff33d2
Parent:
23:e7ecf1416965
Child:
25:e790416e273e
--- a/main.cpp	Thu Jun 17 23:01:23 2021 +0000
+++ b/main.cpp	Tue Jun 22 17:08:41 2021 +0000
@@ -37,7 +37,7 @@
 /******************************************************************************
 * https://os.mbed.com/users/phonemacro/code/MAX32664C_Example_Host_Code
 * Tera Term output is set to 115200 baud rate.
-* ver: 210615
+* ver: 210622
 ******************************************************************************/
 
 /******************************************************************************
@@ -49,12 +49,35 @@
 *******************************************************************************
 */
 
-/*****************************************************************************/
+/*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*/
 // define one and only one of the following three platforms
 #define MAXM86146_CFG 1  // tested on MAXM86146EVSYS_sensorBrd+MAXM86161_ADAPTER_REVB+MAX32630FTHR 33.13.12
 //#define MAXREFDES103_CFG  // not tested
 //#define MAXM86161_CFG 1  // tested on MAXM86161+MAX32630FTHR v32.9.22, 32.13.12
 /*****************************************************************************/
+
+/*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*/
+// define which adaptor board is being used
+//#define MAXM86161_ADPTR_EVKIT_B
+#define MAXREFDES1319
+/******************************************************************************
+* MAX32630FTHR GPIOs
+******************************************************************************/
+#ifdef MAXM86161_ADPTR_EVKIT_B
+  #define RST_PIN   P5_6
+  #define MFIO_PIN  P5_4
+#else
+  #ifdef MAXREFDES1319
+     #define RST_PIN   P3_0
+     #define MFIO_PIN  P5_2
+  #endif
+#endif
+
+DigitalOut rst(RST_PIN, PullUp);
+DigitalOut mfio(MFIO_PIN, PullUp);
+I2C sh_i2c(P3_4, P3_5);
+
+/*****************************************************************************/
 #if defined(MAXM86161_CFG)  //|| defined(MAXM86146_CFG)  // don't need 3.3V for MAXM86146EVSYS_sensorBrd+MAXM86161_ADAPTER_REVB+MAX32630FTHR
 #include "max32630fthr.h"
 MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); // Enable J1-pin2, 3.3V and set GPIO to 3.3v
@@ -106,14 +129,6 @@
 DigitalOut rLED(LED1);
 DigitalOut gLED(LED2);
 DigitalOut bLED(LED3);
-/******************************************************************************
-* MAX32630FTHR GPIOs
-******************************************************************************/
-#define RST_PIN   P5_6
-#define MFIO_PIN  P5_4
-DigitalOut rst(RST_PIN, PullUp);
-DigitalOut mfio(MFIO_PIN, PullUp);
-I2C sh_i2c(P3_4, P3_5);
 
 //#define thread_sleep_for(x) wait_ms(x) // for older versions of mbed