precision-converters-firmware
|
Implementation of AD469x IIO application interfaces. More...
#include <inttypes.h>
#include <string.h>
#include <math.h>
#include "app_config.h"
#include "ad469x_iio.h"
#include "ad469x_support.h"
#include "ad469x_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 "no_os_print_log.h"
#include "iio_trigger.h"
Macros | |
#define | AD469X_CHN_ATTR(_name, _priv) |
#define | AD469X_CHN_AVAIL_ATTR(_name, _priv) |
#define | AD469X_IIO_CH(_name, _idx) |
#define | DATA_BUFFER_SIZE (32768) |
#define | NUM_OF_IIO_DEVICES 1 |
#define | AD469x_IIO_TRIGGER_NAME "ad469x_iio_trigger" |
#define | REGISTER_MAX_VAL 0x017F |
#define | PWM_PERIOD_TO_FREQUENCY(x) (1000000000.0 / x) |
#define | BUF_READ_TIMEOUT 0xffffffff |
#define | AD469X_GAIN_CORR_SCALE(x) (float)(x) / (float)(ADC_MAX_COUNT_BIPOLAR) |
Enumerations | |
enum | ad469x_attribute_ids { ADC_RAW , ADC_SCALE , ADC_OFFSET , ADC_REFERENCE_SEL , ADC_OFFSET_CORRECTION , ADC_GAIN_CORRECTION , ADC_AIN_HIGH_Z , ADC_SAMPLING_FREQUENCY } |
Functions | |
int32_t | ad469x_update_sampling_frequency (uint32_t *sampling_rate) |
Set the sampling rate and get the updated value supported by MCU platform. More... | |
int32_t | ad469x_trigger_handler (struct iio_device_data *iio_dev_data) |
Push data into IIO buffer when trigger handler IRQ is invoked. More... | |
void | burst_capture_callback (void *context) |
Interrupt Service Routine to monitor end of conversion event. More... | |
int32_t | ad469x_iio_initialize (void) |
Release resources allocated for IIO device. More... | |
void | ad469x_iio_event_handler (void) |
Run the ad469x IIO event handler. More... | |
Variables | |
struct ad469x_dev * | p_ad469x_dev = NULL |
volatile bool | ad469x_conversion_flag = false |
volatile uint32_t * | buff_start_addr |
volatile bool | dma_config_updated = false |
struct scan_type | ad469x_iio_scan_type |
volatile struct iio_device_data * | global_iio_dev_data |
uint32_t | global_nb_of_samples |
int32_t | data_read |
Implementation of AD469x IIO application interfaces.
This module acts as an interface for AD469x IIO application
Copyright (c) 2021-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 AD469X_CHN_ATTR | ( | _name, | |
_priv | |||
) |
#define AD469X_CHN_AVAIL_ATTR | ( | _name, | |
_priv | |||
) |
#define AD469X_GAIN_CORR_SCALE | ( | x | ) | (float)(x) / (float)(ADC_MAX_COUNT_BIPOLAR) |
#define AD469X_IIO_CH | ( | _name, | |
_idx | |||
) |
#define AD469x_IIO_TRIGGER_NAME "ad469x_iio_trigger" |
#define BUF_READ_TIMEOUT 0xffffffff |
#define DATA_BUFFER_SIZE (32768) |
#define NUM_OF_IIO_DEVICES 1 |
#define PWM_PERIOD_TO_FREQUENCY | ( | x | ) | (1000000000.0 / x) |
#define REGISTER_MAX_VAL 0x017F |
enum ad469x_attribute_ids |
void ad469x_iio_event_handler | ( | void | ) |
Run the ad469x IIO event handler.
int32_t ad469x_iio_initialize | ( | void | ) |
Release resources allocated for IIO device.
desc[in] | - IIO device descriptor |
int32_t ad469x_trigger_handler | ( | struct iio_device_data * | iio_dev_data | ) |
Push data into IIO buffer when trigger handler IRQ is invoked.
iio_dev_data[in] | - IIO device data instance |
int32_t ad469x_update_sampling_frequency | ( | uint32_t * | sampling_rate | ) |
Set the sampling rate and get the updated value supported by MCU platform.
sampling_rate[in,out] | - Sampling rate value |
void burst_capture_callback | ( | void * | context | ) |
Interrupt Service Routine to monitor end of conversion event.
context[in] | - Callback context (unused) |
volatile bool ad469x_conversion_flag = false |
struct scan_type ad469x_iio_scan_type |
volatile uint32_t* buff_start_addr |
int32_t data_read |
volatile bool dma_config_updated = false |
volatile struct iio_device_data* global_iio_dev_data |
uint32_t global_nb_of_samples |
struct ad469x_dev* p_ad469x_dev = NULL |