Test program for a Max30102 heartrate sensor on a STM32L476RG specific board ENSMM

Dependencies:   mbed

These two pictures show how to connect the Mheuve Sensor to the ST-Link debugger (don't forget to disable ST-link jumpers and JP5 on the board! ):

https://os.mbed.com/media/uploads/jimbaud/1611739514454.jpghttps://os.mbed.com/media/uploads/jimbaud/1611739514453.jpg

These two pictures show how to connect the Mheuve Sensor TX RX to the ST-Link debugger (don't forget to cross TX and RX, it means Mheuve sensor TX on ST-Link RX and ST-Link TX on Mheuve sensor RX ):

https://os.mbed.com/media/uploads/jimbaud/1611739514450.jpg https://os.mbed.com/media/uploads/jimbaud/1611739514452.jpg

The Mheuve sensor board needs to be powered by an external battery.

The result appears on the terminal, speed config is 115200 bds.

https://os.mbed.com/media/uploads/jimbaud/terminal.jpg

Revision:
3:7c0fb55eb3ff
Parent:
0:346a7fa07998
--- a/algorithm/algorithm.h	Thu Apr 21 18:25:34 2016 +0000
+++ b/algorithm/algorithm.h	Thu Apr 21 19:38:17 2016 +0000
@@ -69,11 +69,11 @@
 #define FS 100
 #define BUFFER_SIZE  (FS* 5) 
 #define HR_FIFO_SIZE 7
-#define MA4_SIZE  4 // DONOT CHANGE
-#define HAMMING_SIZE  5// DONOT CHANGE
+#define MA4_SIZE  4 // DO NOT CHANGE
+#define HAMMING_SIZE  5// DO NOT CHANGE
 #define min(x,y) ((x) < (y) ? (x) : (y))
 
-const uint16_t uw_hamm[31]={ 41,    276,    512,    276,     41 }; //Hamm=  long16(512* hamming(5)');
+const uint16_t auw_hamm[31]={ 41,    276,    512,    276,     41 }; //Hamm=  long16(512* hamming(5)');
 //SPO2table is computed as  -45.060*ratioAverage* ratioAverage + 30.354 *ratioAverage + 94.845 ;
 const uint8_t uch_spo2_table[184]={ 95, 95, 95, 96, 96, 96, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 99, 99, 99, 99, 
                             99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 
@@ -85,16 +85,16 @@
                             49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 31, 30, 29, 
                             28, 27, 26, 25, 23, 22, 21, 20, 19, 17, 16, 15, 14, 12, 11, 10, 9, 7, 6, 5, 
                             3, 2, 1 } ;
-static  int32_t n_dx[ BUFFER_SIZE-MA4_SIZE]; // delta
-static  int32_t n_x[ BUFFER_SIZE]; //ir
-static  int32_t n_y[ BUFFER_SIZE]; //red
+static  int32_t an_dx[ BUFFER_SIZE-MA4_SIZE]; // delta
+static  int32_t an_x[ BUFFER_SIZE]; //ir
+static  int32_t an_y[ BUFFER_SIZE]; //red
 
 
-void maxim_heart_rate_and_oxygen_saturation(uint32_t *un_ir_buffer ,  int32_t n_ir_buffer_length, uint32_t *un_red_buffer ,   int32_t *n_spo2, int8_t *ch_spo2_valid ,  int32_t *n_heart_rate , int8_t  *ch_hr_valid);
-void maxim_find_peaks( int32_t *n_locs, int32_t *n_npks,  int32_t *n_x, int32_t n_size, int32_t n_min_height, int32_t n_min_distance, int32_t n_max_num );
-void maxim_peaks_above_min_height( int32_t *n_locs, int32_t *n_npks,  int32_t *n_x, int32_t n_size, int32_t n_min_height );
-void maxim_remove_close_peaks( int32_t *n_locs, int32_t *n_npks,   int32_t  *n_x, int32_t n_min_distance );
-void maxim_sort_ascend( int32_t *n_x, int32_t n_size );
-void maxim_sort_indices_descend(  int32_t  *n_x, int32_t *n_indx, int32_t n_size);
+void maxim_heart_rate_and_oxygen_saturation(uint32_t *pun_ir_buffer ,  int32_t n_ir_buffer_length, uint32_t *pun_red_buffer ,   int32_t *pn_spo2, int8_t *pch_spo2_valid ,  int32_t *pn_heart_rate , int8_t  *pch_hr_valid);
+void maxim_find_peaks( int32_t *pn_locs, int32_t *pn_npks,  int32_t *pn_x, int32_t n_size, int32_t n_min_height, int32_t n_min_distance, int32_t n_max_num );
+void maxim_peaks_above_min_height( int32_t *pn_locs, int32_t *pn_npks,  int32_t *pn_x, int32_t n_size, int32_t n_min_height );
+void maxim_remove_close_peaks( int32_t *pn_locs, int32_t *pn_npks,   int32_t  *pn_x, int32_t n_min_distance );
+void maxim_sort_ascend( int32_t *pn_x, int32_t n_size );
+void maxim_sort_indices_descend(  int32_t  *pn_x, int32_t *pn_indx, int32_t n_size);
 
 #endif /* ALGORITHM_H_ */
\ No newline at end of file