Finished I2C functions and added some type definitions.