-
Notifications
You must be signed in to change notification settings - Fork 534
/
sv1afnfilter.sh
executable file
·76 lines (65 loc) · 1.51 KB
/
sv1afnfilter.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
#COMMAND A BANDPATH FILTER FROM SV1AFN
Init()
{
#GPIO Declaration
if [ ! -d /sys/class/gpio/gpio26 ]; then
echo "Create GPIOs"
echo GPIO declaration
echo 26 > /sys/class/gpio/export
echo 19 > /sys/class/gpio/export
echo 13 > /sys/class/gpio/export
echo 6 > /sys/class/gpio/export
echo 21 > /sys/class/gpio/export
#GPIO out
echo GPIO Mode OUT
echo out > /sys/class/gpio/gpio26/direction
echo out > /sys/class/gpio/gpio19/direction
echo out > /sys/class/gpio/gpio13/direction
echo out > /sys/class/gpio/gpio6/direction
echo out > /sys/class/gpio/gpio21/direction
fi
}
#Initialization : All at zero (disable filter)
reset_all()
{
#GPIO out
echo GPIO Mode OUT
echo out > /sys/class/gpio/gpio26/direction
echo out > /sys/class/gpio/gpio19/direction
echo out > /sys/class/gpio/gpio13/direction
echo out > /sys/class/gpio/gpio6/direction
echo out > /sys/class/gpio/gpio21/direction
echo 0 > /sys/class/gpio/gpio26/value
echo 0 > /sys/class/gpio/gpio19/value
echo 0 > /sys/class/gpio/gpio13/value
echo 0 > /sys/class/gpio/gpio6/value
}
Init
case "$1" in
"10m")
reset_all
echo 1 > /sys/class/gpio/gpio26/value
;;
"15m")
reset_all
echo 1 > /sys/class/gpio/gpio19/value
;;
"20m")
reset_all
echo 1 > /sys/class/gpio/gpio13/value
;;
"40m")
reset_all
echo 1 > /sys/class/gpio/gpio6/value
;;
"ptton")
echo out > /sys/class/gpio/gpio21/direction
echo 1 > /sys/class/gpio/gpio21/value
;;
"pttoff")
echo in > /sys/class/gpio/gpio21/direction
;;
*)
;;
esac