|
precision-converters-firmware
|
Implementation of AD5706R IIO Appication Interface. More...
#include <string.h>#include <stdint.h>#include <stdio.h>#include "app_config.h"#include "ad5706r_iio.h"#include "ad5706r_regs.h"#include "common.h"#include "ad5706r_user_config.h"#include "no_os_error.h"#include "iio_trigger.h"#include "iio.h"#include "no_os_util.h"#include "no_os_alloc.h"#include "version.h"#include "no_os_delay.h"
Macros | |
| #define | AD5706_CHN_ATTR(_name, _priv) |
| #define | AD5706_CHN_AVAIL_ATTR(_name, _priv) |
| #define | AD5706_DAC_CH(_name, _dev, _idx) |
| #define | DATA_BUFFER_SIZE (32768) |
| #define | BYTES_PER_SAMPLE sizeof(uint16_t) |
| #define | CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
| #define | BYTE_SIZE (uint32_t)8 |
| #define | BYTE_MASK (uint32_t)0xff |
| #define | DAC_MAX_COUNT (NO_OS_BIT(AD5706_DAC_RESOLUTION ) - 1) |
| #define | AD5706R_REG_VAL 0x01 |
| #define | AD5706R_REG_DEFAULT_VAL 0x0 |
| #define | AD5706_DEFAULT_REF_VOLTS (float)2.5 |
| #define | AD5706_N_BYTES_SW_LDAC 4 |
| #define | AD5706_SW_LDAC_N_BYTES_WITH_DATA 8 |
| #define | AD5706_DEFAULT_CHN_SCAN |
Functions | |
| int32_t | ad5706r_set_sampling_rate (uint32_t *sampling_rate) |
| Set the sampling rate and get the updated value supported by MCU platform. | |
| int | ad5706r_reconfig_ldac (struct ad5706r_dev *device) |
| Reconfigure LDAC pin as GPIO output. | |
| void | ad5706r_populate_func_mode_data (struct ad5706r_dev *device) |
| Build the command word for Func Mode Update. | |
| void | ad5706r_populate_ldac_mode_data (struct ad5706r_dev *device, struct iio_device_data *iio_dev_data) |
| Build the comman word for a SW LDAC Update with the data to be written to the respective input register. | |
| int32_t | ad5706r_iio_initialize (void) |
| Initialize the IIO interface for AD5706R IIO device. | |
| void | iio_params_deinit (void) |
| DeInitialize the IIO parameters. | |
| void | ad5706r_iio_event_handler (void) |
| Run the AD5706R IIO event handler. | |
Variables | |
| struct ad5706r_dev * | ad5706r_dev_inst [NUM_IIO_DEVICES] = { NULL, NULL } |
| struct iio_device * | ad5706r_iio_dev [NUM_IIO_DEVICES] |
| struct scan_type | iio_ad5706r_scan_type [NUM_IIO_DEVICES][AD5706R_NUM_CH] |
| uint32_t | ad5706r_update_rate = AD5706_MAX_UPDATE_RATE |
| uint8_t | n_bytes = 0 |
| struct iio_trigger_init | iio_trigger_init_params |
| struct iio_init_param | iio_init_params |
| bool | hw_mode_enabled = false |
| bool | sw_mode_enabled = false |
Implementation of AD5706R IIO Appication Interface.
This module acts as an interface for AD5706R IIO device
Copyright (c) 2024-2026 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.
| #define AD5706_CHN_ATTR | ( | _name, | |
| _priv | |||
| ) |
| #define AD5706_CHN_AVAIL_ATTR | ( | _name, | |
| _priv | |||
| ) |
| #define AD5706_DAC_CH | ( | _name, | |
| _dev, | |||
| _idx | |||
| ) |
| #define AD5706_DEFAULT_CHN_SCAN |
| #define AD5706_DEFAULT_REF_VOLTS (float)2.5 |
| #define AD5706_N_BYTES_SW_LDAC 4 |
| #define AD5706_SW_LDAC_N_BYTES_WITH_DATA 8 |
| #define AD5706R_REG_DEFAULT_VAL 0x0 |
| #define AD5706R_REG_VAL 0x01 |
| #define BYTE_MASK (uint32_t)0xff |
| #define BYTE_SIZE (uint32_t)8 |
| #define BYTES_PER_SAMPLE sizeof(uint16_t) |
| #define CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
| #define DAC_MAX_COUNT (NO_OS_BIT(AD5706_DAC_RESOLUTION ) - 1) |
| #define DATA_BUFFER_SIZE (32768) |
| void ad5706r_iio_event_handler | ( | void | ) |
Run the AD5706R IIO event handler.
This function monitors the new IIO client event

| int32_t ad5706r_iio_initialize | ( | void | ) |
Initialize the IIO interface for AD5706R IIO device.

| void ad5706r_populate_func_mode_data | ( | struct ad5706r_dev * | device | ) |
Build the command word for Func Mode Update.
| device[in] | - AD5706R Device descriptor |
| void ad5706r_populate_ldac_mode_data | ( | struct ad5706r_dev * | device, |
| struct iio_device_data * | iio_dev_data | ||
| ) |
Build the comman word for a SW LDAC Update with the data to be written to the respective input register.
| device[in] | - AD5706R Device descriptor |
| iio_dev_data[in] | - IIO Device Data |
| int ad5706r_reconfig_ldac | ( | struct ad5706r_dev * | device | ) |
Reconfigure LDAC pin as GPIO output.
| device[in] | - AD5706R device instance |
| int32_t ad5706r_set_sampling_rate | ( | uint32_t * | sampling_rate | ) |
Set the sampling rate and get the updated value supported by MCU platform.
| update_rate[in,out] | - Update rate value |
| void iio_params_deinit | ( | void | ) |
DeInitialize the IIO parameters.

| struct ad5706r_dev* ad5706r_dev_inst[NUM_IIO_DEVICES] = { NULL, NULL } |
| struct iio_device* ad5706r_iio_dev[NUM_IIO_DEVICES] |
| uint32_t ad5706r_update_rate = AD5706_MAX_UPDATE_RATE |
| bool hw_mode_enabled = false |
| struct scan_type iio_ad5706r_scan_type[NUM_IIO_DEVICES][AD5706R_NUM_CH] |
| struct iio_init_param iio_init_params |
| struct iio_trigger_init iio_trigger_init_params |
| uint8_t n_bytes = 0 |
| bool sw_mode_enabled = false |