no-OS
Loading...
Searching...
No Matches
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 "no_os_alloc.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.
 
int32_t adpd188_iio_remove (struct adpd188_iio_desc *dev)
 Free mmory allocated by adpd188_iio_init().
 

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.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADPD188_IIO_CHANN_DEF

#define ADPD188_IIO_CHANN_DEF ( nm,
ch1 )
Value:
{ \
.name = nm, \
.ch_type = IIO_CURRENT, \
.channel = ch1, \
.scan_index = ch1, \
.scan_type = &adpd188_iio_scan_type, \
.attributes = adpd188_channel_attributes, \
.indexed = 1, \
}
struct scan_type adpd188_iio_scan_type
Definition iio_adpd188.c:62
@ IIO_CURRENT
Definition iio_types.h:34

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.

◆ 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 = iio_adpd188_read_samples,
.debug_reg_read = iio_adpd188_reg_read,
.debug_reg_write = iio_adpd188_reg_write
}
#define NO_OS_ARRAY_SIZE(x)
Definition no_os_util.h:27
#define NULL
Definition wrapper.h:67