In case it's useful for anyone else, I have ported code for the
MLX90621 (4x16 pixel remote IR temperature sensor) from the RPi (talks
directly to the BCM hardware) to use standard Linux I2C devices (eg:
/dev/i2c1) so it works on the 'Bone and other boards with standard
Linux I2C support.
Tested on a BBB using I2C2 (/dev/i2c1, the cape EEPROM I2C bus), 5.6K
pull-up resistors, and a diode-connected transistor to drop the 3.3V
rail to the 2.6V preferred by the MLX.
Code is on github:
Thanks for that. I’ve done something similar for another Melexis device, the MLX90640 32x24 sensor.
However, I’ve used a rather bizarre interface : an arduino that does the I2C operations remotely via the usual USB-serial interface.
It also handles a couple of ST vl53l1x distance sensors. This is because I wanted a fairly generic connection that wasn’t tied to the capabilities of any particular SBC.
It’s a fairly slow way to do things and suffers from the small buffer memory in the arduino, but the USB-serial part is fairly well encapsulated and I can probably learn something from your use of the direct i2c connection. Or perhaps use USB natively, without the serial part, on a different microcontroller such as a teensy or maple.