Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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 TDC 1ns 5cha
Commits
afa7f627
Commit
afa7f627
authored
Oct 10, 2012
by
Samuel Iglesias Gonsálvez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc/test: added more features. Untested\!py
Signed-off-by:
Samuel Iglesias Gonsalvez
<
siglesias@igalia.com
>
parent
9d5d2ec2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
test-fmctdc.py
test/test-fmctdc.py
+22
-6
No files found.
test/test-fmctdc.py
View file @
afa7f627
...
...
@@ -17,6 +17,15 @@ from optparse import OptionParser
lun
=
-
1
;
device
=
-
1
;
class
tdc_dev
(
Structure
):
_fields_
=
[(
"dev_id"
,
c_int
),
(
"lun"
,
c_int
),
(
"devbase"
,
POINTER
(
c_char
)),
(
"sysbase"
,
POINTER
(
c_char
)),
(
"chan_config"
,
c_uint32
),
(
"ctrl"
,
POINTER
(
c_int
)),
(
"data"
,
POINTER
(
c_int
))]
def
print_header
():
print
(
''
)
print
(
'
\t
FMC TDC Testing program
\t
'
)
...
...
@@ -32,7 +41,7 @@ class Cli(cmd.Cmd):
cmd
.
Cmd
.
__init__
(
self
)
self
.
ruler
=
''
self
.
libtdc
=
arg
self
.
tdc
=
0
;
self
.
tdc
_open
=
0
;
def
do_version
(
self
,
arg
):
"print version, license and author of the test program"
...
...
@@ -43,24 +52,31 @@ class Cli(cmd.Cmd):
"open a TDC device: open <lun>"
self
.
lun
=
arg
;
ptr
=
POINTER
(
tdc_dev
);
# self.libtdc.tdc_open.restype = ptr;
self
.
tdc
=
self
.
libtdc
.
tdc_open
(
arg
);
self
.
tdc_open
=
1
;
def
do_close
(
self
,
arg
):
"close an open TDC device"
if
self
.
tdc
==
0
:
if
self
.
tdc
_open
==
0
:
print
"No device to close"
return
self
.
libtdc
.
tdc_close
(
self
.
tdc
);
self
.
tdc
=
0
;
self
.
tdc
_open
=
0
;
def
do_current_utc
(
self
,
arg
):
"show current UTC time of the board in seconds"
if
(
self
.
tdc
):
val
=
self
.
libtdc
.
tdc_get_utc_time
(
self
.
tdc
,
byref
(
val
))
print
"Current utc time: "
+
val
if
(
self
.
tdc_open
):
val
=
c_uint
(
0
)
print
"Current utc time: "
,
print
val
self
.
libtdc
.
tdc_get_utc_time
(
self
.
tdc
,
byref
(
val
))
print
"Current utc time: "
,
print
val
else
:
print
"No device open"
...
...
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