I2C Command Mode Interface
The same messages that can be sent over a serial connection can be sent over I2C.
When MULTOS detects that a master I2C device is present (pin 18 pulled high on power-up / reset) then it activates MULTOS as a slave I2C device and uses this interface to process all incoming embedded command mode commands. The default I2C slave address of MULTOS is 0x5F.
The slave I2C interface supports the following registers.
Register | Type | Register Size | Use | Details |
---|---|---|---|---|
0x00 | Write | 1-3 bytes | Command tag and length | The first byte contains the TAG value. The second and third bytes (if present) contain the length value as follows.
|
0x01 | Write | Variable | Command data | This register should be written to the required number of times to ensure that all the data is transmitted. The maximum number of bytes that should be written per register write is 256. MULTOS processes the command automatically once all data bytes has been received. |
0x80 | Read | 1 byte | Response tag | |
0x81 | Read | 1-2 bytes | Response length | The size of this register depends upon the tag value as follows.
|
0x82 | Read | Variable | Response data | This register should be read from the required number of times to receive all the response data. The register size is the minimum of:
This register must not be read if there is no response data.
|
0x83 | Write | 2 bytes | The maximum amount of response data to return | Power-on initial value equals 0xFFFF. |
The master I2C device must ensure that the correct I2C registers are accessed at the correct time. If an incorrect register is accessed then this might lead to an I2C lock-up, with the I2C master device waiting for data to be returned from MULTOS which is never sent.