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
783d777a
Commit
783d777a
authored
4 years ago
by
Gijs Schoonderbeek
Browse files
Options
Downloads
Patches
Plain Diff
Tested Clock setting / reading on HW
parent
b590f5a8
No related branches found
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
check_clk_status.py
+2
-3
2 additions, 3 deletions
check_clk_status.py
set_clk.py
+4
-7
4 additions, 7 deletions
set_clk.py
with
6 additions
and
10 deletions
check_clk_status.py
+
2
−
3
View file @
783d777a
...
...
@@ -23,7 +23,7 @@ if os.name =="posix":
else
:
from
I2C_serial
import
*
I2CBUSNR
=
1
I2CBUSNR
=
3
sleep_time
=
0.05
READ_LOCK
=
True
...
...
@@ -37,8 +37,7 @@ def Read_byte_PLL(reg_address, nof_bytes=1, ADDRESS=0x20 ):
#
# Read Byte from the ADC
#
I2C_device
=
I2C
(
ADDRESS
)
I2C_device
.
bus
=
I2CBUSNR
I2C_device
=
I2C
(
ADDRESS
,
BUSNR
=
I2CBUSNR
)
PLL_rw
=
0x01
# 0 for write, 1 for read
I2C_device
.
write_bytes
(
0x06
,
0x2C
)
...
...
This diff is collapsed.
Click to expand it.
set_clk.py
+
4
−
7
View file @
783d777a
...
...
@@ -23,7 +23,7 @@ if os.name =="posix":
else
:
from
I2C_serial
import
*
I2CBUSNR
=
1
I2CBUSNR
=
3
sleep_time
=
0.05
PWR_RST
=
False
SET_PLL
=
True
...
...
@@ -42,8 +42,7 @@ def Write_byte_PLL(reg_address, wr_data, ADDRESS=0x20):
#
# Write Byte to the ADC
#
I2C_device
=
I2C
(
ADDRESS
)
I2C_device
.
bus
=
I2CBUSNR
I2C_device
=
I2C
(
ADDRESS
,
BUSNR
=
I2CBUSNR
)
PLL_rw
=
0x00
# 0 for write, 1 for read
stri
=
"
Write : 0x{0:{fill}2x} to Address : 0x{1:{fill}2x}
"
.
format
(
wr_data
,
reg_address
,
fill
=
'
0
'
)
print
(
stri
)
...
...
@@ -70,8 +69,7 @@ def Read_byte_PLL(reg_address, nof_bytes=1, ADDRESS=0x20 ):
#
# Read Byte from the ADC
#
I2C_device
=
I2C
(
ADDRESS
)
I2C_device
.
bus
=
I2CBUSNR
I2C_device
=
I2C
(
ADDRESS
,
BUSNR
=
I2CBUSNR
)
PLL_rw
=
0x01
# 0 for write, 1 for read
I2C_device
.
write_bytes
(
0x06
,
0x2C
)
...
...
@@ -107,8 +105,7 @@ def Read_byte_PLL(reg_address, nof_bytes=1, ADDRESS=0x20 ):
def
power
(
state
):
ADDRESS_IO
=
0x20
I2C_IO_device
=
I2C
(
ADDRESS_IO
)
I2C_device
.
bus
=
I2CBUSNR
I2C_IO_device
=
I2C
(
ADDRESS_IO
,
BUSNR
=
I2CBUSNR
)
I2C_IO_device
.
write_bytes
(
0x06
,
0x2C
)
I2C_IO_device
.
write_bytes
(
0x07
,
00
)
if
state
:
...
...
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