no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad799x.h
Go to the documentation of this file.
1/***************************************************************************/
33
34#ifndef __AD799X_H__
35#define __AD799X_H__
36
37#include <stdint.h>
38#include "no_os_i2c.h"
39
40/* Configuration Register definition. */
41#define AD799X_CHANNEL(ch) ((1 << ch) << 4)
42#define AD799X_REF_SEL (1 << 3)
43#define AD799X_FLTR (1 << 2)
44#define AD799X_BIT_TRIAL_DELAY (1 << 1)
45#define AD799X_SAMPLE_DELAY (1 << 0)
46
47/* Supported devices */
53
54struct ad799x_dev {
55 /* I2C */
57 /* Device Settings */
58 uint8_t bits_number;
59};
60
62 /* I2C */
64 /* Device Settings */
66};
67
69int8_t ad799x_init(struct ad799x_dev **device,
71
73int32_t ad799x_remove(struct ad799x_dev *dev);
74
77 uint8_t register_value);
78
81 int16_t* conv_value,
82 int8_t* channel);
83
85float ad799x_convert_to_volts(struct ad799x_dev *dev,
86 int16_t raw_sample,
87 float v_ref);
88
89#endif /* __AD799X_H__ */
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
float ad799x_convert_to_volts(struct ad799x_dev *dev, int16_t raw_sample, float v_ref)
Converts a raw sample to volts.
Definition ad799x.c:139
int8_t ad799x_init(struct ad799x_dev **device, struct ad799x_init_param init_param)
Initializes I2C.
Definition ad799x.c:49
int32_t ad799x_remove(struct ad799x_dev *dev)
Free the resources allocated by ad799x_init().
Definition ad799x.c:87
void ad799x_set_configuration_reg(struct ad799x_dev *dev, uint8_t register_value)
Writes data into the Configuration Register.
Definition ad799x.c:104
void ad799x_get_conversion_result(struct ad799x_dev *dev, int16_t *conv_value, int8_t *channel)
Reads the High byte and the Low byte of the conversion.
Definition ad799x.c:117
ad799x_type
Definition ad799x.h:48
@ AD7999
Definition ad799x.h:51
@ AD7995
Definition ad799x.h:50
@ AD7991
Definition ad799x.h:49
Header file of I2C Interface.
Definition ad799x.h:54
uint8_t bits_number
Definition ad799x.h:58
struct no_os_i2c_desc * i2c_desc
Definition ad799x.h:56
Definition ad799x.h:61
struct no_os_i2c_init_param i2c_init
Definition ad799x.h:63
enum ad799x_type part_number
Definition ad799x.h:65
Definition ad9361_util.h:63
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52