helper functions for I2C control