Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
FMC DEL 1ns 4cha
Commits
7f7c3541
Commit
7f7c3541
authored
Apr 03, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software: added EEPROM programming tools
parent
150cffdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
Makefile
software/lib/Makefile
+5
-2
fdelay_eeprom.c
software/lib/fdelay_eeprom.c
+53
-0
No files found.
software/lib/Makefile
View file @
7f7c3541
CFLAGS
=
-I
../include
-g
-Imini_bone
-Ispll
CFLAGS
=
-I
../include
-g
-Imini_bone
-Ispll
OBJS_LIB
=
fdelay_lib.o rr_io.o i2c_master.o onewire.o mini_bone/minibone_lib.o mini_bone/ptpd_netif.o fdelay_bus.o
OBJS_LIB
=
fdelay_lib.o rr_io.o i2c_master.o onewire.o mini_bone/minibone_lib.o mini_bone/ptpd_netif.o fdelay_bus.o
all
:
testprog lib testprog2 testprog3
all
:
testprog lib testprog2 testprog3
testprog4
lib
:
$(OBJS_LIB)
lib
:
$(OBJS_LIB)
gcc
-shared
-o
libfinedelay.so
$(OBJS_LIB)
gcc
-shared
-o
libfinedelay.so
$(OBJS_LIB)
...
@@ -16,5 +16,8 @@ testprog2: lib fdelay_cal.o
...
@@ -16,5 +16,8 @@ testprog2: lib fdelay_cal.o
testprog3
:
lib fdelay_pps_demo.o
testprog3
:
lib fdelay_pps_demo.o
gcc
-o
fdelay_pps_demo
$(OBJS_LIB)
fdelay_pps_demo.o
-lm
gcc
-o
fdelay_pps_demo
$(OBJS_LIB)
fdelay_pps_demo.o
-lm
testprog4
:
lib fdelay_eeprom.o
gcc
-o
fdelay_eeprom
$(OBJS_LIB)
fdelay_eeprom.o
-lm
clean
:
clean
:
rm
-f
libfinedelay.so
$(OBJS_LIB)
rm
-f
libfinedelay.so
$(OBJS_LIB)
\ No newline at end of file
software/lib/fdelay_eeprom.c
0 → 100644
View file @
7f7c3541
#include <stdio.h>
#include "fdelay_lib.h"
#include "fdelay_private.h"
#include "rr_io.h"
#include "i2c_master.h"
void
my_writel
(
void
*
priv
,
uint32_t
data
,
uint32_t
addr
)
{
rr_writel
(
data
,
addr
);
}
uint32_t
my_readl
(
void
*
priv
,
uint32_t
addr
)
{
uint32_t
d
=
rr_readl
(
addr
);
return
d
;
}
main
()
{
fdelay_device_t
dev
;
struct
fine_delay_calibration
cal
;
rr_init
();
dev
.
writel
=
my_writel
;
dev
.
readl
=
my_readl
;
dev
.
base_addr
=
0x84000
;
if
(
fdelay_init
(
&
dev
)
<
0
)
return
-
1
;
cal
.
magic
=
0xf19ede1a
;
cal
.
zero_offset
[
0
]
=
63000
;
cal
.
zero_offset
[
1
]
=
63000
;
cal
.
zero_offset
[
2
]
=
63000
;
cal
.
zero_offset
[
3
]
=
63000
;
cal
.
tdc_zero_offset
=
35600
;
cal
.
frr_poly
[
0
]
=
-
165202LL
;
cal
.
frr_poly
[
1
]
=
-
29825595LL
;
cal
.
frr_poly
[
2
]
=
3801939743082LL
;
cal
.
tdc_zero_offset
=
35600
;
cal
.
atmcr_val
=
2
|
(
1000
<<
4
);
cal
.
adsfr_val
=
56648
;
cal
.
acam_start_offset
=
10000
;
printf
(
"Writing EEPROM..."
);
eeprom_write
(
&
dev
,
EEPROM_ADDR
,
0
,
&
cal
,
sizeof
(
struct
fine_delay_calibration
));
printf
(
" done.
\n
"
);
}
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