precision-converters-firmware
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
ad717x_system_config.c File Reference

Implementation of AD717x System Configuration. More...

#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "ad717x_system_config.h"
#include "ad717x_user_config.h"
#include "no_os_alloc.h"
#include "no_os_error.h"
#include "no_os_util.h"
Include dependency graph for ad717x_system_config.c:

Macros

#define AD717x_SETUP_ATTR(_name, _priv)
 
#define AD717x_SETUP_AVAIL_ATTR(_name, _priv)
 
#define AD717x_SETUP_CH(_idx)
 
#define AD717x_CH_ATTR(_name, _priv)
 
#define AD717x_CH_AVAIL_ATTR(_name, _priv)
 
#define AD717x_ADC_CH(_idx)
 
#define AD717x_OPT_IDX_FALSE   0
 
#define AD717x_OPT_IDX_TRUE   1
 
#define AD717x_FILTER_IDX_SINC5_SINC1   0
 
#define AD717x_FILTER_IDX_SINC3   1
 
#define AD717x_NUM_ODR_OPTIONS   23
 

Enumerations

enum  ad717x_setup_attribute_ids {
  POLARITY_ATTR_ID ,
  REFERENCE_SOURCE_ATTR_ID ,
  REFERENCE_BUFFER_ATTR_ID ,
  INPUT_BUFFER_ATTR_ID ,
  DATA_RATE_ATTR_ID ,
  FILTER_ATTR_ID ,
  POST_FILTER_ENABLE_ATTR_ID ,
  POST_FILTER_ATTR_ID ,
  RECONFIGURE_SYSTEM_ATTR_ID
}
 AD717x setup attribute unique IDs. More...
 
enum  ad717x_ch_attribute_ids { SETUP_ATTR_ID }
 AD717x ADC channel attribute unique IDs. More...
 

Functions

int32_t ad717x_get_sampling_frequency (ad717x_dev *device, float *sampling_freq)
 Get the effective sampling frequency with all channels enabled.
 
int32_t iio_ad717x_system_config_init (struct iio_device **desc, ad717x_dev *device)
 Initialize the IIO device descriptor for AD717x system configuration.
 
bool iio_ad717x_is_system_reconfigured (void)
 Check if the AD717x system reconfigure is requested.
 
int32_t iio_ad717x_system_config_remove (struct iio_device *desc)
 Remove the AD717x system configuration device.
 

Detailed Description

Implementation of AD717x System Configuration.

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

Macro Definition Documentation

◆ AD717x_ADC_CH

#define AD717x_ADC_CH (   _idx)
Value:
{\
.name = "ch" # _idx,\
.ch_type = IIO_VOLTAGE,\
.ch_out = false,\
.indexed = true,\
.channel = _idx,\
.attributes = ad717x_adc_channel_attributes,\
}

◆ AD717x_CH_ATTR

#define AD717x_CH_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = iio_ad717x_ch_attr_get,\
.store = iio_ad717x_ch_attr_set\
}

◆ AD717x_CH_AVAIL_ATTR

#define AD717x_CH_AVAIL_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = iio_ad717x_ch_attr_available_get,\
.store = iio_ad717x_ch_attr_available_set\
}

◆ AD717x_FILTER_IDX_SINC3

#define AD717x_FILTER_IDX_SINC3   1

◆ AD717x_FILTER_IDX_SINC5_SINC1

#define AD717x_FILTER_IDX_SINC5_SINC1   0

◆ AD717x_NUM_ODR_OPTIONS

#define AD717x_NUM_ODR_OPTIONS   23

◆ AD717x_OPT_IDX_FALSE

#define AD717x_OPT_IDX_FALSE   0

◆ AD717x_OPT_IDX_TRUE

#define AD717x_OPT_IDX_TRUE   1

◆ AD717x_SETUP_ATTR

#define AD717x_SETUP_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = iio_ad717x_setup_attr_get,\
.store = iio_ad717x_setup_attr_set\
}

◆ AD717x_SETUP_AVAIL_ATTR

#define AD717x_SETUP_AVAIL_ATTR (   _name,
  _priv 
)
Value:
{\
.name = _name,\
.priv = _priv,\
.show = iio_ad717x_setup_attr_available_get,\
.store = iio_ad717x_setup_attr_available_set\
}

◆ AD717x_SETUP_CH

#define AD717x_SETUP_CH (   _idx)
Value:
{\
.name = "setup" # _idx,\
.ch_type = IIO_VOLTAGE,\
.ch_out = false,\
.indexed = true,\
.channel = _idx,\
.attributes = ad717x_setup_channel_attributes,\
}

Enumeration Type Documentation

◆ ad717x_ch_attribute_ids

AD717x ADC channel attribute unique IDs.

Enumerator
SETUP_ATTR_ID 

◆ ad717x_setup_attribute_ids

AD717x setup attribute unique IDs.

Enumerator
POLARITY_ATTR_ID 
REFERENCE_SOURCE_ATTR_ID 
REFERENCE_BUFFER_ATTR_ID 
INPUT_BUFFER_ATTR_ID 
DATA_RATE_ATTR_ID 
FILTER_ATTR_ID 
POST_FILTER_ENABLE_ATTR_ID 
POST_FILTER_ATTR_ID 
RECONFIGURE_SYSTEM_ATTR_ID 

Function Documentation

◆ ad717x_get_sampling_frequency()

int32_t ad717x_get_sampling_frequency ( ad717x_dev *  device,
float *  sampling_freq 
)

Get the effective sampling frequency with all channels enabled.

Parameters
device- AD717x device instance
sampling_freq[out]- Pointer to store the sampling frequency in Hz
Returns
0 in case of success, negative error code otherwise

The ADC cycles through each channel sequentially. The overall effective sampling frequency is the minimum ODR across all channels divided by the total number of channels.

◆ iio_ad717x_is_system_reconfigured()

bool iio_ad717x_is_system_reconfigured ( void  )

Check if the AD717x system reconfigure is requested.

Returns
true if the system reconfigure is requested, false otherwise
Here is the caller graph for this function:

◆ iio_ad717x_system_config_init()

int32_t iio_ad717x_system_config_init ( struct iio_device **  desc,
ad717x_dev *  device 
)

Initialize the IIO device descriptor for AD717x system configuration.

Parameters
desc[in,out]- IIO device descriptor
device[in]- AD717x device instance
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ iio_ad717x_system_config_remove()

int32_t iio_ad717x_system_config_remove ( struct iio_device *  desc)

Remove the AD717x system configuration device.

Parameters
desc- AD717x System Configuration device instance
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: