#ifndef I2C_SIMPLE_H
#define I2C_SIMPLE_H

/* initializes i2c interface (master, 400kHz) */
void i2c_init();

/* reads len bytes from the i2c device addr into data */
uint8_t i2c_read(uint8_t addr, uint8_t len, uint8_t *data);

/* writes to an i2c device */
uint8_t i2c_write(uint8_t addr, uint8_t len, uint8_t *data);

/* writes, followed by a repeated start and a read */
uint8_t i2c_write_read(uint8_t addr, uint8_t writelen, uint8_t *writedata, uint8_t readlen, uint8_t *readdata);

#endif
