Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
b808650b
Commit
b808650b
authored
Sep 13, 2023
by
Vincent van Beveren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot some functions
parent
c8beee64
Pipeline
#4855
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
sfp.c
dev/sfp.c
+37
-0
No files found.
dev/sfp.c
View file @
b808650b
...
...
@@ -318,6 +318,43 @@ end:
return
_tuning_procedure
;
}
static
void
sfp_oe_write_word
(
uint8_t
addr
,
uint8_t
reg
,
uint16_t
val
)
{
uint8_t
tmp
[
2
];
// printf("[Writing %02x.%02x<=%04x (%u)]", addr,reg,val, val);
tmp
[
0
]
=
0xFF
&
(
val
>>
8
);
tmp
[
1
]
=
0xFF
&
(
val
);
sfp_i2c_mod_write
(
addr
,
reg
,
tmp
,
2
);
}
static
uint16_t
sfp_oe_read_word
(
uint8_t
addr
,
uint8_t
reg
)
{
uint8_t
tmp
[
2
];
uint16_t
val
;
sfp_i2c_mod_read
(
addr
,
reg
,
tmp
,
2
);
val
=
(
tmp
[
0
]
<<
8
)
|
tmp
[
1
];
// printf("[Read %02x.%02x=>%04x (%u)]", addr,reg,val, val);
return
val
;
}
void
sfp_oe_set_alarm_range
(
int32_t
low
,
int32_t
high
)
{
if
(
low
<
0
)
low
=
0
;
if
(
high
>
65535
)
high
=
65536
;
sfp_oe_write_word
(
0xa2
,
0x28
,
high
);
sfp_oe_write_word
(
0xa2
,
0x2c
,
high
);
sfp_oe_write_word
(
0xa2
,
0x2a
,
low
);
sfp_oe_write_word
(
0xa2
,
0x2f
,
low
);
}
static
void
sfp_do_tune_word
(
int32_t
*
tw
,
bool
write
)
{
uint8_t
tmp
[
4
];
...
...
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