no-OS
Loading...
Searching...
No Matches
iio_ad559xr.h File Reference

Header file implementation of AD5592R/AD5593R IIO driver. More...

#include "iio_types.h"
#include "ad5592r.h"
#include "ad5593r.h"
Include dependency graph for iio_ad559xr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ad559xr_aio_port
 
struct  iio_ad559xr_desc
 
struct  iio_ad559xr_gpio_map
 

Macros

#define AD559XR_MAX_AIO_PORT   8
 
#define AD559XR_MAX_PORT_NAMELEN   24
 
#define AD559XR_ADC_RESOLUTION   12
 
#define AD559XR_STORAGE_BITS   16
 
#define AD559XR_STORAGE_BYTES   (AD559XR_STORAGE_BITS/8)
 
#define AD559XR_FULL_SCALE_VALUE   ((1 << AD559XR_ADC_RESOLUTION) - 1)
 
#define AD559XR_MIN_VDD   1.0f
 
#define AD559XR_MAX_VDD   5.5f
 
#define AD559XR_INTERNAL_VREF   2.5f
 
#define AD5599XR_MAX_SAMPLE_SIZE   (1024)
 
#define AD559XR_SLOPE_CONSTANT   (3767897513/25)
 
#define AD559XR_SLOPE_NANO_SCALE   1000000000
 

Enumerations

enum  {
  AD559XR_AIO_RAW ,
  AD559XR_AIO_SCALE ,
  AD559XR_AIO_OFFSET ,
  AD559XR_DAC_POWER_DOWN ,
  AD559XR_GPIO_LABEL ,
  AD559XR_GPIO_RAW ,
  AD559XR_TEMP_RAW ,
  AD559XR_TEMP_SCALE ,
  AD559XR_TEMP_OFFSET ,
  AD559XR_ADC_RANGE ,
  AD559XR_ADC_BUFFER ,
  AD559XR_DAC_RANGE ,
  AD559XR_REF_SELECT ,
  AD559XR_VREF_IN_V ,
  AD559XR_LDAC_MODE ,
  AD559XR_REPETITION
}
 

Functions

int iio_ad559xr_aio_init (struct iio_ad559xr_desc **desc, struct ad5592r_dev *ad5592r)
 Initialize an ad559xr iio descriptor for all ADC and DAC channels for one ad559xr device.
 
int iio_ad559xr_gpio_init (struct iio_ad559xr_desc **desc, struct iio_ad559xr_gpio_map *gpio_map, const size_t count)
 Initialize an ad559xr iio descriptor for all GPIO channels.
 
int iio_ad559xr_remove (struct iio_ad559xr_desc *desc)
 Remove an ad559xr iio descriptor.
 

Detailed Description

Header file implementation of AD5592R/AD5593R IIO driver.

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

◆ AD5599XR_MAX_SAMPLE_SIZE

#define AD5599XR_MAX_SAMPLE_SIZE   (1024)

◆ AD559XR_ADC_RESOLUTION

#define AD559XR_ADC_RESOLUTION   12

◆ AD559XR_FULL_SCALE_VALUE

#define AD559XR_FULL_SCALE_VALUE   ((1 << AD559XR_ADC_RESOLUTION) - 1)

◆ AD559XR_INTERNAL_VREF

#define AD559XR_INTERNAL_VREF   2.5f

◆ AD559XR_MAX_AIO_PORT

#define AD559XR_MAX_AIO_PORT   8

◆ AD559XR_MAX_PORT_NAMELEN

#define AD559XR_MAX_PORT_NAMELEN   24

◆ AD559XR_MAX_VDD

#define AD559XR_MAX_VDD   5.5f

◆ AD559XR_MIN_VDD

#define AD559XR_MIN_VDD   1.0f

◆ AD559XR_SLOPE_CONSTANT

#define AD559XR_SLOPE_CONSTANT   (3767897513/25)

◆ AD559XR_SLOPE_NANO_SCALE

#define AD559XR_SLOPE_NANO_SCALE   1000000000

◆ AD559XR_STORAGE_BITS

#define AD559XR_STORAGE_BITS   16

◆ AD559XR_STORAGE_BYTES

#define AD559XR_STORAGE_BYTES   (AD559XR_STORAGE_BITS/8)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AD559XR_AIO_RAW 
AD559XR_AIO_SCALE 
AD559XR_AIO_OFFSET 
AD559XR_DAC_POWER_DOWN 
AD559XR_GPIO_LABEL 
AD559XR_GPIO_RAW 
AD559XR_TEMP_RAW 
AD559XR_TEMP_SCALE 
AD559XR_TEMP_OFFSET 
AD559XR_ADC_RANGE 
AD559XR_ADC_BUFFER 
AD559XR_DAC_RANGE 
AD559XR_REF_SELECT 
AD559XR_VREF_IN_V 
AD559XR_LDAC_MODE 
AD559XR_REPETITION 

Function Documentation

◆ iio_ad559xr_aio_init()

int iio_ad559xr_aio_init ( struct iio_ad559xr_desc ** desc,
struct ad5592r_dev * ad5592r )

Initialize an ad559xr iio descriptor for all ADC and DAC channels for one ad559xr device.

Parameters
[in]descpointer to iio_ad559xr_desc ad559xr iio descriptor
[in]ad5592rpointer to ad5592r_dev
Returns
0 on success
-EINVAL when desc is NULL.
-ENODEV when ad5592r is NULL.
-ENOMEM when memory cannot be allocated.
Here is the caller graph for this function:

◆ iio_ad559xr_gpio_init()

int iio_ad559xr_gpio_init ( struct iio_ad559xr_desc ** desc,
struct iio_ad559xr_gpio_map * gpio_map,
const size_t count )

Initialize an ad559xr iio descriptor for all GPIO channels.

This function takes an array called a gpio_map. It collects all the channels defined in all ad559xr devices declared in the gpio_map and creates one single ad559xr iio descriptor for all.

Parameters
[in]descpointer to iio_ad559xr_desc ad559xr iio descriptor
[in]gpio_mappointer to gpio_map
[in]countnumber of gpio_maps
Returns
0 on success
-EINVAL when desc and gpio_map are both NULL.
-ENODEV when gpio_map contains an NULL ad559xr device descriptor.
Here is the caller graph for this function:

◆ iio_ad559xr_remove()

int iio_ad559xr_remove ( struct iio_ad559xr_desc * desc)

Remove an ad559xr iio descriptor.

Releases memory associated with an ad559xr iio descriptor and also frees up the iio descriptor memory itself.

Parameters
[in]descpointer to iio_ad559xr_desc ad559xr iio descriptor
Here is the caller graph for this function: