Skip to contents

Send a packet of bytes over the I2C bus and read the result, or simply read from an address.

Usage

get_I2C_bus(I2C.bus.wrapper, I2C.address, num.bytes)

set_I2C_bus(I2C.bus.wrapper, I2C.address, num.bytes, message)

Arguments

I2C.bus.wrapper

feature wrapper as returned by function rOmniDriver::get_feature_controller_I2C_bus

I2C.address

byte, address to select device in I2C bus.

num.bytes

numeric Number of bytes to be transferred or read, 1..61.

message

byte, array of bytes with maximum length of 61.

Value

The result Array of bytes containing the read data. May be null.

The result of the write to the I2C device.

Details

Several spectrometers have an I2C bus accesible through the auxiliary connector which can be used to control accessories. The I2C bus in Ocean Insight spectrometers is not intended to be used to control the spectrometer or retrieve data but instead to control and access other accessories with the spectrometer acting as middle man.

Function get_I2C_bus() performs a general purpose read on the I2C pins for interfacing to attached peripherals. The time to complete the command is determined by the amount of data transferred and the response time of the peripheral. The I2C bus runs at 400KHz. The maximum number of bytes that can be read is 61.

Function set_I2C_bus() performs a general-purpose write on the I2C pins for interfacing to attached peripherals. The time to complete the command is determined by the amount of data transferred and the response time of the peripheral. The I2C bus runs at 400KHz.

See also