precision-converters-firmware
Macros | Enumerations | Functions
ad7606_support.h File Reference

Header for AD7606 No-OS driver supports. More...

#include "ad7606.h"
Include dependency graph for ad7606_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHANNEL_RANGE_MSK_OFFSET   4
 
#define AD7606_OVERSAMPLING_MSK   NO_OS_GENMASK(3,0)
 
#define DEFAULT_CHN_RANGE   (10.0)
 
#define AD7606_DIAGN_MUX_CH_MSK(ch)   (NO_OS_GENMASK(2, 0) << (3 * ((ch) % 2)))
 
#define AD7606_DIAGN_MUX_CH_VAL(ch, val)   (val << (3 * ((ch) % 2)))
 
#define AD7606_OPEN_DETECT_ENABLE_MSK(ch)   (NO_OS_GENMASK(7,0) & (~(1 << ch)))
 
#define ANALOG_INPUT_MUX   0X00
 
#define TEMPERATURE_MUX   0x01
 
#define VREF_MUX   0X02
 
#define ALDO_MUX   0X03
 
#define DLDO_MUX   0X04
 
#define VDRIVE_MUX   0x05
 
#define VREF_MUX_MULTIPLIER   4.0
 
#define AD7606C_UNIPOLAR_RANGE_MIN   5
 
#define AD7606C_UNIPOLAR_RANGE_MAX   7
 
#define NUM_OF_REGISTERS   0x2F
 

Enumerations

enum  polarity_e {
  UNIPOLAR ,
  BIPOLAR
}
 

Functions

int32_t ad7606_read_converted_sample (struct ad7606_dev *dev, uint32_t *adc_data, uint8_t input_chn)
 Read ADC raw data for recently sampled channel. More...
 
int32_t ad7606_read_single_sample (struct ad7606_dev *dev, uint32_t *adc_data, uint8_t chn)
 Perform conversion and read single conversion sample. More...
 
polarity_e ad7606_get_input_polarity (uint8_t chn_range_bits)
 Function to get the polarity of analog input. More...
 

Detailed Description

Header for AD7606 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.

Macro Definition Documentation

◆ AD7606_DIAGN_MUX_CH_MSK

#define AD7606_DIAGN_MUX_CH_MSK (   ch)    (NO_OS_GENMASK(2, 0) << (3 * ((ch) % 2)))

◆ AD7606_DIAGN_MUX_CH_VAL

#define AD7606_DIAGN_MUX_CH_VAL (   ch,
  val 
)    (val << (3 * ((ch) % 2)))

◆ AD7606_OPEN_DETECT_ENABLE_MSK

#define AD7606_OPEN_DETECT_ENABLE_MSK (   ch)    (NO_OS_GENMASK(7,0) & (~(1 << ch)))

◆ AD7606_OVERSAMPLING_MSK

#define AD7606_OVERSAMPLING_MSK   NO_OS_GENMASK(3,0)

◆ AD7606C_UNIPOLAR_RANGE_MAX

#define AD7606C_UNIPOLAR_RANGE_MAX   7

◆ AD7606C_UNIPOLAR_RANGE_MIN

#define AD7606C_UNIPOLAR_RANGE_MIN   5

◆ ALDO_MUX

#define ALDO_MUX   0X03

◆ ANALOG_INPUT_MUX

#define ANALOG_INPUT_MUX   0X00

◆ CHANNEL_RANGE_MSK_OFFSET

#define CHANNEL_RANGE_MSK_OFFSET   4

◆ DEFAULT_CHN_RANGE

#define DEFAULT_CHN_RANGE   (10.0)

◆ DLDO_MUX

#define DLDO_MUX   0X04

◆ NUM_OF_REGISTERS

#define NUM_OF_REGISTERS   0x2F

◆ TEMPERATURE_MUX

#define TEMPERATURE_MUX   0x01

◆ VDRIVE_MUX

#define VDRIVE_MUX   0x05

◆ VREF_MUX

#define VREF_MUX   0X02

◆ VREF_MUX_MULTIPLIER

#define VREF_MUX_MULTIPLIER   4.0

Enumeration Type Documentation

◆ polarity_e

enum polarity_e
Enumerator
UNIPOLAR 
BIPOLAR 

Function Documentation

◆ ad7606_get_input_polarity()

polarity_e ad7606_get_input_polarity ( uint8_t  chn_range_bits)

Function to get the polarity of analog input.

Parameters
chn_range_bits[in]- Bits from the channel range register
Returns
UNIPOLAR or BIPOLAR

◆ ad7606_read_converted_sample()

int32_t ad7606_read_converted_sample ( struct ad7606_dev *  dev,
uint32_t *  adc_data,
uint8_t  input_chn 
)

Read ADC raw data for recently sampled channel.

Parameters
dev[in]- AD7606 device instance
adc_data[in,out]- Pointer to adc data read variable
input_chn[in]- Input channel
Returns
0 in case of success, negative error code otherwise

◆ ad7606_read_single_sample()

int32_t ad7606_read_single_sample ( struct ad7606_dev *  dev,
uint32_t *  adc_data,
uint8_t  chn 
)

Perform conversion and read single conversion sample.

Parameters
dev[in]- AD7606 device instance
adc_data[in,out]- Pointer to adc data read variable
chn[in]- Channel for which data is to read
Returns
0 in case of success, negative error code otherwise