xref: /freebsd/share/man/man4/cp2112.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2020 Andriy Gapon <avg@FreeBSD.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd August 12, 2020
28.Dt CP2112 4
29.Os
30.Sh NAME
31.Nm cp2112
32.Nd driver for a USB GPIO and I2C peripheral device
33.Sh SYNOPSIS
34To compile this driver into the kernel,
35place the following lines in your
36kernel configuration file:
37.Bd -ragged -offset indent
38.Cd "device cp2112"
39.Cd "device usb"
40.Cd "device gpio"
41.Cd "device iicbus"
42.Ed
43.Pp
44Alternatively, to load the driver as a
45module at boot time, place the following line in
46.Xr loader.conf 5 :
47.Bd -literal -offset indent
48cp2112_load="YES"
49.Ed
50.Sh DESCRIPTION
51The
52.Nm
53driver provides support for Silicon Labs CP2112 device.
54The device has 8 general purpose I/O pins and an I2C controller that supports
55a subset of the I2C protocol.
56.Pp
57All pins support both input and output modes.
58An output pin can be configured either for open-drain or push-pull operation.
59Pins 0, 1 and 7 support special functions: I2C transmit indication,
60I2C receive indication and clock output respectively.
61At the moment the
62.Nm
63driver does not provide a way to enable and configure the special functions.
64.Pp
65The I2C controller supports read transactions with up to 512 bytes of data,
66write transactions with up to 61 bytes of data and a write followed by
67the repeated start followed by a read transactions where the write can be
68up to 16 bytes and the read can be up to 512 bytes.
69Zero length transfers are not supported.
70The
71.Nm
72driver creates a
73.Xr gpio 4
74and
75.Xr iicbus 4
76child buses to expose the respective functions.
77.Sh SEE ALSO
78.Xr gpio 4 ,
79.Xr iicbus 4 ,
80.Xr usb 4
81.Sh HISTORY
82The
83.Nm
84driver and this manual page was written by
85.An Andriy Gapon Aq Mt avg@FreeBSD.org .
86