Library for MAX30101, read/write functions for registers implemented.
Dependents: test_MAX30101 testSensor
MAX30101 Class Reference
MAX30101 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health. More...
#include <MAX30101.h>
Public Member Functions | |
MAX30101 (PinName sda, PinName scl, int addr) | |
MAX30101 constructor. | |
~MAX30101 () | |
MAX30101 destructor. | |
uint8_t | getID (void) |
Get part id. | |
uint8_t | getRev (void) |
Get revision id. | |
uint16_t | getIntStatus (void) |
Get interrupt status. | |
uint16_t | getIntEnable (void) |
Get interrupt enable. | |
void | setIntEnable (uint16_t mask) |
Set interrupt enable. | |
uint8_t | getFIFO_WR_PTR (void) |
Get FIFO Write Pointer. | |
void | setFIFO_WR_PTR (uint8_t data) |
Set FIFO Write Pointer. | |
uint8_t | getOVF_COUNTER (void) |
Get FIFO Overflow Counter. | |
void | setOVF_COUNTER (uint8_t data) |
Set FIFO Overflow Counter. | |
uint8_t | getFIFO_RD_PTR (void) |
Get FIFO Read Pointer. | |
void | setFIFO_RD_PTR (uint8_t data) |
Set FIFO Read Pointer. | |
uint8_t | getFIFO_DATA (void) |
Get FIFO Data. | |
void | setFIFO_DATA (uint8_t data) |
Set FIFO Data. | |
uint8_t | getFIFO_CONFIG (void) |
Get FIFO Confuguraion. | |
void | setFIFO_CONFIG (uint8_t data) |
Set FIFO Configuration. | |
uint8_t | getMODE_CONFIG (void) |
Get MODE Configuration. | |
void | setMODE_CONFIG (uint8_t data) |
Set MODE Configuration. | |
uint8_t | getSPO2_CONFIG (void) |
Get SpO2 Configuration. | |
void | setSPO2_CONFIG (uint8_t data) |
Set SpO2 Configuration. | |
uint8_t | getLED1_PA (void) |
Get LED1 Pulse Amplitude. | |
void | setLED1_PA (uint8_t data) |
Set LED1 Pulse Amplitude. | |
uint8_t | getLED2_PA (void) |
Get LED2 Pulse Amplitude. | |
void | setLED2_PA (uint8_t data) |
Set LED2 Pulse Amplitude. | |
uint8_t | getLED3_PA (void) |
Get LED3 Pulse Amplitude. | |
void | setLED3_PA (uint8_t data) |
Set LED3 Pulse Amplitude. | |
uint8_t | getPILOT_PA (void) |
Get Proximity Mode LED Pulse Amplitude. | |
void | setPILOT_PA (uint8_t data) |
Set Proximity Mode LED Pulse Amplitude. | |
uint16_t | getSLOT (void) |
Get Multi-LED Mode Control Registers. | |
void | setSLOT (uint16_t data) |
Set Multi-LED Mode Control Registers. | |
uint8_t | getTEMP_INT (void) |
Get Temperature Data (Integer part) | |
uint8_t | getTEMP_FRAC (void) |
Get Temperature Data (Fraction part) | |
uint8_t | getTEMP_EN (void) |
Get Die Temperature Configure. | |
void | setTEMP_EN (void) |
Set Die Temperature Configure. | |
float | getTEMP (void) |
Get Temperature. | |
uint8_t | getPROX_INT_THR (void) |
Get Proximity Mode Interrupt Threshold. | |
void | setPROX_INT_THR (uint8_t data) |
Set Proximity Mode Interrupt Threshold. | |
void | clearFIFO (void) |
Clear FIFO. | |
uint32_t | readFIFO (void) |
Read FIFO. | |
void | reset (void) |
Reset. |
Detailed Description
MAX30101 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health.
Definition at line 9 of file MAX30101.h.
Constructor & Destructor Documentation
MAX30101 | ( | PinName | sda, |
PinName | scl, | ||
int | addr | ||
) |
MAX30101 constructor.
- Parameters:
-
sda SDA pin scl SCL pin addr 7bit address of the I2C peripheral
Definition at line 43 of file MAX30101.cpp.
~MAX30101 | ( | ) |
MAX30101 destructor.
Definition at line 47 of file MAX30101.cpp.
Member Function Documentation
void clearFIFO | ( | void | ) |
Clear FIFO.
Definition at line 338 of file MAX30101.cpp.
uint8_t getFIFO_CONFIG | ( | void | ) |
uint8_t getFIFO_DATA | ( | void | ) |
uint8_t getFIFO_RD_PTR | ( | void | ) |
uint8_t getFIFO_WR_PTR | ( | void | ) |
uint8_t getID | ( | void | ) |
uint16_t getIntEnable | ( | void | ) |
Get interrupt enable.
- Returns:
- interrupt Enable 1 as MSB and interrupt Status 2 as LSB
Definition at line 82 of file MAX30101.cpp.
uint16_t getIntStatus | ( | void | ) |
Get interrupt status.
- Returns:
- interrupt Status 1 as MSB and interrupt Status 2 as LSB
Definition at line 73 of file MAX30101.cpp.
uint8_t getLED1_PA | ( | void | ) |
uint8_t getLED2_PA | ( | void | ) |
uint8_t getLED3_PA | ( | void | ) |
uint8_t getMODE_CONFIG | ( | void | ) |
uint8_t getOVF_COUNTER | ( | void | ) |
uint8_t getPILOT_PA | ( | void | ) |
Get Proximity Mode LED Pulse Amplitude.
- Returns:
- PILOT_PA
Definition at line 250 of file MAX30101.cpp.
uint8_t getPROX_INT_THR | ( | void | ) |
Get Proximity Mode Interrupt Threshold.
- Returns:
- PROX_INT_THR
Definition at line 323 of file MAX30101.cpp.
uint8_t getRev | ( | void | ) |
uint16_t getSLOT | ( | void | ) |
Get Multi-LED Mode Control Registers.
- Returns:
- SLOT2, SLOT1, SLOT4, SLOT3 combined as uint16_t
Definition at line 265 of file MAX30101.cpp.
uint8_t getSPO2_CONFIG | ( | void | ) |
float getTEMP | ( | void | ) |
uint8_t getTEMP_EN | ( | void | ) |
uint8_t getTEMP_FRAC | ( | void | ) |
uint8_t getTEMP_INT | ( | void | ) |
uint32_t readFIFO | ( | void | ) |
Read FIFO.
- Returns:
- FIFO data as uint32_t
- Note:
- FIFO data is always a 3-bytes data
- byte1[1:0] : FIFO_DATA[17]-FIFO_DATA[16]
- byte2[7:0] : FIFO_DATA[15]-FIFO_DATA[8]
- byte3[7:0] : FIFO_DATA[7]-FIFO_DATA[0]
- The data is left aligned, so FIFO_DATA[17]
- is always MSB, although the data length
- can be 18-bit ~ 15-bit
Definition at line 359 of file MAX30101.cpp.
void reset | ( | void | ) |
Reset.
Definition at line 371 of file MAX30101.cpp.
void setFIFO_CONFIG | ( | uint8_t | data ) |
Set FIFO Configuration.
- Parameters:
-
data uint8_t
- Note:
- bit[7:5] -> SMP_AVE[2:0]
- bit[4] -> FIFO_ROLLOVER_EN
- bit[3:0] -> FIFO_A_FULL[3:0]
Definition at line 167 of file MAX30101.cpp.
void setFIFO_DATA | ( | uint8_t | data ) |
void setFIFO_RD_PTR | ( | uint8_t | data ) |
Set FIFO Read Pointer.
- Parameters:
-
data uint8_t FIFO_RD_PTR[4:0]
Definition at line 137 of file MAX30101.cpp.
void setFIFO_WR_PTR | ( | uint8_t | data ) |
Set FIFO Write Pointer.
- Parameters:
-
data uint8_t FIFO_WR_PTR[4:0]
Definition at line 107 of file MAX30101.cpp.
void setIntEnable | ( | uint16_t | mask ) |
Set interrupt enable.
- Parameters:
-
mask uint16_t MSB for Enable 1 and LSB for Enable 2
Definition at line 91 of file MAX30101.cpp.
void setLED1_PA | ( | uint8_t | data ) |
Set LED1 Pulse Amplitude.
- Parameters:
-
data uint8_t LED1_PA[7:0]
Definition at line 212 of file MAX30101.cpp.
void setLED2_PA | ( | uint8_t | data ) |
Set LED2 Pulse Amplitude.
- Parameters:
-
data uint8_t LED2_PA[7:0]
Definition at line 227 of file MAX30101.cpp.
void setLED3_PA | ( | uint8_t | data ) |
Set LED3 Pulse Amplitude.
- Parameters:
-
data uint8_t LED3_PA[7:0]
Definition at line 242 of file MAX30101.cpp.
void setMODE_CONFIG | ( | uint8_t | data ) |
Set MODE Configuration.
- Parameters:
-
data uint8_t
- Note:
- bit[7] Shutdown Control (SHDN)
- bit[6] Reset Control (RESET)
- bit[5:3] (reserved)
- bit[2:0] Mode Control (MODE)
Definition at line 182 of file MAX30101.cpp.
void setOVF_COUNTER | ( | uint8_t | data ) |
Set FIFO Overflow Counter.
- Parameters:
-
data uint8_t OVF_COUNTER[4:0]
Definition at line 122 of file MAX30101.cpp.
void setPILOT_PA | ( | uint8_t | data ) |
Set Proximity Mode LED Pulse Amplitude.
- Parameters:
-
data uint8_t PILOT_PA[7:0]
Definition at line 257 of file MAX30101.cpp.
void setPROX_INT_THR | ( | uint8_t | data ) |
Set Proximity Mode Interrupt Threshold.
- Parameters:
-
data uint8_t PROX_INT_THRESH[7:0]
Definition at line 330 of file MAX30101.cpp.
void setSLOT | ( | uint16_t | data ) |
Set Multi-LED Mode Control Registers.
- Parameters:
-
data uint16_t
- Note:
- bit[15] (reserved)
- bit[14:12] SLOT2[2:0]
- bit[11] (reserved)
- bit[10:8] SLOT1[2:0]
- bit[7] (reserved)
- bit[6:4] SLOT4[2:0]
- bit[3] (reserved)
- bit[2:0] SLOT3[2:0]
Definition at line 274 of file MAX30101.cpp.
void setSPO2_CONFIG | ( | uint8_t | data ) |
Set SpO2 Configuration.
- Parameters:
-
data uint8_t
- Note:
- bit[7] (reserved)
- bit[6:5] SpO2 ADC Range Control (SPO2_ADC_RGE[1:0])
- bit[4:2] SpO2 Sample Rate Control (SPO2_SR[2:0])
- bit[1:0] LED Pulse Width Control (LED_PW[1:0])
Definition at line 197 of file MAX30101.cpp.
void setTEMP_EN | ( | void | ) |
Set Die Temperature Configure.
Definition at line 304 of file MAX30101.cpp.
Generated on Tue Jul 12 2022 19:17:19 by 1.7.2