Laird WB45NBT Reference Manual page 28

Hide thumbs Also See for WB45NBT:
Table of Contents

Advertisement

Laird WB45NBT
Reference Guide
Name
Linux ID
LED
N/A
IRQ/SW1
50
Use in Linux
Linux uses a standard GPIO library and all the GPIOs can be accessed via the sysfs interface. To use a GPIO, you must
first export it. It is exported to /sys/class/gpio/name/.
To work with a pin as an output, follow these steps:
1. Export the pin.
2. Set its direction as an output.
3. Set it to the desired value.
To work with the pin as an input, follow these steps:
1. Export the pin.
2. Set its direction as an input.
Note: These are set as inputs by default so this step is likely unnecessary.
3. Read value.
For example, to change GPIO3 to an output and set it high:
# cd /sys/class/gpio
# echo 75 > export
# echo 'out' > pioC11/direction
# echo '1' > pioC11/value
# cat pioC11/value
1
Note: GPIOs are set as inputs by default. The
export
# echo 75 > export
set input
# echo 'in' > pioC11/direction
read input value
This must be first set as input.
# cat pioC11/value
0
set output
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
Header Pin
Port
Comments
X
pc18
value
reflects the input value on the pin.
28
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0600

Advertisement

Table of Contents
loading

Table of Contents