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

Basic example for MAX30009 Bioimpedance Measurement. More...

#include <stdio.h>
#include <errno.h>
#include "max30009.h"
#include "common_data.h"
#include "no_os_delay.h"
#include "no_os_irq.h"
#include "no_os_print_log.h"
#include "no_os_uart.h"
#include "no_os_util.h"
#include "parameters.h"
Include dependency graph for basic_example.c:

Functions

int max30009_init_interrupt (struct max30009_dev *device)
 Initializes the interrupt for the MAX30009 device.
 
int example_main (void)
 Main example function following clean initialization flow.
 

Detailed Description

Basic example for MAX30009 Bioimpedance Measurement.

Author
Edelweise Escala (edelw.nosp@m.eise.nosp@m..esca.nosp@m.la@a.nosp@m.nalog.nosp@m..com)

Copyright 2026(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ example_main()

int example_main ( void )

Main example function following clean initialization flow.

Basic example main execution.

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.

◆ max30009_init_interrupt()

int max30009_init_interrupt ( struct max30009_dev * device)

Initializes the interrupt for the MAX30009 device.

Parameters
device- Pointer to the MAX30009 device descriptor
Returns
0 in case of success, negative error code otherwise