xref: /openbsd-src/share/man/man4/gpioiic.4 (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1.\"	$OpenBSD: gpioiic.4,v 1.6 2008/11/24 15:30:21 jmc Exp $
2.\"
3.\" Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 24 2008 $
18.Dt GPIOIIC 4
19.Os
20.Sh NAME
21.Nm gpioiic
22.Nd GPIO I2C controller
23.Sh SYNOPSIS
24.Cd "gpioiic* at gpio? offset 0 mask 0x3"
25.Cd "gpioiic* at gpio?"
26.Cd "iic* at gpioiic?"
27.Sh DESCRIPTION
28The
29.Nm
30driver allows bit-banging an I2C bus as a master using two GPIO pins.
31The first pin is used as a serial data (SDA) signal and the second as
32a serial clock (SCL).
33Both GPIO pins must be able to drive an output and the SDA pin must be
34also able to read an input.
35.Pp
36The pins can be specified in the kernel configuration with the
37.Ar offset
38and the
39.Ar mask
40locators.
41The
42.Ar offset
43and
44.Ar mask
45can also be specified when
46.Nm
47is attached at runtime using the
48.Dv GPIOATTACH
49.Xr ioctl 2
50on the
51.Xr gpio 4
52device.
53Each bit in the
54.Ar mask
55locator defines one pin; the pin number is calculated as an addition of
56the bit position and the
57.Ar offset
58locator.
59For example,
60.Ar offset 17
61and
62.Ar mask 0x5
63defines pin numbers 17 and 19.
64.Sh SEE ALSO
65.Xr gpio 4 ,
66.Xr iic 4 ,
67.Xr intro 4
68.Sh HISTORY
69The
70.Nm
71driver first appeared in
72.Ox 3.9 .
73.Sh AUTHORS
74.An -nosplit
75The
76.Nm
77driver was written by
78.An Alexander Yurchenko Aq grange@openbsd.org .
79