Lines Matching refs:i2c
1 Usually, i2c devices are controlled by a kernel driver. But it is also
3 the /dev interface. You need to load module i2c-dev for this.
5 Each registered i2c adapter gets a number, counting from 0. You can
6 examine /proc/bus/i2c to see what number corresponds to which adapter.
9 explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,
10 i2c-10, ...). All 256 minor device numbers are reserved for i2c.
16 So let's say you want to access an i2c adapter from a C program. The
17 first thing to do is `#include <linux/i2c.h>" and "#include <linux/i2c-dev.h>.
19 knows about i2c, there is not much choice.
22 inspect /proc/bus/i2c to decide this. Adapter numbers are assigned
23 somewhat dynamically, so you can not even assume /dev/i2c-0 is the
31 sprintf(filename,"/dev/i2c-%d",adapter_nr);
54 /* ERROR HANDLING: i2c transaction failed */
64 /* ERROR HANDLING: i2c transaction failed */
68 /* ERROR HANDLING: i2c transaction failed */
81 (see also i2c-dev.h and i2c.h):
115 You can do plain i2c transactions by using read(2) and write(2) calls.