-
Notifications
You must be signed in to change notification settings - Fork 5
/
ad9166.h
77 lines (58 loc) · 1.58 KB
/
ad9166.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-License-Identifier: LGPL-2.1-or-later
/** @file ad9166.h
* @brief Public interface */
#ifndef __AD9166_H__
#define __AD9166_H__
#include <stddef.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup FLAGS MCS Flags
*
* @{
*/
/** @} */
#ifdef _WIN32
# ifdef LIBAD9166_EXPORTS
# define __api __declspec(dllexport)
# else
# define __api __declspec(dllimport)
# endif
#elif __GNUC__ >= 4 && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
# define __api __attribute__((visibility ("default")))
#else
# define __api
#endif
struct iio_context;
struct iio_device;
struct iio_channel;
struct ad9166_calibration_data {
double *freqs;
double *offsets;
double *gains;
size_t len;
bool calibrated;
};
/* ---------------------------------------------------------------------------*/
/* ------------------------- Top-level functions -----------------------------*/
/** @defgroup TopLevel Top-level functions
* @{ */
__api int ad9166_context_find_calibration_data(struct iio_context *ctx,
const char *name,
struct ad9166_calibration_data **data);
__api int ad9166_channel_set_freq(struct iio_channel *ch,
unsigned long long int freq);
__api int ad9166_device_set_amplitude(struct iio_device *dev,
long long amplitude);
__api int ad9166_device_set_iofs(struct iio_device *dev,
struct ad9166_calibration_data *data,
unsigned long long int freq);
__api bool ad9166_device_is_calibrated(struct ad9166_calibration_data *data);
/** @} */
#ifdef __cplusplus
}
#endif
#undef __api
#endif /* __AD9166_H__ */