Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PyPCC
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
PyPCC
Commits
bcafe251
Commit
bcafe251
authored
4 years ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
RCU version working
parent
6be0083d
Branches
Branches containing commit
No related tags found
1 merge request
!8
Pypcc2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
i2c/I2C.py
+1
-1
1 addition, 1 deletion
i2c/I2C.py
i2c/setRCUversion.py
+20
-8
20 additions, 8 deletions
i2c/setRCUversion.py
rcu/HWconf.py
+2
-2
2 additions, 2 deletions
rcu/HWconf.py
rcu/RCU.py
+2
-0
2 additions, 0 deletions
rcu/RCU.py
with
25 additions
and
11 deletions
i2c/I2C.py
+
1
−
1
View file @
bcafe251
...
@@ -33,6 +33,6 @@ def I2C1server(addr,data,reg=None,read=0):
...
@@ -33,6 +33,6 @@ def I2C1server(addr,data,reg=None,read=0):
return
True
;
return
True
;
except
:
except
:
if
bus
:
bus
.
close
()
if
bus
:
bus
.
close
()
data
[
0
]
=
0
#
data[0]=0
return
False
;
return
False
;
This diff is collapsed.
Click to expand it.
i2c/setRCUversion.py
+
20
−
8
View file @
bcafe251
from
I2C
import
*
from
I2C
import
*
import
time
import
time
RCU
=
1
RCU
=
3
Ver
=
"
RCU2L v
1.1
"
Ver
=
"
RCU2L v
0.3
"
R1
=
32
R1
=
0
ROM
=
0x50
ROM
=
0x50
#Set switch
I2C1server
(
0x70
,[
1
<<
RCU
],
reg
=
None
,
read
=
0
)
#select RCU
#Get ID
ID
=
[
0
]
*
4
I2C1server
(
ROM
,
ID
,
reg
=
0xFC
,
read
=
1
)
#select RCU
print
(
ID
)
#exit()
#Upload version
Ver2
=
[
ord
(
c
.
encode
(
'
utf-8
'
)[
0
])
for
c
in
Ver
]
Ver2
=
[
ord
(
c
.
encode
(
'
utf-8
'
)[
0
])
for
c
in
Ver
]
print
(
len
(
Ver
),
Ver
,
Ver2
)
print
(
len
(
Ver
),
Ver
,
Ver2
)
V2
=
[
0
]
V2
=
[
0
]
I2C1server
(
0x70
,[
1
<<
RCU
],
reg
=
None
,
read
=
0
)
#select RCU
for
i
,
v
in
enumerate
(
Ver2
):
for
i
,
v
in
enumerate
(
Ver2
):
I2C1server
(
ROM
,[],
reg
=
R1
+
i
,
read
=
0
)
#select RCU
time
.
sleep
(
0.1
)
time
.
sleep
(
0.01
)
I2C1server
(
ROM
,[
v
],
reg
=
R1
+
i
,
read
=
0
)
#select RCU
I2C1server
(
ROM
,[
v
],
reg
=
None
,
read
=
0
)
#select RCU
#
I2C1server(ROM,[v],reg=None,read=0) #select RCU
time
.
sleep
(
0.
0
1
)
time
.
sleep
(
0.1
)
I2C1server
(
ROM
,
V2
,
reg
=
R1
+
i
,
read
=
1
)
#select RCU
I2C1server
(
ROM
,
V2
,
reg
=
R1
+
i
,
read
=
1
)
#select RCU
print
(
i
,
v
,
V2
)
print
(
i
,
v
,
V2
)
#Download version
Ver2
=
[
0
]
*
10
Ver2
=
[
0
]
*
10
I2C1server
(
ROM
,
Ver2
,
reg
=
R1
,
read
=
1
)
#select RCU
I2C1server
(
ROM
,
Ver2
,
reg
=
R1
,
read
=
1
)
#select RCU
print
(
Ver2
)
print
(
Ver2
)
This diff is collapsed.
Click to expand it.
rcu/HWconf.py
+
2
−
2
View file @
bcafe251
...
@@ -45,8 +45,8 @@ RCU_HBA2=DevReg(0x42,0,0,2)
...
@@ -45,8 +45,8 @@ RCU_HBA2=DevReg(0x42,0,0,2)
RCU_HBA3
=
DevReg
(
0x43
,
0
,
0
,
3
)
RCU_HBA3
=
DevReg
(
0x43
,
0
,
0
,
3
)
RCU_ROM_ID
=
DevReg
(
0x50
,
0
,
0
,
0
)
#32 bit ID=4 bytes
RCU_ROM_ID
=
DevReg
(
0x50
,
0
xfc
,
0xfc
,
0
)
#32 bit ID=4 bytes
RCU_ROM_Ver
=
DevReg
(
0x50
,
4
,
4
,
0
)
#String
RCU_ROM_Ver
=
DevReg
(
0x50
,
0
,
0
,
0
)
#String
#Bitbang devices
#Bitbang devices
#BBdev=namedtuple("BBdev","nPins devs pins addr")
#BBdev=namedtuple("BBdev","nPins devs pins addr")
...
...
This diff is collapsed.
Click to expand it.
rcu/RCU.py
+
2
−
0
View file @
bcafe251
...
@@ -197,6 +197,8 @@ class RCU1():
...
@@ -197,6 +197,8 @@ class RCU1():
self
.
SetI2CAddr
(
self
,
dev
)
self
.
SetI2CAddr
(
self
,
dev
)
for
RCUi
in
range
(
self
.
N
):
for
RCUi
in
range
(
self
.
N
):
self
.
SWcallback
(
1
<<
Vars
.
RCU_MPaddr
.
Switch
[
RCUi
])
self
.
SWcallback
(
1
<<
Vars
.
RCU_MPaddr
.
Switch
[
RCUi
])
#for i in range(len(value2)): value2[i]*=0;
value2
[
0
]
=
0
self
.
GetI2Cnoreg
(
RCUi
,
dev
,
width
,
bitoffset
,
value2
)
self
.
GetI2Cnoreg
(
RCUi
,
dev
,
width
,
bitoffset
,
value2
)
value
[
RCUi
]
=
value2
[
0
]
value
[
RCUi
]
=
value2
[
0
]
return
value
;
return
value
;
...
...
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