12 How to use the interfaces in Linux
ReliaGATE 10-14 User manual Rev. 0-10
12.2
How to use the GPIOs: the GPIO Utility
The ReliaGATE 10-14 includes the
gpio_utility
which provides a more convenient way to drive many
of the GPIO functions from the command line:
gpio_utility pin_name function
pin_name
It is the required GPIO line in the format
gpioN
or
gpioBank_Pin
.
function
It may be set as follows:
0 or 1
to set the state of a GPIO output
In or Out
to set the direction of a GPIO
Unexport
to release the GPIO from
sysfs
(not normally required)
The GPIOs are exported by default at start-up.
12.3
How to drive the LED Indicators
The ReliaGATE 10-14 includes 4 LEDs which are available for use in application programs. These LEDs
are provided by GPIO lines which are available through the
sysfs
interface.
The table below shows the GPIO line and color associated with each LED:
LED #
GPIO
Color
1
108
Green
2
109
Green
3
110
Amber
4
111
Amber
EXAMPLES:
To turn ON LED 1, enter the following command:
gpio_utility gpio108 1
To turn OFF LED 1, enter the following command:
gpio_utility gpio108 0
To read the status of LED 1, enter the following command:
gpio_utility gpio108
The current state of the LED is determined by reading the associated GPIO.
The output is as follows:
l
If LED 1 is ON, then
gpio108
= 1
l
If LED 1 is OFF, then
gpio108
= 0
For more information see:
"General Purpose IO" on the previous page
64 / 90
Summary of Contents for ReliaGATE 10-14 Series
Page 4: ...This page has been intentionally left blank...
Page 12: ...This page has been intentionally left blank...
Page 16: ...This page has been intentionally left blank...
Page 18: ...This page has been intentionally left blank...
Page 20: ...This page has been intentionally left blank...
Page 22: ...This page has been intentionally left blank...
Page 28: ...This page has been intentionally left blank...
Page 36: ...This page has been intentionally left blank...
Page 80: ...This page has been intentionally left blank...
Page 86: ...This page has been intentionally left blank...
Page 88: ...This page has been intentionally left blank...
Page 89: ...ReliaGATE 10 14 User manual Rev 0 10 Notes NOTES 89 90...