Syntax
typedef struct {
  VMUINT8* data_ptr;
  VMUINT32 data_length;
} vm_dcl_i2c_control_single_write_t, vm_dcl_i2c_control_single_read_t;
ContentsIndex
PreviousUpNext
vm_dcl_i2c_control_single_write_t
Example
Syntax
typedef struct {
  VMUINT8* data_ptr;
  VMUINT32 data_length;
} vm_dcl_i2c_control_single_write_t, vm_dcl_i2c_control_single_read_t;
Description

vm_dcl_i2c_control_single_write_t and vm_dcl_i2c_control_single_read_t indicate I2C_CMD_SINGLE_WRITE and I2C_CMD_SINGLE_READ command, respectively.

Example
 VM_DCL_HANDLE i2c_handle;
 vm_dcl_i2c_control_config_t conf_data;
 vm_dcl_i2c_control_single_write_t write_data;
 vm_dcl_i2c_control_single_read_t  read_data;
 VM_DCL_BUFF_LEN len;
 VMUINT8 i2c_write_data[2] = {0x56,0x78};
 VMUINT8 i2c_read_data[2] = {0x0,0x0};
i2c_handle = vm_dcl_open(VM_DCL_I2C,0);
if(VM_DCL_HANDLE_INVALID==i2c_handle) return;
conf_data.reserved_0 = 0;
conf_data.transaction_mode = VM_DCL_I2C_TRANSACTION_FAST_MODE;
conf_data.get_handle_wait = 0;
conf_data.reserved_1 = 0;
conf_data.delay_length = 0;
conf_data.slave_address = 0x98;
conf_data.fast_mode_speed = 400;
conf_data.high_mode_speed = 0;
vm_dcl_control(i2c_handle,VM_DCL_I2C_CMD_CONFIG,(void *)&conf_data);
write_data.data_ptr = i2c_write_data;
write_data.data_length = 2;
vm_dcl_control(i2c_handle,I2C_CMD_SINGLE_WRITE,(void *)&write_data);
read_data.data_ptr=i2c_read_data;
read_data.data_length = 2;
vm_dcl_control(i2c_handle,I2C_CMD_SINGLE_READ,(void *)&read_data);
 //To do something with the handle.
File

vmdcl_i2c.h

Members
Members 
Description 
VMUINT8* data_ptr; 
The pointer to the data buffer. 
VMUINT32 data_length; 
The data length. Please note: this length should not exceed 8. 
Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.