{"repo":"amaork/libi2c","free":true,"listed":false,"github":"https://github.com/amaork/libi2c","clone":"git clone https://github.com/amaork/libi2c.git","description":"Linux i2c library, support C/C++/Python","language":"C","stars":193,"topics":["i2c","i2c-device","c","python","raspberry-pi","python27","python3"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"libi2c ======= Linux userspace i2c library. Features - Support C/C++ and Python. - Support Python2+, Python3+ - Support multiple bus and devices. - Support 7-bit and 10-bit i2c slave address. - Support 1 - 4 byte internal address, auto convert. - Provide read/write/ioctl functions to operate i2c device. - Support 8/16/32/64/128/256 bytes page aligned write, read/write length are unlimited. - Using ioctl functions operate i2c can ignore i2c device ack signal and internal address. Installation pip install pylibi2c or sudo python setup.py install or sudo make install or sudo make install PYTHON=pythonX.X Interface i2c ioctl write (once max 16 bytes) are more efficient than i2c write (once max 4 bytes). / Close i2c bus / void i2c close(int bus); / Open i2c bus, return i2c bus fd / int i2c open(const char bus name); / I2C file I/O read, write / ssize t i2c read(const I2CDevice device, unsigned int iaddr, void buf, size t len); ssize t i2c write(const I2CDevice device, unsigned int iaddr, const void buf, size t len); / I2c ioctl read, write can set i2c flags / ssize t i2c ioctl read(const I2CDevice device, unsigned int iaddr, void buf, size t len); ssize t i2c ioctl write(const I2CDevice device, unsigned int iaddr, const void buf, size t len); Data structure C/C++ typedef struct i2c device { int bus; / I2C Bus fd, return from i2c open / unsigned short addr; / I2C device(slave) address / unsigned char tenbit; / I2C is 10 bit device address / unsigned char delay; / I2C internal opera","default_branch":null,"files":null,"tree":[],"storefront":"/r/amaork","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/amaork/libi2c/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}