Add API function to open i2c device with flags