cancel
Showing results for 
Search instead for 
Did you mean: 

IIS3DWB Question about Reading Multiple Data from FIFO

HKim.23
Associate III

I am using the IIS3DWB sensor and have a question about reading data from the FIFO.

Currently, I use the following function to retrieve one set of x, y, z values at a time:

int32_t iis3dwb_fifo_out_raw_get(stmdev_ctx_t *ctx, uint8_t *buff)
{
int32_t ret;
ret = iis3dwb_read_reg(ctx, IIS3DWB_FIFO_DATA_OUT_X_L, buff, 6);
return ret;
}

If I want to retrieve 1024 sets of data at once, can I modify it like this:

ret = iis3dwb_read_reg(ctx, IIS3DWB_FIFO_DATA_OUT_X_L, buff, 1024 * 6);

Will this allow the SPI to fetch all 1024 sets of data in a single cycle?

Additionally, I am using the sensor's FIFO feature with an ODR set to ODR/10, resulting in approximately a 2.6 kHz data FIFO buffer rate. I am interested in reading the buffer data at once when the COUNTER_BDR_IA flag is enabled.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @HKim.23 ,

You can retrieve 1024 sets of data at once, please refer to our drivers on github to develop this correctly using the multiread function: 

FedericaBossi_0-1705930588230.png

 

Yes, you can read the buffer data at once when the COUNTER_BDR_IA flag is enabled.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Federica Bossi
ST Employee

Hi @HKim.23 ,

You can retrieve 1024 sets of data at once, please refer to our drivers on github to develop this correctly using the multiread function: 

FedericaBossi_0-1705930588230.png

 

Yes, you can read the buffer data at once when the COUNTER_BDR_IA flag is enabled.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
HKim.23
Associate III

Thanks, Federica.

I will try it.