This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Confusion reading FIFO of max30101 with nrf51

Hello,

I have configured max30101 with nrf51 and I want to read the fifo of max30101. The fifo can contain 32 samples and the size of each sample could vary from 3-9 bytes depending upon the number of bytes. My question is if I burst read the fifo by specifying the 3x32=96 bytes in data length variable of nrf_drv_rx() function, would I be able to read the all the data?. For more details, I have attached the description of FIFo register. Any help would be greatly appreciated.

Regards

Muhammad Nabeel Tahir

Parents Reply
  • Sorry for so much ambiguity. The above code in black background is from arduino library. I am using SDK 12.3.0 and the function

    // The method I am using to read the FIFO
    nrf_drv_twi_tx(&twi_ins, MAX30101_ADDRESS, &MAX30101_FIFODATA, sizeof(MAX30101_FIFODATA), true);
    nrf_drv_twi_rx(&twi_ins, MAX30101_ADDRESS, data, 3/*Read only 1 byte*/);
    nrf_delay_ms(1);
    
    
    // Here is the nrf_drv_twi_rx function
    
    ret_code_t nrf_drv_twi_rx(nrf_drv_twi_t const * p_instance,
                              uint8_t               address,
                              uint8_t *             p_data,
                              uint8_t               length)
    {
        nrf_drv_twi_xfer_desc_t xfer = NRF_DRV_TWI_XFER_DESC_RX(address, p_data, length);
        return nrf_drv_twi_xfer(p_instance, &xfer, 0);
    }
    and code is  

Children
No Data
Related