no-OS
iio_ad7746.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef IIO_AD7746_H
35 #define IIO_AD7746_H
36 
37 #include "iio.h"
38 
42  // capdac[0] - first channel, capdac[1] - second channel
43  // capdac[_][0] - single-ended, capdac[_][1] - differential
44  uint8_t capdac[2][2];
45  int8_t capdac_set;
46 };
47 
50 };
51 
52 int32_t ad7746_iio_init(struct ad7746_iio_dev **iio_dev,
54 int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc);
55 
56 #endif
ad7746_iio_init_param
Definition: iio_ad7746.h:48
ad7746_cap::cin2
bool cin2
Definition: ad7746.h:114
TEMP_INT
@ TEMP_INT
Definition: iio_ad7746.c:650
AD7746_REG_CAP_GAINH
#define AD7746_REG_CAP_GAINH
Definition: ad7746.h:64
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
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:333
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
IIO_VAL_INT_PLUS_NANO
@ IIO_VAL_INT_PLUS_NANO
Definition: iio_types.h:52
ad7746_init
int32_t ad7746_init(struct ad7746_dev **device, struct ad7746_init_param *init_param)
Initialize the ad7606 device structure.
Definition: ad7746.c:53
IIO_SHARED_BY_TYPE
@ IIO_SHARED_BY_TYPE
Definition: iio_types.h:120
ad7746_cap
Definition: ad7746.h:112
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:115
CIN2_DIFF
@ CIN2_DIFF
Definition: iio_ad7746.c:655
IIO_VAL_FRACTIONAL_LOG2
@ IIO_VAL_FRACTIONAL_LOG2
Definition: iio_types.h:56
ad7746_vt::extref
bool extref
Definition: ad7746.h:129
ad7746_vt::vtshort
bool vtshort
Definition: ad7746.h:130
AD7746_CAPDAC_DACEN_MSK
#define AD7746_CAPDAC_DACEN_MSK
Definition: ad7746.h:103
iio_ad7746.h
Header file of iio_ad7746.
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
ad7746_remove
int32_t ad7746_remove(struct ad7746_dev *dev)
Deinitialize the ad7746 driver and free all allocated resources.
Definition: ad7746.c:181
AD7746_VIN_EXT_VIN
@ AD7746_VIN_EXT_VIN
Definition: ad7746.h:123
no_os_delay.h
Header file of Delay functions.
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:741
ad7746_dev::setup
struct ad7746_setup setup
Definition: ad7746.h:187
ad7746_iio_dev::ad7746_dev
struct ad7746_dev * ad7746_dev
Definition: iio_ad7746.h:40
device
Definition: ad9361_util.h:69
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:172
AD7746_MODE_GAIN_CALIB
@ AD7746_MODE_GAIN_CALIB
Definition: ad7746.h:161
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
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:441
ad7746_iio_remove
int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc)
Definition: iio_ad7746.c:770
ad7746_cap::capen
bool capen
Definition: ad7746.h:113
bool
bool
Definition: common.h:48
ad7746_dev
Definition: ad7746.h:183
ad7746_calibrate
int32_t ad7746_calibrate(struct ad7746_dev *dev, enum ad7746_md md)
Perform offset/gain calibration.
Definition: ad7746.c:524
AD7746_MODE_SINGLE
@ AD7746_MODE_SINGLE
Definition: ad7746.h:158
ID_AD7746
@ ID_AD7746
Definition: ad7746.h:108
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
AD7746_VTMD_VDD_MON
@ AD7746_VTMD_VDD_MON
Definition: ad7746.h:122
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ad7746.h
Header file of AD7746 Driver.
ad7746_config
Definition: ad7746.h:164
iio_attribute::name
const char * name
Definition: iio_types.h:131
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:235
iio_ch_info::differential
bool differential
Definition: iio_types.h:111
ad7746_init_param
Definition: ad7746.h:177
AD7746_CAPDAC_DACP_MSK
#define AD7746_CAPDAC_DACP_MSK
Definition: ad7746.h:104
ad7746_dev::id
enum ad7746_id id
Definition: ad7746.h:185
ad7746_set_cap_gain
int32_t ad7746_set_cap_gain(struct ad7746_dev *dev, uint16_t gain)
Set the capacitive gain.
Definition: ad7746.c:409
ad7746_set_config
int32_t ad7746_set_config(struct ad7746_dev *dev, struct ad7746_config config)
Set the configuration register.
Definition: ad7746.c:301
ad7746_chan
ad7746_chan
Definition: iio_ad7746.c:647
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
ad7746_vt
Definition: ad7746.h:126
ad7746_setup::config
struct ad7746_config config
Definition: ad7746.h:174
AD7746_REG_VOLT_GAINH
#define AD7746_REG_VOLT_GAINH
Definition: ad7746.h:66
ad7746_iio_init_param::ad7746_initial
struct ad7746_init_param * ad7746_initial
Definition: iio_ad7746.h:49
AD7746_VTMD_EXT_TEMP
@ AD7746_VTMD_EXT_TEMP
Definition: ad7746.h:121
AD7746_CAPSETUP_CAPDIFF_MSK
#define AD7746_CAPSETUP_CAPDIFF_MSK
Definition: ad7746.h:80
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:357
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
ad7746_set_volt_gain
int32_t ad7746_set_volt_gain(struct ad7746_dev *dev, uint16_t gain)
Set the voltage gain.
Definition: ad7746.c:424
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
TEMP_EXT
@ TEMP_EXT
Definition: iio_ad7746.c:651
CIN1_DIFF
@ CIN1_DIFF
Definition: iio_ad7746.c:653
ad7746_config::md
enum ad7746_md md
Definition: ad7746.h:167
ad7746_set_cap_offset
int32_t ad7746_set_cap_offset(struct ad7746_dev *dev, uint16_t offset)
Set the capacitive offset.
Definition: ad7746.c:394
ad7746_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_ad7746.h:41
IIO_CAPACITANCE
@ IIO_CAPACITANCE
Definition: iio_types.h:70
ad7746_dev::buf
uint8_t buf[AD7746_NUM_REGISTERS+1u]
Definition: ad7746.h:186
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:140
ad7746_iio_dev::capdac_set
int8_t capdac_set
Definition: iio_ad7746.h:45
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:686
iio_ch_info::address
uint32_t address
Definition: iio_types.h:113
ad7746_cap::capchop
bool capchop
Definition: ad7746.h:116
VIN_VDD
@ VIN_VDD
Definition: iio_ad7746.c:649
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
ad7746_config::capf
uint8_t capf
Definition: ad7746.h:166
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
ad7746_cap::capdiff
bool capdiff
Definition: ad7746.h:115
ad7746_setup::vt
struct ad7746_vt vt
Definition: ad7746.h:172
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
ad7746_vt::vten
bool vten
Definition: ad7746.h:127
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
iio_ch_info::type
enum iio_chan_type type
Definition: iio_types.h:109
ad7746_config::vtf
uint8_t vtf
Definition: ad7746.h:165
CIN2
@ CIN2
Definition: iio_ad7746.c:654
NULL
#define NULL
Definition: wrapper.h:64
AD7746_REG_CAP_OFFH
#define AD7746_REG_CAP_OFFH
Definition: ad7746.h:62
VIN
@ VIN
Definition: iio_ad7746.c:648
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:105
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ad7746_set_cap
int32_t ad7746_set_cap(struct ad7746_dev *dev, struct ad7746_cap cap)
Configure the capacitive setup register.
Definition: ad7746.c:203
ad7746_iio_remove
int32_t ad7746_iio_remove(struct ad7746_iio_dev *desc)
Definition: iio_ad7746.c:770
ad7746_setup::cap
struct ad7746_cap cap
Definition: ad7746.h:171
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:483
true
@ true
Definition: ad5446.h:57
ad7746_iio_dev::capdac
uint8_t capdac[2][2]
Definition: iio_ad7746.h:44
ad7746_iio_dev
Definition: iio_ad7746.h:39
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:741
no_os_util.h
Header file of utility functions.
ad7746_vt::vtchop
bool vtchop
Definition: ad7746.h:131
AD7746_MODE_OFFSET_CALIB
@ AD7746_MODE_OFFSET_CALIB
Definition: ad7746.h:160
AD7746_CAPSETUP_CIN2_MSK
#define AD7746_CAPSETUP_CIN2_MSK
Definition: ad7746.h:79
AD7746_VTMD_INT_TEMP
@ AD7746_VTMD_INT_TEMP
Definition: ad7746.h:120
ad7746_vt::vtmd
enum ad7746_vtmd vtmd
Definition: ad7746.h:128
CIN1
@ CIN1
Definition: iio_ad7746.c:652