[peripherals] refactor adxl345 i2c driver