Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Starting Kit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
White Rabbit Starting Kit
Commits
5a5f0d44
Commit
5a5f0d44
authored
Nov 25, 2013
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: DIO examples added (pulse and config channel)
parent
e8aea1a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
dio_examples.sh
scripts/dio_examples.sh
+79
-0
No files found.
scripts/dio_examples.sh
0 → 100644
View file @
5a5f0d44
pulse_imm
()
{
ip
=
$1
ch
=
$2
len
=
$3
addr
=
0x62348
offset[0]
=
0x00
offset[1]
=
0x04
offset[2]
=
0x08
offset[3]
=
0x0c
offset[4]
=
0x10
addr
=
$((
$addr
+
${
offset
[
$ch
]
}))
eb-mem.sh
--write
--ip
$ip
--address
$addr
--value
$len
addr
=
0x6235c
val
=
0xffffffff
mask[0]
=
0x01
mask[1]
=
0x02
mask[2]
=
0x04
mask[3]
=
0x08
mask[4]
=
0x10
val
=
$((
$val
&
${
mask
[
$ch
]
}))
eb-mem.sh
--write
--ip
$ip
--address
$addr
--value
$val
}
pulse_imm 10.10.10.10 1 0xffffffff
## Configure channel 1 as Output
config_ch_o
()
{
ip
=
$1
ch
=
$2
mask1[0]
=
0xfffffffc
mask1[1]
=
0xffffffcf
mask1[2]
=
0xfffffcff
mask1[3]
=
0xffffcfff
mask1[4]
=
0xfffcffff
mask2[0]
=
0x01
mask2[1]
=
0x10
mask2[2]
=
0x100
mask2[3]
=
0x1000
mask2[4]
=
0x10000
mask3[0]
=
0xfffffffb
mask3[1]
=
0xffffffbf
mask3[2]
=
0xfffffbff
mask3[3]
=
0xffffbfff
mask3[4]
=
0xfffbffff
eb-mem.sh
--read
--ip
$ip
--address
0x6233c
>
value.txt
value
=
`
cat
value.txt
`
value
=
0x
$value
value
=
$((
$value
&
${
mask1
[
$ch
]
}))
eb-mem.sh
--write
--ip
$ip
--address
0x6233c
--value
$value
eb-mem.sh
--read
--ip
$ip
--address
0x6233c
>
value.txt
value
=
`
cat
value.txt
`
value
=
0x
$value
value
=
$((
$value
|
${
mask2
[
$ch
]
}))
eb-mem.sh
--write
--ip
$ip
--address
0x6233c
--value
$value
eb-mem.sh
--read
--ip
$ip
--address
0x6233c
>
value.txt
value
=
`
cat
value.txt
`
value
=
0x
$value
value
=
$((
$value
&
${
mask3
[
$ch
]
}))
eb-mem.sh
--write
--ip
$ip
--address
0x6233c
--value
$value
}
config_ch_o 10.10.10.10 1
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