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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ELEN90089 CDC
gr-bladeRF-cdc
Commits
65b35193
Commit
65b35193
authored
4 years ago
by
Sergey Musikhin
Browse files
Options
Downloads
Patches
Plain Diff
python bindings for ctor
parent
2d1a6982
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/fm_receiver.grc
+10
-10
10 additions, 10 deletions
apps/fm_receiver.grc
grc/gen_bladerf_blocks.py
+21
-14
21 additions, 14 deletions
grc/gen_bladerf_blocks.py
lib/arg_helpers.h
+5
-27
5 additions, 27 deletions
lib/arg_helpers.h
with
36 additions
and
51 deletions
apps/fm_receiver.grc
+
10
−
10
View file @
65b35193
...
...
@@ -120,7 +120,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [56
8
, 1
2
4.0]
coordinate: [5
7
6, 14
0
.0]
rotation: 0
state: true
- name: audio_sink_0
...
...
@@ -137,7 +137,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [
1088, 300
.0]
coordinate: [
944, 204
.0]
rotation: 0
state: true
- name: bladeRF_source_0
...
...
@@ -145,7 +145,6 @@ blocks:
parameters:
affinity: ''
alias: ''
args: '""'
bb_gain0: '20'
bb_gain1: '20'
bias_tee0: 'False'
...
...
@@ -158,7 +157,8 @@ blocks:
dac: '10000'
dc_offset_mode0: '0'
dc_offset_mode1: '0'
fpga_image: ''
device_id: '0'
fpga_image: test
freq0: freq
freq1: 1e8
gain0: '10'
...
...
@@ -175,16 +175,16 @@ blocks:
nchan: '1'
out_clk: 'False'
power_monitoring: 'False'
ref_clk: ''
ref_clk: '
1000000
'
sample_rate: samp_rate
type: fc32
xb_2000: 222M
xb
_
200
1
: auto
verbosity: silent
xb200: auto
3db
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [
16
, 92.0]
coordinate: [
48
, 92.0]
rotation: 0
state: true
- name: blocks_multiply_const_vxx_0
...
...
@@ -202,7 +202,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [
89
6, 3
48
.0]
coordinate: [
77
6, 3
00
.0]
rotation: 0
state: true
- name: rational_resampler_xxx_0
...
...
@@ -222,7 +222,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [3
3
6, 1
08
.0]
coordinate: [36
8
, 1
24
.0]
rotation: 0
state: true
...
...
This diff is collapsed.
Click to expand it.
grc/gen_bladerf_blocks.py
+
21
−
14
View file @
65b35193
...
...
@@ -34,11 +34,11 @@ parameters:
type: [fc32]
hide: part
- id:
args
- id:
device_id
label:
'
Device
'
dtype: string
default:
'
""
'
hide: ${
'
$
'
}{
'
none
'
if
args
else
'
part
'
}
default:
'
0
'
hide: ${
'
$
'
}{
'
none
'
if
device_id
else
'
part
'
}
- id: nchan
label:
'
Number Channels
'
...
...
@@ -88,6 +88,13 @@ parameters:
dtype: real
default: 10000
- id: xb200
label:
'
XB-200
'
dtype: enum
default: auto
options: [
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
option_labels: [
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
${params}
...
...
@@ -116,9 +123,17 @@ templates:
import time
make: |
bladeRF.${sourk}(
args=
"
numchan=
"
+ str(${
'
$
'
}{nchan}) +
"
,
"
+
"
verbosity=
"
+
'
${
'
$
'
}{verbosity}
'
+ ${
'
$
'
}{args}
args=
"
numchan=
"
+ str(${
'
$
'
}{nchan})
+
"
,type=
"
+
'
${
'
$
'
}{type}
'
+
"
,bladerf=
"
+ str(${
'
$
'
}{device_id})
+
"
,verbosity=
"
+
'
${
'
$
'
}{verbosity}
'
+
"
,fpga=
"
+ str(${
'
$
'
}{fpga_image})
+
"
,power_monitoring=
"
+ str(${
'
$
'
}{power_monitoring})
+
"
,ref_clk=
"
+ str(${
'
$
'
}{ref_clk})
+
"
,in_clk=
"
+
'
${
'
$
'
}{in_clk}
'
+
"
,out_clk=
"
+ str(${
'
$
'
}{out_clk})
+
"
,dac=
"
+ str(${
'
$
'
}{dac})
+
"
,xb200=
"
+
'
${
'
$
'
}{xb200}
'
)
self.${
'
$
'
}{id}.set_sample_rate(${
'
$
'
}{sample_rate})
% for n in range(max_nchan):
...
...
@@ -258,14 +273,6 @@ PARAMS_TMPL = """
default: False
hide: ${
'
$
'
}{
'
none
'
if (nchan > ${n}) else
'
all
'
}
- id: xb_200${n}
label:
'
Ch${n}: XB-200
'
dtype: enum
default: auto
options: [
'
auto
'
,
'
auto3db
'
,
'
50M
'
,
'
144M
'
,
'
222M
'
,
'
custom
'
]
option_labels: [auto, auto3db, 50M, 144M, 222M, custom]
hide: ${
'
$
'
}{
'
none
'
if (nchan > ${n}) else
'
all
'
}
% if sourk ==
'
source
'
:
- id: dc_offset_mode${n}
label:
'
Ch${n}: DC Offset Mode
'
...
...
This diff is collapsed.
Click to expand it.
lib/arg_helpers.h
+
5
−
27
View file @
65b35193
...
...
@@ -122,46 +122,24 @@ struct is_nchan_argument
inline
gr
::
io_signature
::
sptr
args_to_io_signature
(
const
std
::
string
&
args
)
{
s
ize_t
max_nchan
=
0
;
s
td
::
cout
<<
"Args: "
<<
args
<<
std
::
endl
;
size_t
dev_nchan
=
0
;
std
::
vector
<
std
::
string
>
arg_list
=
params_to_vector
(
args
);
for
(
std
::
string
arg
:
arg_list
)
{
if
(
arg
.
find
(
"numchan="
)
==
0
)
// try to parse global nchan value
{
pair_t
pair
=
param_to_pair
(
arg
);
max_nchan
=
boost
::
lexical_cast
<
size_t
>
(
pair
.
second
);
}
}
arg_list
.
erase
(
std
::
remove_if
(
// remove any global nchan tokens
arg_list
.
begin
(),
arg_list
.
end
(),
is_nchan_argument
()
),
arg_list
.
end
()
);
// try to parse device specific nchan values, assume 1 channel if none given
for
(
std
::
string
arg
:
arg_list
)
{
dict_t
dict
=
params_to_dict
(
arg
);
if
(
dict
.
count
(
"nchan"
))
{
dev_nchan
+=
boost
::
lexical_cast
<
size_t
>
(
dict
[
"nchan"
]
);
}
else
// no channels given via args
{
dev_nchan
++
;
// assume one channel
dev_nchan
=
boost
::
lexical_cast
<
size_t
>
(
pair
.
second
);
break
;
}
}
// if at least one nchan was given, perform a sanity check
if
(
max_nchan
&&
dev_nchan
&&
max_nchan
!=
dev_nchan
)
if
(
!
dev_nchan
)
throw
std
::
runtime_error
(
"Wrong device arguments specified. Missing nchan?"
);
const
size_t
nchan
=
std
::
max
<
size_t
>
(
dev_nchan
,
1
);
// assume at least one
return
gr
::
io_signature
::
make
(
nchan
,
nchan
,
sizeof
(
gr_complex
));
return
gr
::
io_signature
::
make
(
dev_nchan
,
dev_nchan
,
sizeof
(
gr_complex
));
}
#endif // OSMOSDR_ARG_HELPERS_H
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