Analog Devices / Mbed OS EVAL-AD4696

Dependencies:   platform_drivers

Embed: (wiki syntax)

« Back to documentation index

iio_ad4696.c File Reference

iio_ad4696.c File Reference

Implementation of AD4696 IIO application interfaces. More...

Go to the source code of this file.

Functions

static ssize_t get_adc_raw (void *device, char *buf, size_t len, const struct iio_ch_info *channel, intptr_t id)
 Getter/Setter for the raw, offset and scale attribute value.
ssize_t get_sampling_frequency (void *device, char *buf, size_t len, const struct iio_ch_info *channel, intptr_t id)
 Getter/Setter for the sampling frequency attribute value.
int32_t debug_reg_read (void *dev, uint32_t reg, uint8_t *readval)
 Read the debug register value.
int32_t debug_reg_write (void *dev, uint32_t reg, uint32_t writeval)
 Write into the debug register.
static ssize_t iio_ad4696_read_data (void *dev_instance, char *pbuf, size_t offset, size_t bytes_count, uint32_t ch_mask)
 Read buffer data corresponding to AD4696 IIO device.
static ssize_t iio_ad4696_transfer_dev_data (void *dev_instance, size_t bytes_count, uint32_t ch_mask)
 Transfer the device data into memory (optional)
static int32_t iio_ad4696_start_transfer (void *dev_instance, uint32_t ch_mask)
 Perform tasks before new data transfer.
static int32_t iio_ad4696_stop_transfer (void *dev)
 Perform tasks before end of current data transfer.
static int32_t iio_ad4696_init (struct iio_device **desc)
 Init for reading/writing and parameterization of a ad4696 IIO device.
static int32_t iio_ad4696_remove (struct iio_desc *desc)
 Release resources allocated for IIO device.
int32_t ad4696_iio_initialize (void)
 Initialize the IIO interface for AD4696 IIO device.
void ad4696_iio_event_handler (void)
 Run the AD4696 IIO event handler.

Detailed Description

Implementation of AD4696 IIO application interfaces.

This module acts as an interface for AD4696 IIO application

Copyright (c) 2021 Analog Devices, Inc.

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 iio_ad4696.c.


Function Documentation

void ad4696_iio_event_handler ( void   )

Run the AD4696 IIO event handler.

Returns:
none

This function monitors the new IIO client event

Definition at line 628 of file iio_ad4696.c.

int32_t ad4696_iio_initialize ( void   )

Initialize the IIO interface for AD4696 IIO device.

Returns:
SUCCESS in case of success, FAILURE otherwise

Definition at line 567 of file iio_ad4696.c.

int32_t debug_reg_read ( void *  dev,
uint32_t  reg,
uint8_t *  readval 
)

Read the debug register value.

Parameters:
dev-Pointer to IIO device instance
reg-Register address to read from
readval-Pointer to variable to read data into
Returns:
SUCCESS in case of success, negative value otherwise

Definition at line 186 of file iio_ad4696.c.

int32_t debug_reg_write ( void *  dev,
uint32_t  reg,
uint32_t  writeval 
)

Write into the debug register.

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

Definition at line 205 of file iio_ad4696.c.

static ssize_t get_adc_raw ( void *  device,
char *  buf,
size_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
Returns:
Number of characters read/written

Definition at line 95 of file iio_ad4696.c.

ssize_t get_sampling_frequency ( void *  device,
char *  buf,
size_t  len,
const struct iio_ch_info *  channel,
intptr_t  id 
)

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
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 = 50SPS and requested samples = 400 Timeout = (400 * 0.02) + 1 = 9sec

Definition at line 159 of file iio_ad4696.c.

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

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

Parameters:
desc[in,out]- IIO device descriptor
Returns:
SUCCESS in case of success, FAILURE otherwise

Definition at line 512 of file iio_ad4696.c.

static ssize_t iio_ad4696_read_data ( void *  dev_instance,
char *  pbuf,
size_t  offset,
size_t  bytes_count,
uint32_t  ch_mask 
) [static]

Read buffer data corresponding to AD4696 IIO device.

Parameters:
dev_instance[in]- IIO device instance
pbuf[out]- Pointer to output data buffer
offset[in]- Data buffer offset
bytes_count[in]- Number of bytes to read
ch_mask[in]- Channels select mask
Returns:
SUCCESS in case of success or negative value otherwise

Definition at line 225 of file iio_ad4696.c.

static int32_t iio_ad4696_remove ( struct iio_desc *  desc ) [static]

Release resources allocated for IIO device.

Parameters:
desc[in]- IIO device descriptor
Returns:
SUCCESS in case of success, FAILURE otherwise

Definition at line 546 of file iio_ad4696.c.

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

Perform tasks before new data transfer.

Parameters:
dev_instance[in]- IIO device instance
ch_mask[in]- Channels select mask
Returns:
SUCCESS in case of success or negative value otherwise

Definition at line 262 of file iio_ad4696.c.

static int32_t iio_ad4696_stop_transfer ( void *  dev ) [static]

Perform tasks before end of current data transfer.

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

Definition at line 273 of file iio_ad4696.c.

static ssize_t iio_ad4696_transfer_dev_data ( void *  dev_instance,
size_t  bytes_count,
uint32_t  ch_mask 
) [static]

Transfer the device data into memory (optional)

Parameters:
dev_instance[in]- IIO device instance
bytes_count[in]- Number of bytes to read
ch_mask[in]- Channels select mask
Returns:
SUCCESS in case of success or negative value otherwise

Definition at line 249 of file iio_ad4696.c.