AnsweredAssumed Answered

Sequential Read of ADXL345

Question asked by du_toit.brandon on Oct 23, 2016
Latest reply on Oct 24, 2016 by barton.michael
Hello, I am having problems reading the 6 output registers sequentially using the HAL drivers. I am able to read them one at a time without problems, but can't seem to get the sequential thing working? I'm using the following HAL function:

HAL_I2C_Master_Sequential_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)

where pData is defined as a uint8_t[6]. Do I need to run a loop to fill all 6 spaces in the variable or will all fill at the same time? And which of the XferOptions below do I use because this confuses me?

*I2C_FIRST_AND_LAST_FRAME: No sequential usage, functional is same as associated interfaces in no sequential mode
*I2C_FIRST_FRAME: Sequential usage, this option allow to manage a sequence with start condition, address and data to transfer without a final stop condition
*I2C_NEXT_FRAME: Sequential usage, this option allow to manage a sequence with a restart condition, address and with new data to transfer if the direction change or manage only the new data to transfer if no direction change and without a final stop condition in both cases
* I2C_LAST_FRAME: Sequential usage, this option allow to manage a sequence with a restart condition, address and with new data to transfer if the direction change or manage only the new data to transfer if no direction change and with a final stop condition in both cases

Outcomes