Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: max32630fthr USBDevice
Fork of MAXREFDES220_HEART_RATE_MONITOR by
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

Diff: Interfaces/SensorComm/SmartSensorComm/SSMAX30101/SSMAX30101Comm.cpp
- Revision:
- 8:0f55f59ca341
- Parent:
- 5:e458409e913f
diff -r 3e2a5545f1d8 -r 0f55f59ca341 Interfaces/SensorComm/SmartSensorComm/SSMAX30101/SSMAX30101Comm.cpp
--- a/Interfaces/SensorComm/SmartSensorComm/SSMAX30101/SSMAX30101Comm.cpp Mon May 28 17:31:55 2018 -0700
+++ b/Interfaces/SensorComm/SmartSensorComm/SSMAX30101/SSMAX30101Comm.cpp Mon Jul 02 21:07:27 2018 +0000
@@ -38,6 +38,10 @@
#include "utils.h"
#include "CRC8.h"
+#ifdef ENABLE_BLE
+#include "BLE_ICARUS.h"
+#endif
+
#define ENABLE_MAX30101
#define ENABLE_ACCEL
#define ENABLE_WHRM_ANS_SP02
@@ -58,8 +62,6 @@
"set_cfg bpt med",
"set_cfg bpt sys_bp",
"set_cfg bpt dia_bp",
- "get_cfg bpt cal_result",
- "set_cfg bpt cal_result",
"set_cfg bpt date",
"set_cfg bpt nonrest",
"self_test ppg os24",
@@ -122,10 +124,10 @@
unsigned int val32;
//Eat spaces after cmd
- while (*sptr != ' ' && *sptr != '\0') { sptr++; }
+ while (*sptr == ' ') { sptr++; }
if (*sptr == '\0')
return -1;
- sptr++;
+ //sptr++;
while (found < cal_data_sz) {
if (*sptr == '\0')
@@ -149,6 +151,7 @@
bool SSMAX30101Comm::parse_command(const char* cmd)
{
int ret;
+ char cal_str_to_be_set[650];
SS_STATUS status;
bool recognizedCmd = false;
@@ -509,46 +512,6 @@
m_USB->printf("\r\n%s err=%d\r\n", cmd, COMM_GENERAL_ERROR);
} break;
- case get_cfg_bpt_cal_data:
- {
- //Calibration result will be 2*(35 + 3) values, 4 bytes each, for a total of 304 bytes
- uint8_t cal_result[304];
- char cal_str[2*sizeof(cal_result)];
- int str_idx = 0;
-
- status = ss_int->get_algo_cfg(SS_ALGOIDX_BPT, SS_CFGIDX_BP_CAL_DATA,
- &cal_result[0], sizeof(cal_result));
-
- if (status != SS_SUCCESS) {
- m_USB->printf("\r\n%s err=%d\r\n", cmd, COMM_GENERAL_ERROR);
- break;
- }
-
- for (int i = 0; i < sizeof(cal_result); i++)
- str_idx += snprintf(cal_str + str_idx, sizeof(cal_str) - str_idx - 1, "%02X", cal_result[i]);
-
- m_USB->printf("\r\n%s value=%s err=%d\r\n", cmd, cal_str, COMM_SUCCESS);
- } break;
-
- case set_cfg_bpt_cal_data:
- {
- uint8_t cal_data[304];
- ret = parse_cal_str(cmd, cmd_tbl[i], cal_data, sizeof(cal_data));
-
- if (ret) {
- m_USB->printf("\r\n%s err=%d\r\n", cmd, COMM_INVALID_PARAM);
- break;
- }
-
- status = ss_int->set_algo_cfg(SS_ALGOIDX_BPT, SS_CFGIDX_BP_CAL_DATA,
- &cal_data[0], sizeof(cal_data));
-
- if (status == SS_SUCCESS)
- m_USB->printf("\r\n%s err=%d\r\n", cmd, COMM_SUCCESS);
- else
- m_USB->printf("\r\n%s err=%d\r\n", cmd, COMM_GENERAL_ERROR);
- } break;
-
case set_cfg_bpt_date:
{
// Date format is yyyy mm dd
@@ -796,8 +759,8 @@
pkt->prog = bpt_sample.prog;
pkt->sys_bp = bpt_sample.sys_bp;
pkt->dia_bp = bpt_sample.dia_bp;
- pkt->crc8 = crc8((uint8_t*)pkt, sizeof(ds_pkt_data_mode1) - sizeof(uint8_t));
- data_len = sizeof(ds_pkt_data_mode1);
+ pkt->crc8 = crc8((uint8_t*)pkt, sizeof(ds_pkt_bpt_data) - sizeof(uint8_t));
+ data_len = sizeof(ds_pkt_bpt_data);
#endif
}
@@ -878,3 +841,8 @@
}
return true;
}
+
+const char* SSMAX30101Comm::get_algo_ver()
+{
+ return ss_int->get_ss_algo_version();
+}

Heart Rate SpO2 Algorithm EvKit Health Monitor Development System Board MAXREFDES220