Introduction
This example shows Master Peripheral Communication between Two I2C instances using LLD interface.
One of the core is in control of the I2C Master instance and the other core is in control of the I2C Peripheral instance.
The main core in in control of the Master I2C Instance. The remote cores in in control of the Peripheral I2C Instance.
Three transactions are carried out in this example:
- Controller writes 4 bytes to Peripheral
- Controller writes 2 bytes to Peripheral
- Controller reads 2 bytes from Peripheral
- Attention
- This Example requires two I2C instances to be connected together.
SCL and SDA pins of I2C1 and I2C3 are available on the LP board. I2C1 can be connected to I2C3 with following jumper Connections.
- Connect Pin 9 of J1 (I2C1_SCL) to Pin 49 of J5 (I2C3_SCL).
- Connect Pin 10 of J1 (I2C1_SDA) to Pin 50 of J5 (I2C3_SDA).
Supported Combinations
| Parameter | Value |
| CPU + OS | r5fss0-0 nortos |
^ | Toolchain | ti-arm-clang Boards | am263x-lp Example folder | examples/drivers/i2c/i2c_peripheral_transfer_lld
Steps to Run the Example
See Also
I2C
Sample Output
Shown below is a sample output when the application is run,
[I2C] I2C Controller Peripheral Transaction Started ... !!!
[I2C Peripheral] Transaction 1: Ready (receive 4)...
[I2C Controller] Transaction 1: Start (write 4)...
[I2C Controller] Transmitted Data 1 2 3 4 !!!
[I2C Peripheral] Received Data 1 2 3 4 !!!
[I2C Peripheral] Transaction 2: Ready (receive 2)...
[I2C Controller] Transaction 2: Start (write 2)...
[I2C Controller] Transmitted Data 1 2 !!!
[I2C Peripheral] Received Data 1 2 !!!
[I2C Peripheral] Transaction 3: Ready (send 2)...
[I2C Controller] Transaction 3: Start (read 2)...
[I2C Controller] Received Data 5 6 !!!
[I2C Peripheral] Transmitted Data 5 6 !!!
[I2C] All 3 transactions completed successfully!!!
All tests have passed!!