HAL I2C loopback polling

This example demonstrates how to use the I2C HAL module with polling mode to perform a loopback test. The application configures one I2C instance as a controller and another as a target device, then performs a data transfer between them using polling to handle the communication events.

Example Usage

  1. Build and Load the example to your device

  2. Run the application and observe the output in the terminal

  3. The application will initialize the I2C HAL with polling mode

  4. The controller will send data to the target address (0x50)

  5. The target will receive the data and send a response

  6. The application will verify successful data transmission and reception

This example demonstrates:

  • I2C HAL initialization for both controller and target modes

  • Configuring I2C polling

  • Using SPGSS loopback for internal testing

  • Handling HAL based I2C communication with polling-driven transfers

External Connections

This example uses an internal loopback configuration via the SPGSS module. No external connections are required as the loopback is configured through software:

  • UC2 is configured as the I2C controller

  • UC1 is configured as the I2C target

  • SPG0 provides the loopback connection between these instances