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
3fd85a76
Commit
3fd85a76
authored
May 22, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc_adc: Add function to write/read a byte list to the FMC eeprom.
parent
c934a3f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
fmc_adc.py
test/fmcadc100m14b4cha/python/fmc_adc.py
+23
-11
No files found.
test/fmcadc100m14b4cha/python/fmc_adc.py
View file @
3fd85a76
...
...
@@ -328,20 +328,32 @@ class CFmcAdc100m:
print
'
\n
Scanning FMC system I2C bus'
return
self
.
fmc_sys_i2c
.
scan
()
###########################################################################
########## Code to review ##########
# write to EEPROM on system i2c bus
def
sys_i2c_eeprom_write
(
self
,
addr
,
data
):
return
self
.
eeprom_24aa64
.
wr_data
(
addr
,
data
)
# read from EEPROM on system i2c bus
def
sys_i2c_eeprom_write
(
self
,
data
):
try
:
byte_to_write
=
len
(
data
)
addr
=
0
while
byte_to_write
:
if
byte_to_write
>
32
:
size
=
32
else
:
size
=
byte_to_write
self
.
eeprom_24aa64
.
wr_page
(
addr
,
data
[
addr
:(
addr
+
size
)])
byte_to_write
-=
size
addr
+=
size
time
.
sleep
(
0.005
)
# have to wait between writes otherwise the eeprom gives NACK on the i2c bus
except
Eeprom24AA64OperationError
as
e
:
raise
FmcAdc100mOperationError
(
e
)
# read from EEPROM on system i2c bus
def
sys_i2c_eeprom_read
(
self
,
addr
,
size
):
return
self
.
eeprom_24aa64
.
rd_data
(
addr
,
size
)
###########################################################################
try
:
return
self
.
eeprom_24aa64
.
rd_seq
(
addr
,
size
)
except
Eeprom24AA64OperationError
as
e
:
raise
FmcAdc100mOperationError
(
e
)
#======================================================================
# CSR and LTC217x
# Set input range
def
set_input_range
(
self
,
channel
,
in_range
):
...
...
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