no-OS
Macros | Functions | Variables
iio_adpd188.c File Reference

Implementation of the ADPD188 IIO driver. More...

#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include "iio_adpd188.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include <stdio.h>
Include dependency graph for iio_adpd188.c:

Macros

#define ADPD188_IIO_CHANN_DEF(nm, ch1)
 

Functions

int32_t adpd188_iio_init (struct adpd188_iio_desc **device, struct adpd188_iio_init_param *init_param)
 Initialize the IIO driver and allocate memory. More...
 
int32_t adpd188_iio_remove (struct adpd188_iio_desc *dev)
 Free mmory allocated by adpd188_iio_init(). More...
 

Variables

struct scan_type adpd188_iio_scan_type
 
struct iio_device iio_adpd188_device
 

Detailed Description

Implementation of the ADPD188 IIO driver.

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 2021(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

◆ ADPD188_IIO_CHANN_DEF

#define ADPD188_IIO_CHANN_DEF (   nm,
  ch1 
)
Value:
{ \
.name = nm, \
.ch_type = IIO_CURRENT, \
.channel = ch1, \
.scan_type = &adpd188_iio_scan_type, \
.attributes = adpd188_channel_attributes, \
.indexed = 1, \
}

Function Documentation

◆ adpd188_iio_init()

int32_t adpd188_iio_init ( struct adpd188_iio_desc **  device,
struct adpd188_iio_init_param init_param 
)

Initialize the IIO driver and allocate memory.

Parameters
device- Pointer to the IIO driver handler structure.
init_param- Pointer to the IIO driver initialization structure.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ adpd188_iio_remove()

int32_t adpd188_iio_remove ( struct adpd188_iio_desc dev)

Free mmory allocated by adpd188_iio_init().

Parameters
dev- Pointer to the IIO driver structure.
Returns
0 in case of success, error code otherwise.

Variable Documentation

◆ adpd188_iio_scan_type

struct scan_type adpd188_iio_scan_type
Initial value:
= {
.sign = 'u',
.realbits = 27,
.storagebits = 32,
.shift = 0,
.is_big_endian = true
}

◆ iio_adpd188_device

struct iio_device iio_adpd188_device
Initial value:
= {
.num_ch = NO_OS_ARRAY_SIZE(adpd188_channels),
.channels = adpd188_channels,
.attributes = adpd188_device_attributes,
.debug_attributes = NULL,
.buffer_attributes = NULL,
.pre_enable = iio_adpd188_prepare_data_read,
.post_disable = iio_adpd188_end_data_read,
.read_dev = (int32_t (*)())iio_adpd188_read_samples,
.debug_reg_read = (int32_t (*)())iio_adpd188_reg_read,
.debug_reg_write = (int32_t (*)())iio_adpd188_reg_write
}
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
adpd188_iio_scan_type
struct scan_type adpd188_iio_scan_type
Definition: iio_adpd188.c:93
IIO_CURRENT
@ IIO_CURRENT
Definition: iio_types.h:72
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:195
NULL
#define NULL
Definition: wrapper.h:64