Maxim Integrated / Mbed OS MAXREFDES220_HR_SPO2_MONITOR

Dependencies:   max32630fthr USBDevice

Fork of MAXREFDES220_HEART_RATE_MONITOR by Maxim Integrated

Finger Heart Rate Monitor and SpO2 Monitor

The MAXREFDES220 Smart Sensor FeatherWing board is a integrated solution for providing finger-based heart rate measurements and SpO2 (blood oxygen saturation). This evaluation board interfaces to the host computer using the I2C interface. Heart rate outpu is available in beats per minute (BPM) and SpO2 is reported in percentages.; the PPG (photoplethysmography) raw data is also available. The board has an MAX30101 chip which is a low power heart rate monitor with adjustable sample rates and adjustable LED currents. The low cost MAX32664 microcontroller is pre-flashed with C code for finger-based pulse rate and SpO2 monitoring. Bootloader software is included to allow for future algorithms or updates to the algorithm from Maxim Integrated.

Ordering information will be available soon.

Note: SpO2 values are not calibrated. Calibration should be performed using the final end product.

Warning

The MAXREFDES220 source code listed is dated and only compatible with the 1.2.8a.msbl. The latest sample host source code is available on the MAX32664 website.

MAXREFDES220 FeatherWing Pinout Connections

/media/uploads/phonemacro/maxrefdes220_pinouts_heart_rate_monitor.jpg

Revision:
7:3e2a5545f1d8
Parent:
5:e458409e913f
Child:
8:0f55f59ca341
diff -r af745c7b8520 -r 3e2a5545f1d8 Interfaces/SmartSensor/SSInterface.cpp
--- a/Interfaces/SmartSensor/SSInterface.cpp	Thu May 24 14:55:26 2018 -0700
+++ b/Interfaces/SmartSensor/SSInterface.cpp	Mon May 28 17:31:55 2018 -0700
@@ -68,16 +68,9 @@
 SS_STATUS SSInterface::reset_to_main_app()
 {
 	irq_pin.disable_irq();
-#if 0
-	uint8_t cmd_bytes[] = { SS_FAM_W_MODE, SS_CMDIDX_MODE };
-	uint8_t data[] = { 0x00 };
-
-	SS_STATUS status = ss_int->write_cmd(
-			&cmd_bytes[0], ARRAY_SIZE(cmd_bytes),
-			&data[0], ARRAY_SIZE(data),
-			SS_STARTUP_TIME);
-	if (status == SS_SUCCESS)
-		in_bootldr = false;
+#if 1
+	SS_STATUS status = exit_from_bootloader();
+	irq_pin.enable_irq();
 	return status;
 #else
 	reset_pin.output();
@@ -89,14 +82,13 @@
 	wait_ms(SS_STARTUP_TIME);
 	cfg_mfio(PIN_INPUT);
 	reset_pin.input();
+	irq_pin.enable_irq();
 	// Verify we exited bootloader mode
 	if (in_bootldr_mode() == 0)
 		return SS_SUCCESS;
 	else
 		return SS_ERR_UNKNOWN;
 #endif
-
-	irq_pin.enable_irq();
 }
 
 SS_STATUS SSInterface::reset_to_bootloader()
@@ -123,6 +115,7 @@
 	wait_ms(SS_STARTUP_TIME);
 	cfg_mfio(PIN_INPUT);
 	reset_pin.input();
+	stay_in_bootloader();
 	// Verify we entered bootloader mode
 	if (in_bootldr_mode() < 0)
 		return SS_ERR_UNKNOWN;
@@ -132,6 +125,32 @@
 	irq_pin.disable_irq();
 }
 
+SS_STATUS SSInterface::exit_from_bootloader()
+{
+	uint8_t cmd_bytes[] = { SS_FAM_W_MODE, SS_CMDIDX_MODE };
+	uint8_t data[] = { 0x00 };
+
+	SS_STATUS status = write_cmd(
+			&cmd_bytes[0], ARRAY_SIZE(cmd_bytes),
+			&data[0], ARRAY_SIZE(data));
+
+	in_bootldr = (status == SS_SUCCESS) ? true : false;
+	return status;
+}
+
+SS_STATUS SSInterface::stay_in_bootloader()
+{
+	uint8_t cmd_bytes[] = { SS_FAM_W_MODE, SS_CMDIDX_MODE };
+	uint8_t data[] = { SS_MASK_MODE_BOOTLDR };
+
+	SS_STATUS status = write_cmd(
+			&cmd_bytes[0], ARRAY_SIZE(cmd_bytes),
+			&data[0], ARRAY_SIZE(data));
+
+	in_bootldr = (status == SS_SUCCESS) ? true : false;
+	return status;
+}
+
 SS_STATUS SSInterface::reset()
 {
 	int bootldr = in_bootldr_mode();