Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha
Commits
a298a3e9
Commit
a298a3e9
authored
Apr 27, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/lib: cleaned up fdelay_test.c program
parent
e1ed6c8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
37 deletions
+9
-37
fdelay_test.c
software/lib/fdelay_test.c
+9
-37
No files found.
software/lib/fdelay_test.c
View file @
a298a3e9
...
@@ -3,54 +3,26 @@
...
@@ -3,54 +3,26 @@
#include "fdelay_lib.h"
#include "fdelay_lib.h"
#include "rr_io.h"
#include "rr_io.h"
int
spec_fdelay_init
(
int
argc
,
char
*
argv
[],
fdelay_device_t
*
dev
);
extern
int
spec_fdelay_init
(
int
argc
,
char
*
argv
[],
fdelay_device_t
*
dev
);
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
fdelay_device_t
dev
;
fdelay_device_t
dev
;
fdelay_time_t
t_cur
,
t_start
;
/* Initialize the fine delay generator */
if
(
spec_fdelay_init
(
argc
,
argv
,
&
dev
)
<
0
)
if
(
spec_fdelay_init
(
argc
,
argv
,
&
dev
)
<
0
)
{
{
fdelay_show_test_results
();
fdelay_show_test_results
();
return
-
1
;
return
-
1
;
}
}
fdelay_configure_trigger
(
&
dev
,
1
,
1
);
/* Enable trigger input and 50 ohm termination */
fdelay_configure_trigger
(
&
dev
,
1
,
1
);
fdelay_configure_output
(
&
dev
,
1
,
1
,
500000
,
100000
,
100000
,
0
);
fdelay_configure_output
(
&
dev
,
2
,
1
,
500000
,
100000
,
100000
,
0
);
fdelay_configure_output
(
&
dev
,
3
,
1
,
500000
,
100000
,
100000
,
0
);
fdelay_configure_output
(
&
dev
,
4
,
1
,
500000
,
100000
,
100000
,
0
);
fdelay_configure_readout
(
&
dev
,
1
);
// fd_update_spll(&dev);
int64_t
prev
=
0
,
dp
,
pmin
=
10000000000LL
,
pmax
=
0
;
#if 0
/* Enable all outputs and set them to 500 ns delay, 100 ns pulse width, single output pulse per trigger */
for(;;)
fdelay_configure_output
(
&
dev
,
1
,
1
,
500000
,
100000
,
100000
,
1
);
{
fdelay_configure_output
(
&
dev
,
2
,
1
,
500000
,
100000
,
100000
,
1
);
fdelay_time_t ts;
fdelay_configure_output
(
&
dev
,
3
,
1
,
500000
,
100000
,
100000
,
1
);
if(fdelay_read(&dev, &ts, 1) == 1)
fdelay_configure_output
(
&
dev
,
4
,
1
,
500000
,
100000
,
100000
,
1
);
{
int64_t ts_p = fdelay_to_picos(ts), d;
d=ts_p - prev;
if(prev > 0)
{
if(d<pmin) pmin=d;
if(d>pmax) pmax=d;
fprintf(stderr,"Got it %lld:%d:%d delta %lld span %lld\n", ts.utc, ts.coarse, ts.frac, d, pmax-pmin);
}
prev = ts_p;
}
}
#endif
for
(;;)
{
fdelay_update_calibration
(
&
dev
);
sleep
(
1
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment