Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gr-bladeRF-cdc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ELEN90089 CDC
gr-bladeRF-cdc
Commits
c16e4a26
Commit
c16e4a26
authored
Jun 13, 2021
by
Sergey Musikhin
Browse files
Options
Downloads
Patches
Plain Diff
split init bladerf1/bladerf2, tamer
parent
c16f54a7
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
grc/gen_bladerf_blocks.py
+10
-1
10 additions, 1 deletion
grc/gen_bladerf_blocks.py
lib/bladerf/bladerf_common.cc
+26
-9
26 additions, 9 deletions
lib/bladerf/bladerf_common.cc
lib/bladerf/bladerf_common.h
+3
-0
3 additions, 0 deletions
lib/bladerf/bladerf_common.h
with
39 additions
and
10 deletions
grc/gen_bladerf_blocks.py
+
10
−
1
View file @
c16e4a26
...
@@ -114,13 +114,21 @@ parameters:
...
@@ -114,13 +114,21 @@ parameters:
default: 10000
default: 10000
- id: xb200
- id: xb200
category:
Advanced
category:
x40/x115
label:
'
XB-200
'
label:
'
XB-200
'
dtype: enum
dtype: enum
default:
'
none
'
default:
'
none
'
options: [
'
none
'
,
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
options: [
'
none
'
,
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
option_labels: [
'
none
'
,
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
option_labels: [
'
none
'
,
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
- id: tamer
category: x40/x115
label:
'
Tamer
'
dtype: enum
default:
'
internal
'
options: [
'
internal
'
,
'
external_1pps
'
,
'
external
'
]
option_labels: [
'
Internal
'
,
'
External 1pps
'
,
'
External 10 MHz
'
]
...
@@ -176,6 +184,7 @@ templates:
...
@@ -176,6 +184,7 @@ templates:
+
"
,out_clk=
"
+ str(${
'
$
'
}{out_clk})
+
"
,out_clk=
"
+ str(${
'
$
'
}{out_clk})
+
"
,dac=
"
+ str(${
'
$
'
}{dac})
+
"
,dac=
"
+ str(${
'
$
'
}{dac})
+
"
,xb200=
"
+
'
${
'
$
'
}{xb200}
'
+
"
,xb200=
"
+
'
${
'
$
'
}{xb200}
'
+
"
,tamer=
"
+
'
${
'
$
'
}{tamer}
'
+
"
,trigger0=
"
+
'
${
'
$
'
}{trigger0}
'
+
"
,trigger0=
"
+
'
${
'
$
'
}{trigger0}
'
+
"
,trigger_role0=
"
+
'
${
'
$
'
}{trigger_role0}
'
+
"
,trigger_role0=
"
+
'
${
'
$
'
}{trigger_role0}
'
+
"
,trigger_signal0=
"
+
'
${
'
$
'
}{trigger_signal0}
'
+
"
,trigger_signal0=
"
+
'
${
'
$
'
}{trigger_signal0}
'
...
...
This diff is collapsed.
Click to expand it.
lib/bladerf/bladerf_common.cc
+
26
−
9
View file @
c16e4a26
...
@@ -271,10 +271,16 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
...
@@ -271,10 +271,16 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
"fpga=/path/to/the/bitstream.rbf to load it."
);
"fpga=/path/to/the/bitstream.rbf to load it."
);
}
}
if
(
dict
.
count
(
"xb200"
)
&&
_get
(
dict
,
"xb200"
)
!
=
"none"
)
{
if
(
get_board_type
(
)
=
=
BOARD_TYPE_BLADERF_1
)
init_xb200
(
_get
(
dict
,
"xb200"
),
direction
);
{
init_bladerf1
(
dict
,
direction
);
}
}
if
(
get_board_type
()
==
BOARD_TYPE_BLADERF_2
)
{
init_bladerf2
(
dict
,
direction
);
}
if
(
dict
.
count
(
"ref_clk"
))
if
(
dict
.
count
(
"ref_clk"
))
{
{
...
@@ -334,11 +340,7 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
...
@@ -334,11 +340,7 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
/* Show some info about the device we've opened */
/* Show some info about the device we've opened */
print_device_info
();
print_device_info
();
if
(
dict
.
count
(
"tamer"
))
{
set_clock_source
(
_get
(
dict
,
"tamer"
));
BLADERF_INFO
(
boost
::
str
(
boost
::
format
(
"Tamer mode set to '%s'"
)
%
get_clock_source
()));
}
...
@@ -408,6 +410,21 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
...
@@ -408,6 +410,21 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
%
_num_transfers
));
%
_num_transfers
));
}
}
void
bladerf_common
::
init_bladerf1
(
const
dict_t
&
dict
,
bladerf_direction
direction
)
{
if
(
dict
.
count
(
"xb200"
)
&&
_get
(
dict
,
"xb200"
)
!=
"none"
)
{
init_xb200
(
_get
(
dict
,
"xb200"
),
direction
);
}
if
(
dict
.
count
(
"tamer"
))
{
set_clock_source
(
_get
(
dict
,
"tamer"
));
}
}
void
bladerf_common
::
init_bladerf2
(
const
dict_t
&
dict
,
bladerf_direction
direction
)
{
}
std
::
vector
<
std
::
string
>
bladerf_common
::
devices
()
std
::
vector
<
std
::
string
>
bladerf_common
::
devices
()
{
{
struct
bladerf_devinfo
*
devices
;
struct
bladerf_devinfo
*
devices
;
...
...
This diff is collapsed.
Click to expand it.
lib/bladerf/bladerf_common.h
+
3
−
0
View file @
c16e4a26
...
@@ -156,6 +156,9 @@ protected:
...
@@ -156,6 +156,9 @@ protected:
*/
*/
void
init
(
dict_t
const
&
dict
,
bladerf_direction
direction
);
void
init
(
dict_t
const
&
dict
,
bladerf_direction
direction
);
void
init_bladerf1
(
dict_t
const
&
dict
,
bladerf_direction
direction
);
void
init_bladerf2
(
dict_t
const
&
dict
,
bladerf_direction
direction
);
/* Get a vector of available devices */
/* Get a vector of available devices */
static
std
::
vector
<
std
::
string
>
devices
();
static
std
::
vector
<
std
::
string
>
devices
();
/* Get the type of the open bladeRF board */
/* Get the type of the open bladeRF board */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment