![]() ![]() The library is well documented and easy to use.īelow is test program which reads the temperature registers on a MAX31785. It is the only thing that I've found that reliably runs repeated start transactions, which are required by many devices which take a register number at the start of a read command. The nice thing about the bit bang commands is that they take a list of "address, write, data, read, start, stop" command bytes so that you can run multiple I/Os with a single call. If you are using a PI2, there is not much of a disadvantage to bit banging, since you have 4 CPUs. I especially like the bit bang mode, since it allows you to use any two GPIO pins as an I2C interface, as long as they have pullup resistors. I just started using the pigpio library and I am very impressed. Other great examples can be found on Github, like this I2CBus library I'd recommend authoring your own library to suit your needs. I've seen a few simple C++ libraries wrapping these functions. The source code for i2c-tools ( download) are good examples in C. Including i2c-dev header will allow the following I2C SMBus functions xGoat has a nice article covering preparation & usage. ![]() I'd check your distro's package repository. I can't remember if this header is shipped with the lm-sensors package, or if it will need to be installed from source. There's a i2c-dev header in the Linux userspace. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |