Syntax
typedef struct {
  VMUINT8 slave_address;
} vm_dcl_i2c_control_set_slave_address_t;
ContentsIndex
PreviousUpNext
vm_dcl_i2c_control_set_slave_address_t
Example
Syntax
typedef struct {
  VMUINT8 slave_address;
} vm_dcl_i2c_control_set_slave_address_t;
Description

vm_dcl_i2c_control_set_slave_address_t indicates the I2C_CMD_SET_SLAVE_ADDRESS command.

Example
 VM_DCL_HANDLE i2c_handle;
 vm_dcl_i2c_control_config_t conf_data;
vm_dcl_i2c_control_set_slave_address_t address_setting;
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);
address_setting.slave_address=0x98;
vm_dcl_control(i2c_handle,I2C_CMD_GET_TRANSACTION_MODE,(void *)&address_setting);
 //To do something with the handle.
File

vmdcl_i2c.h

Members
Members 
Description 
VMUINT8 slave_address; 
The slave address. 
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.