Skip to content

Commit

Permalink
matlab: add ability to select channel in bladeRF_rx_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
rghilduta committed Aug 29, 2019
1 parent a49ac5c commit 991bba2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Binary file modified host/libraries/libbladeRF_bindings/matlab/bladeRF_rx_gui.fig
Binary file not shown.
30 changes: 30 additions & 0 deletions host/libraries/libbladeRF_bindings/matlab/bladeRF_rx_gui.m
Expand Up @@ -416,6 +416,18 @@ function actionbutton_Callback(hObject, ~, handles)
handles.devicelist.Enable = 'off';
handles.xb200_attached.Enable = 'off';

if handles.bladerf.info.gen == 2
if handles.channel.Value == 1
handles.bladerf.rx.channel = 'RX1';
elseif handles.channel.Value == 2
handles.bladerf.rx.channel = 'RX2';
end
else
handles.bladerf.rx.channel = 'RX1';
handles.channel.Value = 1;
end
handles.channel.Enable = 'off';

handles.bladerf.rx.config.num_buffers = str2num(handles.num_buffers.String);
handles.bladerf.rx.config.buffer_size = str2num(handles.buffer_size.String);
handles.bladerf.rx.config.num_transfers = str2num(handles.num_transfers.String);
Expand Down Expand Up @@ -545,6 +557,7 @@ function actionbutton_Callback(hObject, ~, handles)
handles.num_transfers.Enable = 'on';
handles.devicelist.Enable = 'on';
handles.xb200_attached.Enable = 'on';
handles.channel.Enable = 'on';

hObject.String = 'Start';
guidata(hObject, handles);
Expand Down Expand Up @@ -613,6 +626,23 @@ function bandwidth_CreateFcn(hObject, ~, ~)
end
end

function channel_Callback(hObject, ~, handles)
values = hObject.String;
index = hObject.Value;
if handles.bladerf.info.gen == 2 && strcmpi(values{index}, 'RX2')
handles.bladerf.rx.channel = 'RX2';
else
handles.bladerf.rx.channel = 'RX1';
hObject.Value = 1;
end
end

function channel_CreateFcn(hObject, ~, ~)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
hObject.BackgroundColor = 'white';
end
end

function corr_dc_i_Callback(hObject, ~, handles)
val = str2num(hObject.String);
if isempty(val)
Expand Down

0 comments on commit 991bba2

Please sign in to comment.