summaryrefslogtreecommitdiff
path: root/usr.sbin/gpioctl
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2011-10-04 07:19:14 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2011-10-04 07:19:14 +0000
commit22d59143b24c68530a21ef23cc3558ea72dab438 (patch)
tree36978552ffff109651b05d04bbcf847e0e7c13f5 /usr.sbin/gpioctl
parentf68581de654e801b4a24ed616c4eab9999125420 (diff)
- sync usage() and SYNOPSIS
- document "flag", for I2C devices - "pin" is not optional ok matthieu
Diffstat (limited to 'usr.sbin/gpioctl')
-rw-r--r--usr.sbin/gpioctl/gpioctl.846
-rw-r--r--usr.sbin/gpioctl/gpioctl.c4
2 files changed, 26 insertions, 24 deletions
diff --git a/usr.sbin/gpioctl/gpioctl.8 b/usr.sbin/gpioctl/gpioctl.8
index 7c3dafd4085..0f3fc0cac55 100644
--- a/usr.sbin/gpioctl/gpioctl.8
+++ b/usr.sbin/gpioctl/gpioctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gpioctl.8,v 1.20 2011/10/03 20:24:51 matthieu Exp $
+.\" $OpenBSD: gpioctl.8,v 1.21 2011/10/04 07:19:13 jmc Exp $
.\"
.\" Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 3 2011 $
+.Dd $Mdocdate: October 4 2011 $
.Dt GPIOCTL 8
.Os
.Sh NAME
@@ -24,38 +24,33 @@
.Nm gpioctl
.Op Fl q
.Ar device
-attach
-.Ar device
-.Ar offset
-.Ar mask
-.Op Ar flag
-.Nm gpioctl
-.Op Fl q
-.Ar device
-detach
-.Ar device
+.Ar pin
+.Op Ar 0 | 1 | 2 | on | off | toggle
.Nm gpioctl
.Op Fl q
.Ar device
.Ar pin
-.Op Ar 0 | 1 | 2
+set
+.Op Ar flags
+.Op Ar name
.Nm gpioctl
.Op Fl q
.Ar device
.Ar pin
-.Op Ar on | off | toggle
+unset
.Nm gpioctl
.Op Fl q
.Ar device
-.Ar pin
-set
-.Op Ar flags
-.Op Ar name
+attach
+.Ar device
+.Ar offset
+.Ar mask
+.Op Ar flag
.Nm gpioctl
.Op Fl q
.Ar device
-.Ar pin
-unset
+detach
+.Ar device
.Sh DESCRIPTION
The
.Nm
@@ -114,7 +109,8 @@ command.
.Pp
The following configuration
.Ar flags
-are supported by the GPIO framework:
+are supported by the GPIO framework.
+Note that not all the flags can be supported by the particular GPIO controller.
.Pp
.Bl -tag -width Ds -offset indent -compact
.It in
@@ -139,7 +135,13 @@ invert input
invert output
.El
.Pp
-Note that not all the flags can be supported by the particular GPIO controller.
+When attaching an I2C device,
+if the
+.Ar flag
+argument is set to 0x01,
+the order of the SDA and SCL signals is reversed
+(see
+.Xr gpioiic 4 ) .
.Pp
When executed with only the
.Xr gpio 4
diff --git a/usr.sbin/gpioctl/gpioctl.c b/usr.sbin/gpioctl/gpioctl.c
index 7d9a29f74ed..2d9e5991a15 100644
--- a/usr.sbin/gpioctl/gpioctl.c
+++ b/usr.sbin/gpioctl/gpioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpioctl.c,v 1.15 2011/10/03 20:24:51 matthieu Exp $ */
+/* $OpenBSD: gpioctl.c,v 1.16 2011/10/04 07:19:13 jmc Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -344,7 +344,7 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-q] device [pin] [0 | 1 | 2 | "
+ fprintf(stderr, "usage: %s [-q] device pin [0 | 1 | 2 | "
"on | off | toggle]\n", __progname);
fprintf(stderr, " %s [-q] device pin set [flags] [name]\n",
__progname);