The MAX30112 device does not include built-in algorithms for heart rate or SpO2 measurement, nor does it come with sample code for these functions. Additionally, SpO2 polynomial coefficients must be determined empirically for each unique device design (the opto-mechanical of a wearable device influences the SpO2 coefficients), typically through hypoxia testing.
For a general example of how to initialize and configure the MAX30112, follow these steps:
- Reset the device by writing to the system control register.
- Wait for the reset to complete.
- Clear interrupts by reading the interrupt status register.
- Configure device registers by preparing a configuration table with register addresses and values. These settings may include:
- FIFO configuration
- LED enable
- ADC range
- Sample rate
- LED pulse width
- Enable other features
Write each configuration pair to the device using the appropriate communication protocol (e.g., I2C).
If heart rate and SpO2 algorithms are required, they are only available in specific encrypted microcontroller devices such as the MAX32664 and MAX32674C. These algorithms are not distributed as source code.