Page 1 of 1

Is i2c support via i2c_smbus functions missing on Ubuntu?

Posted: Sat Jan 18, 2020 7:28 pm
by yp66
I have used several of the FriendElec CPUs (NanoPi Fire3, NanoPC T4, NanoPi NEO4, plus others) and for the first time, I have to access an I2C device.

I am running Ubuntu 18.04.2 LTS

I can open the /dev/i2c-2 device and set the device address but I get compile errors as none of the i2c_smbus functions seems to be defined (for example i2c_smbus_read_word_data).

What am I missing before accessing I2C devices using the smbus functions?

Is there another way to access i2c devices from C/C++?