Analog Devices / Mbed OS EVAL-AD7689

Dependencies:   sdp_k1_sdram

Embed: (wiki syntax)

« Back to documentation index

ad7689_iio.c File Reference

ad7689_iio.c File Reference

Implementation of AD7689 IIO application interfaces. More...

Go to the source code of this file.

Functions

static int get_sampling_frequency (void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t id)
 Getter/Setter for the sampling frequency attribute value.
static int get_adc_raw (void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t id)
 Getter/Setter for the raw, offset and scale attribute value.
static int32_t iio_ad7689_submit_buffer (struct iio_device_data *iio_dev_data)
 Read buffer data corresponding to AD4170 IIO device.
static int32_t iio_ad7689_prepare_transfer (void *dev_instance, uint32_t ch_mask)
 Transfer the device data into memory (optional)
static int32_t iio_ad7689_end_transfer (void *dev)
 Perform tasks before end of current data transfer.
static int32_t iio_ad7689_init (struct iio_device **desc)
 Init for reading/writing and parameterization of a ad7689 IIO device.
int32_t ad7689_iio_initialize (void)
 Initialize the IIO interface for AD7689 IIO device.
void ad7689_iio_event_handler (void)
 Run the AD7689 IIO event handler.

Detailed Description

Implementation of AD7689 IIO application interfaces.

Copyright (c) 2021-22 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Definition in file ad7689_iio.c.


Function Documentation

void ad7689_iio_event_handler ( void   )

Run the AD7689 IIO event handler.

Returns:
none

This function monitors the new IIO client event

Definition at line 510 of file ad7689_iio.c.

int32_t ad7689_iio_initialize ( void   )

Initialize the IIO interface for AD7689 IIO device.

Returns:
none
0 in case of success, negative error code otherwise

Definition at line 450 of file ad7689_iio.c.

static int get_adc_raw ( void *  device,
char *  buf,
uint32_t  len,
const struct iio_ch_info *  channel,
intptr_t  id 
) [static]

Getter/Setter for the raw, offset and scale attribute value.

Parameters:
device-pointer to IIO device structure
buf-pointer to buffer holding attribute value
len-length of buffer string data
channel-pointer to IIO channel structure
id-Attribute ID (optional)
Returns:
Number of characters read/written

Definition at line 141 of file ad7689_iio.c.

static int get_sampling_frequency ( void *  device,
char *  buf,
uint32_t  len,
const struct iio_ch_info *  channel,
intptr_t  id 
) [static]

Getter/Setter for the sampling frequency attribute value.

Parameters:
device-pointer to IIO device structure
buf-pointer to buffer holding attribute value
len-length of buffer string data
channel-pointer to IIO channel structure
id-Attribute ID (optional)
Returns:
Number of characters read/written This attribute is used to define the timeout period in IIO client during data capture. Timeout = (number of requested samples * (1/sampling frequency)) + 1sec e.g. if sampling frequency = 60KSPS and requested samples = 400 Timeout = (400 * (1/60000)) + 1 = 1.0067sec = ~1sec

Definition at line 112 of file ad7689_iio.c.

static int32_t iio_ad7689_end_transfer ( void *  dev ) [static]

Perform tasks before end of current data transfer.

Parameters:
dev[in]- IIO device instance
Returns:
0 in case of success, negative error code otherwise

Definition at line 237 of file ad7689_iio.c.

static int32_t iio_ad7689_init ( struct iio_device **  desc ) [static]

Init for reading/writing and parameterization of a ad7689 IIO device.

Parameters:
desc[in,out]- IIO device descriptor
Returns:
0 in case of success, negative error code otherwise

Definition at line 418 of file ad7689_iio.c.

static int32_t iio_ad7689_prepare_transfer ( void *  dev_instance,
uint32_t  ch_mask 
) [static]

Transfer the device data into memory (optional)

Parameters:
dev_instance[in]- IIO device instance
ch_mask[in]- Channels select mask
Returns:
0 in case of success, negative error code otherwise

Definition at line 226 of file ad7689_iio.c.

static int32_t iio_ad7689_submit_buffer ( struct iio_device_data *  iio_dev_data ) [static]

Read buffer data corresponding to AD4170 IIO device.

Parameters:
iio_dev_data[in]- Pointer to IIO device data structure
Returns:
0 in case of success, negative error code otherwise

Definition at line 199 of file ad7689_iio.c.