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)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
Other Spectrometer I2C- and SPI-bus functions.:
get_SPI_bytes(),
get_feature_I2C_bus(),
get_feature_SPI_bus(),
is_feature_supported_I2C_bus(),
is_feature_supported_SPI_bus()
