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

Implementation of AD5592R/AD5593R IIO driver. More...

#include <errno.h>
#include <assert.h>
#include <string.h>
#include "no_os_alloc.h"
#include "no_os_list.h"
#include "iio_ad559xr.h"
#include "ad5592r.h"
#include "ad5593r.h"
Include dependency graph for iio_ad559xr.c:

Macros

#define DEFINE_AD559XR_ATTR(_name, _priv)
 
#define DEFINE_AD559XR_AVAIL_ATTR(_name, _priv)
 
#define DEFINE_AD559XR_GPI_ATTR(_name, _priv)
 
#define DEFINE_AD559XR_GPO_ATTR(_name, _priv)
 

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

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.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ DEFINE_AD559XR_ATTR

#define DEFINE_AD559XR_ATTR ( _name,
_priv )
Value:
{\
.name = _name, \
.priv = _priv, \
.show = ad559xr_iio_show, \
.store = ad559xr_iio_store, \
}

◆ DEFINE_AD559XR_AVAIL_ATTR

#define DEFINE_AD559XR_AVAIL_ATTR ( _name,
_priv )
Value:
{\
.name = _name, \
.priv = _priv, \
.show = ad559xr_iio_avail_show, \
}

◆ DEFINE_AD559XR_GPI_ATTR

#define DEFINE_AD559XR_GPI_ATTR ( _name,
_priv )
Value:
{\
.name = _name, \
.priv = _priv, \
.show = ad559xr_iio_show, \
}

◆ DEFINE_AD559XR_GPO_ATTR

#define DEFINE_AD559XR_GPO_ATTR ( _name,
_priv )
Value:
{\
.name = _name, \
.priv = _priv, \
.show = ad559xr_iio_show, \
.store = ad559xr_iio_store, \
}

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.

◆ 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.

◆ 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