Analog Devices / Mbed OS EVAL-AD4110

Dependencies:   tempsensors sdp_k1_sdram

Embed: (wiki syntax)

« Back to documentation index

ad4110_iio.c File Reference

ad4110_iio.c File Reference

Implementation of AD4110-1 IIO application interfaces. More...

Go to the source code of this file.

Functions

static int ad4110_get_attribute (void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Getter/Setter function for ADC attributes.
static int32_t ad4110_get_scale (uint8_t chan_id, int32_t adc_raw)
 Calculate the scale value.
static int32_t iio_ad4110_pre_enable (void *dev_instance, uint32_t chn_mask)
 Transfer the device data into memory (optional)
static int32_t iio_ad4110_submit_buffer (struct iio_device_data *iio_dev_data)
 Read buffer data corresponding to AD4110 IIO device.
static int32_t iio_ad4110_post_disable (void *dev)
 Perform tasks before end of current data transfer.
static int32_t ad4110_read_register (void *dev, uint32_t reg, uint32_t *readval)
 Read the device register value.
static int32_t ad4110_write_register (void *dev, uint32_t reg, uint32_t writeval)
 Write into the device register.
int32_t ad4110_iio_init (struct iio_device **desc)
 Init for reading/writing and parameterization of a AD4110-1 IIO device.
static void update_channel_scan_parameters (struct ad4110_dev *dev)
 Update channel attribute structure.
int32_t ad4110_iio_initialize (void)
 Initialize the AD4110-1 IIO application.
void ad4110_iio_event_handler (void)
 Run the AD4110-1 IIO event handler.

Detailed Description

Implementation of AD4110-1 IIO application interfaces.

Copyright (c) 2022 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 ad4110_iio.c.


Function Documentation

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

Getter/Setter function for ADC attributes.

Parameters:
device[in]-Pointer to IIO device instance
buf[in]-IIO input data buffer
len[in]-Number of input bytes
channel[in]- ADC input channel
priv[in]- Attribute private ID
Returns:
len in case of success, negative error code otherwise

Definition at line 233 of file ad4110_iio.c.

static int32_t ad4110_get_scale ( uint8_t  chan_id,
int32_t  adc_raw 
) [static]

Calculate the scale value.

Parameters:
chan_id[in]- ADC input channel
adc_raw[in]- Raw ADC Data
Returns:
0 in case of success, negative error code otherwise.

Definition at line 170 of file ad4110_iio.c.

void ad4110_iio_event_handler ( void   )

Run the AD4110-1 IIO event handler.

Returns:
None

Definition at line 550 of file ad4110_iio.c.

int32_t ad4110_iio_init ( struct iio_device **  desc )

Init for reading/writing and parameterization of a AD4110-1 IIO device.

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

Definition at line 419 of file ad4110_iio.c.

int32_t ad4110_iio_initialize ( void   )

Initialize the AD4110-1 IIO application.

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

Definition at line 489 of file ad4110_iio.c.

static int32_t ad4110_read_register ( void *  dev,
uint32_t  reg,
uint32_t *  readval 
) [static]

Read the device register value.

Parameters:
dev[in]-Pointer to IIO device instance
reg[in]-Register address to read from
readval[out]-Pointer to variable to read data into
Returns:
0 in case of success, negative error code otherwise

Definition at line 375 of file ad4110_iio.c.

static int32_t ad4110_write_register ( void *  dev,
uint32_t  reg,
uint32_t  writeval 
) [static]

Write into the device register.

Parameters:
dev[in]- Pointer to IIO device instance
reg[in]- Register address to write into
writeval[in]- Register value to write
Returns:
0 in case of success, negative error code otherwise

Definition at line 398 of file ad4110_iio.c.

static int32_t iio_ad4110_post_disable ( void *  dev ) [static]

Perform tasks before end of current data transfer.

Parameters:
dev[in]- IIO device instance
Returns:
0 in case of success or negative value otherwise

Definition at line 363 of file ad4110_iio.c.

static int32_t iio_ad4110_pre_enable ( void *  dev_instance,
uint32_t  chn_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 or negative value otherwise

Definition at line 326 of file ad4110_iio.c.

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

Read buffer data corresponding to AD4110 IIO device.

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

Definition at line 336 of file ad4110_iio.c.

static void update_channel_scan_parameters ( struct ad4110_dev *  dev ) [static]

Update channel attribute structure.

Parameters:
dev[in]- AD4110 device descriptor
Returns:
None

Definition at line 450 of file ad4110_iio.c.