xref: /freebsd/share/man/man4/gpioiic.4 (revision 71099ec5097cff9b4a566e5474b7f214bd539e8a)
1.\" Copyright (c) 2013, Luiz Otavio O Souza <loos@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd November 5, 2013
28.Dt GPIOIIC 4
29.Os
30.Sh NAME
31.Nm gpioiic
32.Nd GPIO I2C bit-banging device driver
33.Sh SYNOPSIS
34.Cd "device gpio"
35.Cd "device gpioiic"
36.Cd "device iic"
37.Cd "device iicbb"
38.Cd "device iicbus"
39.Sh DESCRIPTION
40The
41.Em gpioiic
42driver provides an IIC bit-banging interface using two GPIO pins for the
43SCL and SDA on the
44.Em gpiobus .
45.Nm
46implements an open colector kind of output, as recommended by the standard,
47when driving the pins on the
48.Em gpiobus ,
49i.e, they are never switched to the logical value of '1',
50or they are '0' or simply open (Hi-Z/tri-state).
51So the pullup resistors are required so
52.Nm
53can work.
54.Pp
55On a hint based system, like
56.Li MIPS , these values are configureable for the
57.Nm gpioiic :
58.Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
59.It Va hint.gpioiic.%d.at
60The gpiobus you are attaching to.
61Normally just gpiobus0.
62.It Va hint.gpioiic.%d.pins
63This is a bitmask of the pins on the
64.Em gpiobus
65that are to be used for SCLOCK and SDATA from the GPIO IIC
66bit-banging bus.
67To configure pin 0 and 7, use the bitmask of
6810000001 and convert it to a hexadecimal value of 0x0081.
69Please note that this mask should only ever have two bits set
70(any others bits - i.e., pins - will be ignored).
71.It Va hint.gpioiic.%d.scl
72Indicates which bit in the
73.Va hint.gpioiic.%d.pins
74should be used as the SCLOCK
75source.
76.It Va hint.gpioiic.%d.sda
77Indicates which bit in the
78.Va hint.gpioiic.%d.pins
79should be used as the SDATA
80source.
81.El
82.Sh SEE ALSO
83.Xr gpio 4 ,
84.Xr gpioled 4 ,
85.Xr iic 4 ,
86.Xr iicbb 4 ,
87.Xr iicbus 4
88.Sh HISTORY
89The
90.Nm
91manual page first appeared in
92.Fx 11.0 .
93.Sh AUTHORS
94This
95manual page was written by
96.An Luiz Otavio O Souza .
97