update pinctrl shell script
| | |
| | | #!/bin/bash |
| | | #!/bin/sh |
| | | # This shell script used to control GPIO port on IGKBoard |
| | | |
| | | direction=out |
| | |
| | | cat $pindir/value |
| | | } |
| | | |
| | | if [ $# -lt 1 ] ; then |
| | | if [[ $# -lt 1 ]] ; then |
| | | usage; |
| | | fi |
| | | |
| | |
| | | do |
| | | case "${OPTNAME}" in |
| | | "i") |
| | | direction=in |
| | | direction="in" |
| | | shift |
| | | ;; |
| | | |
| | | "u") |
| | | action=unexport; |
| | | action="unexport"; |
| | | shift |
| | | ;; |
| | | |
| | |
| | | |
| | | calc_pinum $1 |
| | | |
| | | if [[ $action == unexport ]] ; then |
| | | if [[ "$action" == "unexport" ]] ; then |
| | | unexport_gpio |
| | | exit; |
| | | fi |
| | | |
| | | export_gpio |
| | | |
| | | if [ $direction == in ] ; then |
| | | if [[ "$direction" == "in" ]] ; then |
| | | read_gpio |
| | | else |
| | | set_gpio $2 |
| | |
| | | #!/bin/bash |
| | | #!/bin/sh |
| | | # 40 Pin Header GPIO loop test script, it based on pinctrl shell script |
| | | |
| | | function loop_test() |
| | | { |
| | | if [ $# != 3 ] ; then |
| | | if [[ $# != 3 ]] ; then |
| | | echo "ERROR: Invalid input arguments" |
| | | return 1; |
| | | fi |
| | |
| | | res=`pinctrl -i $2` |
| | | |
| | | printf "$1 out [$level] --> $2 in [$res] : " |
| | | if [ $level == $res ] ; then |
| | | if [[ $level == $res ]] ; then |
| | | printf " [ OK ]\n" |
| | | else |
| | | printf " [ FAIL ]\n" |
| | |
| | | } |
| | | |
| | | |
| | | if [ $# != 2 ] ; then |
| | | if [[ $# != 2 ]] ; then |
| | | echo "" |
| | | echo "Usage : $0 Pin1 Pin2" |
| | | echo "Example: $0 GPIO01_IO10 GPIO01_IO11" |