forked from BeBeBerr/Pluto-Network
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpluto.m
More file actions
26 lines (25 loc) · 771 Bytes
/
pluto.m
File metadata and controls
26 lines (25 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function sys_obj = pluto(cable, mode)
switch cable
case 'usb'
uri = 'ip:192.168.2.1';
case 'eth'
uri = 'ip:192.168.1.10';
otherwise
error(['Error: cant find device at ', cable]);
end
switch mode
case 'tx'
sys_obj = adi.Pluto.Tx;
sys_obj.uri = uri;
sys_obj.EnableCyclicBuffers = 1;
sys_obj.AttenuationChannel0 = 0;
sys_obj.RFPortSelect = "B";
case 'rx'
sys_obj = adi.Pluto.Rx;
sys_obj.uri = uri;
sys_obj.RFPortSelect = "B_BALANCED";
sys_obj.SamplesPerFrame = 1e4;
otherwise
error(['Error: cant find mode ', mode, ', please check your input.'])
end
end