no-OS
Macros | Variables
iio_ad7124.c File Reference

Implementation of iio_ad7124.c. More...

#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include "no_os_error.h"
#include "iio.h"
#include "iio_ad7124.h"
#include "no_os_util.h"
#include "ad7124.h"
Include dependency graph for iio_ad7124.c:

Macros

#define AD7124_IIO_CHANN_DEF(nm, ch1, ch2)
 

Variables

struct scan_type ad7124_iio_scan_type
 
struct iio_device iio_ad7124_device
 

Detailed Description

Implementation of iio_ad7124.c.

Author
Andrei Drimbarean (andre.nosp@m.i.dr.nosp@m.imbar.nosp@m.ean@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright 2020(c) Analog Devices, Inc.

All rights reserved.

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

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ AD7124_IIO_CHANN_DEF

#define AD7124_IIO_CHANN_DEF (   nm,
  ch1,
  ch2 
)
Value:
{ \
.name = nm, \
.ch_type = IIO_VOLTAGE, \
.channel = ch1, \
.channel2 = ch2, \
.scan_type = &ad7124_iio_scan_type, \
.attributes = channel_attributes, \
.ch_out = 0, \
.indexed = 1, \
.diferential = true, \
}

Variable Documentation

◆ ad7124_iio_scan_type

struct scan_type ad7124_iio_scan_type
Initial value:
= {
.sign = 's',
.realbits = 24,
.storagebits = 32,
.shift = 0,
.is_big_endian = true
}

◆ iio_ad7124_device

struct iio_device iio_ad7124_device
Initial value:
= {
.num_ch = NO_OS_ARRAY_SIZE(ad7124_channels),
.channels = ad7124_channels,
.debug_attributes = NULL,
.buffer_attributes = NULL,
.pre_enable = iio_ad7124_update_active_channels,
.post_disable = iio_ad7124_close_channels,
.read_dev = (int32_t (*)())iio_ad7124_read_samples,
.debug_reg_read = (int32_t (*)())ad7124_read_register2,
.debug_reg_write = (int32_t (*)())ad7124_write_register2
}
ad7124_iio_scan_type
struct scan_type ad7124_iio_scan_type
Definition: iio_ad7124.c:119
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:71
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:191
NULL
#define NULL
Definition: wrapper.h:64
ad7124_read_register2
int32_t ad7124_read_register2(struct ad7124_dev *dev, uint32_t reg, uint32_t *readval)
Wrap the read register function to give it a modern signature.
Definition: ad7124.c:204
ad7124_write_register2
int32_t ad7124_write_register2(struct ad7124_dev *dev, uint32_t reg, uint32_t writeval)
Wrap the write register function to give it a modern signature.
Definition: ad7124.c:251