I2C Master peripheral interface (XVF3610-UA Only)¶
The XVF3610-UA variant provides an I2C master interface which can be used as:
a bridge from the USB interface, i.e. VFCTRL_USB commands can be used from the host to read and write devices connected to the I2C Peripheral Port;
a mechanism to initialise devices connected to the I2C Peripheral Port by incorporating commands into the Data Partition (in the external flash), which are executed at boot time.
The interface supports:
100kbps fixed speed
7bit addressing only
Byte I2C register read/writes
The following table shows the commands for the configuration of the I2C Master interface:
COMMAND |
TYPE |
NUM ARGS |
NUM VALUES |
DEFINITION |
---|---|---|---|---|
SET_I2C_READ _HEADER |
uint8 |
3 |
0 |
Set the parameters to be used by the next GET_I2C, or GET_I2C_WITH_REG command.
Arguments:
1: The 7-bit I2C slave device address.
2: The register address within the device.
3: The number of bytes to read.
|
GET_I2C_READ _HEADER |
uint8 |
0 |
3 |
Get the parameters to be used by the next GET_I2C, or GET_I2C_WITH_REG command.
Returned values:
1: The 7-bit I2C slave device address.
2: The register address within the device.
3: The number of bytes to read.
|
GET_I2C |
uint8 |
0 |
56 |
Read from an I2C device defined by the SET_I2C_READ_HEADER command.
Returned values:
1 to 56:
The number of bytes read as defined by the SET_I2C_READ_HEADER command followed by additional undefined values.
The number of bytes read from the I2C device when executing GET_I2C is set using SET_I2C_READ_HEADER
|
GET_I2C_WITH_REG |
uint8 |
0 |
56 |
Read from the register of an I2C device as defined by the SET_I2C_READ_HEADER command.
Returned values:
1 to 56:
The number of bytes read as defined by the SET_I2C_READ_HEADER command followed by additional undefined values.
The number of bytes read from the I2C device when executing GET_I2C is set using SET_I2C_READ_HEADER
|
SET_I2C |
uint8 |
56 |
0 |
Write to an I2C slave device.
Arguments:
1: The 7-bit I2C slave device address.
2: The number of data bytes to write (n).
3 to 56: Data bytes.
All 54 values must be given but only n will be sent.
|
SET_I2C_WITH_REG |
uint8 |
56 |
0 |
Write to a specific register of an I2C slave device.
Arguments:
1: The 7-bit I2C slave device address.
2: The register address within the device.
3: The number of data bytes to write (n).
4 to 56: Data bytes.
All 53 values must be given but only n will be sent.
|
raw I2C read/writes may be performed.