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

Basic example source file for adp1055 project. More...

#include "common_data.h"
#include "no_os_delay.h"
#include "no_os_i2c.h"
#include "no_os_print_log.h"
#include "no_os_util.h"
#include "no_os_pwm.h"
#include "adp1055.h"
Include dependency graph for basic_example.c:

Functions

int example_main ()
 Basic example main executiont.
 

Detailed Description

Basic example source file for adp1055 project.

Author
Ivan Gil Mercano (Ivang.nosp@m.il.m.nosp@m.ercan.nosp@m.o@an.nosp@m.alog..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ example_main()

int example_main ( void )

Basic example main executiont.

Basic example main execution.

Returns
ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.

Basic example main executiont.

  • 50 ADC readings with delay.
  • Threshold event (non-blocking).
    Returns
    ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.
    Basic example main executiont.
Returns
ret - Result of the example execution. If working correctly, will execute print the sample data.

Basic example main executiont.

Returns
ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.

Basic example main executiont.

Returns
ret - 0 on success.

Basic example main executiont.

Returns
ret - Result of the example execution. If working correctly, will execute continuously function iio_app_run and will not return.

Basic example main executiont.

Returns
ret - Result of the example execution. If working correctly, will execute continuously the iio_app_run and will not return.

Basic example main executiont.

Returns
ret - Result of the example execution. If working correctly, will measure active and reactive energy and RMS for channel A and for voltage stopping whenever an interrupt occurs and resulting in a stoppage of the measurement.

Basic example main executiont.

Returns
ret - Result of the example execution.

Basic example main executiont.

This example demonstrates basic ADMT4000 functionality by continuously reading sensor values and displaying them on the console.

Returns
0 in case of success, negative error code otherwise.

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