Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
White Rabbit Switch - Software
Commits
11e08a66
Commit
11e08a66
authored
May 12, 2023
by
Fabian Mauchle
Committed by
Adam Wujek
May 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/libwr: increase sfp dom presciscion and print as dBm too
parent
0c7af6e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
i2c_sfp.c
userspace/libwr/i2c_sfp.c
+5
-2
No files found.
userspace/libwr/i2c_sfp.c
View file @
11e08a66
...
...
@@ -9,6 +9,7 @@
#include <unistd.h>
#include <errno.h>
#include <stddef.h>
#include <math.h>
#include <libwr/pio.h>
#include <libwr/wrs-msg.h>
...
...
@@ -347,11 +348,13 @@ void shw_sfp_print_header(struct shw_sfp_header *head)
void
shw_sfp_print_dom
(
struct
shw_sfp_dom
*
dom
)
{
float
tx_pow
=
(
dom
->
tx_pow
[
0
]
*
256
+
dom
->
tx_pow
[
1
])
/
(
float
)
10000
;
float
rx_pow
=
(
dom
->
rx_pow
[
0
]
*
256
+
dom
->
rx_pow
[
1
])
/
(
float
)
10000
;
printf
(
"Temperature: %.3f C
\n
"
,
(
int8_t
)
dom
->
temp
[
0
]
+
dom
->
temp
[
1
]
/
(
float
)
256
);
printf
(
"Voltage: %.3f V
\n
"
,
(
dom
->
vcc
[
0
]
*
256
+
dom
->
vcc
[
1
])
/
(
float
)
10000
);
printf
(
"Bias Current: %.3f mA
\n
"
,
(
dom
->
tx_bias
[
0
]
*
256
+
dom
->
tx_bias
[
1
])
/
(
float
)
500
);
printf
(
"TX power: %.
3f mW
\n
"
,
(
dom
->
tx_pow
[
0
]
*
256
+
dom
->
tx_pow
[
1
])
/
(
float
)
10000
);
printf
(
"RX power: %.
3f mW
\n
"
,
(
dom
->
rx_pow
[
0
]
*
256
+
dom
->
rx_pow
[
1
])
/
(
float
)
10000
);
printf
(
"TX power: %.
4f mW (%.1f dBm)
\n
"
,
tx_pow
,
10
*
log10
(
tx_pow
)
);
printf
(
"RX power: %.
4f mW (%.1f dBm)
\n
"
,
rx_pow
,
10
*
log10
(
rx_pow
)
);
}
void
shw_sfp_header_dump
(
struct
shw_sfp_header
*
head
)
...
...
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