Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
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
Conv TTL Blocking
Commits
b2a08835
Commit
b2a08835
authored
Jan 08, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed old unneeded script
Signed-off-by:
Theodor Stana
<
t.stana@cern.ch
>
parent
7154443d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
47 deletions
+0
-47
test.py
software/test.py
+0
-47
No files found.
software/test.py
deleted
100644 → 0
View file @
7154443d
def
write
(
addr
,
val
):
reg
=
addr
/
4
+
1
sl
=
0xb6
#(0x40 | ((~slot) & 0x1f)) << 1
print
'
%02
x'
%
sl
cmd
=
"iic4wr
%
x
%
x
%
x
%
s
\r\n
"
%
(
sl
,
(
addr
&
0xff00
)
>>
8
,
addr
&
0xff
,
' '
.
join
(
format
(
b
,
'x'
)
for
b
in
val
))
print
cmd
def
spi_transfer
(
cs
,
dat
):
retval
=
0
wval
=
[]
if
isinstance
(
dat
,
int
):
wval
.
append
(
dat
)
wval
.
append
((
cs
<<
2
)
|
1
)
wval
.
append
(
0
)
wval
.
append
(
0
)
else
:
for
i
in
xrange
(
len
(
dat
)):
wval
.
append
(
dat
[
i
])
wval
.
append
((
cs
<<
2
)
|
1
)
wval
.
append
(
0
)
wval
.
append
(
0
)
write
(
0x90
,
wval
)
# while (retval & (1 << 9) == 0):
# retval = read(0x90)
# return retval & 0xFF
def
flash_write
(
addr
,
dat
):
spi_transfer
(
0
,
0
)
spi_transfer
(
1
,
0x06
)
spi_transfer
(
0
,
0
)
spi_transfer
(
1
,
0x02
)
spi_transfer
(
1
,(
addr
&
0xFF0000
)
>>
16
)
spi_transfer
(
1
,(
addr
&
0xFF00
)
>>
8
)
spi_transfer
(
1
,(
addr
&
0xFF
))
for
i
in
range
(
len
(
dat
)):
spi_transfer
(
1
,
dat
[
i
])
spi_transfer
(
0
,
0
)
if
__name__
==
"__main__"
:
for
addr
in
range
(
0
,
0xf0000
,
256
):
print
'
%
x'
%
addr
if
not
(
addr
%
0x10000
):
print
'erase'
# dat = [1,2]
# spi_transfer(1, dat)
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