59 #include <sys/types.h> 60 #include <sys/errno.h> 61 #include <sys/ioctl.h> 63 #include "rnr/rnrconfig.h" 125 return rc>=0? 0x0FF & data.
byte: -1;
161 return rc>=0? 0x0FF & data.
byte: -1;
203 return rc>=0? 0x0FFFF & data.
word: -1;
248 return rc>=0? 0x0FFFF & data.
word: -1;
275 for(i=1; i<=data.
block[0]; ++i)
277 values[i-1] = data.
block[i];
298 const byte_t *values)
308 for(i=1; i<=length; i++)
310 data.
block[i] = values[i-1];
312 data.
block[0] = length;
340 for(i=1; i<=data.
block[0]; i++)
342 values[i-1] = data.
block[i];
362 const byte_t *values)
372 for(i=1; i<=length; i++)
374 data.
block[i] = values[i-1];
376 data.
block[0] = length;
408 for(i=1; i<=length; i++)
410 data.
block[i] = values[i-1];
412 data.
block[0] = length;
419 for(i=1; i<=data.
block[0]; i++)
421 values[i-1] = data.
block[i];
byte_t block[32+2]
block[0] is used for length and one more for PEC
#define I2C_NOCMD
no command
int i2c_smbus_access(int fd, byte_t read_write, byte_t command, int size, i2c_smbus_data_t *data)
Execute an SMBus IOCTL.
#define I2C_SMBUS_READ
read
int i2c_smbus_process_call(int fd, byte_t command, ushort_t value)
Issue a 2-byte word process call (write/read) to the SMBus.
#define I2C_SMBUS_WORD_DATA
data word r/w operation
#define I2C_SMBUS_I2C_BLOCK_DATA
i2c format block r/w/ operation
int i2c_smbus_read_byte(int fd)
Read an immediate byte from the SMBus.
#define I2C_SMBUS_I2C_BLOCK_MAX
Not specified - use same structure.
int i2c_smbus_write_i2c_block_data(int fd, byte_t command, byte_t length, const byte_t *values)
Write a block of data to the SMBus via low-level I2C.
int i2c_smbus_write_quick(int fd, byte_t value)
Write a quick value to the SMBus.
#define I2C_SMBUS_BLOCK_DATA
data block r/w operation
#define I2C_SMBUS_BYTE_DATA
data byte r/w operation
ushort_t word
data short word
#define I2C_SMBUS_PROC_CALL
issue word process call
int i2c_smbus_read_word_data(int fd, byte_t command)
Read a data 2-byte word from the SMBus.
I2C SMBus IOCTL Call Structure.
#define I2C_SMBUS_BLOCK_MAX
As specified in SMBus standard.
I2C character device interface.
#define I2C_SMBUS_BLOCK_PROC_CALL
SMBus 2.0: issue block process call.
int i2c_smbus_read_block_data(int fd, byte_t command, byte_t *values)
Read a block of data from the SMBus.
#define I2C_SMBUS
SMBus-level access.
int i2c_smbus_write_byte_data(int fd, byte_t command, byte_t value)
Write a data byte to the SMBus.
int i2c_smbus_read_i2c_block_data(int fd, byte_t command, byte_t *values)
Read a block of data from the SMBus via low-level I2C.
int i2c_smbus_block_process_call(int fd, byte_t command, byte_t length, byte_t *values)
Issue a block process call (write/read) to the SMBus.
byte_t read_write
operation direction
i2c_smbus_data_t * data
data
#define I2C_SMBUS_BYTE
immediate r/w byte operation
int i2c_smbus_write_block_data(int fd, byte_t command, byte_t length, const byte_t *values)
Write a data block to the SMBus.
#define I2C_SMBUS_WRITE
write
#define I2C_SMBUS_QUICK
quick SMBus ioctl operation
int i2c_smbus_write_byte(int fd, byte_t value)
Write an immediate byte to the SMBus.
System Management Bus (SMBus) over I2C communication interface declarations.
byte_t command
ioctl command
int i2c_smbus_read_byte_data(int fd, byte_t command)
Read a data byte from the SMBus.
int i2c_smbus_write_word_data(int fd, byte_t command, ushort_t value)
Write a data 2-byte word to the SMBus.