typedef struct { VM_DCL_I2C_OWNER reserved_0; VMBOOL get_handle_wait; VMUINT8 slave_address; VMUINT8 delay_length; VM_DCL_I2C_TRANSACTION_MODE transaction_mode; VMUINT32 fast_mode_speed; VMUINT32 high_mode_speed; VMBOOL reserved_1; } vm_dcl_i2c_control_config_t;
typedef struct { VM_DCL_I2C_OWNER reserved_0; VMBOOL get_handle_wait; VMUINT8 slave_address; VMUINT8 delay_length; VM_DCL_I2C_TRANSACTION_MODE transaction_mode; VMUINT32 fast_mode_speed; VMUINT32 high_mode_speed; VMBOOL reserved_1; } vm_dcl_i2c_control_config_t;
vm_dcl_i2c_control_config_t indicates the I2C_CMD_CONFIG command.
VM_DCL_HANDLE i2c_handle; vm_dcl_i2c_control_config_t conf_data; 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); //To do something with the handle.
vmdcl_i2c.h
|
Members |
Description |
|
VM_DCL_I2C_OWNER reserved_0; |
This is reserved. Please use 0. |
|
VMBOOL get_handle_wait; |
If KAL_TRUE: wait until I2C is idle; If KAL_FALSE: do not wait. |
|
VMUINT8 slave_address; |
The slave address. |
|
VMUINT8 delay_length; |
The delay length between consecutive transfers (in half pulse width unit). |
|
VM_DCL_I2C_TRANSACTION_MODE transaction_mode; |
The fast mode or high speed mode. |
|
VMUINT32 fast_mode_speed; |
The transfer speed under fast mode. You should configure this parameter even when using high speed mode. |
|
VMUINT32 high_mode_speed; |
The transfer speed under high speed mode. |
|
VMBOOL reserved_1; |
This is reserved. Please always use 0 to fill this member. |
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.