xref: /freebsd/usr.sbin/gpioctl/gpioctl.8 (revision d752f0f69de80ecb93e4d64e8353218edbdbdccf)
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*d752f0f6SLuiz Otavio O Souza.Dd March 7, 2015
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
3822e3858cSSean Bruno.Op Fl f Ar ctldev
39*d752f0f6SLuiz Otavio O Souza.Cm -l
40968ec6a6SOleksandr Tymoshenko.Op Fl v
41968ec6a6SOleksandr Tymoshenko.Nm
4222e3858cSSean Bruno.Op Fl f Ar ctldev
43*d752f0f6SLuiz Otavio O Souza.Cm -t
44968ec6a6SOleksandr Tymoshenko.Ar pin
45968ec6a6SOleksandr Tymoshenko.Nm
4622e3858cSSean Bruno.Op Fl f Ar ctldev
47*d752f0f6SLuiz Otavio O Souza.Cm -c
48968ec6a6SOleksandr Tymoshenko.Ar pin
49968ec6a6SOleksandr Tymoshenko.Ar flag
50968ec6a6SOleksandr Tymoshenko.Op flag ...
51968ec6a6SOleksandr Tymoshenko.Nm
52*d752f0f6SLuiz Otavio O Souza.Op Fl f Ar ctldev
53*d752f0f6SLuiz Otavio O Souza.Cm -n
54*d752f0f6SLuiz Otavio O Souza.Ar pin
55*d752f0f6SLuiz Otavio O Souza.Ar pin-name
56*d752f0f6SLuiz Otavio O Souza.Nm
5722e3858cSSean Bruno.Op Cm -f Ar ctldev
58968ec6a6SOleksandr Tymoshenko.Ar pin
59968ec6a6SOleksandr Tymoshenko.Ar [0|1]
60968ec6a6SOleksandr Tymoshenko.Sh DESCRIPTION
61968ec6a6SOleksandr TymoshenkoThe
62968ec6a6SOleksandr Tymoshenko.Nm
63968ec6a6SOleksandr Tymoshenkoutility could be used to manage GPIO pins from userland and list available pins.
64968ec6a6SOleksandr Tymoshenko.Pp
65968ec6a6SOleksandr TymoshenkoThe options are as follows:
66968ec6a6SOleksandr Tymoshenko.Bl -tag -width ".Fl f Ar ctldev"
67968ec6a6SOleksandr Tymoshenko.It Fl c Ar pin Ar flag Op flag ...
68968ec6a6SOleksandr TymoshenkoConfigure pin by setting provided flags. The following flags are currently defined:
69968ec6a6SOleksandr Tymoshenko.Bl -tag -offset indent -width ".Cm PULSE"
70968ec6a6SOleksandr Tymoshenko.It Cm IN
71968ec6a6SOleksandr TymoshenkoInput pin
72968ec6a6SOleksandr Tymoshenko.It Cm OUT
73968ec6a6SOleksandr TymoshenkoOutput pin
74968ec6a6SOleksandr Tymoshenko.It Cm OD
75968ec6a6SOleksandr TymoshenkoOpen drain pin
76968ec6a6SOleksandr Tymoshenko.It Cm PP
77968ec6a6SOleksandr TymoshenkoPush pull pin
78968ec6a6SOleksandr Tymoshenko.It Cm TS
79968ec6a6SOleksandr TymoshenkoTristate pin
80968ec6a6SOleksandr Tymoshenko.It Cm PU
81968ec6a6SOleksandr TymoshenkoPull-up pin
82968ec6a6SOleksandr Tymoshenko.It Cm PD
83968ec6a6SOleksandr TymoshenkoPull-down pin
84968ec6a6SOleksandr Tymoshenko.It Cm II
85968ec6a6SOleksandr TymoshenkoInverted input pin
86968ec6a6SOleksandr Tymoshenko.It Cm IO
87968ec6a6SOleksandr TymoshenkoInverted output pin
88968ec6a6SOleksandr Tymoshenko.El
89968ec6a6SOleksandr Tymoshenko.It Fl f Ar ctldev
90968ec6a6SOleksandr TymoshenkoGPIO controller device to use
9122e3858cSSean BrunoIf not specified, defaults to
9222e3858cSSean Bruno.Pa /dev/gpioc0
93968ec6a6SOleksandr Tymoshenko.It Fl l
94968ec6a6SOleksandr Tymoshenkolist available pins
95*d752f0f6SLuiz Otavio O Souza.It Fl n Ar pin Ar pin-name
96*d752f0f6SLuiz Otavio O Souzaset the name used to describe the pin
97968ec6a6SOleksandr Tymoshenko.It Fl t Ar pin
98968ec6a6SOleksandr Tymoshenkotoggle value of provided pin number
99968ec6a6SOleksandr Tymoshenko.It Fl v
100968ec6a6SOleksandr Tymoshenkobe verbose: for each listed pin print current configuration
101968ec6a6SOleksandr Tymoshenko.El
102968ec6a6SOleksandr Tymoshenko.Sh EXAMPLES
103968ec6a6SOleksandr Tymoshenko.Bl -bullet
104968ec6a6SOleksandr Tymoshenko.It
105e74fe876SBenedict ReuschlingList pins available on GPIO controller defined by device /dev/gpioc0
106968ec6a6SOleksandr Tymoshenko.Pp
107e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 -l
108968ec6a6SOleksandr Tymoshenko.It
109968ec6a6SOleksandr TymoshenkoSet the value of pin 12 to 1
110968ec6a6SOleksandr Tymoshenko.Pp
111e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 12 1
112968ec6a6SOleksandr Tymoshenko.It
113968ec6a6SOleksandr TymoshenkoConfigure pin 12 to be input pin
114968ec6a6SOleksandr Tymoshenko.Pp
115e74fe876SBenedict Reuschlinggpioctl -f /dev/gpioc0 -c 12 IN
116968ec6a6SOleksandr Tymoshenko.El
117dbcb0e96SSean Bruno.Sh SEE ALSO
118914f6e62SJoel Dahl.Xr gpio 4 ,
119914f6e62SJoel Dahl.Xr gpioiic 4 ,
1208ce07fe7SLuiz Otavio O Souza.Xr gpioled 4
121968ec6a6SOleksandr Tymoshenko.Sh HISTORY
122968ec6a6SOleksandr TymoshenkoThe
123968ec6a6SOleksandr Tymoshenko.Nm
124968ec6a6SOleksandr Tymoshenkoutility appeared in
125968ec6a6SOleksandr Tymoshenko.Fx 9.0 .
126968ec6a6SOleksandr Tymoshenko.Sh AUTHORS
127968ec6a6SOleksandr Tymoshenko.An -nosplit
128968ec6a6SOleksandr TymoshenkoThe
129968ec6a6SOleksandr Tymoshenko.Nm
130968ec6a6SOleksandr Tymoshenkoutility and this manual page were written by
13101c2b8acSBaptiste Daroussin.An Oleksandr Tymoshenko Aq Mt gonzo@freebsd.org .
132