precision-converters-firmware
|
Implementation of AD405X IIO Application Interface. More...
#include <string.h>
#include <math.h>
#include "app_config.h"
#include "app_support.h"
#include "ad405x.h"
#include "ad405x_iio.h"
#include "ad405x_user_config.h"
#include "common.h"
#include "no_os_delay.h"
#include "no_os_error.h"
#include "no_os_gpio.h"
#include "no_os_pwm.h"
#include "no_os_alloc.h"
#include "no_os_util.h"
#include "iio_trigger.h"
#include "version.h"
Macros | |
#define | AD405X_CHN_ATTR(_name, _priv) |
#define | AD405X_CHN_AVAIL_ATTR(_name, _priv) |
#define | NUM_OF_IIO_DEVICES 2 |
#define | AD405X_IIO_TRIGGER_NAME ACTIVE_DEVICE_NAME"_iio_trigger" |
#define | DEV_AD4050 "ad4050" |
#define | DEV_AD4052 "ad4052" |
#define | DEV_AD4060 "ad4060" |
#define | DEV_AD4062 "ad4062" |
#define | COMPENSATION_FACTOR 1.1 |
#define | CONVERSION_TIME_NS 250 |
#define | MAX_SAMPLING_PERIOD_NSEC 2500000 |
Enumerations | |
enum | ad405x_attribute_ids { ADC_RAW , ADC_SCALE , ADC_OFFSET , ADC_OPERATING_MODE , ADC_SAMPLE_RATE , RESTART_IIO , ADC_BURST_SAMPLE_RATE , ADC_FILTER_LENGTH } |
Functions | |
void | data_capture_callback (void *context) |
Interrupt Service Routine to monitor data ready event. | |
int | iio_params_deinit (void) |
DeInitialize the IIO params. | |
int32_t | iio_ad405x_initialize (void) |
Initialize the IIO interface for AD405X IIO device. | |
void | iio_ad405x_event_handler (void) |
Run the AD405X IIO event handler. | |
Variables | |
struct ad405x_dev * | p_ad405x_dev = NULL |
struct iio_device * | p_iio_ad405x_dev [NUM_OF_IIO_DEVICES] |
struct iio_hw_trig * | ad405x_hw_trig_desc |
enum ad405x_operation_mode | ad405x_operating_mode = AD405X_ADC_MODE_OP |
enum ad405x_interface_modes | ad405x_interface_mode = SPI_DMA |
volatile bool | data_ready = false |
volatile uint8_t * | buff_start_addr |
volatile struct iio_device_data * | iio_dev_data_g |
uint8_t | bytes_per_sample |
struct no_os_spi_msg | ad405x_spi_msg |
struct stm32_spi_init_param * | spi_init_param |
Implementation of AD405X IIO Application Interface.
This module acts as an interface for AD405X IIO device
Copyright (c) 2022-2025 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 AD405X_CHN_ATTR | ( | _name, | |
_priv | |||
) |
#define AD405X_CHN_AVAIL_ATTR | ( | _name, | |
_priv | |||
) |
#define AD405X_IIO_TRIGGER_NAME ACTIVE_DEVICE_NAME"_iio_trigger" |
#define COMPENSATION_FACTOR 1.1 |
#define CONVERSION_TIME_NS 250 |
#define DEV_AD4050 "ad4050" |
#define DEV_AD4052 "ad4052" |
#define DEV_AD4060 "ad4060" |
#define DEV_AD4062 "ad4062" |
#define MAX_SAMPLING_PERIOD_NSEC 2500000 |
#define NUM_OF_IIO_DEVICES 2 |
enum ad405x_attribute_ids |
void data_capture_callback | ( | void * | context | ) |
Interrupt Service Routine to monitor data ready event.
context[in] | - Callback context (unused) |
void iio_ad405x_event_handler | ( | void | ) |
Run the AD405X IIO event handler.
This function monitors the new IIO client event
int32_t iio_ad405x_initialize | ( | void | ) |
Initialize the IIO interface for AD405X IIO device.
int iio_params_deinit | ( | void | ) |
DeInitialize the IIO params.
struct iio_hw_trig* ad405x_hw_trig_desc |
enum ad405x_interface_modes ad405x_interface_mode = SPI_DMA |
enum ad405x_operation_mode ad405x_operating_mode = AD405X_ADC_MODE_OP |
struct no_os_spi_msg ad405x_spi_msg |
volatile uint8_t* buff_start_addr |
uint8_t bytes_per_sample |
volatile bool data_ready = false |
volatile struct iio_device_data* iio_dev_data_g |
struct ad405x_dev* p_ad405x_dev = NULL |
struct iio_device* p_iio_ad405x_dev[NUM_OF_IIO_DEVICES] |
struct stm32_spi_init_param* spi_init_param |