Library for MAX30101 SpO2 and heart rate sensor
Dependents: HeartRate HeartRate proj final_project_ee119 ... more
Diff: MAX30101.h
- Revision:
- 5:be1dde31fe49
- Parent:
- 4:d1b50bd4065a
- Child:
- 6:302fb0f991d8
diff -r d1b50bd4065a -r be1dde31fe49 MAX30101.h --- a/MAX30101.h Thu May 04 23:46:46 2017 +0000 +++ b/MAX30101.h Fri May 05 00:25:21 2017 +0000 @@ -109,6 +109,57 @@ MultiLedMode = 7 }; + ///Number of LED channels used + enum LedChannels_e + { + OneLedChannel = 1, + TwoLedChannels = 2, + ThreeLedChannels = 3 + }; + + ///Number of samples averaged per FIFO sample, set in FIFO config + enum NumSamplesAveraged_e + { + AveragedSamples_0 = 0, + AveragedSamples_2 = 1, + AveragedSamples_4 = 2, + AveragedSamples_8 = 3, + AveragedSamples_16 = 4, + AveragedSamples_32 = 5 + }; + + ///ADC Range, set in SpO2 config + enum ADCRange_e + { + ADC_Range_0 = 0, + ADC_Range_1 = 1, + ADC_Range_2 = 2, + ADC_Range_3 = 3 + }; + + //LED PulseWidth, set in SpO2 config + enum LEDPulseWidth + { + PW_0 = 0, + PW_1 = 0, + PW_2 = 0, + PW_3 = 0 + }; + + + ///Sample rate, set in SpO2 config + enum SampleRate_e + { + SR_50_Hz = 0, + SR_100_Hz = 1, + SR_200_Hz = 3, + SR_400_Hz = 4, + SR_800_Hz = 5, + SR_1000_Hz = 6, + SR_1600_Hz = 7, + SR_3200_Hz = 8 + }; + ///Interrupt Status/Enable BitField union InterruptBitField_u { @@ -345,7 +396,7 @@ * * @return 0 on success, non 0 otherwise */ - int32_t readFIFO(uint8_t numLeds, uint8_t *data, uint16_t &readBytes); + int32_t readFIFO(LedChannels_e numLeds, uint8_t *data, uint16_t &readBytes); protected: