precision-converters-firmware
|
Implementation of AD4130 IIO application interfaces. More...
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include "app_config.h"
#include "ad4130_iio.h"
#include "ad4130_support.h"
#include "ad4130_user_config.h"
#include "ad4130_temperature_sensor.h"
#include "ad4130_regs.h"
#include "common.h"
#include "no_os_error.h"
#include "board_info.h"
#include "iio_trigger.h"
Classes | |
struct | adc_calibration_configs |
Macros | |
#define | AD4130_CHN_ATTR(_name, _priv) |
#define | AD4130_CHN_AVAIL_ATTR(_name, _priv) |
#define | AD4130_CH(_name, _idx, _type) |
#define | AD4130_MIN_SAMPLING_FREQ (50 / ADC_USER_CHANNELS) |
#define | AD4130_DEFAULT_OFFSET 0x800000 |
#define | NUM_OF_IIO_DEVICES 1 |
#define | AD4130_IIO_TRIGGER_NAME "ad4130_iio_trigger" |
#define | BYTES_PER_SAMPLE sizeof(uint32_t) |
#define | CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define | LOADCELL_SAMPLES_COUNT 10 |
#define | CJC_CHANNEL 1 |
#define | I_RSENSE 10 |
#define | V_SCALE 6 |
#define | FIFO_SIZE 256 |
#define | BUF_READ_TIMEOUT 0xffffffff |
#define | DATA_BUFFER_SIZE (32768) |
Functions | |
int32_t | debug_reg_read (void *dev, uint32_t reg, uint32_t *readval) |
Read the debug register value. More... | |
int32_t | debug_reg_write (void *dev, uint32_t reg, uint32_t writeval) |
Write into the debug register. More... | |
int32_t | start_burst_mode_capture (void) |
Start the burst mode data capture. More... | |
int32_t | iio_ad4130_trigger_handler (struct iio_device_data *iio_dev_data) |
Push data into IIO buffer when trigger handler IRQ is invoked. More... | |
void | ad4130_fifo_event_handler (void *ctx) |
This is an ISR (Interrupt Service Routine) to monitor FIFO data available event. This function is expected to be called asynchronously when data from internal device FIFO is available to read. More... | |
int32_t | ad4130_data_capture_init (void) |
Function to init the data capture for AD4130 device. More... | |
int32_t | ad4130_iio_init (struct iio_device **desc) |
Init for reading/writing and parameterization of a ad4130 IIO device. More... | |
int32_t | ad4130_iio_remove (struct iio_desc *desc) |
Release resources allocated for IIO device. More... | |
int32_t | ad4130_iio_initialize (void) |
Initialize the IIO interface for AD4130 IIO device. More... | |
void | ad4130_iio_event_handler (void) |
Run the AD4130 IIO event handler. More... | |
Variables | |
struct ad413x_dev * | ad4130_dev_inst = NULL |
Implementation of AD4130 IIO application interfaces.
This module acts as an interface for AD4130 IIO application
Copyright (c) 2020-2023 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 AD4130_CH | ( | _name, | |
_idx, | |||
_type | |||
) |
#define AD4130_CHN_ATTR | ( | _name, | |
_priv | |||
) |
#define AD4130_CHN_AVAIL_ATTR | ( | _name, | |
_priv | |||
) |
#define AD4130_DEFAULT_OFFSET 0x800000 |
#define AD4130_IIO_TRIGGER_NAME "ad4130_iio_trigger" |
#define AD4130_MIN_SAMPLING_FREQ (50 / ADC_USER_CHANNELS) |
#define BUF_READ_TIMEOUT 0xffffffff |
#define BYTES_PER_SAMPLE sizeof(uint32_t) |
#define CHN_STORAGE_BITS (BYTES_PER_SAMPLE * 8) |
#define CJC_CHANNEL 1 |
#define DATA_BUFFER_SIZE (32768) |
#define FIFO_SIZE 256 |
#define I_RSENSE 10 |
#define LOADCELL_SAMPLES_COUNT 10 |
#define NUM_OF_IIO_DEVICES 1 |
#define V_SCALE 6 |
enum ad4130_attribute_id |
enum calib_status |
enum calibration_state |
enum context_attr_ids |
int32_t ad4130_data_capture_init | ( | void | ) |
Function to init the data capture for AD4130 device.
void ad4130_fifo_event_handler | ( | void * | ctx | ) |
This is an ISR (Interrupt Service Routine) to monitor FIFO data available event. This function is expected to be called asynchronously when data from internal device FIFO is available to read.
ctx[in] | - Callback context (unused) |
void ad4130_iio_event_handler | ( | void | ) |
Run the AD4130 IIO event handler.
This function monitors the new IIO client event
int32_t ad4130_iio_init | ( | struct iio_device ** | desc | ) |
Init for reading/writing and parameterization of a ad4130 IIO device.
desc[in,out] | - IIO device descriptor |
int32_t ad4130_iio_initialize | ( | void | ) |
Initialize the IIO interface for AD4130 IIO device.
int32_t ad4130_iio_remove | ( | struct iio_desc * | desc | ) |
Release resources allocated for IIO device.
desc[in] | - IIO device descriptor |
int32_t debug_reg_read | ( | void * | dev, |
uint32_t | reg, | ||
uint32_t * | readval | ||
) |
Read the debug register value.
dev[in]- | Pointer to IIO device instance |
reg[in]- | Register address to read from |
readval[in,out]- | Pointer to variable to read data into |
int32_t debug_reg_write | ( | void * | dev, |
uint32_t | reg, | ||
uint32_t | writeval | ||
) |
Write into the debug register.
dev[in]- | Pointer to IIO device instance |
reg[in]- | Register address to write into |
writeval[in]- | Register value to write |
int32_t iio_ad4130_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 start_burst_mode_capture | ( | void | ) |
Start the burst mode data capture.
struct ad413x_dev* ad4130_dev_inst = NULL |