precision-converters-firmware
|
AD579x IIO application interface module. More...
#include <string.h>
#include "app_config.h"
#include "ad579x_iio.h"
#include "ad579x_support.h"
#include "ad5791.h"
#include "ad579x_user_config.h"
#include "common.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "no_os_gpio.h"
#include "no_os_pwm.h"
#include "iio_trigger.h"
Macros | |
#define | AD579X_CHN_ATTR(_name, _priv) |
#define | AD579X_CHN_AVAIL_ATTR(_name, _priv) |
#define | AD579X_CH(_name, _idx, _type) |
#define | NUM_OF_IIO_DEVICES 1 |
#define | AD579X_IIO_TRIGGER_NAME "ad579x_iio_trigger" |
#define | DEFAULT_SCALE (((float)DAC_CH_SPAN/DAC_MAX_COUNT_BIN_OFFSET)*1000) |
#define | BYTES_PER_SAMPLE sizeof(uint32_t) |
#define | CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define | DATA_BUFFER_SIZE (32768) |
Enumerations | |
enum | ad579x_attribute_ids { DAC_RAW , DAC_SCALE , DAC_OFFSET , DAC_POWERDOWN , DAC_CLR_CODE , DAC_LIN_COMP , DAC_OUTPUT_AMPLIFIER , DAC_POWERDOWN_MODE , DAC_CODE_SELECT , DAC_SAMPLING_FREQUENCY , DAC_LDAC , DAC_CLR } |
enum | code_format_selection { TWOS_COMPLEMNT , BINARY_OFFSET } |
Functions | |
int32_t | ad579x_set_sampling_rate (uint32_t *sampling_rate) |
Set the sampling rate and get the updated value supported by MCU platform. More... | |
int | ad579x_get_scale (float *scale) |
Get the IIO scale factor. More... | |
int | ad579x_get_offset (uint32_t raw, int32_t *offset) |
Get the IIO offset value. More... | |
int32_t | ad579x_iio_init () |
Initialize the IIO interface for AD579x IIO device. More... | |
void | ad579x_iio_event_handler (void) |
Run the AD579x IIO event handler. More... | |
Variables | |
struct ad5791_dev * | ad579x_dev_desc = NULL |
struct scan_type | ad579x_iio_scan_type |
AD579x IIO application interface module.
Copyright (c) 2023-24 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 AD579X_CH | ( | _name, | |
_idx, | |||
_type | |||
) |
#define AD579X_CHN_ATTR | ( | _name, | |
_priv | |||
) |
#define AD579X_CHN_AVAIL_ATTR | ( | _name, | |
_priv | |||
) |
#define AD579X_IIO_TRIGGER_NAME "ad579x_iio_trigger" |
#define BYTES_PER_SAMPLE sizeof(uint32_t) |
#define CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define DATA_BUFFER_SIZE (32768) |
#define DEFAULT_SCALE (((float)DAC_CH_SPAN/DAC_MAX_COUNT_BIN_OFFSET)*1000) |
#define NUM_OF_IIO_DEVICES 1 |
enum ad579x_attribute_ids |
int ad579x_get_offset | ( | uint32_t | raw, |
int32_t * | offset | ||
) |
Get the IIO offset value.
raw[in] | - DAC raw data |
offset[in,out] | - IIO offset value |
int ad579x_get_scale | ( | float * | scale | ) |
Get the IIO scale factor.
scale[in,out] | - IIO scale value |
void ad579x_iio_event_handler | ( | void | ) |
Run the AD579x IIO event handler.
This function monitors the new IIO client event
int32_t ad579x_iio_init | ( | ) |
Initialize the IIO interface for AD579x IIO device.
int32_t ad579x_set_sampling_rate | ( | uint32_t * | sampling_rate | ) |
Set the sampling rate and get the updated value supported by MCU platform.
sampling_rate[in,out] | - Sampling rate value |
struct ad5791_dev* ad579x_dev_desc = NULL |
struct scan_type ad579x_iio_scan_type |