1968ec6a6SOleksandr Tymoshenko.\" Copyright (c) 1980, 1991, 1993 2968ec6a6SOleksandr Tymoshenko.\" The Regents of the University of California. All rights reserved. 3968ec6a6SOleksandr Tymoshenko.\" 4968ec6a6SOleksandr Tymoshenko.\" Redistribution and use in source and binary forms, with or without 5968ec6a6SOleksandr Tymoshenko.\" modification, are permitted provided that the following conditions 6968ec6a6SOleksandr Tymoshenko.\" are met: 7968ec6a6SOleksandr Tymoshenko.\" 1. Redistributions of source code must retain the above copyright 8968ec6a6SOleksandr Tymoshenko.\" notice, this list of conditions and the following disclaimer. 9968ec6a6SOleksandr Tymoshenko.\" 2. Redistributions in binary form must reproduce the above copyright 10968ec6a6SOleksandr Tymoshenko.\" notice, this list of conditions and the following disclaimer in the 11968ec6a6SOleksandr Tymoshenko.\" documentation and/or other materials provided with the distribution. 12968ec6a6SOleksandr Tymoshenko.\" 4. Neither the name of the University nor the names of its contributors 13968ec6a6SOleksandr Tymoshenko.\" may be used to endorse or promote products derived from this software 14968ec6a6SOleksandr Tymoshenko.\" without specific prior written permission. 15968ec6a6SOleksandr Tymoshenko.\" 16968ec6a6SOleksandr Tymoshenko.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17968ec6a6SOleksandr Tymoshenko.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18968ec6a6SOleksandr Tymoshenko.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19968ec6a6SOleksandr Tymoshenko.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20968ec6a6SOleksandr Tymoshenko.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21968ec6a6SOleksandr Tymoshenko.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22968ec6a6SOleksandr Tymoshenko.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23968ec6a6SOleksandr Tymoshenko.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24968ec6a6SOleksandr Tymoshenko.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25968ec6a6SOleksandr Tymoshenko.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26968ec6a6SOleksandr Tymoshenko.\" SUCH DAMAGE. 27968ec6a6SOleksandr Tymoshenko.\" 28968ec6a6SOleksandr Tymoshenko.\" $FreeBSD$ 29968ec6a6SOleksandr Tymoshenko.\" 30*e74fe876SBenedict Reuschling.Dd May 15, 2011 31968ec6a6SOleksandr Tymoshenko.Dt GPIOCTL 1 32968ec6a6SOleksandr Tymoshenko.Os 33968ec6a6SOleksandr Tymoshenko.Sh NAME 34968ec6a6SOleksandr Tymoshenko.Nm gpioctl 35968ec6a6SOleksandr Tymoshenko.Nd GPIO control utility 36968ec6a6SOleksandr Tymoshenko.Sh SYNOPSIS 37968ec6a6SOleksandr Tymoshenko.Nm 38968ec6a6SOleksandr Tymoshenko.Cm -l 39968ec6a6SOleksandr Tymoshenko.Fl f Ar ctldev 40968ec6a6SOleksandr Tymoshenko.Op Fl v 41968ec6a6SOleksandr Tymoshenko.Nm 42968ec6a6SOleksandr Tymoshenko.Cm -t 43968ec6a6SOleksandr Tymoshenko.Fl f Ar ctldev 44968ec6a6SOleksandr Tymoshenko.Ar pin 45968ec6a6SOleksandr Tymoshenko.Nm 46968ec6a6SOleksandr Tymoshenko.Cm -c 47968ec6a6SOleksandr Tymoshenko.Fl f Ar ctldev 48968ec6a6SOleksandr Tymoshenko.Ar pin 49968ec6a6SOleksandr Tymoshenko.Ar flag 50968ec6a6SOleksandr Tymoshenko.Op flag ... 51968ec6a6SOleksandr Tymoshenko.Nm 52968ec6a6SOleksandr Tymoshenko.Cm -f Ar ctldev 53968ec6a6SOleksandr Tymoshenko.Ar pin 54968ec6a6SOleksandr Tymoshenko.Ar [0|1] 55968ec6a6SOleksandr Tymoshenko.Sh DESCRIPTION 56968ec6a6SOleksandr TymoshenkoThe 57968ec6a6SOleksandr Tymoshenko.Nm 58968ec6a6SOleksandr Tymoshenkoutility could be used to manage GPIO pins from userland and list available pins. 59968ec6a6SOleksandr Tymoshenko.Pp 60968ec6a6SOleksandr TymoshenkoThe options are as follows: 61968ec6a6SOleksandr Tymoshenko.Bl -tag -width ".Fl f Ar ctldev" 62968ec6a6SOleksandr Tymoshenko.It Fl c Ar pin Ar flag Op flag ... 63968ec6a6SOleksandr TymoshenkoConfigure pin by setting provided flags. The following flags are currently defined: 64968ec6a6SOleksandr Tymoshenko.Bl -tag -offset indent -width ".Cm PULSE" 65968ec6a6SOleksandr Tymoshenko.It Cm IN 66968ec6a6SOleksandr TymoshenkoInput pin 67968ec6a6SOleksandr Tymoshenko.It Cm OUT 68968ec6a6SOleksandr TymoshenkoOutput pin 69968ec6a6SOleksandr Tymoshenko.It Cm OD 70968ec6a6SOleksandr TymoshenkoOpen drain pin 71968ec6a6SOleksandr Tymoshenko.It Cm PP 72968ec6a6SOleksandr TymoshenkoPush pull pin 73968ec6a6SOleksandr Tymoshenko.It Cm TS 74968ec6a6SOleksandr TymoshenkoTristate pin 75968ec6a6SOleksandr Tymoshenko.It Cm PU 76968ec6a6SOleksandr TymoshenkoPull-up pin 77968ec6a6SOleksandr Tymoshenko.It Cm PD 78968ec6a6SOleksandr TymoshenkoPull-down pin 79968ec6a6SOleksandr Tymoshenko.It Cm II 80968ec6a6SOleksandr TymoshenkoInverted input pin 81968ec6a6SOleksandr Tymoshenko.It Cm IO 82968ec6a6SOleksandr TymoshenkoInverted output pin 83968ec6a6SOleksandr Tymoshenko.El 84968ec6a6SOleksandr Tymoshenko.It Fl f Ar ctldev 85968ec6a6SOleksandr TymoshenkoGPIO controller device to use 86968ec6a6SOleksandr Tymoshenko.It Fl l 87968ec6a6SOleksandr Tymoshenkolist available pins 88968ec6a6SOleksandr Tymoshenko.It Fl t Ar pin 89968ec6a6SOleksandr Tymoshenkotoggle value of provided pin number 90968ec6a6SOleksandr Tymoshenko.It Fl v 91968ec6a6SOleksandr Tymoshenkobe verbose: for each listed pin print current configuration 92968ec6a6SOleksandr Tymoshenko.El 93968ec6a6SOleksandr Tymoshenko.Sh EXAMPLES 94968ec6a6SOleksandr Tymoshenko.Bl -bullet 95968ec6a6SOleksandr Tymoshenko.It 96*e74fe876SBenedict ReuschlingList pins available on GPIO controller defined by device /dev/gpioc0 97968ec6a6SOleksandr Tymoshenko.Pp 98*e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 -l 99968ec6a6SOleksandr Tymoshenko.It 100968ec6a6SOleksandr TymoshenkoSet the value of pin 12 to 1 101968ec6a6SOleksandr Tymoshenko.Pp 102*e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 12 1 103968ec6a6SOleksandr Tymoshenko.It 104968ec6a6SOleksandr TymoshenkoConfigure pin 12 to be input pin 105968ec6a6SOleksandr Tymoshenko.Pp 106*e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 -c 12 IN 107968ec6a6SOleksandr Tymoshenko.El 108968ec6a6SOleksandr Tymoshenko.Sh HISTORY 109968ec6a6SOleksandr TymoshenkoThe 110968ec6a6SOleksandr Tymoshenko.Nm 111968ec6a6SOleksandr Tymoshenkoutility appeared in 112968ec6a6SOleksandr Tymoshenko.Fx 9.0 . 113968ec6a6SOleksandr Tymoshenko.Sh AUTHORS 114968ec6a6SOleksandr Tymoshenko.An -nosplit 115968ec6a6SOleksandr TymoshenkoThe 116968ec6a6SOleksandr Tymoshenko.Nm 117968ec6a6SOleksandr Tymoshenkoutility and this manual page were written by 118968ec6a6SOleksandr Tymoshenko.An Oleksandr Tymoshenko 119968ec6a6SOleksandr Tymoshenko.Aq gonzo@freebsd.org 120