Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
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
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 ADC 100M 14b 4cha - Testing
Commits
2ef248ae
Commit
2ef248ae
authored
May 16, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test00: Fix firmware path to make it work when called by pts module.
Add a few comments in fmc_adc module.
parent
2a996bbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
fmc_adc.py
test/fmcadc100m14b4cha/python/fmc_adc.py
+13
-1
test00.py
test/fmcadc100m14b4cha/python/test00.py
+6
-4
No files found.
test/fmcadc100m14b4cha/python/fmc_adc.py
View file @
2ef248ae
...
...
@@ -192,7 +192,7 @@ class CFmcAdc100m:
WAIT_TIME_OUT
=
2
"""
def channel_addr(self, channel, reg):
if(channel < 1 or channel > 4):
raise FmcAdc100mOperationError("Channel number not in range (1 to 4).")
...
...
@@ -200,6 +200,7 @@ class CFmcAdc100m:
addr = (reg + (0x10*(channel - 1)))
#print("Channel
%
d address:
%.2
X")
%
(channel, addr)
return addr
"""
def
__init__
(
self
,
bus
):
self
.
bus
=
bus
...
...
@@ -280,6 +281,10 @@ class CFmcAdc100m:
print
(
"Test pattern :
%.4
X"
)
%
self
.
adc_cfg
.
get_testpat
()
print
(
"Test pattern status :
%.1
X"
)
%
self
.
adc_cfg
.
get_testpat_stat
()
#======================================================================
# Onewire thermometer and unique ID
# print FMC unique ID
def
print_unique_id
(
self
):
try
:
...
...
@@ -310,6 +315,9 @@ class CFmcAdc100m:
except
DS18B20OperationError
as
e
:
raise
FmcAdc100mOperationError
(
e
)
#======================================================================
# I2C buses
# scan FMC i2c bus
def
i2c_scan
(
self
):
print
'
\n
Scanning FMC I2C bus'
...
...
@@ -754,6 +762,10 @@ class CFmcAdc100m:
except
CSRDeviceOperationError
as
e
:
raise
FmcAdc100mOperationError
(
e
)
#======================================================================
# Si570 programmable oscillator
# Print Si570 config
def
print_si570_config
(
self
):
try
:
...
...
test/fmcadc100m14b4cha/python/test00.py
View file @
2ef248ae
...
...
@@ -12,7 +12,7 @@ import sys
import
time
import
os
# Add common modules
location tp
path
# Add common modules
and libraries location to
path
sys
.
path
.
append
(
'../../../'
)
sys
.
path
.
append
(
'../../../gnurabbit/python/'
)
sys
.
path
.
append
(
'../../../common/'
)
...
...
@@ -32,14 +32,16 @@ test00: Load firmware, verify firmware type and test mezzanine presence line.
def
main
(
default_directory
=
'.'
):
# Constants declaration
TEST_NB
=
0
#FMC_ADC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_ADC_BITSTREAM
=
'../firmwares/spec_fmcadc100m14b4cha.bin'
FMC_ADC_BITSTREAM
=
os
.
path
.
join
(
default_directory
,
FMC_ADC_BITSTREAM
)
EXPECTED_BITSTREAM_TYPE
=
0x1
start_test_time
=
time
.
time
()
print
"
\n
================================================================================"
print
"==> Test
00 start
\n
"
print
"==> Test
%02
d start
\n
"
%
TEST_NB
# SPEC object declaration
print
"Loading hardware access library and opening device.
\n
"
...
...
@@ -70,10 +72,10 @@ def main (default_directory='.'):
# Print carrier CSR registers
carrier
.
print_csr
()
print
"==> End of test
00"
print
"==> End of test
%02
d"
%
TEST_NB
print
"================================================================================"
end_test_time
=
time
.
time
()
print
"Test
00 elapsed time:
%.2
f seconds
\n
"
%
(
end_test_time
-
start_test_time
)
print
"Test
%02
d elapsed time:
%.2
f seconds
\n
"
%
(
TEST_NB
,
end_test_time
-
start_test_time
)
if
__name__
==
'__main__'
:
...
...
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