RTEMS  5.0.0
Data Fields

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_busbus
 The bus control.
 
uint16_t address
 The device address.
 
int bus_fd
 File descriptor of the bus. More...
 

Detailed Description

I2C slave device control.

Field Documentation

◆ bus_fd

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.

◆ ioctl

int(* i2c_dev::ioctl) (i2c_dev *dev, ioctl_command_t command, void *arg)

Device IO control.

Return values
0Successful operation.
negativeNegative error number in case of an error.

◆ read

ssize_t(* i2c_dev::read) (i2c_dev *dev, void *buf, size_t n, off_t offset)

Reads from the device.

Return values
non-negativeBytes transferred from device.
negativeNegative error number in case of an error.

◆ write

ssize_t(* i2c_dev::write) (i2c_dev *dev, const void *buf, size_t n, off_t offset)

Writes to the device.

Return values
non-negativeBytes transferred to device.
negativeNegative error number in case of an error.

The documentation for this struct was generated from the following file: