no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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.

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

◆ 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, \
}
struct scan_type ad7124_iio_scan_type
Definition iio_ad7124.c:105
@ IIO_VOLTAGE
Definition iio_types.h:56

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,
.attributes = NULL,
.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
}
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:241
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:194
#define NO_OS_ARRAY_SIZE(x)
Definition no_os_util.h:43
#define NULL
Definition wrapper.h:64