no-OS
Loading...
Searching...
No Matches
iio_ad559xr.h
Go to the documentation of this file.
1/***************************************************************************/
34#ifndef __IIO_AD559XR_H__
35#define __IIO_AD559XR_H__
36#include "iio_types.h"
37#include "ad5592r.h"
38#include "ad5593r.h"
39
40#define AD559XR_MAX_AIO_PORT 8
41
42#define AD559XR_MAX_PORT_NAMELEN 24
43
44#define AD559XR_ADC_RESOLUTION 12
45#define AD559XR_STORAGE_BITS 16
46#define AD559XR_STORAGE_BYTES (AD559XR_STORAGE_BITS/8)
47
48#define AD559XR_FULL_SCALE_VALUE ((1 << AD559XR_ADC_RESOLUTION) - 1)
49
50/* AD559xr vref range is from 1000 to VDD (1v up to 5v5)
51 * but has an internal VRef of 2500 mV (2v5)
52 */
53#define AD559XR_MIN_VDD 1.0f
54#define AD559XR_MAX_VDD 5.5f
55#define AD559XR_INTERNAL_VREF 2.5f
56
57#define AD5599XR_MAX_SAMPLE_SIZE (1024)
58
59#define AD559XR_SLOPE_CONSTANT (3767897513/25)
60#define AD559XR_SLOPE_NANO_SCALE 1000000000
61
62enum {
69
73
74 /* global attributes */
82};
83
87 uint8_t number;
88 uint8_t mode;
89 uint8_t gpio_map;
90 struct iio_channel *chptr; /* so we can access the scan_index */
91};
92
94 bool repeat;
96 struct no_os_iterator *aio_ports_iter;
97 size_t port_count;
100 uint8_t *raw_buffer;
102};
103
106
107 /* this is only relevant for pins which are GPIO. look into your
108 * init_param.channel_modes[x] and match the index value you want
109 * that particular GPIO to have */
111};
112
113int iio_ad559xr_aio_init(struct iio_ad559xr_desc **desc,
114 struct ad5592r_dev *ad5592r);
116 struct iio_ad559xr_gpio_map *gpio_map,
117 const size_t count);
118int iio_ad559xr_remove(struct iio_ad559xr_desc *desc);
119
120#endif /* __IIO_AD559XR_H__ */
Header file of AD5592R driver.
Header file of AD5593R driver.
@ AD559XR_ADC_RANGE
Definition iio_ad559xr.h:75
@ AD559XR_ADC_BUFFER
Definition iio_ad559xr.h:76
@ AD559XR_GPIO_RAW
Definition iio_ad559xr.h:68
@ AD559XR_DAC_POWER_DOWN
Definition iio_ad559xr.h:66
@ AD559XR_AIO_OFFSET
Definition iio_ad559xr.h:65
@ AD559XR_TEMP_RAW
Definition iio_ad559xr.h:70
@ AD559XR_REF_SELECT
Definition iio_ad559xr.h:78
@ AD559XR_REPETITION
Definition iio_ad559xr.h:81
@ AD559XR_GPIO_LABEL
Definition iio_ad559xr.h:67
@ AD559XR_AIO_SCALE
Definition iio_ad559xr.h:64
@ AD559XR_VREF_IN_V
Definition iio_ad559xr.h:79
@ AD559XR_LDAC_MODE
Definition iio_ad559xr.h:80
@ AD559XR_TEMP_SCALE
Definition iio_ad559xr.h:71
@ AD559XR_AIO_RAW
Definition iio_ad559xr.h:63
@ AD559XR_TEMP_OFFSET
Definition iio_ad559xr.h:72
@ AD559XR_DAC_RANGE
Definition iio_ad559xr.h:77
int iio_ad559xr_aio_init(struct iio_ad559xr_desc **desc, struct ad5592r_dev *ad5592r)
Initialize an ad559xr iio descriptor for all ADC and DAC channels for one ad559xr device.
Definition iio_ad559xr.c:672
int iio_ad559xr_gpio_init(struct iio_ad559xr_desc **desc, struct iio_ad559xr_gpio_map *gpio_map, const size_t count)
Initialize an ad559xr iio descriptor for all GPIO channels.
Definition iio_ad559xr.c:761
#define AD559XR_MAX_PORT_NAMELEN
Definition iio_ad559xr.h:42
#define AD559XR_MAX_AIO_PORT
Definition iio_ad559xr.h:40
int iio_ad559xr_remove(struct iio_ad559xr_desc *desc)
Remove an ad559xr iio descriptor.
Definition iio_ad559xr.c:846
Header file for iio_types.
Definition ad5592r-base.h:139
Definition iio_ad559xr.h:84
uint8_t gpio_map
Definition iio_ad559xr.h:89
char name[AD559XR_MAX_PORT_NAMELEN]
Definition iio_ad559xr.h:85
struct iio_channel * chptr
Definition iio_ad559xr.h:90
struct ad5592r_dev * ad5592r
Definition iio_ad559xr.h:86
uint8_t number
Definition iio_ad559xr.h:87
uint8_t mode
Definition iio_ad559xr.h:88
Definition iio_ad559xr.h:93
struct no_os_list_desc * aio_ports
Definition iio_ad559xr.h:95
uint8_t * raw_buffer
Definition iio_ad559xr.h:100
struct iio_channel * channels
Definition iio_ad559xr.h:99
bool repeat
Definition iio_ad559xr.h:94
size_t raw_buffer_size
Definition iio_ad559xr.h:101
struct iio_device iiodev
Definition iio_ad559xr.h:98
struct no_os_iterator * aio_ports_iter
Definition iio_ad559xr.h:96
size_t port_count
Definition iio_ad559xr.h:97
Definition iio_ad559xr.h:104
uint8_t map[AD559XR_MAX_AIO_PORT]
Definition iio_ad559xr.h:110
struct ad5592r_dev * ad559xr
Definition iio_ad559xr.h:105
Struct describing the scan type.
Definition iio_types.h:160
Structure holding channels and attributes of a device.
Definition iio_types.h:239
Structure storing the list and function wrapper for usual list types.
Definition no_os_list.h:218