Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python_test_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
python_test_scripts
Commits
66168781
Commit
66168781
authored
4 years ago
by
Gijs Schoonderbeek
Browse files
Options
Downloads
Patches
Plain Diff
Update rd_unb2c.py and UniBoard_I2C.py after testing on hardware
parent
91bc850d
Branches
Branches containing commit
No related tags found
1 merge request
!2
Modified the scripts to run on Raspberry Pi.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
UniBoard2_I2C.py
+1
-1
1 addition, 1 deletion
UniBoard2_I2C.py
rd_unb2c.py
+4
-10
4 additions, 10 deletions
rd_unb2c.py
with
5 additions
and
11 deletions
UniBoard2_I2C.py
+
1
−
1
View file @
66168781
...
...
@@ -46,7 +46,7 @@ CTRL_POWER = 0x10
# Front panel LED
################
LED_DRIVER
=
0x41
LED_COLORS
=
{
"
red
"
:
0x0
1
,
"
blue
"
:
0x0
2
,
"
green
"
:
0x0
4
,
"
magenta
"
:
0x0
3
,
"
yellow
"
:
0x0
6
,
"
cyaan
"
:
0x0
5
}
LED_COLORS
=
{
"
red
"
:
0x0
6
,
"
blue
"
:
0x0
5
,
"
green
"
:
0x0
3
,
"
magenta
"
:
0x0
4
,
"
yellow
"
:
0x0
2
,
"
cyaan
"
:
0x0
1
,
"
white
"
:
0x00
,
"
black
"
:
0x07
}
################
# Node I2C switch
...
...
This diff is collapsed.
Click to expand it.
rd_unb2c.py
+
4
−
10
View file @
66168781
...
...
@@ -44,13 +44,7 @@ def front_led(collor):
print
(
"
Front LED driver not found
"
)
else
:
front
.
write_bytes
(
0x01
,
collor
)
sleep
(
0.5
)
for
cnt
in
range
(
6
):
front
.
write_bytes
(
0x01
,
(
1
<<
cnt
%
3
)
^
0xff
)
sleep
(
0.2
)
front
.
write_bytes
(
0x01
,
0
)
sleep
(
0.2
)
front
.
write_bytes
(
0x01
,
0xf
)
sleep
(
1.5
)
def
read_pol
(
node_nr
,
i2c_addr
):
if
node_nr
>=
0
:
...
...
@@ -81,8 +75,6 @@ def read_pol(node_nr, i2c_addr):
if
ret_ack
<
1
:
print
(
"
no device found
"
)
else
:
# pr_stri = "Found device at address 0x{:02x}".format(LOC_PWR.I2C_Address)
# print(pr_stri)
ret_ack
,
vout_mod
=
LOC_PWR
.
read_bytes
(
LP_VOUT_MODE
,
1
)
ret_ack
,
raw_value
=
LOC_PWR
.
read_bytes
(
LP_VOUT
,
2
)
vout_mod
=
int
(
vout_mod
,
16
)
...
...
@@ -170,7 +162,9 @@ def read_qsfp(node_nr = 0, module=0):
if
1
:
rw_eeprom
(
0xCD
)
front_led
(
LED_COLORS
[
"
green
"
])
for
color
in
list
(
LED_COLORS
.
keys
()):
print
(
color
)
front_led
(
LED_COLORS
[
color
])
for
node_cnt
in
range
(
4
):
for
module_cnt
in
range
(
2
):
read_ddr
(
node_nr
=
node_cnt
,
module
=
module_cnt
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment