Hello Saa,
First, your system supports burst read operation.
If yes, could you follow below code?
config_size = sizeof(bmi2xx_config_file); file_count = 0;
while (config_size > 0) {
Wire.beginTransmission(BMI270_ADDR); Wire.write(INIT_ADDR_0); Wire.write(0x00); Wire.write(file_count); Wire.endTransmission(); byte reg_data[32]; // Begin I2C communication with provided I2C address Wire.beginTransmission(BMI270_ADDR); Wire.write(INIT_DATA); // Done writting, end the transmission Wire.endTransmission();
// Requests the required number of bytes from the sensor Wire.requestFrom((int)BMI270_ADDR, (int)32);
// Reads the requested number of bytes into the provided array
uint16_t i = 0;
for (i = 0; (i < 32 ) && Wire.available(); i++) { reg_data[i] = Wire.read(); // This is for the modern Wire library Serial.print(reg_data[i]); Serial.print(" "); }
Serial.println("\t");
filepos += 32; file_count += 1; config_size -= 32; delay(1); }
... View more