no-OS
Loading...
Searching...
No Matches
iio_example.c File Reference
#include <assert.h>
#include <errno.h>
#include "example.h"
#include "common_data.h"
#include "iio_app.h"
#include "iio_ad559xr.h"
#include "iio_lm75.h"
Include dependency graph for iio_example.c:

Macros

#define DEFINE_AD559XR_IP(_spi_init, _ss_init, _i2c_init)
 

Enumerations

enum  led_state {
  led_state_off ,
  led_state_pulse_1 ,
  led_state_pause ,
  led_state_pulse_2
}
 

Functions

int iio_example (void)
 
 example_main ("iio_example")
 

Detailed Description

Author
Niel Acuna (niel..nosp@m.acun.nosp@m.a@ana.nosp@m.log..nosp@m.com)
Marc Paolo Sosa (MarcP.nosp@m.aolo.nosp@m..Sosa.nosp@m.@ana.nosp@m.log.c.nosp@m.om)

Copyright 2026(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ DEFINE_AD559XR_IP

#define DEFINE_AD559XR_IP ( _spi_init,
_ss_init,
_i2c_init )
Value:
{ \
.int_ref = true, \
.spi_init = _spi_init, \
.i2c_init = _i2c_init, \
.ss_init = _ss_init, \
.channel_modes = { \
CH_MODE_DAC, /* channel 0 */ \
CH_MODE_ADC, /* channel 1 */ \
CH_MODE_DAC_AND_ADC, /* channel 2 */ \
CH_MODE_DAC_AND_ADC, /* channel 3 */ \
CH_MODE_GPI, /* channel 4 */ \
CH_MODE_GPO, /* channel 5 */ \
CH_MODE_GPI, /* channel 6 */ \
CH_MODE_GPO, /* channel 7 */ \
}, \
.channel_offstate = { \
CH_OFFSTATE_OUT_TRISTATE, /* channel 0 */ \
CH_OFFSTATE_OUT_TRISTATE, /* channel 1 */ \
CH_OFFSTATE_OUT_TRISTATE, /* channel 2 */ \
CH_OFFSTATE_OUT_TRISTATE, /* channel 3 */ \
CH_OFFSTATE_PULLDOWN, /* channel 4 */ \
CH_OFFSTATE_OUT_LOW, /* channel 5 */ \
CH_OFFSTATE_PULLDOWN, /* channel 6 */ \
CH_OFFSTATE_OUT_LOW, /* channel 7 */ \
}, \
.adc_range = ZERO_TO_VREF, \
.dac_range = ZERO_TO_VREF, \
.adc_buf = false, \
}
#define CH_MODE_GPI
Definition ad5592r-base.h:50
#define CH_MODE_ADC
Definition ad5592r-base.h:47
@ ZERO_TO_VREF
Definition ad5592r-base.h:121
#define CH_OFFSTATE_OUT_TRISTATE
Definition ad5592r-base.h:56
#define CH_MODE_GPO
Definition ad5592r-base.h:51
#define CH_MODE_DAC
Definition ad5592r-base.h:48
#define CH_OFFSTATE_PULLDOWN
Definition ad5592r-base.h:53
#define CH_MODE_DAC_AND_ADC
Definition ad5592r-base.h:49
#define CH_OFFSTATE_OUT_LOW
Definition ad5592r-base.h:54

Enumeration Type Documentation

◆ led_state

enum led_state
Enumerator
led_state_off 
led_state_pulse_1 
led_state_pause 
led_state_pulse_2 

Function Documentation

◆ example_main()

example_main ( "iio_example" )

◆ iio_example()

int iio_example ( void )