no-OS
Classes | Macros | Functions
ad7193.h File Reference

Header file of AD7193 Driver. More...

#include <stdint.h>
#include "no-os/gpio.h"
#include "no-os/spi.h"
#include "no-os/util.h"
Include dependency graph for ad7193.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ad7193_dev
 
struct  ad7193_init_param
 

Macros

#define AD7193_SLAVE_ID   1
 
#define AD7193_REG_COMM   0
 
#define AD7193_REG_STAT   0
 
#define AD7193_REG_MODE   1
 
#define AD7193_REG_CONF   2
 
#define AD7193_REG_DATA   3
 
#define AD7193_REG_ID   4
 
#define AD7193_REG_GPOCON   5
 
#define AD7193_REG_OFFSET   6
 
#define AD7193_REG_FULLSCALE   7
 
#define AD7193_COMM_WEN   (1 << 7)
 
#define AD7193_COMM_WRITE   (0 << 6)
 
#define AD7193_COMM_READ   (1 << 6)
 
#define AD7193_COMM_ADDR(x)   (((x) & 0x7) << 3)
 
#define AD7193_COMM_CREAD   (1 << 2)
 
#define AD7193_STAT_RDY   (1 << 7)
 
#define AD7193_STAT_ERR   (1 << 6)
 
#define AD7193_STAT_NOREF   (1 << 5)
 
#define AD7193_STAT_PARITY   (1 << 4)
 
#define AD7193_STAT_CH3   (1 << 3)
 
#define AD7193_STAT_CH2   (1 << 2)
 
#define AD7193_STAT_CH1   (1 << 1)
 
#define AD7193_STAT_CH0   (1 << 0)
 
#define AD7193_MODE_SEL(x)   (((uint32_t)(x) & 0x7) << 21)
 
#define AD7193_MODE_DAT_STA   ((uint32_t)1 << 20)
 
#define AD7193_MODE_CLKSRC(x)   (((uint32_t)(x) & 0x3) << 18)
 
#define AD7193_MODE_AVG(x)   (((uint32_t)(x) & 0x3) << 16)
 
#define AD7193_MODE_SINC3   (1 << 15)
 
#define AD7193_MODE_ENPAR   (1 << 13)
 
#define AD7193_MODE_CLKDIV   (1 << 12)
 
#define AD7193_MODE_SCYCLE   (1 << 11)
 
#define AD7193_MODE_REJ60   (1 << 10)
 
#define AD7193_MODE_RATE(x)   ((x) & 0x3FF)
 
#define AD7193_MODE_CONT   0
 
#define AD7193_MODE_SINGLE   1
 
#define AD7193_MODE_IDLE   2
 
#define AD7193_MODE_PWRDN   3
 
#define AD7193_MODE_CAL_INT_ZERO   4
 
#define AD7193_MODE_CAL_INT_FULL   5
 
#define AD7193_MODE_CAL_SYS_ZERO   6
 
#define AD7193_MODE_CAL_SYS_FULL   7
 
#define AD7193_CLK_EXT_MCLK1_2   0
 
#define AD7193_CLK_EXT_MCLK2   1
 
#define AD7193_CLK_INT   2
 
#define AD7193_CLK_INT_CO   3
 
#define AD7193_AVG_NONE   0
 
#define AD7193_AVG_BY_2   1
 
#define AD7193_AVG_BY_8   2
 
#define AD7193_AVG_BY_16   3
 
#define AD7193_CONF_CHOP   ((uint32_t)1 << 23)
 
#define AD7193_CONF_REFSEL   ((uint32_t)1 << 20)
 
#define AD7193_CONF_PSEUDO   ((uint32_t)1 << 18)
 
#define AD7193_CONF_CHAN(x)   ((uint32_t)((x) & 0x3FF) << 8)
 
#define AD7193_CONF_BURN   (1 << 7)
 
#define AD7193_CONF_REFDET   (1 << 6)
 
#define AD7193_CONF_BUF   (1 << 4)
 
#define AD7193_CONF_UNIPOLAR   (1 << 3)
 
#define AD7193_CONF_GAIN(x)   ((x) & 0x7)
 
#define AD7193_CH_0   0
 
#define AD7193_CH_1   1
 
#define AD7193_CH_2   2
 
#define AD7193_CH_3   3
 
#define AD7193_CH_4   4
 
#define AD7193_CH_5   5
 
#define AD7193_CH_6   6
 
#define AD7193_CH_7   7
 
#define AD7193_CH_TEMP   8
 
#define AD7193_CH_SHORT   9
 
#define AD7193_CONF_GAIN_1   0
 
#define AD7193_CONF_GAIN_8   3
 
#define AD7193_CONF_GAIN_16   4
 
#define AD7193_CONF_GAIN_32   5
 
#define AD7193_CONF_GAIN_64   6
 
#define AD7193_CONF_GAIN_128   7
 
#define ID_AD7193   0x2
 
#define AD7193_ID_MASK   0x0F
 
#define AD7193_GPOCON_BPDSW   (1 << 6)
 
#define AD7193_GPOCON_GP32EN   (1 << 5)
 
#define AD7193_GPOCON_GP10EN   (1 << 4)
 
#define AD7193_GPOCON_P3DAT   (1 << 3)
 
#define AD7193_GPOCON_P2DAT   (1 << 2)
 
#define AD7193_GPOCON_P1DAT   (1 << 1)
 
#define AD7193_GPOCON_P0DAT   (1 << 0)
 
#define AD7193_CH_MASK(x)   BIT(x)
 

Functions

int ad7193_init (struct ad7193_dev **device, struct ad7193_init_param init_param)
 Initializes the communication peripheral and the initial Values for AD7193 Board and resets the device. More...
 
int ad7193_remove (struct ad7193_dev *dev)
 Free the resources allocated by ad7193_init(). More...
 
int ad7193_set_register_value (struct ad7193_dev *dev, uint8_t reg_addr, uint32_t reg_value, uint8_t bytes_number, uint8_t modify_cs)
 Writes data into a register. More...
 
int ad7193_get_register_value (struct ad7193_dev *dev, uint8_t reg_addr, uint8_t bytes_number, uint32_t *reg_data, uint8_t modify_cs)
 Reads the value of a register. More...
 
int ad7193_set_masked_register_value (struct ad7193_dev *dev, uint8_t reg_addr, uint32_t mask, uint32_t data, uint8_t bytes, uint8_t modify_cs)
 Write masked data into device register. More...
 
int ad7193_reset (struct ad7193_dev *dev)
 Resets the device. More...
 
int ad7193_set_operating_mode (struct ad7193_dev *dev, uint8_t opt_mode, uint8_t modify_cs)
 Sets device into the specified operating mode. More...
 
int ad7193_wait_rdy_go_low (struct ad7193_dev *dev)
 Waits for RDY pin to go low. More...
 
int ad7193_channels_select (struct ad7193_dev *dev, uint16_t chn_mask)
 Selects the channels to be enabled. More...
 
int ad7193_calibrate (struct ad7193_dev *dev, uint8_t mode, uint8_t channel)
 Performs the given calibration to the specified channel. More...
 
int ad7193_config_input_mode (struct ad7193_dev *dev, uint8_t mode)
 Configures the input mode of the ADC. More...
 
int ad7193_buffer_select (struct ad7193_dev *dev, uint8_t buff_en)
 Enables or disables the buffer on the ADC input channels. More...
 
int ad7193_output_rate_select (struct ad7193_dev *dev, uint16_t out_rate_code)
 Selects the filter output data rate of the ADC. More...
 
int ad7193_clock_select (struct ad7193_dev *dev, uint16_t clk_select)
 Selects the clock source of the ADC. More...
 
int ad7193_set_bridge_switch (struct ad7193_dev *dev, uint8_t bpdsw_select)
 Opens or closes the bridge power-down switch of the ADC. More...
 
int ad7193_range_setup (struct ad7193_dev *dev, uint8_t polarity, uint8_t range)
 Selects the polarity of the conversion and the ADC input range. More...
 
int ad7193_single_conversion (struct ad7193_dev *dev, uint32_t *reg_data)
 Returns the result of a single conversion. More...
 
int ad7193_continuous_read_avg (struct ad7193_dev *dev, uint8_t sample_number, uint32_t *samples_avg)
 Returns the average of several conversion results. More...
 
int ad7193_temperature_read (struct ad7193_dev *dev, float *temp)
 Read data from temperature sensor and converts it to Celsius degrees. More...
 
float ad7193_convert_to_volts (struct ad7193_dev *dev, uint32_t raw_data, float v_ref)
 Converts 24-bit raw data to milivolts. More...
 

Detailed Description

Header file of AD7193 Driver.

Author
DNechita (Dan.N.nosp@m.echi.nosp@m.ta@an.nosp@m.alog.nosp@m..com)

Copyright 2012(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ AD7193_AVG_BY_16

#define AD7193_AVG_BY_16   3

◆ AD7193_AVG_BY_2

#define AD7193_AVG_BY_2   1

◆ AD7193_AVG_BY_8

#define AD7193_AVG_BY_8   2

◆ AD7193_AVG_NONE

#define AD7193_AVG_NONE   0

◆ AD7193_CH_0

#define AD7193_CH_0   0

◆ AD7193_CH_1

#define AD7193_CH_1   1

◆ AD7193_CH_2

#define AD7193_CH_2   2

◆ AD7193_CH_3

#define AD7193_CH_3   3

◆ AD7193_CH_4

#define AD7193_CH_4   4

◆ AD7193_CH_5

#define AD7193_CH_5   5

◆ AD7193_CH_6

#define AD7193_CH_6   6

◆ AD7193_CH_7

#define AD7193_CH_7   7

◆ AD7193_CH_MASK

#define AD7193_CH_MASK (   x)    BIT(x)

◆ AD7193_CH_SHORT

#define AD7193_CH_SHORT   9

◆ AD7193_CH_TEMP

#define AD7193_CH_TEMP   8

◆ AD7193_CLK_EXT_MCLK1_2

#define AD7193_CLK_EXT_MCLK1_2   0

◆ AD7193_CLK_EXT_MCLK2

#define AD7193_CLK_EXT_MCLK2   1

◆ AD7193_CLK_INT

#define AD7193_CLK_INT   2

◆ AD7193_CLK_INT_CO

#define AD7193_CLK_INT_CO   3

◆ AD7193_COMM_ADDR

#define AD7193_COMM_ADDR (   x)    (((x) & 0x7) << 3)

◆ AD7193_COMM_CREAD

#define AD7193_COMM_CREAD   (1 << 2)

◆ AD7193_COMM_READ

#define AD7193_COMM_READ   (1 << 6)

◆ AD7193_COMM_WEN

#define AD7193_COMM_WEN   (1 << 7)

◆ AD7193_COMM_WRITE

#define AD7193_COMM_WRITE   (0 << 6)

◆ AD7193_CONF_BUF

#define AD7193_CONF_BUF   (1 << 4)

◆ AD7193_CONF_BURN

#define AD7193_CONF_BURN   (1 << 7)

◆ AD7193_CONF_CHAN

#define AD7193_CONF_CHAN (   x)    ((uint32_t)((x) & 0x3FF) << 8)

◆ AD7193_CONF_CHOP

#define AD7193_CONF_CHOP   ((uint32_t)1 << 23)

◆ AD7193_CONF_GAIN

#define AD7193_CONF_GAIN (   x)    ((x) & 0x7)

◆ AD7193_CONF_GAIN_1

#define AD7193_CONF_GAIN_1   0

◆ AD7193_CONF_GAIN_128

#define AD7193_CONF_GAIN_128   7

◆ AD7193_CONF_GAIN_16

#define AD7193_CONF_GAIN_16   4

◆ AD7193_CONF_GAIN_32

#define AD7193_CONF_GAIN_32   5

◆ AD7193_CONF_GAIN_64

#define AD7193_CONF_GAIN_64   6

◆ AD7193_CONF_GAIN_8

#define AD7193_CONF_GAIN_8   3

◆ AD7193_CONF_PSEUDO

#define AD7193_CONF_PSEUDO   ((uint32_t)1 << 18)

◆ AD7193_CONF_REFDET

#define AD7193_CONF_REFDET   (1 << 6)

◆ AD7193_CONF_REFSEL

#define AD7193_CONF_REFSEL   ((uint32_t)1 << 20)

◆ AD7193_CONF_UNIPOLAR

#define AD7193_CONF_UNIPOLAR   (1 << 3)

◆ AD7193_GPOCON_BPDSW

#define AD7193_GPOCON_BPDSW   (1 << 6)

◆ AD7193_GPOCON_GP10EN

#define AD7193_GPOCON_GP10EN   (1 << 4)

◆ AD7193_GPOCON_GP32EN

#define AD7193_GPOCON_GP32EN   (1 << 5)

◆ AD7193_GPOCON_P0DAT

#define AD7193_GPOCON_P0DAT   (1 << 0)

◆ AD7193_GPOCON_P1DAT

#define AD7193_GPOCON_P1DAT   (1 << 1)

◆ AD7193_GPOCON_P2DAT

#define AD7193_GPOCON_P2DAT   (1 << 2)

◆ AD7193_GPOCON_P3DAT

#define AD7193_GPOCON_P3DAT   (1 << 3)

◆ AD7193_ID_MASK

#define AD7193_ID_MASK   0x0F

◆ AD7193_MODE_AVG

#define AD7193_MODE_AVG (   x)    (((uint32_t)(x) & 0x3) << 16)

◆ AD7193_MODE_CAL_INT_FULL

#define AD7193_MODE_CAL_INT_FULL   5

◆ AD7193_MODE_CAL_INT_ZERO

#define AD7193_MODE_CAL_INT_ZERO   4

◆ AD7193_MODE_CAL_SYS_FULL

#define AD7193_MODE_CAL_SYS_FULL   7

◆ AD7193_MODE_CAL_SYS_ZERO

#define AD7193_MODE_CAL_SYS_ZERO   6

◆ AD7193_MODE_CLKDIV

#define AD7193_MODE_CLKDIV   (1 << 12)

◆ AD7193_MODE_CLKSRC

#define AD7193_MODE_CLKSRC (   x)    (((uint32_t)(x) & 0x3) << 18)

◆ AD7193_MODE_CONT

#define AD7193_MODE_CONT   0

◆ AD7193_MODE_DAT_STA

#define AD7193_MODE_DAT_STA   ((uint32_t)1 << 20)

◆ AD7193_MODE_ENPAR

#define AD7193_MODE_ENPAR   (1 << 13)

◆ AD7193_MODE_IDLE

#define AD7193_MODE_IDLE   2

◆ AD7193_MODE_PWRDN

#define AD7193_MODE_PWRDN   3

◆ AD7193_MODE_RATE

#define AD7193_MODE_RATE (   x)    ((x) & 0x3FF)

◆ AD7193_MODE_REJ60

#define AD7193_MODE_REJ60   (1 << 10)

◆ AD7193_MODE_SCYCLE

#define AD7193_MODE_SCYCLE   (1 << 11)

◆ AD7193_MODE_SEL

#define AD7193_MODE_SEL (   x)    (((uint32_t)(x) & 0x7) << 21)

◆ AD7193_MODE_SINC3

#define AD7193_MODE_SINC3   (1 << 15)

◆ AD7193_MODE_SINGLE

#define AD7193_MODE_SINGLE   1

◆ AD7193_REG_COMM

#define AD7193_REG_COMM   0

◆ AD7193_REG_CONF

#define AD7193_REG_CONF   2

◆ AD7193_REG_DATA

#define AD7193_REG_DATA   3

◆ AD7193_REG_FULLSCALE

#define AD7193_REG_FULLSCALE   7

◆ AD7193_REG_GPOCON

#define AD7193_REG_GPOCON   5

◆ AD7193_REG_ID

#define AD7193_REG_ID   4

◆ AD7193_REG_MODE

#define AD7193_REG_MODE   1

◆ AD7193_REG_OFFSET

#define AD7193_REG_OFFSET   6

◆ AD7193_REG_STAT

#define AD7193_REG_STAT   0

◆ AD7193_SLAVE_ID

#define AD7193_SLAVE_ID   1

◆ AD7193_STAT_CH0

#define AD7193_STAT_CH0   (1 << 0)

◆ AD7193_STAT_CH1

#define AD7193_STAT_CH1   (1 << 1)

◆ AD7193_STAT_CH2

#define AD7193_STAT_CH2   (1 << 2)

◆ AD7193_STAT_CH3

#define AD7193_STAT_CH3   (1 << 3)

◆ AD7193_STAT_ERR

#define AD7193_STAT_ERR   (1 << 6)

◆ AD7193_STAT_NOREF

#define AD7193_STAT_NOREF   (1 << 5)

◆ AD7193_STAT_PARITY

#define AD7193_STAT_PARITY   (1 << 4)

◆ AD7193_STAT_RDY

#define AD7193_STAT_RDY   (1 << 7)

◆ ID_AD7193

#define ID_AD7193   0x2

Function Documentation

◆ ad7193_buffer_select()

int ad7193_buffer_select ( struct ad7193_dev dev,
uint8_t  buff_en 
)

Enables or disables the buffer on the ADC input channels.

Enables or disables the buffer on the ADC input channels

Parameters
dev- The device structure.
buff_en- Enable/disable option. Example: 0 - Buffer disabled 1 - Buffer Enabled
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_calibrate()

int ad7193_calibrate ( struct ad7193_dev dev,
uint8_t  mode,
uint8_t  channel 
)

Performs the given calibration to the specified channel.

Performs the given calibration to the specified channel.

Parameters
dev- The device structure.
mode- Calibration type.
channel- Channel to be calibrated.
Returns
SUCCESS in case of success or negative error code.

◆ ad7193_channels_select()

int ad7193_channels_select ( struct ad7193_dev dev,
uint16_t  chn_mask 
)

Selects the channels to be enabled.

Selects the channels to be enabled.

Parameters
dev- The device structure.
chn_mask- Channel mask. Example: AD7193_CH_0 - AIN1(+) - AIN2(-); (Pseudo = 0) AD7193_CH_1 - AIN3(+) - AIN4(-); (Pseudo = 0) AD7193_TEMP - Temperature sensor AD7193_SHORT - AIN2(+) - AIN2(-); (Pseudo = 0)
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_clock_select()

int ad7193_clock_select ( struct ad7193_dev dev,
uint16_t  clk_select 
)

Selects the clock source of the ADC.

Selects the clock source of the ADC

Parameters
dev- The device structure.
clk_select- Clock source to be selected.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_config_input_mode()

int ad7193_config_input_mode ( struct ad7193_dev dev,
uint8_t  mode 
)

Configures the input mode of the ADC.

Configures the input mode of the ADC

Parameters
dev- The device structure.
mode- Mode selection. Example: 0 - Differential Analog Inputs 1 - Pseudo Differential Analog Inputs
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_continuous_read_avg()

int ad7193_continuous_read_avg ( struct ad7193_dev dev,
uint8_t  sample_number,
uint32_t *  samples_avg 
)

Returns the average of several conversion results.

Returns the average of several conversion results.

Parameters
dev- The device structure.
sample_number- the number of samples
samples_avg- Average of the samples read
Returns
SUCCESS in case of success or negative error code.

◆ ad7193_convert_to_volts()

float ad7193_convert_to_volts ( struct ad7193_dev dev,
uint32_t  raw_data,
float  v_ref 
)

Converts 24-bit raw data to milivolts.

Converts 24-bit raw data to volts.

Parameters
dev- The device structure.
raw_data- 24-bit data sample.
v_ref- The value of the voltage reference used by the device.
Returns
voltage - The result of the conversion expressed as volts.

◆ ad7193_get_register_value()

int ad7193_get_register_value ( struct ad7193_dev dev,
uint8_t  reg_addr,
uint8_t  bytes_number,
uint32_t *  reg_data,
uint8_t  modify_cs 
)

Reads the value of a register.

Reads the value of a register.

Parameters
dev- The device structure.
reg_addr- Address of the register.
bytes_number- Number of bytes that will be read.
reg_data- Data read from the register.
modify_cs- Allows Chip Select to be modified.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_init()

int ad7193_init ( struct ad7193_dev **  device,
struct ad7193_init_param  init_param 
)

Initializes the communication peripheral and the initial Values for AD7193 Board and resets the device.

Checks if the AD7139 part is present.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
SUCCESS in case of success or negative error code.

◆ ad7193_output_rate_select()

int ad7193_output_rate_select ( struct ad7193_dev dev,
uint16_t  out_rate_code 
)

Selects the filter output data rate of the ADC.

Selects the filter output data rate of the ADC

Parameters
dev- The device structure.
out_rate_code- Filter output data rate code.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_range_setup()

int ad7193_range_setup ( struct ad7193_dev dev,
uint8_t  polarity,
uint8_t  range 
)

Selects the polarity of the conversion and the ADC input range.

Selects the polarity of the conversion and the ADC input range.

Parameters
dev- The device structure.
polarity- Polarity select bit. Example: 0 - bipolar operation is selected. 1 - unipolar operation is selected.
range- Gain select bits. These bits are written by the user to select the ADC input range.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_remove()

int ad7193_remove ( struct ad7193_dev dev)

Free the resources allocated by ad7193_init().

Free the resources allocated by ad7193_init().

Parameters
dev- The device structure.
Returns
SUCCESS in case of success or negative error code.

◆ ad7193_reset()

int ad7193_reset ( struct ad7193_dev dev)

Resets the device.

Resets the device.

Parameters
dev- The device structure.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_set_bridge_switch()

int ad7193_set_bridge_switch ( struct ad7193_dev dev,
uint8_t  bpdsw_select 
)

Opens or closes the bridge power-down switch of the ADC.

Opens or closes the bridge power-down switch of the ADC

Parameters
dev- The device structure.
bpdsw_select- Option to open or close bridge power-down switch. 0 - Switch Opened 1 - Switch Closed
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_set_masked_register_value()

int ad7193_set_masked_register_value ( struct ad7193_dev dev,
uint8_t  reg_addr,
uint32_t  mask,
uint32_t  reg_data,
uint8_t  bytes,
uint8_t  modify_cs 
)

Write masked data into device register.

Parameters
dev- The device structure.
reg_addr- Address of the register.
mask- The mask.
reg_data- Register data to be written.
bytes- Number of bytes that will be read.
modify_cs- Allows Chip Select to be modified.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_set_operating_mode()

int ad7193_set_operating_mode ( struct ad7193_dev dev,
uint8_t  opt_mode,
uint8_t  modify_cs 
)

Sets device into the specified operating mode.

Set the device into specified operating mode.

Parameters
dev- The device structure.
opt_mode- Operating mode to be set.
modify_cs- Allows Chip Select to be modified.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_set_register_value()

int ad7193_set_register_value ( struct ad7193_dev dev,
uint8_t  reg_addr,
uint32_t  reg_val,
uint8_t  bytes_number,
uint8_t  modify_cs 
)

Writes data into a register.

Writes data into a register.

Parameters
dev- The device structure.
reg_addr- Address of the register.
reg_val- Data value to write.
bytes_number- Number of bytes to be written.
modify_cs- Allows Chip Select to be modified.
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_single_conversion()

int ad7193_single_conversion ( struct ad7193_dev dev,
uint32_t *  reg_data 
)

Returns the result of a single conversion.

Returns the result of a single conversion.

Parameters
dev- The device structure.
reg_data- Buffer to store sampled register data
Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function:

◆ ad7193_temperature_read()

int ad7193_temperature_read ( struct ad7193_dev dev,
float *  temp 
)

Read data from temperature sensor and converts it to Celsius degrees.

Read data from temperature sensor and converts it to Celsius degrees.

Parameters
dev- The device structure.
temp- Stores the temperature result.
Returns
SUCCESS in case of success or negative error code.

◆ ad7193_wait_rdy_go_low()

int ad7193_wait_rdy_go_low ( struct ad7193_dev dev)

Waits for RDY pin to go low.

Waits for RDY pin to go low.

Returns
SUCCESS in case of success or negative error code.
Here is the caller graph for this function: