forked from analogdevicesinc/linux_image_ADI-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pll_tx_sweep.sh
executable file
·59 lines (51 loc) · 937 Bytes
/
pll_tx_sweep.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
echo "$0 <start> <end> <increment> <pause>"
start=$1
end=$2
inc=$3
pause=$4
if [ -z $inc ] ; then
inc=5
fi
if [ -z $pause ] ; then
pause=1
fi
# find the TX LO generator
for i in $(find /sys -name name)
do
if [ "`cat $i`" = "adf4351-tx-lpc" ] ; then
tx_lo_path=$(echo $i | sed 's:/name$::')
if [ -z $start ] ; then
start=400
fi
if [ -z $end ] ; then
end=4000
fi
pll=out_altvoltage0_frequency
break
fi
if [ "`cat $i`" = "ad9361-phy" ] ; then
tx_lo_path=$(echo $i | sed 's:/name$::')
if [ -z $start ] ; then
start=100
fi
if [ -z $end ] ; then
end=6000
fi
pll=out_altvoltage1_TX_LO_frequency
break
fi
done
if [ -z $tx_lo_path ] ; then
echo "Can't find PLL"
exit 1
fi
freq_tx() {
echo $1 > $tx_lo_path/$pll
}
for i in `seq $start $inc $end`;
do
echo $i
freq_tx `expr $i \\* 1000000`
sleep $pause
done