RTEMS
5.1
|
I2C slave device control. More...
#include <i2c.h>
Data Fields | |
ssize_t(* | read )(i2c_dev *dev, void *buf, size_t n, off_t offset) |
Reads from the device. More... | |
ssize_t(* | write )(i2c_dev *dev, const void *buf, size_t n, off_t offset) |
Writes to the device. More... | |
int(* | ioctl )(i2c_dev *dev, ioctl_command_t command, void *arg) |
Device IO control. More... | |
off_t(* | get_size )(i2c_dev *dev) |
Gets the file size. | |
blksize_t(* | get_block_size )(i2c_dev *dev) |
Gets the file block size. | |
void(* | destroy )(i2c_dev *dev) |
Destroys the device. | |
i2c_bus * | bus |
The bus control. | |
uint16_t | address |
The device address. | |
int | bus_fd |
File descriptor of the bus. More... | |
I2C slave device control.
int i2c_dev::bus_fd |
File descriptor of the bus.
This prevents destruction of the bus since we hold a reference to it with this.
int(* i2c_dev::ioctl) (i2c_dev *dev, ioctl_command_t command, void *arg) |
Device IO control.
0 | Successful operation. |
negative | Negative error number in case of an error. |
ssize_t(* i2c_dev::read) (i2c_dev *dev, void *buf, size_t n, off_t offset) |
Reads from the device.
non-negative | Bytes transferred from device. |
negative | Negative error number in case of an error. |
ssize_t(* i2c_dev::write) (i2c_dev *dev, const void *buf, size_t n, off_t offset) |
Writes to the device.
non-negative | Bytes transferred to device. |
negative | Negative error number in case of an error. |