mraa_i2c_context mraa_i2c_init(int bus);
/**
- * Initialise i2c context, passing in spi bus to use.
+ * Initialise i2c context, passing in the i2c bus to use.
*
* @param bus The i2c bus to use i.e. /dev/i2c-2 would be "2"
* @return i2c context or NULL
* Sets the frequency of the i2c context. Most platforms do not support this.
*
* @param dev The i2c context
- * @param hz The bus frequency in hertz
+ * @param mode The bus mode
* @return Result of operation
*/
-mraa_result_t mraa_i2c_frequency(mraa_i2c_context dev, int hz);
+mraa_result_t mraa_i2c_frequency(mraa_i2c_context dev, mraa_i2c_mode_t mode);
/**
* Simple bulk read from an i2c context, this will always begin with the i2c
* @param length max number of bytes to read
* @return length of the read in bytes or 0
*/
-int mraa_i2c_read(mraa_i2c_context dev, uint8_t *data, int length);
+int mraa_i2c_read(mraa_i2c_context dev, uint8_t* data, int length);
/**
* Simple read for a single byte from the i2c context, this will always begin
uint16_t mraa_i2c_read_word_data(mraa_i2c_context dev, const uint8_t command);
/**
+ * Bulk read from i2c context, starting from designated register
+ *
+ * @param dev The i2c context
+ * @param command The register
+ * @param data pointer to the byte array to read data in to
+ * @param length max number of bytes to read
+ * @return The length in bytes passed to the function or 0
+ */
+int mraa_i2c_read_bytes_data(mraa_i2c_context dev, uint8_t command, uint8_t* data, int length);
+
+/**
* Write length bytes to the bus, the first byte in the array is the
* command/register to write
*
* @param length the number of bytes to transmit
* @return Result of operation
*/
-mraa_result_t mraa_i2c_write(mraa_i2c_context dev, const uint8_t *data, int length);
+mraa_result_t mraa_i2c_write(mraa_i2c_context dev, const uint8_t* data, int length);
/**
* Write a single byte to an i2c context, always at offset 0x0