precision-converters-firmware
|
Header for AD4130 No-OS driver supports. More...
#include <stdint.h>
#include "ad413x.h"
Go to the source code of this file.
Macros | |
#define | AD413X_ADDR(x) ((x) & 0xFF) |
#define | AD4130_INT_SRC_SEL_MSK NO_OS_GENMASK(9, 8) |
#define | AD4130_FILTER_FS_MSK NO_OS_GENMASK(10, 0) |
#define | AD4130_FIFO_MODE_MSK NO_OS_GENMASK(17, 16) |
#define | AD413X_WATERMARK_MSK NO_OS_GENMASK(7, 0) |
#define | AD413X_COMM_REG_RD NO_OS_BIT(6) |
Enumerations | |
enum | fifo_mode_e { FIFO_DISABLED , FIFO_OLDEST_SAVE_MODE , FIFO_STREAM_MODE } |
enum | adc_conv_int_source_e { INT_PIN , CLK_PIN , GPIO1_PIN } |
Functions | |
float | ad4130_get_reference_voltage (struct ad413x_dev *dev, uint8_t chn) |
Get reference voltage based on the reference source. More... | |
int32_t | perform_sign_conversion (struct ad413x_dev *dev, uint32_t adc_raw_data, uint8_t chn) |
Perform the sign conversion for handling negative voltages in bipolar mode. More... | |
float | convert_adc_sample_into_voltage (void *dev, uint32_t adc_raw, uint8_t chn) |
Convert the ADC raw value into equivalent voltage. More... | |
float | convert_adc_data_to_voltage_wrt_vref (void *dev, int32_t code, uint8_t chn) |
Convert ADC data to voltage w.r.t Vref. More... | |
float | convert_adc_data_to_voltage_without_vref (void *dev, int32_t code, uint8_t chn) |
Convert ADC data to voltage without Vref. More... | |
float | convert_adc_raw_into_rtd_resistance (void *dev, uint32_t adc_raw, float rtd_ref, uint8_t chn) |
Convert the ADC raw value into equivalent RTD resistance. More... | |
int32_t | ad4130_read_fifo (struct ad413x_dev *dev, uint32_t *data, uint32_t adc_samples) |
Read the data from FIFO. More... | |
int32_t | ad413x_read_single_sample (struct ad413x_dev *dev, uint8_t input_chn, uint32_t *adc_raw) |
Function to read the single ADC sample (raw data) for input channel. More... | |
int32_t | ad413x_mon_conv_and_read_data (struct ad413x_dev *dev, uint32_t *raw_data) |
Function to monitor end of conversion and read conversion result. More... | |
int32_t | ad413x_set_int_source (struct ad413x_dev *dev, adc_conv_int_source_e conv_int_source) |
Set interrupt conversion source (GPIO) More... | |
int32_t | ad413x_set_filter_fs (struct ad413x_dev *dev, uint32_t fs, uint8_t preset) |
Set filter FS value. More... | |
Header for AD4130 No-OS driver supports.
Copyright (c) 2020-2022 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_FIFO_MODE_MSK NO_OS_GENMASK(17, 16) |
#define AD4130_FILTER_FS_MSK NO_OS_GENMASK(10, 0) |
#define AD4130_INT_SRC_SEL_MSK NO_OS_GENMASK(9, 8) |
#define AD413X_ADDR | ( | x | ) | ((x) & 0xFF) |
#define AD413X_COMM_REG_RD NO_OS_BIT(6) |
#define AD413X_WATERMARK_MSK NO_OS_GENMASK(7, 0) |
enum fifo_mode_e |
float ad4130_get_reference_voltage | ( | struct ad413x_dev * | dev, |
uint8_t | chn | ||
) |
Get reference voltage based on the reference source.
dev[in] | - Device instance |
chn[in] | - ADC channel |
int32_t ad4130_read_fifo | ( | struct ad413x_dev * | dev, |
uint32_t * | data, | ||
uint32_t | adc_samples | ||
) |
Read the data from FIFO.
dev[in] | - device instance |
data[in] | - Buffer to store FIFO data |
adc_samples[in] | - Number of ADC samples to read |
int32_t ad413x_mon_conv_and_read_data | ( | struct ad413x_dev * | dev, |
uint32_t * | raw_data | ||
) |
Function to monitor end of conversion and read conversion result.
dev[in] | - Device instance |
raw_data[in,out]- | ADC raw data |
int32_t ad413x_read_single_sample | ( | struct ad413x_dev * | dev, |
uint8_t | input_chn, | ||
uint32_t * | adc_raw | ||
) |
Function to read the single ADC sample (raw data) for input channel.
dev[in] | - Device instance |
input_chn[in] | - Input channel to be sampled and read data for |
adc_raw[in,out]- | ADC raw data |
int32_t ad413x_set_filter_fs | ( | struct ad413x_dev * | dev, |
uint32_t | fs, | ||
uint8_t | preset | ||
) |
Set filter FS value.
dev[in] | - Device instance |
fs[in]- | FS value |
preset[in] | - Channel setup |
int32_t ad413x_set_int_source | ( | struct ad413x_dev * | dev, |
adc_conv_int_source_e | conv_int_source | ||
) |
Set interrupt conversion source (GPIO)
dev[in] | - Device instance |
conv_int_source[in]- | Interrupt source |
float convert_adc_data_to_voltage_without_vref | ( | void * | dev, |
int32_t | data, | ||
uint8_t | chn | ||
) |
Convert ADC data to voltage without Vref.
dev[in] | - Device instance |
data[in] | - ADC data in straight binary format (signed) |
chn[in] | - ADC channel |
float convert_adc_data_to_voltage_wrt_vref | ( | void * | dev, |
int32_t | data, | ||
uint8_t | chn | ||
) |
Convert ADC data to voltage w.r.t Vref.
dev[in] | - Device instance |
data[in] | - ADC data in straight binary format (signed) |
chn[in] | - ADC channel |
float convert_adc_raw_into_rtd_resistance | ( | void * | dev, |
uint32_t | adc_raw, | ||
float | rtd_ref, | ||
uint8_t | chn | ||
) |
float convert_adc_sample_into_voltage | ( | void * | dev, |
uint32_t | adc_raw, | ||
uint8_t | chn | ||
) |
Convert the ADC raw value into equivalent voltage.
dev[in] | - Device instance |
adc_raw[in]- | ADC raw data |
chn[in] | - ADC channel |
int32_t perform_sign_conversion | ( | struct ad413x_dev * | dev, |
uint32_t | adc_raw_data, | ||
uint8_t | chn | ||
) |
Perform the sign conversion for handling negative voltages in bipolar mode.
dev[in] | - Device instance |
adc_raw_data[in] | - ADC raw value |
chn[in] | - ADC Channel |