pihwm  r1
A lightweight C library for Raspberry Pi hardware modules.
pi_i2c.h
Go to the documentation of this file.
1 
28 #ifndef PI_I2C_H
29 #define PI_I2C_H
30 
31 int i2c_init ();
32 int i2c_init_name (char *devname);
33 int i2c_select_device (unsigned int fd, unsigned int addr);
34 int i2c_write (unsigned int fd, unsigned int addr, unsigned char *data, unsigned int len);
35 int i2c_read (unsigned int fd, unsigned int addr, unsigned char *data, unsigned int len);
36 
37 #endif
int i2c_write(unsigned int fd, unsigned int addr, unsigned char *data, unsigned int len)
Initiates an I2C write operation.
Definition: pi_i2c.c:145
int i2c_select_device(unsigned int fd, unsigned int addr)
Selects a specific I2C slave device.
Definition: pi_i2c.c:121
int i2c_init_name(char *devname)
Initialises the i2c-dev interface for the sysfs entry specified by the devname parameter.
Definition: pi_i2c.c:97
int i2c_init()
Initialises the i2c-dev interface for the I2C peripheral exposed on the P1 header (which is dependent...
Definition: pi_i2c.c:54
int i2c_read(unsigned int fd, unsigned int addr, unsigned char *data, unsigned int len)
Initiates an I2C read operation.
Definition: pi_i2c.c:176