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

Source file of the IIO AD74413r Driver. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "no_os_error.h"
#include "no_os_units.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
#include "ad74413r.h"
#include "iio_ad74413r.h"
Include dependency graph for iio_ad74413r.c:

Macros

#define AD74413R_ADC_CHANNEL(type, attrs)
 
#define AD74413R_DIAG_CHANNEL(_addr, _type)
 
#define AD74413R_DAC_CHANNEL(type)
 
#define _AD74413R_CHANNELS(_channels)
 
#define AD74413R_CHANNELS(name)
 

Enumerations

enum  channel_type {
  AD74413R_ADC ,
  AD74413R_DIAG
}
 

Functions

int ad74413r_iio_init (struct ad74413r_iio_desc **iio_desc, struct ad74413r_iio_desc_init_param *init_param)
 Initializes the AD74413R IIO descriptor.
 
int ad74413r_iio_remove (struct ad74413r_iio_desc *desc)
 Free an iio descriptor.
 

Detailed Description

Source file of the IIO AD74413r Driver.

Author
Ciprian Regus (cipri.nosp@m.an.r.nosp@m.egus@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ _AD74413R_CHANNELS

#define _AD74413R_CHANNELS ( _channels)
Value:
{ \
.channels = _channels, \
.num_channels = NO_OS_ARRAY_SIZE(_channels) \
}
#define NO_OS_ARRAY_SIZE(x)
Definition no_os_util.h:27

◆ AD74413R_ADC_CHANNEL

#define AD74413R_ADC_CHANNEL ( type,
attrs )
Value:
{ \
.ch_type = type, \
.indexed = 1, \
.ch_out = 0, \
.scan_type = &ad74413r_iio_adc_scan_type, \
.attributes = attrs \
}

◆ AD74413R_CHANNELS

#define AD74413R_CHANNELS ( name)
Value:
_AD74413R_CHANNELS(ad74413r_ ## name ## _channels)
#define _AD74413R_CHANNELS(_channels)
Definition iio_ad74413r.c:49

◆ AD74413R_DAC_CHANNEL

#define AD74413R_DAC_CHANNEL ( type)
Value:
{ \
.ch_type = type, \
.indexed = 1, \
.ch_out = 1, \
.attributes = ad74413r_iio_dac_attrs, \
}

◆ AD74413R_DIAG_CHANNEL

#define AD74413R_DIAG_CHANNEL ( _addr,
_type )
Value:
{ \
.ch_type = _type, \
.indexed = 1, \
.ch_out = 0, \
.channel = _addr, \
.address = _addr - 4, \
.scan_type = &ad74413r_iio_adc_scan_type, \
.attributes = ad74413r_iio_adc_diag_attrs \
}

Enumeration Type Documentation

◆ channel_type

Enumerator
AD74413R_ADC 
AD74413R_DIAG 

Function Documentation

◆ ad74413r_iio_init()

int ad74413r_iio_init ( struct ad74413r_iio_desc ** iio_desc,
struct ad74413r_iio_desc_init_param * init_param )

Initializes the AD74413R IIO descriptor.

Parameters
iio_desc- The iio device descriptor.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, an error code otherwise.

◆ ad74413r_iio_remove()

int ad74413r_iio_remove ( struct ad74413r_iio_desc * desc)

Free an iio descriptor.

Parameters
desc- The descriptor to be freed.
Returns
0 in case of success, an error code otherwise.