Mercurial > hg > fxanalyse
annotate ad9956.c @ 206:c700a2d38fb8
New AD9956 interface
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Mon, 31 Mar 2014 17:03:38 +0200 |
parents | |
children | fcc988c6f841 |
rev | line source |
---|---|
206
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
1 #ifdef _CVI_ |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
2 #include <winsock2.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
3 #include <ansi_c.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
4 #include <toolbox.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
5 #else |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
6 #include <stdio.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
7 #include <stdlib.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
8 #include <unistd.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
9 #include <errno.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
10 #include <string.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
11 #include <sys/types.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
12 #include <sys/socket.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
13 #include <netinet/in.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
14 #include <arpa/inet.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
15 #include <netdb.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
16 #include <ctype.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
17 #include <stdarg.h> |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
18 #endif |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
19 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
20 #include "dds.h" |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
21 #include "ad9956.h" |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
22 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
23 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
24 int ad9956_init(struct ad9956 *d, const char *hostname, double clock) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
25 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
26 int sock, n, r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
27 char buffer[256]; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
28 struct sockaddr_in addr; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
29 struct hostent* host; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
30 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
31 #ifdef _CVI_ |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
32 WSADATA wsdata; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
33 WSAStartup(MAKEWORD(2,2), &wsdata); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
34 #endif |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
35 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
36 d->hostname = strdup(hostname); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
37 d->port = 1234; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
38 d->profile = 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
39 d->clock = clock; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
40 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
41 host = gethostbyname(hostname); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
42 if (host == NULL) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
43 return -1; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
44 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
45 sock = socket(AF_INET, SOCK_STREAM, 0); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
46 if (sock < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
47 return -2; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
48 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
49 addr.sin_family = host->h_addrtype; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
50 memcpy(&addr.sin_addr.s_addr, host->h_addr_list[0], host->h_length); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
51 addr.sin_port = htons(d->port); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
52 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
53 r = connect(sock, (struct sockaddr*)&addr, sizeof(addr)); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
54 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
55 return -3; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
56 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
57 d->fd = sock; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
58 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
59 /* check compatibility */ |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
60 n = snprintf(buffer, sizeof(buffer), "REVISION"); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
61 r = msend(d->fd, buffer, n); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
62 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
63 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
64 r = mrecv(d->fd, buffer, sizeof(buffer)); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
65 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
66 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
67 if (atoi(buffer) != REVISION) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
68 return -EINVAL; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
69 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
70 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
71 } |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
72 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
73 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
74 int ad9956_set_frequency(struct ad9956 *d, double f) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
75 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
76 int r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
77 uint64 value = ftw(d->clock, f); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
78 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
79 r = command(d->fd, "SET PCR%d 0x%llX", d->profile, value); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
80 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
81 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
82 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
83 d->frequency = freq(d->clock, value); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
84 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
85 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
86 } |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
87 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
88 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
89 int ad9956_get_frequency(struct ad9956 *d, double *f) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
90 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
91 int r, n; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
92 uint64 value; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
93 char buffer[256]; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
94 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
95 n = snprintf(buffer, sizeof(buffer), "GET PCR%d", d->profile); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
96 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
97 r = msend(d->fd, buffer, n); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
98 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
99 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
100 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
101 r = mrecv(d->fd, buffer, sizeof(buffer)); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
102 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
103 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
104 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
105 r = strtouint64(buffer, &value); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
106 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
107 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
108 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
109 d->frequency = freq(d->clock, value); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
110 if (f) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
111 *f = d->frequency; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
112 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
113 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
114 } |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
115 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
116 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
117 int ad9956_set_sweep_rate(struct ad9956 *d, double rate) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
118 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
119 int r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
120 uint64 value = ftw(d->clock, rate); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
121 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
122 r = command(d->fd, "SWEEP SET DFTW %lld", d->profile, value); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
123 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
124 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
125 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
126 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
127 } |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
128 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
129 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
130 int ad9956_sweep_start(struct ad9956 *d) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
131 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
132 int r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
133 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
134 r = command(d->fd, "SWEEP START"); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
135 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
136 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
137 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
138 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
139 } |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
140 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
141 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
142 int ad9956_sweep_stop(struct ad9956 *d) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
143 { |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
144 int r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
145 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
146 r = command(d->fd, "SWEEP STOP"); |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
147 if (r < 0) |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
148 return r; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
149 |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
150 return 0; |
c700a2d38fb8
New AD9956 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
151 } |