![Phytec phyBoard Wega AM335x Скачать руководство пользователя страница 125](http://html1.mh-extra.com/html/phytec/phyboard-wega-am335x/phyboard-wega-am335x_application-manual_1554191125.webp)
Advanced
Information
©
PHYTEC Messtechnik GmbH 2014 L-792e_1
109
Now you can read the values with
cat
GPIOno
/value
Example:
cd
/sys/class/gpio
echo
106
>
export
cat
gpio106/value
will read the value at pin 33 (GPIO3_10) at the expansion connector. To get the next
values, just retype
cat
gpio106/value
In order to use the GPIOs not used by the LED driver as output you can change the direction
after you have requested the GPIO by entering
echo
out
>
GPIOno
/direction
Now you can write to the GPIO with
echo
1
>
GPIOno
/value
and
echo
0
>
GPIOno
/value
Example:
cd
/sys/class/gpio
echo
63
>
export
echo
out
>
63/direction
echo
1
>
63/value
will result in a high level at pin 44 (GPIO1_31) at the expansion connector.
A different procedure is necessary for the GPIOs already requested by the LED driver
(GPIO2_18, GPIO2_19 and GPIO3_9). For setting and resetting these LED outputs on the
expansion connector switch to the appropriate directory listed in the following table:
Pin # Signal Name
Path
31 GPIO3_9
/sys/class/leds/user_led_green
35 GPIO2_18
/sys/class/leds/user_led_red
36 GPIO2_19
/sys/class/leds/user_led_yellow
Table 23:
GPO Pins and Device Path
and enter:
echo
255
>
brightness
for a high level at the pin, and
echo
0
>
brightness
for a low level at the pin