Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
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
Beam Positoning Monitor - Software
Commits
f95982ad
Commit
f95982ad
authored
Apr 26, 2016
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sm_io/chips/*: add new si57x get_freq ()
parent
84b2c397
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
sm_ch_si57x.h
include/sm_ch_si57x.h
+2
-0
sm_ch_si57x.c
src/sm_io/chips/sm_ch_si57x.c
+18
-0
No files found.
include/sm_ch_si57x.h
View file @
f95982ad
...
...
@@ -41,6 +41,8 @@ smch_err_e smch_si57x_get_defaults (smch_si57x_t *self, double fout);
/* Setup new frequency */
smch_err_e
smch_si57x_set_freq
(
smch_si57x_t
*
self
,
double
frequency
);
/* Get current frequency */
smch_err_e
smch_si57x_get_freq
(
smch_si57x_t
*
self
,
double
*
freq
);
#ifdef __cplusplus
}
...
...
src/sm_io/chips/sm_ch_si57x.c
View file @
f95982ad
...
...
@@ -200,6 +200,24 @@ err_exit:
return
err
;
}
smch_err_e
smch_si57x_get_freq
(
smch_si57x_t
*
self
,
double
*
freq
)
{
assert
(
self
);
assert
(
freq
);
smch_err_e
err
=
SMCH_SUCCESS
;
double
frequency
=
0
;
DBE_DEBUG
(
DBG_SM_CH
|
DBG_LVL_TRACE
,
"[sm_ch:si57x_set_freq] Getting current "
"frequency
\n
"
);
/* rfreq is usually a large value. So we divide it first */
frequency
=
(
double
)
self
->
rfreq
/
(
self
->
hs_div
*
self
->
n1
);
frequency
*=
self
->
fxtal
;
*
freq
=
frequency
;
return
err
;
}
/***************** Static functions *****************/
static
smch_err_e
_smch_si57x_write_8
(
smch_si57x_t
*
self
,
uint8_t
addr
,
...
...
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