precision-converters-firmware
|
Main interface for AD7124 IIO Application firmware example program. More...
#include <stdio.h>
#include <string.h>
#include "ad7124_user_config.h"
#include "ad7124_iio.h"
#include "no_os_util.h"
#include "no_os_error.h"
#include "common.h"
#include "no_os_gpio.h"
#include "no_os_irq.h"
#include "ad7124_support.h"
#include "iio_trigger.h"
Macros | |
#define | BYTES_PER_SAMPLE sizeof(uint32_t) |
#define | CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define | ADC_BUFFER_SIZE (32768) |
#define | AD7124_DEFAULT_REF_VOLTAGE (2.5) |
#define | NUM_OF_IIO_DEVICES 1 |
#define | AD7124_CHN_ATTR(_name, _priv) |
#define | AD7124_CHN_AVAIL_ATTR(_name, _priv) |
#define | AD7124_CH(_name, _dev, _idx, _type) |
#define | AD7124_DEFAULT_CHN_SCAN |
#define | SAMPLING_RATE_LOW_POWER 2400 |
#define | SAMPLING_RATE_MID_POWER 4800 |
#define | SAMPLING_RATE_HIGH_POWER 19200 |
#define | SAMPLING_RATE 19200 |
#define | AD7124_MAX_REG AD7124_GAIN7_REG |
#define | AD7124_IIO_TRIGGER_NAME "ad7124_iio_trigger" |
Enumerations | |
enum | ad7124_iio_attr_id { IIO_RAW_ATTR_ID , IIO_SCALE_ATTR_ID , IIO_OFFSET_ATTR_ID , NUM_OF_CHN_ATTR , IIO_3DB_FREQUENCY_ID , IIO_SAMPLING_FREQUENCY_ID , IIO_POWER_MODE_ID } |
Functions | |
int32_t | ad7124_trigger_handler (struct iio_device_data *iio_dev_data) |
void | data_capture_callback (void *ctx) |
Interrupt Service Routine to monitor end of conversion event. More... | |
int | ad7124_iio_remove (struct iio_desc *desc) |
Release resources allocated for IIO device. More... | |
int | ad7124_iio_init (struct iio_device **desc, uint8_t dev_indx) |
Init for reading/writing and parameterization of a AD7124 IIO device. More... | |
int32_t | ad7124_iio_initialize (void) |
Initialize the AD7124 IIO Interface. More... | |
void | ad7124_iio_event_handler (void) |
Run the AD7124 IIO event handler. More... | |
Variables | |
struct ad7124_dev * | ad7124_dev_inst = NULL |
struct scan_type | chn_scan [NUM_OF_IIO_DEVICES][AD7124_MAX_CHANNELS] |
volatile bool | data_capture_done = false |
struct iio_trigger_init | iio_trigger_init_params |
Main interface for AD7124 IIO Application firmware example program.
This module acts as an interface for the AD7124 IIO Application.
Copyright (c) 2023-24 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.
#define AD7124_CH | ( | _name, | |
_dev, | |||
_idx, | |||
_type | |||
) |
#define AD7124_CHN_ATTR | ( | _name, | |
_priv | |||
) |
#define AD7124_CHN_AVAIL_ATTR | ( | _name, | |
_priv | |||
) |
#define AD7124_DEFAULT_CHN_SCAN |
#define AD7124_DEFAULT_REF_VOLTAGE (2.5) |
#define AD7124_IIO_TRIGGER_NAME "ad7124_iio_trigger" |
#define AD7124_MAX_REG AD7124_GAIN7_REG |
#define ADC_BUFFER_SIZE (32768) |
#define BYTES_PER_SAMPLE sizeof(uint32_t) |
#define CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define NUM_OF_IIO_DEVICES 1 |
#define SAMPLING_RATE 19200 |
#define SAMPLING_RATE_HIGH_POWER 19200 |
#define SAMPLING_RATE_LOW_POWER 2400 |
#define SAMPLING_RATE_MID_POWER 4800 |
enum ad7124_iio_attr_id |
void ad7124_iio_event_handler | ( | void | ) |
Run the AD7124 IIO event handler.
int ad7124_iio_init | ( | struct iio_device ** | desc, |
uint8_t | dev_indx | ||
) |
Init for reading/writing and parameterization of a AD7124 IIO device.
desc[in,out] | - IIO device descriptor |
dev_indx[in] | - IIO device number |
int32_t ad7124_iio_initialize | ( | void | ) |
Initialize the AD7124 IIO Interface.
int ad7124_iio_remove | ( | struct iio_desc * | desc | ) |
Release resources allocated for IIO device.
desc[in] | - IIO device descriptor |
int32_t ad7124_trigger_handler | ( | struct iio_device_data * | iio_dev_data | ) |
void data_capture_callback | ( | void * | ctx | ) |
Interrupt Service Routine to monitor end of conversion event.
Interrupt Service Routine to monitor data ready event.
ctx[in] | - Callback context (unused) |
struct ad7124_dev* ad7124_dev_inst = NULL |
struct scan_type chn_scan[NUM_OF_IIO_DEVICES][AD7124_MAX_CHANNELS] |
volatile bool data_capture_done = false |
struct iio_trigger_init iio_trigger_init_params |