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

exmaple program for Maxim platfom of LTC3220 project. More...

#include "common_data.h"
#include "ltc3220.h"
#include "no_os_delay.h"
#include "basic_example.h"
Include dependency graph for basic_example.c:

Functions

int example_main ()
 Basic example main execution.
 
int ltc3220_test_led_singles (struct ltc3220_dev *ltc3220, enum ltc3220_uled_mode mode)
 individual LED control for all 18 LEDs
 
int ltc3220_test_led_singles_alt_modes (struct ltc3220_dev *ltc3220)
 individual LED control with alternating modes for all 18 LEDs
 
int ltc3220_test_led_quick_write_with_indiv (struct ltc3220_dev *ltc3220, enum ltc3220_uled_mode mode)
 Parallel and Serial LED control. LED 2 to 9 are set to serial, then LED1 is set to display on all LEDs. After some delay LED 9 to 18 will change mode in serial write.
 

Detailed Description

exmaple program for Maxim platfom of LTC3220 project.

Author
Jan Carlo Roleda (janca.nosp@m.rlo..nosp@m.roled.nosp@m.a@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 execution.

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.

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

◆ ltc3220_test_led_quick_write_with_indiv()

int ltc3220_test_led_quick_write_with_indiv ( struct ltc3220_dev * ltc3220,
enum ltc3220_uled_mode mode )

Parallel and Serial LED control. LED 2 to 9 are set to serial, then LED1 is set to display on all LEDs. After some delay LED 9 to 18 will change mode in serial write.

Parameters
ltc3220- the device structure.
mode- the mode to set the individual LEDs
Returns
0 in case of success, negative error code otherwise.

◆ ltc3220_test_led_singles()

int ltc3220_test_led_singles ( struct ltc3220_dev * ltc3220,
enum ltc3220_uled_mode mode )

individual LED control for all 18 LEDs

Parameters
ltc3220- The device structure.
mode- the mode to set all the LEDs to.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3220_test_led_singles_alt_modes()

int ltc3220_test_led_singles_alt_modes ( struct ltc3220_dev * ltc3220)

individual LED control with alternating modes for all 18 LEDs

Parameters
ltc3220- the device structure.
Returns
0 in case of success, negative error code otherwise.