orangepi-xunlong / wiringOP

wiringPi for Orange Pi
GNU Lesser General Public License v3.0
394 stars 189 forks source link

OPi5 i2c interface initialized by wiringPiI2CSetup() #104

Open NicolARun06 opened 5 months ago

NicolARun06 commented 5 months ago

HW: OrangePi5, and its available I2C dev are: /dev/i2c-1, /dev/i2c-3, /dev/i2c-5.

OS: Orangepi5_1.1.8_ubuntu_jammy_desktop_xfce_linux6.1.43 the operating system default i2c dev include: /dev/i2c-0 /dev/i2c-10 /dev/i2c-2 /dev/i2c-6 /dev/i2c-7 /dev/i2c-9

But, in wiringOP sources: https://github.com/orangepi-xunlong/wiringOP/blob/ce520ea17701445eb2e8e3cc1b6e157d29b63713/wiringPi/wiringPiI2C.h#L38 https://github.com/orangepi-xunlong/wiringOP/blob/ce520ea17701445eb2e8e3cc1b6e157d29b63713/wiringPi/wiringPiI2C.c#L228

`/*

int wiringPiI2CSetup (const int devId) { int rev ; const char *device ; int model;

piBoardId(&model);

device = "/dev/i2c-0" ;

return wiringPiI2CSetupInterface (device, devId) ;

}`

The default I2C device used in code is i2c-0.

That means, this function wiringPiI2CSetup could be initialized successfully (WITHOUT open device failure) in any case, but it cannot obtain the valid register values...