![]() |
no-OS
|
On-target integration test for the MAXM86161 driver. More...
#include <stdio.h>#include <stdbool.h>#include <errno.h>#include "common_data.h"#include "maxm86161.h"#include "no_os_delay.h"#include "no_os_print_log.h"Macros | |
| #define | TEST_FAIL(fmt, ...) |
| #define | TEST_PASS() |
| #define | TEST_ASSERT_TRUE(cond) |
| #define | TEST_ASSERT_FALSE(cond) |
| #define | TEST_ASSERT_EQUAL(expected, actual) |
| #define | TEST_ASSERT_EQUAL_INT(expected, actual) |
| #define | TEST_ASSERT_NOT_NULL(ptr) |
| #define | RUN_TEST(dev, fn) |
Typedefs | |
| typedef void(* | maxm86161_test_fn) (struct maxm86161_dev *dev) |
Functions | |
| int | example_main (void) |
| Basic example main executiont. | |
On-target integration test for the MAXM86161 driver.
Copyright 2026(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
Hardware-in-the-loop (HIL) integration test for the MAXM86161.
This example mirrors the offline unit-test suite in tests/maxm86161/test/test_maxm86161.c, but runs against a real device over the live I2C bus instead of CMock stubs. Where the unit tests assert the driver produced the right mock traffic, this harness performs full write-then-read-back round trips: every setter is followed by its matching getter, confirming the value actually reached the silicon and reads back unchanged. It also re-checks the parameter-validation and FIFO-decode logic that the unit tests cover, plus a short live acquisition sanity check that only a real sensor can exercise.
A tiny Unity-style assertion layer keeps the test bodies readable and prints a PASS/FAIL line per check followed by a summary, so the same test-case structure as the unit suite is preserved on-target. The run is non-destructive: the original device state is not restored, so re-flash or power-cycle before switching to a measurement example.
| #define RUN_TEST | ( | dev, | |
| fn ) |
| #define TEST_ASSERT_EQUAL | ( | expected, | |
| actual ) |
| #define TEST_ASSERT_EQUAL_INT | ( | expected, | |
| actual ) |
| #define TEST_ASSERT_FALSE | ( | cond | ) |
| #define TEST_ASSERT_NOT_NULL | ( | ptr | ) |
| #define TEST_ASSERT_TRUE | ( | cond | ) |
| #define TEST_FAIL | ( | fmt, | |
| ... ) |
| #define TEST_PASS | ( | ) |
| typedef void(* maxm86161_test_fn) (struct maxm86161_dev *dev) |
| int example_main | ( | void | ) |
Basic example main executiont.
Basic example main execution.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
This example demonstrates basic ADMT4000 functionality by continuously reading sensor values and displaying them on the console.
Basic example main executiont.
Basic example main executiont.
Brings up the full JESD204 link between the FPGA and the ADRV903X:
Basic example main executiont.
Brings up the full JESD204 link and demonstrates DMA data transfer:
Basic example main executiont.
Brings up the full JESD204 link and starts the IIO application loop:
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
The platform main.c is the real program entry point. It performs platform startup, then calls this no-OS example entry.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
Basic example main executiont.
IIO descriptor and initialization parameter.
IIO app.
Declaring iio_devices structure
Initializing IIO app init param.
Initializing IIO app.
Running the IIO app (use iio_info or osc in terminal).
Set the threshold voltage to 5V
The comparator output will be available on the GPO_A pin
Set the DAC output on channel C to 5V
Measure input current on channel D
GPIO Pin Interrupt Controller
UART init params
IIO application descriptor
IIO application initialization parameters
iio axi adc configurations.
iio axi dac configurations.
iio instance descriptor.
iio instance descriptor.
iio device instance descriptor.
UART init params
IIO application descriptor
IIO application initialization parameters
iio axi adc configurations.
iio axi dac configurations.
iio instance descriptor.
iio instance descriptor.
iio device instance descriptor.
Negative temperature
Positive temperature
Negative temperature
Positive temperature
Switch to APG mode
Switch to AWG mode
Parameter to be passed when the callback is called.
GPIO Pin Interrupt Controller
MAX14906 Initialization
Setting SLED set bit 1 in the config register.
Turning the Status LEDs on, then off.
Setting a current limit for channel 0.
Read current limit for all channels.
Setting the on state for channel 0, and then verifying it.
IIO descriptor and initialization parameter.
Channel configuration to be used in the example.
IIO app.
Declaring iio_devices structure
Initializing IIO app init param.
Initializing IIO app.
Running the IIO app (use iio_info or osc in terminal).
Maximum value of 3V.
The increment of the AO1 to be used (needs to be smaller then the SR step-size).
Frequency of the signal.
Initializing GPIO 0 of MAX22017.
Setting its value to HIGH.
Changing operation mode of MAX22017.
Changing configuration of MAX22017.
Changing slew-rate configuration of MAX22017.
Reading the GAIN correction.