void run_without_config_file(void) { int8_t rslt; uint8_t reg_data, command_reg, status; uint8_t data[BMA4_ACCEL_DATA_LENGTH] = { 0 }; uint16_t lsb = 0, msb = 0; int16_t x, y, z; uint8_t bma456_i2c_addr; bma456_i2c_addr = BMA4_I2C_ADDR_SECONDARY; SensorAPI_I2Cx_Read(BMA4_CHIP_ID_ADDR, ®_data, 1, &bma456_i2c_addr); PDEBUG("Chip ID:0x%02x\r\n", reg_data); command_reg = 0xB6; SensorAPI_I2Cx_Write(BMA4_CMD_ADDR, &command_reg, 1, &bma456_i2c_addr); HAL_Delay(100); bma456_i2c_addr = BMA4_I2C_ADDR_SECONDARY; SensorAPI_I2Cx_Read(BMA4_CHIP_ID_ADDR, ®_data, 1, &bma456_i2c_addr); PDEBUG("Chip ID:0x%02x\r\n", reg_data); reg_data = 0; SensorAPI_I2Cx_Write(BMA4_POWER_CONF_ADDR, ®_data, 1, &bma456_i2c_addr); bst_delay_us(450,NULL); reg_data = 0x04; SensorAPI_I2Cx_Write(BMA4_POWER_CTRL_ADDR, ®_data, 1, &bma456_i2c_addr); bst_delay_us(2,NULL); SensorAPI_I2Cx_Read(BMA4_STATUS_ADDR, ®_data, 1, &bma456_i2c_addr); PDEBUG("Status:0x%02x\r\n", reg_data); for(int i=0;i<100;i++) { SensorAPI_I2Cx_Read(BMA4_DATA_8_ADDR, data, BMA4_ACCEL_DATA_LENGTH, &bma456_i2c_addr); msb = data[1]; lsb = data[0]; /* Accel data x axis */ x = (int16_t)((msb << 8) | lsb); msb = data[3]; lsb = data[2]; /* Accel data y axis */ y = (int16_t)((msb << 8) | lsb); msb = data[5]; lsb = data[4]; /* Accel data z axis */ z = (int16_t)((msb << 8) | lsb); PDEBUG("data X: %d, Y: %d, Z: %d\r\n", x, y, z); HAL_Delay(500); } }