MAX30102 High-Sensitivity Pulse Oximeter and Heart-Rate Sensor for Wearable Health Pseudo-Code Example of Reading Data from FIFO First transaction: Get the FIFO_WR_PTR: START; Send device address + write mode Send address of FIFO_WR_PTR; REPEATED_START; Send device address + read mode Read FIFO_WR_PTR; STOP; The central processor evaluates the number of samples to be read from the FIFO: NUM_AVAILABLE_SAMPLES = FIFO_WR_PTR – FIFO_RD_PTR (Note: pointer wrap around should be taken into account) NUM_SAMPLES_TO_READ = < less than or equal to NUM_AVAILABLE_SAMPLES > Second transaction: Read NUM_SAMPLES_TO_READ samples from the FIFO: START; Send device address + write mode Send address of FIFO_DATA; REPEATED_START; Send device address + read mode for (i = 0; i < NUM_SAMPLES_TO_READ; i++) { Read FIFO_DATA; Save LED1[23:16]; Read FIFO_DATA; Save LED1[15:8]; Read FIFO_DATA; Save LED1[7:0]; Read FIFO_DATA; Save LED2[23:16]; Read FIFO_DATA; Save LED2[15:8]; Read FIFO_DATA; Save LED2[7:0]; Read FIFO_DATA; } STOP; START; Send device address + write mode Send address of FIFO_RD_PTR; Write FIFO_RD_PTR; STOP; www.maximintegrated.com Maxim Integrated │