no-OS
iio_ad7746.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IIO_AD7746_H
41 #define IIO_AD7746_H
42 
43 #include "iio.h"
44 
48  // capdac[0] - first channel, capdac[1] - second channel
49  // capdac[_][0] - single-ended, capdac[_][1] - differential
50  uint8_t capdac[2][2];
51  int8_t capdac_set;
52 };
53 
56 };
57 
58 int32_t ad7746_iio_init(struct ad7746_iio_dev **iio_dev,
60 int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc);
61 
62 #endif
ad7746_iio_init_param
Definition: iio_ad7746.h:54
ad7746_cap::cin2
bool cin2
Definition: ad7746.h:120
TEMP_INT
@ TEMP_INT
Definition: iio_ad7746.c:648
AD7746_REG_CAP_GAINH
#define AD7746_REG_CAP_GAINH
Definition: ad7746.h:70
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:107
ad7746_set_cap_dac_a
int32_t ad7746_set_cap_dac_a(struct ad7746_dev *dev, bool enable, uint8_t code)
Set the DAC code and enable state for EXCA.
Definition: ad7746.c:338
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:56
iio_channel
Struct describing the scan type.
Definition: iio_types.h:159
IIO_VAL_INT_PLUS_NANO
@ IIO_VAL_INT_PLUS_NANO
Definition: iio_types.h:58
ad7746_init
int32_t ad7746_init(struct ad7746_dev **device, struct ad7746_init_param *init_param)
Initialize the ad7606 device structure.
Definition: ad7746.c:58
IIO_SHARED_BY_TYPE
@ IIO_SHARED_BY_TYPE
Definition: iio_types.h:111
ad7746_cap
Definition: ad7746.h:118
mdelay
void mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:129
ad7746_reg_write
int32_t ad7746_reg_write(struct ad7746_dev *dev, uint8_t reg, uint8_t *data, uint16_t bytes_number)
Writes data into AD7746 registers, starting from the selected register address pointer.
Definition: ad7746.c:120
CIN2_DIFF
@ CIN2_DIFF
Definition: iio_ad7746.c:653
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:62
ad7746_vt::extref
bool extref
Definition: ad7746.h:135
ad7746_vt::vtshort
bool vtshort
Definition: ad7746.h:136
AD7746_CAPDAC_DACEN_MSK
#define AD7746_CAPDAC_DACEN_MSK
Definition: ad7746.h:109
iio_ad7746.h
Header file of iio_ad7746.
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:94
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:57
ad7746_remove
int32_t ad7746_remove(struct ad7746_dev *dev)
Deinitialize the ad7746 driver and free all allocated resources.
Definition: ad7746.c:186
AD7746_VIN_EXT_VIN
@ AD7746_VIN_EXT_VIN
Definition: ad7746.h:129
ad7746_iio_init
int32_t ad7746_iio_init(struct ad7746_iio_dev **iio_dev, struct ad7746_iio_init_param *init_param)
Definition: iio_ad7746.c:739
ad7746_dev::setup
struct ad7746_setup setup
Definition: ad7746.h:193
ad7746_iio_dev::ad7746_dev
struct ad7746_dev * ad7746_dev
Definition: iio_ad7746.h:46
device
Definition: ad9361_util.h:75
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:163
AD7746_MODE_GAIN_CALIB
@ AD7746_MODE_GAIN_CALIB
Definition: ad7746.h:167
ad7746_get_vt_data
int32_t ad7746_get_vt_data(struct ad7746_dev *dev, uint32_t *vt_data)
Waits until a conversion on a voltage/temperature channel has been finished and returns the output da...
Definition: ad7746.c:446
ad7746_iio_remove
int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc)
Definition: iio_ad7746.c:768
ad7746_cap::capen
bool capen
Definition: ad7746.h:119
bool
bool
Definition: common.h:54
ad7746_dev
Definition: ad7746.h:189
ad7746_calibrate
int32_t ad7746_calibrate(struct ad7746_dev *dev, enum ad7746_md md)
Perform offset/gain calibration.
Definition: ad7746.c:529
AD7746_MODE_SINGLE
@ AD7746_MODE_SINGLE
Definition: ad7746.h:164
ID_AD7746
@ ID_AD7746
Definition: ad7746.h:114
AD7746_VTMD_VDD_MON
@ AD7746_VTMD_VDD_MON
Definition: ad7746.h:128
iio.h
Header file of iio.
ad7746.h
Header file of AD7746 Driver.
ad7746_config
Definition: ad7746.h:170
iio_attribute::name
const char * name
Definition: iio_types.h:122
ad7746_set_vt
int32_t ad7746_set_vt(struct ad7746_dev *dev, struct ad7746_vt vt)
Configure the voltage/temperature setup register.
Definition: ad7746.c:240
iio_ch_info::differential
bool differential
Definition: iio_types.h:102
ad7746_init_param
Definition: ad7746.h:183
AD7746_CAPDAC_DACP_MSK
#define AD7746_CAPDAC_DACP_MSK
Definition: ad7746.h:110
ad7746_dev::id
enum ad7746_id id
Definition: ad7746.h:191
ad7746_set_cap_gain
int32_t ad7746_set_cap_gain(struct ad7746_dev *dev, uint16_t gain)
Set the capacitive gain.
Definition: ad7746.c:414
ad7746_set_config
int32_t ad7746_set_config(struct ad7746_dev *dev, struct ad7746_config config)
Set the configuration register.
Definition: ad7746.c:306
ad7746_chan
ad7746_chan
Definition: iio_ad7746.c:645
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:120
ad7746_vt
Definition: ad7746.h:132
ad7746_setup::config
struct ad7746_config config
Definition: ad7746.h:180
AD7746_REG_VOLT_GAINH
#define AD7746_REG_VOLT_GAINH
Definition: ad7746.h:72
error.h
Error codes definition.
ad7746_iio_init_param::ad7746_initial
struct ad7746_init_param * ad7746_initial
Definition: iio_ad7746.h:55
AD7746_VTMD_EXT_TEMP
@ AD7746_VTMD_EXT_TEMP
Definition: ad7746.h:127
AD7746_CAPSETUP_CAPDIFF_MSK
#define AD7746_CAPSETUP_CAPDIFF_MSK
Definition: ad7746.h:86
ad7746_set_cap_dac_b
int32_t ad7746_set_cap_dac_b(struct ad7746_dev *dev, bool enable, uint8_t code)
Set the DAC code and enable state for EXCB.
Definition: ad7746.c:362
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:503
ad7746_set_volt_gain
int32_t ad7746_set_volt_gain(struct ad7746_dev *dev, uint16_t gain)
Set the voltage gain.
Definition: ad7746.c:429
delay.h
Header file of Delay functions.
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:71
TEMP_EXT
@ TEMP_EXT
Definition: iio_ad7746.c:649
CIN1_DIFF
@ CIN1_DIFF
Definition: iio_ad7746.c:651
ad7746_config::md
enum ad7746_md md
Definition: ad7746.h:173
ad7746_set_cap_offset
int32_t ad7746_set_cap_offset(struct ad7746_dev *dev, uint16_t offset)
Set the capacitive offset.
Definition: ad7746.c:399
ad7746_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_ad7746.h:47
IIO_CAPACITANCE
@ IIO_CAPACITANCE
Definition: iio_types.h:76
ad7746_dev::buf
uint8_t buf[AD7746_NUM_REGISTERS+1u]
Definition: ad7746.h:192
ad7746_reg_read
int32_t ad7746_reg_read(struct ad7746_dev *dev, uint8_t reg, uint8_t *data, uint16_t bytes_number)
Reads data from AD7746 registers, starting from the selected register address pointer.
Definition: ad7746.c:145
ad7746_iio_dev::capdac_set
int8_t capdac_set
Definition: iio_ad7746.h:51
iio_format_value
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:549
iio_ch_info::address
uint32_t address
Definition: iio_types.h:104
ad7746_cap::capchop
bool capchop
Definition: ad7746.h:122
VIN_VDD
@ VIN_VDD
Definition: iio_ad7746.c:647
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:177
ad7746_config::capf
uint8_t capf
Definition: ad7746.h:172
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:219
ad7746_cap::capdiff
bool capdiff
Definition: ad7746.h:121
ad7746_setup::vt
struct ad7746_vt vt
Definition: ad7746.h:178
ad7746_vt::vten
bool vten
Definition: ad7746.h:133
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:75
iio_ch_info::type
enum iio_chan_type type
Definition: iio_types.h:100
ad7746_config::vtf
uint8_t vtf
Definition: ad7746.h:171
CIN2
@ CIN2
Definition: iio_ad7746.c:652
NULL
#define NULL
Definition: wrapper.h:64
SUCCESS
#define SUCCESS
Definition: error.h:52
AD7746_REG_CAP_OFFH
#define AD7746_REG_CAP_OFFH
Definition: ad7746.h:68
VIN
@ VIN
Definition: iio_ad7746.c:646
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ARRAY_SIZE
#define ARRAY_SIZE(x)
Definition: util.h:53
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:96
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:217
ad7746_set_cap
int32_t ad7746_set_cap(struct ad7746_dev *dev, struct ad7746_cap cap)
Configure the capacitive setup register.
Definition: ad7746.c:208
ad7746_iio_remove
int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc)
Definition: iio_ad7746.c:768
ad7746_setup::cap
struct ad7746_cap cap
Definition: ad7746.h:177
ad7746_get_cap_data
int32_t ad7746_get_cap_data(struct ad7746_dev *dev, uint32_t *cap_data)
Waits until a conversion on the capacitive channel has been finished and returns the output data.
Definition: ad7746.c:488
true
@ true
Definition: ad5446.h:65
ad7746_iio_dev::capdac
uint8_t capdac[2][2]
Definition: iio_ad7746.h:50
ad7746_iio_dev
Definition: iio_ad7746.h:45
ad7746_iio_init
int32_t ad7746_iio_init(struct ad7746_iio_dev **iio_dev, struct ad7746_iio_init_param *init_param)
Definition: iio_ad7746.c:739
ad7746_vt::vtchop
bool vtchop
Definition: ad7746.h:137
AD7746_MODE_OFFSET_CALIB
@ AD7746_MODE_OFFSET_CALIB
Definition: ad7746.h:166
util.h
Implementation of utility functions.
AD7746_CAPSETUP_CIN2_MSK
#define AD7746_CAPSETUP_CIN2_MSK
Definition: ad7746.h:85
FAILURE
#define FAILURE
Definition: error.h:56
AD7746_VTMD_INT_TEMP
@ AD7746_VTMD_INT_TEMP
Definition: ad7746.h:126
ad7746_vt::vtmd
enum ad7746_vtmd vtmd
Definition: ad7746.h:134
CIN1
@ CIN1
Definition: iio_ad7746.c:650