Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TDC core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
TDC core
Commits
ff408591
Commit
ff408591
authored
Oct 25, 2011
by
Sebastien Bourdeauducq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo: dump calibration info
parent
859c9361
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
main.c
demo/software/demo/main.c
+1
-0
tdc.c
demo/software/demo/tdc.c
+42
-1
tdc.h
demo/software/demo/tdc.h
+1
-0
No files found.
demo/software/demo/main.c
View file @
ff408591
...
@@ -220,6 +220,7 @@ static void do_command(char *c)
...
@@ -220,6 +220,7 @@ static void do_command(char *c)
/* payload */
/* payload */
else
if
(
strcmp
(
token
,
"rofreq"
)
==
0
)
rofreq
();
else
if
(
strcmp
(
token
,
"rofreq"
)
==
0
)
rofreq
();
else
if
(
strcmp
(
token
,
"calinfo"
)
==
0
)
calinfo
();
else
if
(
strcmp
(
token
,
""
)
!=
0
)
else
if
(
strcmp
(
token
,
""
)
!=
0
)
printf
(
"Command not found
\n
"
);
printf
(
"Command not found
\n
"
);
...
...
demo/software/demo/tdc.c
View file @
ff408591
...
@@ -41,7 +41,7 @@ void rofreq()
...
@@ -41,7 +41,7 @@ void rofreq()
tdc
->
FCC
=
TDC_FCC_ST
;
tdc
->
FCC
=
TDC_FCC_ST
;
while
(
!
(
tdc
->
FCC
&
TDC_FCC_RDY
));
while
(
!
(
tdc
->
FCC
&
TDC_FCC_RDY
));
val
=
tdc
->
FCR
;
val
=
tdc
->
FCR
;
printf
(
"C
hannel
%d: %d
\n
"
,
channel
,
val
);
printf
(
"C
HANNEL
%d: %d
\n
"
,
channel
,
val
);
channel
++
;
channel
++
;
last
=
tdc
->
CSEL
&
TDC_CSEL_LAST
;
last
=
tdc
->
CSEL
&
TDC_CSEL_LAST
;
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
...
@@ -49,3 +49,44 @@ void rofreq()
...
@@ -49,3 +49,44 @@ void rofreq()
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
}
}
#define TDC_RAW_COUNT 9
void
calinfo
()
{
int
channel
;
int
i
;
if
(
!
(
tdc
->
CS
&
TDC_CS_RDY
))
{
printf
(
"Startup calibration not done
\n
"
);
return
;
}
tdc
->
DCTL
=
TDC_DCTL_REQ
;
while
(
!
(
tdc
->
DCTL
&
TDC_DCTL_ACK
));
/* go to first channel */
while
(
!
(
tdc
->
CSEL
&
TDC_CSEL_LAST
))
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
channel
=
0
;
do
{
printf
(
"CHANNEL %d
\n
"
,
channel
);
printf
(
"HIST: "
);
for
(
i
=
0
;
i
<
(
1
<<
TDC_RAW_COUNT
);
i
++
)
{
tdc
->
HISA
=
i
;
printf
(
"%d,"
,
tdc
->
HISD
);
}
printf
(
"
\n
"
);
printf
(
"LUT: "
);
for
(
i
=
0
;
i
<
(
1
<<
TDC_RAW_COUNT
);
i
++
)
{
tdc
->
LUTA
=
i
;
printf
(
"%d,"
,
tdc
->
LUTD
);
}
printf
(
"
\n\n
"
);
channel
++
;
tdc
->
CSEL
=
TDC_CSEL_NEXT
;
}
while
(
!
(
tdc
->
CSEL
&
TDC_CSEL_LAST
));
tdc
->
DCTL
=
0
;
}
demo/software/demo/tdc.h
View file @
ff408591
...
@@ -20,5 +20,6 @@
...
@@ -20,5 +20,6 @@
#define __TDC_H
#define __TDC_H
void
rofreq
();
void
rofreq
();
void
calinfo
();
#endif
/* __TDC_H */
#endif
/* __TDC_H */
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