5.1.1 I2C_Config Command and its Response
The I2C_Config command (0x40) configures the I2C
peripheral with the specified clock speed and clock-stretch timeout.
This command is sent through Endpoint 0x03 (OUT). The response is read through Endpoint 0x83 (IN).
| Byte Index | Command | Description | |
|---|---|---|---|
| 0 | 0x40 | Command code | Configures the I2C module with the following settings: |
| 1 |
|
Speed: 100 kHz 400 kHz 1 MHz | I2C clock speed |
| 2 |
…
|
Timeout: 1 ms 2 ms ... 250 ms | I2C clock-stretch timeout |
| Byte Index | Response | Description | |
|---|---|---|---|
| 0 | 0x40 | Return command code | Returns whether the I2C_Config command was accepted
or rejected |
| 1 | 0x20 | Accepted – success | The command is accepted |
0x60 | Rejected – wrong parameters | The command is rejected because the parameters are invalid | |
0x64 | Rejected – I2C is busy | The command is rejected because the I2C module is busy | |
