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
4df5bb44
"readme.md" did not exist on "9dd04473e37c4dc9b2e3629525d5a8a4aa10c13a"
Commit
4df5bb44
authored
4 years ago
by
Paulus Kruger
Browse files
Options
Downloads
Patches
Plain Diff
fixed various bugs
parent
1e346cda
No related branches found
No related tags found
1 merge request
!8
Pypcc2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
i2c/setRCUversion.py
+9
-7
9 additions, 7 deletions
i2c/setRCUversion.py
pypcc2.py
+1
-1
1 addition, 1 deletion
pypcc2.py
rcu/HWconf.py
+1
-1
1 addition, 1 deletion
rcu/HWconf.py
rcu/RCU.py
+2
-2
2 additions, 2 deletions
rcu/RCU.py
rcu/Vars.py
+22
-7
22 additions, 7 deletions
rcu/Vars.py
with
35 additions
and
18 deletions
i2c/setRCUversion.py
+
9
−
7
View file @
4df5bb44
from
I2C
import
*
from
I2C
import
*
import
time
import
time
RCU
=
3
RCU
=
1
Ver
=
"
RCU2
L
v0.
3
"
Ver
=
"
RCU2
H
v0.
2
"
R1
=
0
R1
=
0
ROM
=
0x50
ROM
=
0x50
#Set switch
#Set switch
I2C1server
(
0x70
,[
1
<<
RCU
],
reg
=
None
,
read
=
0
)
#select RCU
print
(
"
Set switch
"
)
if
not
(
I2C1server
(
0x70
,[
1
<<
RCU
],
reg
=
None
,
read
=
0
)):
exit
()
#select RCU
#exit()
#Get ID
#Get ID
print
(
"
Get ID
"
)
ID
=
[
0
]
*
4
ID
=
[
0
]
*
4
I2C1server
(
ROM
,
ID
,
reg
=
0xFC
,
read
=
1
)
#select RCU
if
not
(
I2C1server
(
ROM
,
ID
,
reg
=
0xFC
,
read
=
1
)
):
exit
()
#select RCU
print
(
ID
)
print
(
ID
)
#
exit()
exit
()
#Upload version
#Upload version
Ver2
=
[
ord
(
c
.
encode
(
'
utf-8
'
)[
0
])
for
c
in
Ver
]
Ver2
=
[(
c
.
encode
(
'
utf-8
'
)[
0
])
for
c
in
Ver
]
print
(
len
(
Ver
),
Ver
,
Ver2
)
print
(
len
(
Ver
),
Ver
,
Ver2
)
V2
=
[
0
]
V2
=
[
0
]
for
i
,
v
in
enumerate
(
Ver2
):
for
i
,
v
in
enumerate
(
Ver2
):
...
...
This diff is collapsed.
Click to expand it.
pypcc2.py
+
1
−
1
View file @
4df5bb44
...
@@ -63,7 +63,7 @@ RCUthread1=RCU.start(Q1)
...
@@ -63,7 +63,7 @@ RCUthread1=RCU.start(Q1)
RunTimer
=
True
;
RunTimer
=
True
;
def
TimerThread
(
Q1
,
RCU
):
def
TimerThread
(
Q1
,
RCU
):
V1
=
opcuaserv
.
AddVar
(
"
RCU_monitor_rate
"
,
1
0
)
V1
=
opcuaserv
.
AddVar
(
"
RCU_monitor_rate
_RW
"
,
3
0
)
cnt
=
0
;
#Count second ticks
cnt
=
0
;
#Count second ticks
while
RunTimer
:
while
RunTimer
:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
...
This diff is collapsed.
Click to expand it.
rcu/HWconf.py
+
1
−
1
View file @
4df5bb44
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
from
pcctypes
import
*
from
pcctypes
import
*
#Mid plane address
#Mid plane address
#MPaddr=namedtuple("MPaddr","nI2C I2C nSwitch Switch");
#MPaddr=namedtuple("MPaddr","nI2C I2C nSwitch Switch");
RCU_MPaddr
=
MPaddr
(
1
,[
1
],
32
,[
1
,
2
,
3
,
4
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
])
RCU_MPaddr
=
MPaddr
(
1
,[
1
],
32
,[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
])
#CLK_MPaddr=MPaddr(1,[1],1,[7])
#CLK_MPaddr=MPaddr(1,[1],1,[7])
#DevReg=namedtuple("DevReg","Addr Register_R Register_W store");
#DevReg=namedtuple("DevReg","Addr Register_R Register_W store");
...
...
This diff is collapsed.
Click to expand it.
rcu/RCU.py
+
2
−
2
View file @
4df5bb44
...
@@ -317,8 +317,8 @@ class RCU1():
...
@@ -317,8 +317,8 @@ class RCU1():
def
Queue_Monitor
(
self
,
Q1
):
def
Queue_Monitor
(
self
,
Q1
):
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_temp
,
32
,[
0
]
*
32
)
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_temp
,
32
,[
0
]
*
32
)
Q1
.
put
(
Inst1
)
Q1
.
put
(
Inst1
)
Inst1
=
Vars
.
Instr
(
Vars
.
DevType
.
VarUpdate
,
Vars
.
RCU_ADC_lock
,
96
,[
0
]
*
96
)
#
Inst1=Vars.Instr(Vars.DevType.VarUpdate,Vars.RCU_ADC_lock,96,[0]*96)
Q1
.
put
(
Inst1
)
#
Q1.put(Inst1)
def
AddVars
(
self
,
Q1
,
AddVarR
,
AddVarW
):
def
AddVars
(
self
,
Q1
,
AddVarR
,
AddVarW
):
for
v
in
Vars
.
OPC_devvars
:
for
v
in
Vars
.
OPC_devvars
:
...
...
This diff is collapsed.
Click to expand it.
rcu/Vars.py
+
22
−
7
View file @
4df5bb44
...
@@ -114,23 +114,23 @@ RCU_init=Instrs("ReadRegisters",2,[
...
@@ -114,23 +114,23 @@ RCU_init=Instrs("ReadRegisters",2,[
Instr
(
DevType
.
VarUpdate
,
RCU_OUT2
,
3
,[
0
,
0
,
0
])
Instr
(
DevType
.
VarUpdate
,
RCU_OUT2
,
3
,[
0
,
0
,
0
])
])
])
ADC_on
=
Instrs
(
"
ADC_on
"
,
1
5
,[
ADC_on
=
Instrs
(
"
ADC_on
"
,
1
6
,[
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_JESD_ctr
,
1
,[
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_JESD_ctr
,
1
,[
0x
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_update
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC1_update
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_JESD_ctr
,
1
,[
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_JESD_ctr
,
1
,[
0x
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_update
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC2_update
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_JESD_ctr
,
1
,[
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_JESD_ctr
,
1
,[
0x
14
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_CML_level
,
1
,[
0x7
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_SYNC_ctr
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_update
,
1
,[
1
]),
Instr
(
DevType
.
SPIbb
,
RCU_ADC3_update
,
1
,[
1
]),
# Instr(DevType.VarUpdate,RCU_ADC_lock,3,[0,0,0]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_SYNC
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_SYNC
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_JESD
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_JESD
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_CML
,
3
,[
0
,
0
,
0
])
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_CML
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_lock
,
3
,[
0
,
0
,
0
])
])
])
RCU_on
=
Instrs
(
"
RCU_on
"
,
12
,[
RCU_on
=
Instrs
(
"
RCU_on
"
,
12
,[
...
@@ -162,5 +162,20 @@ RCU_off=Instrs("RCU_off",1,[
...
@@ -162,5 +162,20 @@ RCU_off=Instrs("RCU_off",1,[
# Instr(DevType.Var,RCU_mask,4,[0,0,0,0])
# Instr(DevType.Var,RCU_mask,4,[0,0,0,0])
])
])
RCU_update
=
Instrs
(
"
RCU_update
"
,
11
,[
Instr
(
DevType
.
VarUpdate
,
RCU_pwrd
,
1
,[
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_OUT1
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_OUT2
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ID
,
1
,[
0
]),
# Instr(DevType.VarUpdate,RCU_VER,1,[0]*10),
Instr
(
DevType
.
VarUpdate
,
RCU_att
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_band
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_LED
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_SYNC
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_JESD
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_CML
,
3
,[
0
,
0
,
0
]),
Instr
(
DevType
.
VarUpdate
,
RCU_ADC_lock
,
3
,[
0
,
0
,
0
])
])
OPC_methods
=
[
RCU_on
,
RCU_off
,
ADC_on
]
OPC_methods
=
[
RCU_on
,
RCU_off
,
ADC_on
,
RCU_update
]
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