no-OS
Loading...
Searching...
No Matches
test_i2c.c File Reference

CAPI I2C single-board loopback tests. More...

#include <stdint.h>
#include <string.h>
#include "parameters.h"
#include "test_framework.h"
#include "test_i2c.h"
Include dependency graph for test_i2c.c:

Functions

int test_i2c (void)
 Run all I2C test cases available on the mapped platform.
 

Detailed Description

CAPI I2C single-board loopback tests.

Exercises the CAPI I2C API using two buses on the same board: I2C1 as initiator and I2C2 as target. Both sides go through CAPI — no platform-specific fixture is needed for the data path. Every case moves real bytes over the wire and checks them at the other end; the target side runs async so the interrupt path is exercised implicitly (its completion callback is what the initiator's blocking call is proven against).

Hardware assumption: two I2C buses with SCL and SDA cross-wired.

Copyright (c) 2026 Analog Devices, Inc. SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ test_i2c()

int test_i2c ( void )

Run all I2C test cases available on the mapped platform.

Returns
0 if all executed cases passed, first non-zero test error otherwise.